Audio with Yocto and the iMX8M Mini

Hello @mnano

Your output of aplay -L shows a NAU8822 codec, which is not present on the Dalia carrier board, only on the Verdin development board.

The Dahlia carrier board uses a WM8904 codec

As you pointed out this issue comes from the wrong device tree being loaded:

Unfortunately I don’t have a Verdin iMX8M Mini at hand, but I have been able to reproduce the issue with a Verdin iMX8M Plus , and as a quick test, adapted the solution from that thread

For your SoM it should be:

fw_setenv board 'dahlia-imx8mm'
fw_setenv board_name 'dahlia-imx8mm'
fw_setenv fdt_board 'dahlia'
fw_setenv fdtfile 'imx8mm-verdin-wifi-dahlia.dtb'
reboot now

Then try playing some sound, for example:

aplay -D sysdefault:CARD=imx8mpwm8904 /home/root/sound/Gong.wav

Can you try and check if that works for you?

For the production version of your image, here you have information about how to load your custom device tree on a Yocto build:

Best regards,
Josep