RaspberryPi Soundboard – Update #3

Finally found more time to spend on the RaspberryPi Soundboard Project.

After mucking around for days with Pulseaudio, and getting significantly annoyed at being able to do a simple loopback or virtual device functionality, I tried Jack.

Jack is perfect for such ‘piping’, but I figured out the hard way that there is no official Mumble support for Jack.

Thankfully I found out about ALSA’s snd_aloop module. This creates a ‘virtual card’ with 2 devices. If you play audio into one, it comes out of the other. Exactly what I needed, and Mumble does query all the ALSA devices, so I can easily find my ‘Loopback’ device.

mumble

Next was playing the audio. Using simple ‘aplay’, I could test if my setup was working. But to have better control over the audio (fade-in, fade-out), I would need a more programmatic approach.

Since we’re on a RaspberryPi, Python is a natural choice, although since I am using Archlinux, Python doesn’t come installed!. So I installed Python2 and found pygame, a wrapper around libSDL which has a nice mixer and audio module. It’s surely an overkill for what I’m trying to do. But I do need something that lets me choose which ALSA device to use (with pygame I can define that using environment variables which SDL uses), and something which lets me do basic audio effects like mixing, fading etc.

So this works for now. Although the audio from Mumble is pretty glitchy, I think some Mumble settings need to be tweaked. But I am still worried that running the Mumble GUI is making the Pi slow. I may have to figure out a way to run Mumble headless.