Hi,
On a custom carrier board using a Verdin IMX8MP SoM we added a MAX98357a I2S audio DAC/AMP to be able to connect a small speaker to the board.
So far I ran into some issues trying to get data out on the I2S bus.
The card seems to be recognizes in Linux, based on the dmesg output:
[ 1.816719] debugfs: Directory ‘30c10000.sai’ with parent ‘max98357a’ already present!
[ 1.824786] asoc-simple-card sound-card: HiFi <-> 30c10000.sai mapping ok
[ 1.831624] asoc-simple-card sound-card: ASoC: no DMI vendor name!
and in alsamixed I see the sound card, which has no controls as expected.
But if I try to play audio or run speaker-test I get the following message:
speaker-test 1.2.1
Playback device is default
Stream paramet[ 298.905978] fsl-sai 30c10000.sai: ASoC: can’t open component 30c10000.sai: -6
ers are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
ALSA lib …/…/…/alsa-lib-1.2.1.2/src/pcm/pcm_dmix.c:1089:(snd_pcm_dmix_open) unable to open slave
Playback open error: -6,No such device or address
Could you give us some pointers on what this could be?
We are using Yocto, BSP 5.7.2 and I changed the following for the sound card:
I added the codec driver in Linux
│ Symbol: SND_SOC_MAX98357A [=y]
│ Type : tristate
│ Prompt: Maxim MAX98357A CODEC
│ Location:
│ -> Device Drivers
│ -> Sound card support (SOUND [=y])
│ -> Advanced Linux Sound Architecture (SND [=y])
│ -> ALSA for SoC audio support (SND_SOC [=y])
│ (6) -> CODEC drivers
And I added it to the device tree as follows:
codec_ext: max98357a@0 {
compatible = "maxim,max98357a";
#sound-dai-cells = <0>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1>;
clock-names = "mclk";
};
sound_card: sound-card {
compatible = "simple-audio-card";
simple-audio-card,bitclock-master = <&dailink_master>;
simple-audio-card,format = "i2s";
simple-audio-card,frame-master = <&dailink_master>;
simple-audio-card,name = "max98357a";
dailink_master: simple-audio-card,codec {
sound-dai = <&codec_ext>;
clocks = <&audiomix_clk IMX8MP_CLK_AUDIOMIX_SAI1_MCLK1>;
};
simple-audio-card,cpu {
sound-dai = <&sai1>;
};
};
I also changed the asound.conf to the following:
pcm.speakerbonnet {
type hw card 0
}
pcm.dmixer {
type dmix
ipc_key 1024
ipc_perm 0666
slave {
pcm "speakerbonnet"
period_time 0
period_size 1024
buffer_size 8192
rate 44100
channels 2
}
}
ctl.dmixer {
type hw card 0
}
pcm.softvol {
type softvol
slave.pcm "dmixer"
control.name "PCM"
control.card 0
}
ctl.softvol {
type hw card 0
}
pcm.!default {
type plug
slave.pcm "softvol"
}
Best regards,
Rik