Play .aac/.mp3/.ogg files running cog inside a container (Torizon)?

(How to play audio on Torizon OS using Alsa and C/C++ | Toradex Developer Center) , this guide seems to be for another version of visual studio code plugin, isn’t it? The apolloX seems a ‘little’ bit different

This article is outdated and written for a much older version of our extension please don’t reference this word for word at the moment. I provided updated instructions on how to use this example for the current extension on this other thread here: Audio sample for torizon, vs code extension

I’ve used the example you’ve pointed in the original post, and i’m using a apalis imx8 module with ixora carrierboard.

In the gst-launch-1.0 command I used device=hw:0,0 since that is what the sound card enumerated as during my test. But this can change and the soundcard can be enumerated as a different numbered device other than 0,0. Based on your error it looks like this was the case. You can check /proc/asound/cards to see what device numer the sound card enumerated as. For apalis-imx8 the correct soundcard device is apalisimx8qmsgt. For example see on my device:

cat /proc/asound/cards
 0 [apalisimx8qmsgt]: simple-card - apalis-imx8qm-sgtl5000
                      apalis-imx8qm-sgtl5000
 1 [imxaudiohdmitx ]: imx-audio-hdmi- - imx-audio-hdmi-tx
                      imx-audio-hdmi-tx
 2 [imxspdif       ]: imx-spdif - imx-spdif
                      imx-spdif

In this case it’s still device 0, but this is not consistent across boots. One final note, you may need to set the volume on your headphones/playback device before you can hear anything. You can do that by installing alsa-utils in the container and running amixer set Headphone unmuted 50%.

For reference I just tried my example again on an Apalis i.MX8 with the Ixora carrier board and it still seems to work fine for me.

Best Regards,
Jeremias