Linux Sound /dev/dsp PulseAudio Interface for old Applications

This is one little snippet of Linux ‘hidden knowledge’ for getting old applications that use “/dev/dsp” for their sound device to transparently interface to use instead the much more recent and powerful PulseAudio sound server system:

padsp

From the padsp man page:

padsp(1)

NAME
padsp – PulseAudio OSS Wrapper

SYNOPSIS
padsp [options] PROGRAM [ARGUMENTS …]

padsp -h

DESCRIPTION
padsp starts the specified program and redirects its access to OSS compatible audio devices (/dev/dsp and auxiliary devices) to a PulseAudio sound server.

padsp uses the $LD_PRELOAD environment variable that is interpreted by ld.so(8) and thus does not work for SUID binaries and statically built executables.

Equivalent to using padsp is starting an application with $LD_PRELOAD set to libpulsedsp.so

In brief, what that means is that you can start up an application from a shell/terminal commandline using “padsp Your_Application” just as you would do with such as the “nice” command, and all interaction with the old OSS “/dev/dsp” device are intercepted to instead transparently use PulseAudio. Works easily! What’s more, you no longer suffer any one application monopolising “/dev/dsp” and blocking anything else from running.

Aside: In PulseAudio you have “Monitors” that make audio streams available as an “Input Device” for recording or redirecting elsewhere. Hence if you wish to record your system’s sound outputs, there’s no need to run a JACK sound patchbay or resort to physically wiring a sound output back to a physical line-in socket on your sound card. Just select the appropriate monitor as your input device. You may need to select to see them by selecting “All Input Devices” in the show selector of the PulseAudio volume control GUI.

Leave a Reply