Hi,
I am using Max98390C amplifier with speaker in our device having NXP IMX8MP SOM. I am able to play songs using the MAX98390 Development Board. But when I play the audio files in the device using aplay, I am getting the following errors:
[15666.371878] fsl-sai 30c10000.sai: failed to derive required Tx rate: 1411200
[15666.378977] fsl-sai 30c10000.sai: ASoC: error at snd_soc_dai_hw_params on 30c10000.sai: -22
[15666.387360] 30c10000.sai-max98390-aif1: ASoC: error at __soc_pcm_hw_params on 30c10000.sai-max98390-aif1: -22
ALSA lib /usr/src/debug/alsa-lib/1.2.8-r0/src/pcm/pcm_direct.c:1336:(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib /usr/src/debug/alsa-lib/1.2.8-r0/src/pcm/pcm_dmix.c:1011:(snd_pcm_dmix_open) unable to initialize slave
aplay: main:831: audio open error: Invalid argument
speaker-test also outputs the same error.
Below are the dts nodes:
sound {
compatible = "simple-audio-card";
pinctrl-names = "default";
simple-audio-card,name = "max98390-audio-card";
simple-audio-card,format = "i2s";
/*simple-audio-card,widgets = "Speaker", "Speaker";
simple-audio-card,routing = "Speaker", "Speaker";*/
simple-audio-card,bitclock-master = <&cpu_dai>;
simple-audio-card,frame-master = <&cpu_dai>;
/*simple-audio-card,mclk-fs = <256>;*/
status = "okay";
cpu_dai: simple-audio-card,cpu {
sound-dai = <&sai1>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <16>;
};
simple-audio-card,codec {
sound-dai = <&max98390>;
};
};
&sai1 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
assigned-clocks = <&clk IMX8MP_CLK_SAI1>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI1_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI1_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
/*assigned-clock-rates = <0>, <786432000>, <49152000>, <12288000>, <49152000>;*/
fsl,mode = "i2s-master";
fsl,sai-mclk-direction-output;
status = "okay";
};
&i2c3 {
clock-frequency = <400000>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_i2c3>;
pinctrl-1 = <&pinctrl_i2c3_gpio>;
scl-gpios = <&gpio5 18 GPIO_ACTIVE_HIGH>;
sda-gpios = <&gpio5 19 GPIO_ACTIVE_HIGH>;
status = "okay";
max98390: amplifier@38 {
#sound-dai-cells = <0>;
compatible = "maxim,max98390";
reg = <0x38>;
maxim,temperature_calib = <1024>;
maxim,r0_calib = <100232>;
reset-gpios = <&gpio4 21 GPIO_ACTIVE_LOW>;
status = "okay";
};
};
pinctrl_sai1: sai1grp {
fsl,pins = <
MX8MP_IOMUXC_SAI1_RXD7__AUDIOMIX_SAI1_TX_SYNC 0xd6
MX8MP_IOMUXC_SAI1_TXC__AUDIOMIX_SAI1_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI1_TXD0__AUDIOMIX_SAI1_TX_DATA00 0xd6
>;
};
Someone please help me to fix this issue?
Thanks
Chris