No sound through HDMI on Verdin iMX8M-Plus running TorizonOS 6

I have a Next.js application running on Verdin iMX8M-Plus with TorizonOS 6.
I connected a HDMI monitor with builtin speakers but I don’t hear any sound through HDMI.
If I built the same application for my Windows 10 PC, I can hear the sound.

I found this on NXP community but I don’t know if the info are correct, and if the configuration is applied inside TorizonOS.

Greetings @vix,

I assume your application is using ALSA for audio playback purposes. Are you selecting the correct ALSA card device for HDMI audio? I believe this can be set by the ALSA_CARD environment variable, assuming your application recognizes this. For reference we have an arcade cabinet demo that we use for shows. It makes use of HDMI audio and for our application we just need to set ALSA_CARD=audiohdmi in the container so that our application uses the correct ALSA audio device.

Best Regards,
Jeremias

Hi @jeremias.tx
my application is a node.js application, with the UI shown in a Chromium container, and so I call
window.audioContext
to use Web Audio API.
As far as I understand this plays the sound in the default OS audio output interface.
I’m going to try if event is this case, setting ALSA_CARD=audiohdmi in the node.js container is enough.
I let you know.

my application is a node.js application, with the UI shown in a Chromium container, and so I call
window.audioContext
to use Web Audio API.

I’m not familiar with this particular function/stack here. I assume it uses ALSA underneath it all I hope. As this is the audio framework we are most familiar with.

As far as I understand this plays the sound in the default OS audio output interface.

HDMI audio would not be the default audio device I would imagine. At least on our default setups there are other audio interfaces that take priority: Audio (Linux) | Toradex Developer Center

Though this might differ on your hardware setup if you have a custom carrier board.

Best Regards,
Jeremias

Hi @jeremias.tx,
thanks for your hint!
Adding ALSA_CARD=audiohdmi in the docker environment makes the magic!

thanks

Perfect! Glad to hear it was just that simple. Glad I could help.

Best Regards,
Jeremias