Dahlia Carrier Board: Audio not working

Hi,

I currently have a Dahlia Carrier Board with a Verdin AM62 SoM attached. I tried following the guides from Audio (Linux) | Toradex Developer Center and How to play audio on Torizon OS using Alsa and C/C++ | Toradex Developer Center to run audio but none of it worked for me. In my case, I have plugged my headphones (Sennheiser MX375) into the minijack plug on the carrier board and then I ran a container with my Avalonia FB/DRM application (I also added alsa-utils to the torizonPackages.json in order to run aplay). On that container I tried running both aplay on a .wav file and speaker-test. None of these worked and the headphones didn’t produce any sound at all even though no errors were outputed to the console. The only weird thing that I’ve noticed is that I see the files on my host OS in /proc/asound/ but I don’t see anything in this folder on the container.

My docker-compose.yml file contains a record for binding /dev/snd with the container

  • “c 116:* rmw”
# cat /proc/asound/cards 
  0 [verdinnau8822  ]: simple-card - verdin-nau8822
                       verdin-nau8822
## aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: verdinnau8822 [verdin-nau8822], device 0: 2b00000.audio-controller-nau8822-hifi nau8822-hifi-0 [2b00000.audio-controller-nau8822-hifi nau8822-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
## aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
hw:CARD=verdinnau8822,DEV=0
    verdin-nau8822, 2b00000.audio-controller-nau8822-hifi nau8822-hifi-0
    Direct hardware device without any conversions
plughw:CARD=verdinnau8822,DEV=0
    verdin-nau8822, 2b00000.audio-controller-nau8822-hifi nau8822-hifi-0
    Hardware device with all software conversions
default:CARD=verdinnau8822
    verdin-nau8822, 2b00000.audio-controller-nau8822-hifi nau8822-hifi-0
    Default Audio Device
sysdefault:CARD=verdinnau8822
    verdin-nau8822, 2b00000.audio-controller-nau8822-hifi nau8822-hifi-0
    Default Audio Device
dmix:CARD=verdinnau8822,DEV=0
    verdin-nau8822, 2b00000.audio-controller-nau8822-hifi nau8822-hifi-0
    Direct sample mixing device

I tried running these commands in order to check the sound

## amixer -c 0 sset Headphone unmute
## amixer -c 0 set Headphone 50%
## aplay test.wav

tdx-info

Software summary
------------------------------------------------------------
Bootloader:               U-Boot
Kernel version:           6.6.84-7.2.0-g8bf00740f043 #1-Torizon SMP PREEMPT Thu Mar 27 16:42:10 UTC 2025
Kernel command line:      root=LABEL=otaroot rootfstype=ext4 quiet logo.nologo vt.global_cursor_default=0 plymouth.ignore-serial-consoles splash fbcon=map:3 ostree=/ostree/boot.1/torizon/ec9ba211477b683a44806a237c2aef7ced86fcf9aaf09a12fbbb778532976ed6/0
Distro name:              NAME="Torizon OS"
Distro version:           VERSION_ID=7.2.0-build.13
Distro variant:           VARIANT="Docker"
Hostname:                 verdin-am62-15380640
------------------------------------------------------------

Hardware info
------------------------------------------------------------
HW model:                 Toradex Verdin AM62 WB on Verdin Development Board
Toradex version:          0076 V1.1C
Serial number:            15380640
Processor arch:           aarch64
------------------------------------------------------------

Hi, I’m the Toradex AI Assistant.

I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.

Did you like my answer? :+1: :-1:


Hello! Thank you for your detailed description and the outputs provided. Based on your setup—a Verdin AM62 on a Dahlia Carrier Board running Torizon OS 7.x in a container—here are some important points and troubleshooting steps to help you get audio working:

1. Correct Device Binding for Audio in Docker

The recommended way to pass audio devices to the container is using the --device flag or the equivalent compose format. Your binding for /dev/snd using "c 116:* rmw" may not expose all underlying devices properly.

Update your docker-compose.yml to include:

services:
  your-service:
    devices:
      - /dev/snd:/dev/snd

This ensures the whole /dev/snd directory (containing ALSA PCM and control devices) is visible in the container.

Reference:


2. Set ALSA_CARD Environment Variable

Add the following environment variable to your container to pick the correct sound card:

ENV ALSA_CARD=verdinnau8822

Or in docker-compose.yml:

environment:
  ALSA_CARD: verdinnau8822

3. Install ALSA Utilities in Your Container

You mentioned adding alsa-utils to torizonPackages.json. Double-check that aplay, amixer, etc., are actually present in your running container. If not, ensure your Dockerfile contains:

RUN apt-get update && \
    apt-get install -y alsa-utils && \
    apt-get clean && \
    rm -rf /var/lib/apt/lists/*

4. PulseAudio or ALSA?

Stick with ALSA as documented. If you add PulseAudio or other sound servers, they may interfere.


5. Verifying /proc/asound in Container

If /proc/asound is empty in your container, likely the /dev/snd device mapping is incomplete or missing. Fixing your docker-compose as above should solve this.


6. Test Audio Outside the Container

SSH into your device and run the following directly on Torizon OS outside any container:

amixer -c 0 sset Headphone unmute
amixer -c 0 set Headphone 50%
aplay /usr/share/sounds/alsa/Front_Center.wav

If you don’t hear audio here, the problem is not with your container, but with the underlying system setup.


7. Volume and Output Settings

Double-check:

  • Volume is set above zero
  • Device isn’t muted (amixer -c 0)
  • Headphones are firmly plugged in the correct jack

8. For the Dahlia Board Connector

The Dahlia’s minijack uses the codec on the Verdin module—which is the NAU8822 in your case, and drivers seem loaded (aplay -l output). Double-check the board schematic for correct plug-in if you use a 4-pole/3-pole connector.

Reference:


9. Troubleshoot with Speaker-Test

Try this both on the host and in the container (after correct device binding):

speaker-test -c 2 -D hw:0,0

You should hear a left-right test pattern.


Summary of Actions:

  1. Update your docker-compose.yml to map /dev/snd:/dev/snd.
  2. Set ALSA_CARD environment variable.
  3. Ensure alsa-utils are installed and available in the container.
  4. Test audio directly on the host (outside a container).
  5. If audio works on the host, it should work in the container with the above adjustments.

Let me know your results after trying these steps!

Best regards,
Toradex AI Assistant.

Reference documentation:

I followed the instruction from the AI and ran
## speaker-test -c 2 -D hw:0,0

I got the following error:

speaker-test 1.2.8

Playback device is hw:0,0
Stream parameters are 48000Hz, S16_LE, 2 channels
Using 16 octaves of pink noise
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 16 to 131072
Period size range from 8 to 16384
Using max buffer size 131072
Periods = 4
was set period_size = 16384
was set buffer_size = 131072
 0 - Front Left
 1 - Front Right
Write error: -5,Input/output error
xrun_recovery failed: -5,Input/output error
Transfer failed: Input/output error

Greetings @daniel.l,

Looks like you’re not using the correct device tree. You say you’re on the Dahlia carrier board. The Dahlia carrier board uses a different audio codec than the Verdin Development board. The device tree needs to be changed to the Dahlia one, to account for this difference. Otherwise the Linux kernel will try to use an audio codec that is not physically there.

You can do this by setting the fdtfile variable in U-Boot. I believe the device tree for Verdin AM62 with Dahlia would be k3-am625-verdin-wifi-dahlia.dtb.

Best Regards,
Jeremias

Hi, Jeremias

I did the following in the boot console

setenv fdt_board dahlia
setenv fdtfile k3-am625-verdin-wifi-dahlia.dtb
saveenv
boot

Then I’ve repeated the previous instructions and it did work like a charm this time :smiley:
Thank you for the advice.

Best Regards,
Daniel

Glad I was able to assist.

Best Regards,
Jeremias