Hello Everyon:
在Android9的环境下,移植了一个codec芯片程序,使用了sai3
设备树配置如下:
&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
fsl,sai-asynchronous;
status = "okay";
};
aw8838: aw8838@37 {
compatible = "awinic,aw8838_codec";
reg = <0x37>;
reset-gpio = <&gpio1 15 0>;
status = "okay";
};
sound-aw8838 {
compatible = "fsl,imx-audio-aw8838";
model = "aw8838-audio";
audio-cpu = <&sai3>;
audio-codec = <&aw8838>;
};
播放48000Hz32bit的wav文件,能正常驱动,但是换成44100Hz16bit的wav文件报如下错误:
[ 444.644392] aw8838_startup: enter
[ 444.653581] aw8838_startup: enter
[ 444.660985] fsl-sai 30030000.sai: failed to derive required Tx rate: 1411200
[ 444.668046] fsl-sai 30030000.sai: ASoC: can't set 30030000.sai hw params: -22
[ 444.675204] aw8838_mute: mute state=1
Unable to open PCM device 0 (cannot set hw params: Invalid argument)
evk_8mm:/ #
想请教下如何播放44100Hz16bit的wav文件,出现上面的错误原因是什么?
希望大佬们能解答下
Bset Wishes
CheLL
Hi,
Where did you get the aw8838 driver? I did not see aw8838 driver realized by nxp. You can refer the fsl codec driver in \vendor\nxp-opensource\kernel_imx\sound\soc\fsl. Some params set in driver may be different.
Best Regards
Zhiming
Hi,
This is a chip of a domestic chip company. Their codec chip has been verified by MTK. The machine code is the reference imx-wm8524. There is no problem playing 48000Hz32bit wav files at present, but the above error occurs at 44100Hz16bit. What may be the reason? What files need to be modified?
Best Wishes
CheLL
Hi~
Thank you for your answers
&sai3 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MM_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <24576000>;
status = "okay";
};
The 48000Hz wav file is available, but 44100Hz is not.
Is it related to assigned-clock-rates = <24576000>;, should this value be changed to a multiple of 44100?
You can refer this to change clk
Thanks for your answers!