IMX8MP SAI2 as I2S slave mode connect to other MCU design

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

IMX8MP SAI2 as I2S slave mode connect to other MCU design

155 Views
ZenJeams
Contributor I

hi,

In my usage scenario, the I2S of IMX8MP is connected to the I2S of another MCU, the I2S of IMX8MP is used as the slave, and the I2S of MCU is used as the Master, PCM format 48K/S24 LE / 2 channels, The connection is as follows: 

ZenJeams_0-1711596853756.png

Question 1 In this case, does MCLK have to be connected to the MCLK of the MCU? 

Question 2: My DTS configuration is as follows. I used  ‘aplay -D hw: btscoaudio,0 test.wav’   for playback test and the data recorded on MCU was wrong. I can confirm that the I2S configuration on the MCU side is correct. Could you please tell me what was wrong with my configuration?  Could you give me some suggestions?  Thank you! 

pinctrl_sai2: sai2grp {
fsl,pins = <
MX8MP_IOMUXC_SAI2_TXC__AUDIOMIX_SAI2_TX_BCLK 0xd6
MX8MP_IOMUXC_SAI2_TXFS__AUDIOMIX_SAI2_TX_SYNC 0xd6
MX8MP_IOMUXC_SAI2_TXD0__AUDIOMIX_SAI2_TX_DATA00 0xd6
MX8MP_IOMUXC_SAI2_RXD0__AUDIOMIX_SAI2_RX_DATA00 0xd6
>;
};
 

&sai2 {
#sound-dai-cells = <0>;
pinctrl-names = "default";
pinctrl-0 = <&pinctrl_sai2>;
assigned-clocks = <&clk IMX8MP_CLK_SAI2>;
assigned-clock-parents = <&clk IMX8MP_AUDIO_PLL1_OUT>;
assigned-clock-rates = <12288000>;
fsl,sai-asynchronous;
fsl,txm-rxs;
status = "okay";
};

bt_sco_codec: bt_sco_codec {
#sound-dai-cells = <1>;
compatible = "linux,bt-sco";
};
 
sound-bt-sco {
compatible = "simple-audio-card";
simple-audio-card,name = "bt-sco-audio";
simple-audio-card,format = "i2s";
simple-audio-card,bitclock-inversion;
simple-audio-card,frame-master = <&btcpu>;
simple-audio-card,bitclock-master = <&btcpu>;
 
btcpu: simple-audio-card,cpu {
sound-dai = <&sai2>;
dai-tdm-slot-num = <2>;
dai-tdm-slot-width = <32>;
};
simple-audio-card,codec {
sound-dai = <&bt_sco_codec 1>;
};
};

 

Labels (1)
0 Kudos
2 Replies

66 Views
ZenJeams
Contributor I

Thanks.

I  cannot found  "codec-master"  configuration  used in yocto-real-time-edge V2.5.

I add 

 fsl,txmasterflag = <1>;
fsl,rxmasterflag = <1>;

on  device tree, it works now.

 

 

 

0 Kudos

100 Views
JorgeCas
NXP TechSupport
NXP TechSupport

Hello,

MCLK does not necessarily have to be connected but, devices should have a synchronized clock source as is showed on next image.

JorgeCas_0-1711982894245.png

Maybe you should add the next property on your device tree.

codec-master;

Also, this thread could be helpful.

Best regards.

 

0 Kudos