Adding MAX98357A I2S DAC to a custom carrier board

Hello @rikte ,
About this error:

It could be that the module is built for another kernel version, as in this case:

Best regards,

Hello @rikte ,
Do you have any updates on this topic?

Best regards,

Hi @josep.tx

I verified that I have the exact same kernel, modules and such. So I am not sure if that is the issue.
I used the steps I mentioned in my previous post to build the kernel with driver.
if someone on your side would be able to validate or check if they can reproduce it, that would be very appreciated.

Hi @rikte ,
Since BSP6, we have provided downstream and upstream kernels for Verdin IMX8MP. You have to check BSP installed on your Verdin iMX8MP and the Linux source code you downloaded.

Hi @benjamin.tx
This is all based on the downstream BSP 6.1, so using the toradex_5.15-2.1.x-imx branch.

Hi @rikte , I tested on our latest downstream multimedia bsp v6.3. And the kernel branch is toradex_5.15-2.1.x-imx.

root@verdin-imx8mp-06849221:~# cat /etc/os-release
NAME="TDX Wayland with XWayland"
VERSION="6.3.0-devel-202306+build.11 (kirkstone)"
PRETTY_NAME="TDX Wayland with XWayland 6.3.0-devel-202306+build.11 (kirkstone)"

On V6.3 BSP, max98357 has been enabled as a kernel module by default. So one doesn’t have to recompile the kernel and kernel modules. The device tree is the only thing to modify.

root@verdin-imx8mp-06849221:~# zcat /proc/config.gz |grep CONFIG_SND_SOC_MAX98357A
root@verdin-imx8mp-06849221:~# find /lib/modules/ -name *98357*

max98357.patch (3.6 KB)
is the patch.

With the new device tree applied, the audio can be played via max98357a decoder.

root@verdin-imx8mp-06849221:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: max98357a [max98357a], device 0: 30c10000.sai-HiFi HiFi-0 [30c10000.sai-HiFi HiFi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: audiohdmi [audio-hdmi], device 0: i.MX HDMI i2s-hifi-0 [i.MX HDMI i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

root@verdin-imx8mp-06849221:~# aplay -D sysdefault:CARD=max98357a LRMonoPhase4.wav
Playing WAVE 'LRMonoPhase4.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

Thanks! I’ll give it a try later this week.

I got your device tree working pretty quickly. After a good bit of debugging I found out why it did not work on my side.
When cleaning up the device tree for our board we removed a bit too much.

&sdma2 {
status = “okay”;

was missing and the root cause of our audio issues on Kirkstone. Adding that back in and it worked. Thanks for the support!

Hi @rikte ,
Thanks for the update :slight_smile:
Could you please mark the most suitable answer on this topic as a solution? Thanks

Best regards,