Audio over HDMI not working with browser block or audio block

Hello, I need help getting audio out of the raspberry pi audio jack.

I have a Pi4 running balenaOS 2.98.33. I am running the browser block and audio block.

By default the sound is meant to come over HDMI, but I can’t get sound from anything.

This is the output of the audio service:

audio — Audio —
audio Starting audio service with settings:
audio - pulseaudio 15.0
audio - Pulse log level: NOTICE
audio - Default output: RPI_HEADPHONES
audio - Default volume: 75%
audio
audio Detected audio cards:
audio 0 vc4hdmi0 vc4-hdmi-vc4-hdmi-0
audio 1 vc4hdmi1 vc4-hdmi-vc4-hdmi-1
audio
audio
audio WARNING: BCM2835 audio card not found, are you sure you are running on a Raspberry Pi?
audio W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
audio E: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
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.
audio E: [pulseaudio] bluez5-util.c: Failed to get D-Bus connection: Failed to connect to socket /host/run/dbus/system_bus_socket: No such file or directory
audio E: [pulseaudio] module.c: Failed to load module “module-bluez5-discover” (argument: “autodetect_mtu=yes headset=native”): initialization failed.
audio E: [pulseaudio] module.c: Failed to load module “module-bluetooth-discover” (argument: “autodetect_mtu=yes headset=native”): initialization failed.
audio W: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
audio W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

I have tried setting RESIN_HOST_CONFIG_hdmi_ignore_edid_audio = 1 but this didn’t change anything. The documentation for the browser block suggests that it comes pre-configured for the audio block which I have double checked and everything seems in order in the docker-compose.

I have also tried changing the AUDIO_OUTPUT env variable but no luck.

Hi c-swift

Some of the issues may be related to permissions. Can you share your docker-compose.yml file to take a look?

The errors related to Bluetooth could be caused because the container doesn’t have access to the D-Bus or doesn’t have enough privileges. For example, from the audio block readme GitHub - balenablocks/audio: Audio building block for balenaOS, based on pulseaudio. the following may be missing:

    privileged: true
    labels:
      io.balena.features.dbus: 1  # Only required for bluetooth support

The errors related to the audio card not being found may also be related. Can you run cat /proc/asound/cards from the HostOS shell and from the audio container?

Cheers
Ramiro

Sure! Here is my docker-compose.yml:

version: '2'

volumes:
  settings:                      

services:

  browser:
    image: bhcr.io/balenablocks/browser-aarch64
    privileged: true 
    network_mode: host
    ports:
        - '5011' # management API (optional)
        - '35173' # Chromium debugging port (optional)
    volumes:
      - 'settings:/data' 
  audio:
    image: balenablocks/audio
    privileged: true
    ports:
      - 4317:4317

Here is the output from cat /proc/asound/cards:

From the Host OS:

0 [vc4hdmi0 ]: vc4-hdmi - vc4-hdmi-0
vc4-hdmi-0
1 [vc4hdmi1 ]: vc4-hdmi - vc4-hdmi-1
vc4-hdmi-1

From the audio container:

0 [vc4hdmi0 ]: vc4-hdmi - vc4-hdmi-0
vc4-hdmi-0
1 [vc4hdmi1 ]: vc4-hdmi - vc4-hdmi-1
vc4-hdmi-1

Hi

I’d like to ask you for more info to try to understand what’s happening. 1) Can you share the full dmesg output? 2) Can you go to the Device configuration tab on your device and tell me what the contents of Define DT overlays is? Or maybe share a screenshot of the whole fleet/device config page. 3) Is there anything plugged into the HDMI port?

Last step, can you try with the following docker-compose? This should fix the blueetooth issues and uses the arch-specific image for the audio block.

version: '2'

volumes:
  settings:                      

services:

  browser:
    image: bhcr.io/balenablocks/browser-aarch64
    privileged: true 
    network_mode: host
    ports:
        - '5011' # management API (optional)
        - '35173' # Chromium debugging port (optional)
    volumes:
      - 'settings:/data' 
  audio:
    image: bhcr.io/balenablocks/audio-aarch64
    privileged: true
    labels:
      io.balena.features.dbus: 1  # Only required for bluetooth support
    ports:
      - 4317:4317

Thanks, Ramiro