Hi all,
i'm trying to play audio using alsa command aplay but i always get this error :
[ 97.759983] fsl-sai 30050000.sai: failed to derive required Tx rate: 1411200
[ 97.759988] fsl-sai 30050000.sai: ASoC: can't set 30050000.sai hw params: -22
here my configuration in dtsi and dts file
1) sound card configuration
sound-tlv320aic32x4 {
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 = "tlv320aic32x4";
simple-audio-card,routing =
"Left DAC", "LOL",
"Right DAC", "LOR",
"IN1_L", "Left ADC",
"IN1_R", "Right ADC";
simple-audio-card,widgets =
"Line", "Line In",
"Line", "Line Out";
simple-audio-card,mclk-fs = <256>;
simple-audio-card,codec {
sound-dai = <&tlv320aic32x4>;
system-clock-frequency = <12288000>;
/*dai-tdm-slot-num = <2>;
dai-tdm-slot-width =<16>;*/
};
dailink_master:simple-audio-card,cpu {
sound-dai = <&sai5>;
/*dai-tdm-slot-num = <2>;
dai-tdm-slot-width =<16>;*/
/*clocks = <&clk IMX8MM_CLK_SAI5_ROOT>; */
};
};
2) sai configuratio
&sai5 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai5>;
assigned-clocks = <&clk IMX8MM_CLK_SAI5>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
clocks = <&clk IMX8MM_CLK_SAI5_IPG>, <&clk IMX8MM_CLK_DUMMY>,
<&clk IMX8MM_CLK_SAI5_ROOT>, <&clk IMX8MM_CLK_DUMMY>,
<&clk IMX8MM_CLK_DUMMY>, <&clk IMX8MM_AUDIO_PLL1_OUT>,
<&clk IMX8MM_AUDIO_PLL2_OUT>;
clock-names = "bus", "mclk0", "mclk1", "mclk2", "mclk3", "pll4k", "pll11k";
assigned-clock-rates = <12288000>;
status = "okay";
};
3) codec configuration
&i2c2 {
clock-frequency = <100000>;
pinctrl-names = "default", "gpio";
pinctrl-0 = <&pinctrl_i2c2>;
pinctrl-1 = <&pinctrl_i2c2_gpio>;
scl-gpios = <&gpio5 16 GPIO_ACTIVE_HIGH>;
sda-gpios = <&gpio5 17 GPIO_ACTIVE_HIGH>;
status = "okay";
/*mux audio codec*/
mux@70{
compatible = "nxp,pca9548";
status = "okay";
reg = <0x70>;
#address-cells = <1>;
#size-cells = <0>;
#pinctrl-names = "default", "gpio";
i2c@0{
#address-cells = <1>;
#size-cells = <0>;
reg = <0>;
tlv320aic32x4: tlv320aic32x4@18
{
compatible = "ti,tlv320aic32x4";
#sound-dai-cells = <0>;
reg = <0x18>;
pinctrl-0 = <&pinctrl_audio>;
reset-gpios = <&gpio2 14 GPIO_ACTIVE_LOW>;
clock-names = "mclk";
assigned-clocks = <&clk IMX8MM_CLK_SAI5>;
assigned-clock-parents = <&clk IMX8MM_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
HPVDD-supply = <&ldo3_reg>;
SPRVDD-supply = <&ldo3_reg>;
SPLVDD-supply = <&ldo3_reg>;
IOVDD-supply = <&ldo3_reg>; /*3V3*/
DVDD-supply = <&ldo5_reg>; /*1V8*/
AVDD-supply = <&ldo3_reg>;
ldoin-supply = <&ldo3_reg>;
iov-supply = <&ldo3_reg>;
ldo_supply = <&ldo3_reg>;
status = "okay";
};
};
};
the sai is master, the codec is slave.
help me please to configure the sai to generate the correct mclk