padsp
Emulate OSS audio for PulseAudio compatibility
SYNOPSIS
padsp COMMAND [ARGUMENTS...]
PARAMETERS
COMMAND
The executable program you wish to run with OSS emulation enabled. padsp
will launch this command, ensuring it can output sound via PulseAudio even if it expects to use an OSS device.
ARGUMENTS...
Any command-line arguments that should be passed directly to the COMMAND
being executed. padsp
does not interpret these arguments; it simply forwards them.
DESCRIPTION
padsp
(PulseAudio DSP) is a utility provided by the PulseAudio sound server to enable legacy applications designed for the Open Sound System (OSS) to play audio through PulseAudio. Many older Linux audio applications were written to directly access OSS devices like /dev/dsp
. When PulseAudio became the dominant sound server, these applications would fail to produce sound without a compatibility layer.padsp
acts as a wrapper. When you run a command using padsp
(e.g., padsp <application>
), it preloads a special library (typically libpulsedsp.so
) into the application's memory space. This library intercepts calls that the application makes to the OSS API (e.g., open("/dev/dsp")
, ioctl(DSP_SETFMT)
). Instead of interacting with a non-existent or conflicting /dev/dsp
device, the preloaded library redirects these calls to the PulseAudio server, effectively translating OSS commands into PulseAudio operations. This allows older games, multimedia players, or audio tools to function seamlessly within a PulseAudio environment without needing to be recompiled or modified.
CAVEATS
- Compatibility Limitations: While
padsp
works for many simple OSS applications, it might not be perfect for all. Complex or low-latency audio applications, or those relying on very specific OSS features (like direct hardware access for advanced mixing or effects), might still experience issues or sub-optimal performance. - Performance Overhead: The emulation layer introduces a slight overhead. For modern applications, direct PulseAudio (or ALSA) integration is always preferred for better performance and lower latency.
- Deprecation Context: OSS is largely superseded by ALSA and PulseAudio on modern Linux systems.
padsp
is a legacy compatibility tool and not intended for new application development. - Environment Variables: Its functionality heavily relies on the
LD_PRELOAD
mechanism, which can sometimes be affected by security policies or other preloaded libraries.
HOW IT WORKS
padsp
leverages the LD_PRELOAD
environment variable. When padsp
is invoked, it sets LD_PRELOAD
to point to libpulsedsp.so
(or a similar PulseAudio DSP emulation library) and then executes the specified command. The ld.so
dynamic linker then loads libpulsedsp.so
before any other libraries. This preloaded library contains replacement functions for the standard OSS API calls, which then reroute the audio operations to the active PulseAudio server instead of attempting to access a /dev/dsp
device directly.
TYPICAL USE CASE
Running older games or specific audio utilities that have not been updated to use modern audio APIs (like ALSA or PulseAudio directly). For example, padsp quake3
to run an old game, or padsp sox -d my_audio.wav
to use a legacy audio utility that expects OSS.
HISTORY
With the increasing adoption of PulseAudio as the default sound server in many Linux distributions around the mid-2000s, there was a need to support existing applications that were written against the older Open Sound System (OSS) API. padsp
was developed as part of the PulseAudio project to bridge this compatibility gap, allowing users to continue running their favorite legacy audio software without having to switch sound servers or modify application code. Its development mirrored the rise of PulseAudio itself, providing a smoother transition path for users.
SEE ALSO
pulseaudio(1), pavucontrol(1), aoss(1), oss(7), ld.so(8)