Direct audio output to 3.5mm jack in HA (Docker supervised) stopped working

I was running HA (supervised Docker installation on Raspberry Pi 4B) for months in such way, that audio has been played directly to 3.5mm audio jack - mostly via MPD addon (playing music, radio streams and TTS announcements). All of a sudden it stopped working and MPD showed error “Failed to connect the stream: No such entity”. Firstly I assumed it’s an addon problem, but have discovered, that obviously something happened in my system - etiher HA itself or even host (Raspbian). Restoring old snapshots didn’t work either, so I guess it’s down to Raspbian then (i do regular APT upgrades).
So, to get to the point, after running “ha audio log” I get the result below and have no idea where and how to start troubleshooting - all I can conclude from that is, that the audio jack can not be initialised, most likely because of missing configuration.
Has anyone experienced something similar and/or is willing to guide me?

I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for card bcm2835 Headphones
I: [pulseaudio] (alsa-lib)main.c: error: failed to import bcm2835 Headphones use case configuration -2
I: [pulseaudio] alsa-ucm.c: UCM not available for card bcm2835 Headphones
D: [pulseaudio] conf-parser.c: Failed to open configuration file '/usr/share/pulseaudio/alsa-mixer/profile-sets/rpi-analog.conf': No such file or directory
D: [pulseaudio] alsa-mixer.c: Profile set 0xb6fcc088, auto_profiles=no, probed=yes, n_mappings=0, n_profiles=0, n_decibel_fixes=0
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/platform/soc/soc:audio/sound/card1 (alsa_card.platform-soc_audio) failed to load module.
I: [pulseaudio] client.c: Created 1 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Client authenticated anonymously.
D: [pulseaudio] protocol-native.c: Protocol version: remote 33, local 33
D: [pulseaudio] protocol-native.c: SHM possible: no
D: [pulseaudio] protocol-native.c: Negotiated SHM: no
D: [pulseaudio] protocol-native.c: Disabling srbchannel, reason: No SHM support
I: [pulseaudio] client.c: Freed 1 "supervisor"
I: [pulseaudio] protocol-native.c: Connection died.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC1 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/platform/soc/soc:audio/sound/card1 is busy: no
D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"'
I: [pulseaudio] (alsa-lib)utils.c: could not open configuration file /usr/share/alsa/ucm2/bcm2835 Headphones/bcm2835 Headphones.conf
I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for card bcm2835 Headphones
I: [pulseaudio] (alsa-lib)main.c: error: failed to import bcm2835 Headphones use case configuration -2
I: [pulseaudio] alsa-ucm.c: UCM not available for card bcm2835 Headphones
D: [pulseaudio] conf-parser.c: Failed to open configuration file '/usr/share/pulseaudio/alsa-mixer/profile-sets/rpi-analog.conf': No such file or directory
D: [pulseaudio] alsa-mixer.c: Profile set 0xb6fcc040, auto_profiles=no, probed=yes, n_mappings=0, n_profiles=0, n_decibel_fixes=0
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/platform/soc/soc:audio/sound/card1 (alsa_card.platform-soc_audio) failed to load module.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC1 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/platform/soc/soc:audio/sound/card1 is busy: no
D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"'
I: [pulseaudio] (alsa-lib)utils.c: could not open configuration file /usr/share/alsa/ucm2/bcm2835 Headphones/bcm2835 Headphones.conf
I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for card bcm2835 Headphones
I: [pulseaudio] (alsa-lib)main.c: error: failed to import bcm2835 Headphones use case configuration -2
I: [pulseaudio] alsa-ucm.c: UCM not available for card bcm2835 Headphones
D: [pulseaudio] conf-parser.c: Failed to open configuration file '/usr/share/pulseaudio/alsa-mixer/profile-sets/rpi-analog.conf': No such file or directory
D: [pulseaudio] alsa-mixer.c: Profile set 0xb6fcbff8, auto_profiles=no, probed=yes, n_mappings=0, n_profiles=0, n_decibel_fixes=0
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/platform/soc/soc:audio/sound/card1 (alsa_card.platform-soc_audio) failed to load module.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC1 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/platform/soc/soc:audio/sound/card1 is busy: no
D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"'
I: [pulseaudio] (alsa-lib)utils.c: could not open configuration file /usr/share/alsa/ucm2/bcm2835 Headphones/bcm2835 Headphones.conf
I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for card bcm2835 Headphones
I: [pulseaudio] (alsa-lib)main.c: error: failed to import bcm2835 Headphones use case configuration -2
I: [pulseaudio] alsa-ucm.c: UCM not available for card bcm2835 Headphones
D: [pulseaudio] conf-parser.c: Failed to open configuration file '/usr/share/pulseaudio/alsa-mixer/profile-sets/rpi-analog.conf': No such file or directory
D: [pulseaudio] alsa-mixer.c: Profile set 0xb6fcb620, auto_profiles=no, probed=yes, n_mappings=0, n_profiles=0, n_decibel_fixes=0
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/platform/soc/soc:audio/sound/card1 (alsa_card.platform-soc_audio) failed to load module.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC1 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/platform/soc/soc:audio/sound/card1 is busy: no
D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"'
I: [pulseaudio] (alsa-lib)utils.c: could not open configuration file /usr/share/alsa/ucm2/bcm2835 Headphones/bcm2835 Headphones.conf
I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for card bcm2835 Headphones
I: [pulseaudio] (alsa-lib)main.c: error: failed to import bcm2835 Headphones use case configuration -2
I: [pulseaudio] alsa-ucm.c: UCM not available for card bcm2835 Headphones
D: [pulseaudio] conf-parser.c: Failed to open configuration file '/usr/share/pulseaudio/alsa-mixer/profile-sets/rpi-analog.conf': No such file or directory
D: [pulseaudio] alsa-mixer.c: Profile set 0xb6fcc088, auto_profiles=no, probed=yes, n_mappings=0, n_profiles=0, n_decibel_fixes=0
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/platform/soc/soc:audio/sound/card1 (alsa_card.platform-soc_audio) failed to load module.
D: [pulseaudio] module-udev-detect.c: /dev/snd/controlC1 is accessible: yes
D: [pulseaudio] module-udev-detect.c: /devices/platform/soc/soc:audio/sound/card1 is busy: no
D: [pulseaudio] module-udev-detect.c: Loading module-alsa-card with arguments 'device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1"'
I: [pulseaudio] (alsa-lib)utils.c: could not open configuration file /usr/share/alsa/ucm2/bcm2835 Headphones/bcm2835 Headphones.conf
I: [pulseaudio] (alsa-lib)parser.c: error: could not parse configuration for card bcm2835 Headphones
I: [pulseaudio] (alsa-lib)main.c: error: failed to import bcm2835 Headphones use case configuration -2
I: [pulseaudio] alsa-ucm.c: UCM not available for card bcm2835 Headphones
D: [pulseaudio] conf-parser.c: Failed to open configuration file '/usr/share/pulseaudio/alsa-mixer/profile-sets/rpi-analog.conf': No such file or directory
D: [pulseaudio] alsa-mixer.c: Profile set 0xb6fcc040, auto_profiles=no, probed=yes, n_mappings=0, n_profiles=0, n_decibel_fixes=0
E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
E: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="1" name="platform-soc_audio" card_name="alsa_card.platform-soc_audio" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes avoid_resampling=no card_properties="module-udev-detect.discovered=1""): initialization failed.
I: [pulseaudio] module-udev-detect.c: Card /devices/platform/soc/soc:audio/sound/card1 (alsa_card.platform-soc_audio) failed to load module.
I: [pulseaudio] client.c: Created 2 "Native client (UNIX socket client)"
I: [pulseaudio] protocol-native.c: Client authenticated anonymously.
D: [pulseaudio] protocol-native.c: Protocol version: remote 33, local 33
D: [pulseaudio] protocol-native.c: SHM possible: no
D: [pulseaudio] protocol-native.c: Negotiated SHM: no
D: [pulseaudio] protocol-native.c: Disabling srbchannel, reason: No SHM support
I: [pulseaudio] client.c: Freed 2 "supervisor"
I: [pulseaudio] protocol-native.c: Connection died.

hi. can you fix it?

Nope, I switched to Mopidy instead.

Hey there awesome community, I’ve opened an account just to post my discovery about this topic since I spent quite some time and I’m hoping this will help someone having the same issue I had.

First, my setup:

  • RPI4 8GB RAM
  • Raspberry Pi OS 5.10.63-v7l+
  • Home Assistant Supervised 2021.12.8

The problem:

The audio jack 3,5mm (bcm2835 Headphones) is not recognized by the hassio_audio module, meaning nor Spotify, Mopidy, VLC or any other can have access to it… even if it works perfectly fine in the host OS.

The reason is that the pulseaudio module-alsa-sink is not being loaded automatically by the hassio_audio container.

The solution:

So far I’ve encountered 2,

  1. Load the module via script automation, which translate to do the following that you could check manually:
  • Wait until ha audio is started
  • bash into it docker exec -it hassio_audio /bin/bash
  • Exec pactl load-module module-alsa-sink
  • Profit!
  1. Use USB audio, get a cable or adapter (jack → USB) that are very cheap.

Hope this is useful,
Cheers!
dd

Don’t know why I never thought of this solution, since these adapters are really cheap… Will try it, so I can get rid of Mopidy and maybe even switch to HAOS if it works (remained on Supervised installation mostly because of this issue).

Would you mind sharing (or giving some more detailed instructions, which commands to execute in the script) on how to implement the first solution (want to try it while waiting for the delivery of USB audio card :slight_smile: )?

1 Like

I’d like to know more too, unable to do it with the current info

Well, in my case, i removed pulseaudio from host, “sudo apt get remove pulseaudio” and now audio is working as expected in HA.

hi all, i wanted to create a slider to control the volume of the pi, i’m using hassio, on RPI4, i wanted to know if anyone has a solution about it, thanks