Using SBaGen (or anything that uses /dev/dsp) with a 64-bit linux system and PulseAudio by Tweaking Padsp

I like SBaGen for a binaural beat white noise generator. It’s pretty cool, and cross-platform, and lets you put other soundfiles in the background. (If you’re commandline-phobic and run Windows, I used to use Raindrop for the same reason.) But SBaGen is FAR more configurable, with all sorts of scriptable options.

Do I buy the brainwave stuff? Hell, I don’t know. But I do know that it’s a fantastic tool to help with concentration and block out outside noise and distraction. Give it (or Raindrop) a try while wearing headphones.

But. I started having problems when firing it up on my 64-bit Debian Jessie (#!) system… especially since the venerable padsp trick stopped working. I managed to get it working flawlessly again, but I’ve put this here for my own reference and to help anyone else dealing with this problem:

PulseAudio is the newer system of sound servers for linux, but some older programs try to write directly to sound devices the “old way”.   Padsp is a wrapper script that lets the old programs use the new sound interface.

Until 64 bit systems came along, and the old programs wanted a 32-bit sound library.  Then you get this error:

ERROR: object ‘/usr/lib/x86_64-linux-gnu/pulseaudio/’ from LD_PRELOAD cannot be preloaded: ignored.

Here’s the workaround: Download (but do not install) the 32-bit package that includes libpulsedsp (here they are for Debian and Ubuntu). Extract the file

dpkg-deb -x *.deb /tmp/extract/

Copy to /usr/lib32/
Edit /usr/bin/padsp so that the line “while getopts” now reads:

while getopts ‘hs:n:m:MSDdi’ param ; do

Before the line starting with *), add these lines:

if [ x”$LD_PRELOAD” = x ] ; then
LD_PRELOAD=”$LD_PRELOAD /usr/lib32/”

shift $(( $OPTIND – 1 ))
exec “$@”
exit 0

Now change your script to call padsp -i /path/to/sbagen

Was this post helpful or insightful? Buy me a coffee here or here and share this post with others!

Popular posts:

  • The difference between boundaries and rules
  • Two Ways to get CMYK Separation Using GIMP Instead of Photoshop in 2022
  • Weekend Project: Whole House and Streaming Audio for Free with MPD
  • Word Porn Quotes
  • If there's one Nazi (or a racist) at the table...
  • Odds and Ends: Optimizing SSHFS, moving files into subdirectories, and getting placeholder images

Recent Posts