Cannot have working SAI on iMX7D

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

Cannot have working SAI on iMX7D

640 Views
jbaptiste_marie
Contributor I

Hello, 

I am trying to configure SAI1 of the iMX7 to be used with an external codec.

Interesting part of my device tree is shown below:

sound {
compatible = "simple-audio-card";
status = "okay";
simple-audio-card,name = "My sound card";
simple-audio-card,format = "i2s";
clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
assigned-clocks = <&clks IMX7D_AUDIO_MCLK_ROOT_SRC>,
<&clks IMX7D_AUDIO_MCLK_ROOT_CLK>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
assigned-clock-rates = <0>, <24576000>;
mclk-fs = <512>;
simple-audio-card,cpu {
sound-dai = <&sai1>;
};
simple-audio-card,codec {
sound-dai = <&my_external_codec>;
};
};

...

&sai1 {
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai1>;
assigned-clocks = <&clks IMX7D_SAI1_ROOT_SRC>,
<&clks IMX7D_SAI1_ROOT_CLK>;
assigned-clock-parents = <&clks IMX7D_PLL_AUDIO_POST_DIV>;
assigned-clock-rates = <0>, <24576000>;
status = "okay";
};

I am trying to play a 48kHz audio file with aplay and it always fails with this error:

aplay: set_params:1403: Unable to install hw params:

Going deeper into the code, it seems the problem comes in clk.c:

clk_calc_new_rates

That function is called when the DAI is configured:

ret = snd_soc_dai_set_sysclk(cpu_dai, 0, mclk,
SND_SOC_CLOCK_OUT);

The clk_calc_new_rates fails as "parent" is not defined when the function is called, and no callback are defined for the "derterminate_rate" and "round_rate" functions for the clock. 

Kernel version is 4.14

I do not see what is wrong in my configuration, am i missing something?

Thanks for your help.

Labels (4)
0 Kudos
2 Replies

580 Views
igorpadykov
NXP Employee
NXP Employee

Hi Jean-Baptiste

for MX7 simple audio card one can look at

Eight channels audio on i.MX7 with PCM3168 - Bootlin's blog 


Best regards
igor
-----------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
-----------------------------------------------------------------------------------------------------------------------

0 Kudos

580 Views
jbaptiste_marie
Contributor I

Hello, 

The mistake was on my side, the question is totally off topic.

However thanks for your answer.

Regards,

0 Kudos