"Unsupported Clock setting 44100 for DAI 0" in rt5640 audio driver

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

"Unsupported Clock setting 44100 for DAI 0" in rt5640 audio driver

298 Views
Yocto_learner
Contributor II

Hello Everyone, 

I am working with two rt5640 audio chips having imx8mplus soc. In both of the audio chip one is working in slave mode and the other one is master. IMX8MPLUS soc is master mode for rt5640 slave and slave for rt5640 master. I am not getting sound in any one of them.

But first I need to focus for the rt5640 slave chip and have to work it. I am able to make audio card for rt5640 and also getting data on the i2c-3 bus for it. But when I try to play a wav file or record I get "Unsupported clock setting for 44100 for rt5640 DAI 0".

It is not getting the proper clock setting for rt5640 work in slave mode. Here I am attaching some pieces of code which I have configured and rt5640 driver code. 

 

imx8mp-evk.dts

&i2c4 {
clock-frequency = <400000>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_i2c4>;
status = "okay";

codec: rt5640@1c {
compatible = "realtek,rt5640";
reg = <0x1c>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>;
//clock-names = "mclk";
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
interrupt-parent=<&gpio1>;
interrupts=<11  IRQ_TYPE_LEVEL_HIGH>;
realtek,in1-differential = "true";
realtek,in2-differential = "true";
//realtek,in3-differential = "true";
realtek,jack-detect-source = <0>;
status = "okay";
};

};

&sai3 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai3>;
assigned-clocks = <&clk IMX8MP_CLK_SAI3>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
//assigned-clock-rates = <12288000>;
assigned-clock-rates = <786432000>, <393216000>, <49152000>, <12288000>, <49152000>;
clocks = <&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_IPG>, <&clk IMX8MP_CLK_DUMMY>,
<&audio_blk_ctrl IMX8MP_CLK_AUDIO_BLK_CTRL_SAI3_MCLK1>, <&clk IMX8MP_CLK_DUMMY>,
<&clk IMX8MP_CLK_DUMMY>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3";
fsl,sai-mclk-direction-output;
status = "okay";
};

sound-rt5640 {
compatible = "fsl,imx-audio-rt5640";
model = "rt5640-audio";
audio-cpu = <&sai3>;
audio-codec = <&codec>;
audio-ascr =<&easrc>;
hp-det-gpio=<&gpio1 13 0>;
mic-det-gpio=<&gpio1 12 0>;
audio-routing =
"Headphone Jack", "HPO_L",
"Headphone Jack", "HPO_R",
"Ext Spk", "SPO_LP",
"Ext Spk", "SPO_LN",
"Ext Spk", "SPO_RP",
"Ext Spk", "SPO_RN",
"IN2P", "Mic Jack",
"IN2N", "Mic Jack",
"Mic Jack", "MICBIAS1";
constraint-rate = <8000>,
<11025>,
<12000>,
<16000>,
<22050>,
<24000>,
<32000>,
<44100>,
<48000>,
<88200>,
<96000>,
<176400>,
<192000>;
staus = "okay";
};

why am I getting this unsupported clock setting how to resolve this for rt5640 slave working? 
 rt5640 driver source code 

Thanks in Advance 

0 Kudos
Reply
1 Reply

276 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

The RT5640 audio CODEC is not supported by default on our BSP. To use this CODEC to your system, maybe you need to add a third-party driver provided by CODEC manufacturer and configure your device tree.

Unfortunately, there is not a guide to port this specific CODEC to the BSP. The references we have are the i.MX porting guide and EVK device tree (WM8960).

You are getting that error because PLL/prescaler cannot provide requested frequency to play audio at 44.1 KHz sample rate.

If you need to reproduce at that sample rate, maybe you should use an external crystal to provide necessary clock frequency.

Best regards.

0 Kudos
Reply