Lightshowpi and pHAT DAC - save my Christmas!

In the Christmas spirit I need your urgent HELP!!!

Lightshowpi.org is a sound and light application for the RasPi. (Flashing Christmas lights to music.)

To improve sound quality, I installed pHAT DAC.

I’m running it on a Pi Zero with Stretch Lite. Works perfectly.

I installed the pHAT DAC, and it too runs perfectly. Nice strong sound from my speaker.

The problem: when I run the two together, I get the error: alsaaudio.ALSAAudioError: Device or resource busy [sysdefault:CARD=sndrpihifiberry]

There is nothing else running and I’ve lost 4 nights sleep, 5 kg weight, and most of my hair trying to figure it out. Even the help forum at lightshowpi raised their hands in despair.

Please, please, please, will someone look at their config file

https://bitbucket.org/togiles/lightshowpi/src/master/config/defaults.cfg?fileviewer=file-view-default

and tell me IS THERE ANYTHING THERE THAT MIGHT CAUSE ALSA TO GIVE ME THIS ERROR? (Note, I changed GPIO pin 1 (BCM 18) in their default setup because I know the pHAT needs it).

Please save my Christmas!

1 Like

Presumable Pulse Audio is causing ALSA to generate that error, since Pulse- by default- will attach to the sndrpihifiberry device and permanently occupy it to prevent speaker pops and other issues.

Try setting:

# If you are using a usb sound card and do not want to set is as the default,
# you can just set it here and not have to edit your alsa-base.conf / alsa.conf files
# All of this applies to audio_in_card as well 
audio_out_card = pulse

(I think pulse is the right one)

Or, alternatively, you could disable Pulse altogether:

sudo systemctl stop pulseaudio
sudo systemctl disable pulseaudio

Many thanks, gadgetoid, but it’s not that. First, my apologies - I’m actually using Stretch, not Jessie. My mistake. I’ll change my original post. Second, it appears that Stretch doesn’t include pulseaudio. See here: https://www.raspberrypi.org/blog/raspbian-stretch/

Any other ideas?

I gave up in the end and installed Jessie in place of Stretch. Works perfectly.

There’s a problem with the way Stretch handles sound and the pHAT DAC. May have something to do with the missing Pulseaudio.