Balena sound - No audio playing from 3.5mm jack; RPI4

I have a similar issue to many posts on this topic, but I have not found any solutions that work for me.
I am 100% confident that the speakers are not the issue, I unplugged them from my daily use PC straight into the PI and still no audio.

I am using an RPI4 with BalenaOS. I installed via CLI with a customized yml file that has PiHole services added to it. I used this guide to get started: https://www.balena.io/blog/two-projects-one-device-turn-your-raspberry-pi-into-a-multitool/. It requires BalenaSound to run on a different port, I chose 8080, which is set in the variables.

I am able to connect with Spotify and AirPlay, but no audio plays and then the connection breaks after a little bit.

I’ve tried the following:

  • set AUDIO-OUTPUT variable to RPI_HEADPHONES
  • set SOUND_MODE to STANDALONE
  • running PULSE_SINK=alsa_output.bcm2835-jack.stereo-fallback paplay /usr/share/sounds/alsa/Front_Center.wav - this returns a “Stream error: No such entity”
  • running PULSE_SINK=balena-sound.output paplay /usr/share/sounds/alsa/Front_Center.wav - this didn’t return any error or play any sounds
  • re-deploying the image

I have seen error messages in the logs like:

12.05.22 17:08:13 (-0400) audio WARNING: BCM2835 audio card not found, are you sure you are running on a Raspberry Pi?
12.05.22 17:08:13 (-0400) audio Setting audio routing rules…
12.05.22 17:08:13 (-0400) audio Routing ‘balena-sound.input’ to ‘balena-sound.output’.
12.05.22 17:08:13 (-0400) audio Routing ‘balena-sound.output’ to ‘0’.
12.05.22 17:08:13 (-0400) audio W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
12.05.22 17:08:14 (-0400) audio E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
12.05.22 17:08:14 (-0400) audio E: [pulseaudio] module.c: Failed to load module “module-alsa-card” (argument: "device_id=“0” name=“platform-fef00700.hdmi” card_name=“alsa_card.platform-fef00700.hdmi” namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=yes card_properties=“module-udev-detect.discovered=1"”): initialization failed.
12.05.22 17:08:14 (-0400) audio E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
12.05.22 17:08:14 (-0400) audio E: [pulseaudio] module.c: Failed to load module “module-alsa-card” (argument: "device_id=“1” name=“platform-fef05700.hdmi” card_name=“alsa_card.platform-fef05700.hdmi” namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=yes card_properties=“module-udev-detect.discovered=1"”): initialization failed.
12.05.22 17:08:14 (-0400) Service exited ‘multiroom-client sha256:ab0f2f2839f602d57da4d5d1f1a2f4a93bbb147bc048cc2008ef3a6adc13a585’

Not sure if another PulseAudio update caused this or what, but I have been digging into this for a while and I’m at a loss.

EDIT:
Initial output from PulseAudio -vvvvv shows errors like “Error opening PCM device hw:1: No such file or directory” over and over, “skipping profile”, “caching failure”, etc.

Hi, it looks like the module isn’t finding your audio card. Can you run the command

pactl list sinks short

in the audio container and post the results?

Error is coming from here btw: audio/entry.sh at 5a2eaee22a8fc56e780b51dac5b49436812bc876 · balenablocks/audio · GitHub

1       balena-sound.input      module-null-sink.c      s16le 2ch 44100Hz       RUNNING
2       balena-sound.output     module-null-sink.c      s16le 2ch 44100Hz       RUNNING
3       snapcast        module-null-sink.c      s16le 2ch 44100Hz       SUSPENDED

Hi calcidius

I’d like to get a bit more info about the device to try to pinpoint the issue. It looks like the BCM2835 audio is not found. Can you ssh to the device and run cat /proc/asound/cards and copy the output here?

Thanks, Ramiro

If you can also run these commands on the audio container it would give us more info:

lsmod | grep snd
aplay -l

Ramiro

The command you ran previously should’ve printed out an entry like:

0       alsa_output.bcm2835-jack.stereo-fallback        module-alsa-card.c      s16le 2ch 44100Hz       RUNNING

But it seems the device is not there.

Have you done any specific customization to the os or app you’re deploying?

Hello @calcidius

Can you confirm the audio service in your docker-compose.yml has priviledge: true?
(or better paste your while docker-compose.ym)