I have a Verdin iMX8M Mini on a Dahlia Carrier Board Rev 1.1. I use Yocto and I have been trying to play and record audio following this: Audio (Linux) | Toradex Developer Center
Using the Easy Installer, I used the Multimedia Reference Image and tried some of the steps, but nothing seems to work properly:
root@verdin-imx8mm-06898530:/# aplay -L
null
Discard all samples (playback) or generate zero samples (capture)
sysdefault:CARD=imx8mmnau8822
imx8mm-nau8822,
Default Audio Device
root@verdin-imx8mm-06898530:/# cat /proc/asound/cards
0 [imx8mmnau8822 ]: imx8mm-nau8822 - imx8mm-nau8822
imx8mm-nau8822
root@verdin-imx8mm-06898530:/# amixer set "Capture" cap
amixer: Unable to find simple control 'Capture',0
But, the solution indicated is for Torizon Core. It seems to me that the problem is the same (the device tree being used). How do I set the desired device tree, i.e., imx8mm-verdin-wifi-dahlia.dts in a custom layer using Yocto?
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
Thank you for your answer. Using fw_setenv to set the correct device tree did indeed work as intended.
However, I still do not know how to implement it correctly in my custom layer. It is not clear to me from the link you gave how to do that. I tried setting KERNEL_DEVICETREE in machine-extra.conf (which is included by my-distro.conf):