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

Popular posts:

  • HOWTO Make Your Hamburger Helper Better
  • The Songs That Chronicle Our Lives
  • If there's one Nazi (or a racist) at the table...
  • Word Porn Quotes
  • I am not a number; I am a free man, OR, why you should never rely on social media
  • It's not being "Awkward", and the difference between Excuses and Explanations
  • I really like you, but I have to break up with you before I don't.