i.MX7D SAI1 (Slave) connection to codec (Master)

キャンセル
次の結果を表示 
表示  限定  | 次の代わりに検索 
もしかして: 

i.MX7D SAI1 (Slave) connection to codec (Master)

3,253件の閲覧回数
frankyhsu
Contributor III

Hi Support,

We see the thread that ever discussed it before. We still have something needing to clarify.

i.MX7 SAI connection when i.MX7 is I2S slave. 

We have the connection described in the thread that we connect the codec BCLK and FS to I.MX7 RX_BCLK and RX_FS just like the sample picture in that thread. Does it work?

pastedImage_2.png

We see the description shows the TXC/TXFS can be slave or master mode. Does RXC/RXFS have the same feature or it just can be used as asynchronous mode?

In our board, currently, the TXC and TXFS is no connected and we just connect RXC and RXFS to codec to receive the signal.

ラベル(1)
タグ(1)
0 件の賞賛
返信
8 返答(返信)

2,563件の閲覧回数
frankyhsu
Contributor III

So, if we miss to connect the TX_bclk and TX_FS, the HW will be a wrong connection for SAI function?

0 件の賞賛
返信

2,563件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Franky Hsu,

    About this question, there exist 2 kinds of different advice : Yes or No. I just communicated with Software AE (Max) in TaiPei, He gave a patch for you current connection, the code should be sent to you, I can also paste them here, please try it!

--

diff --git a/sound/soc/fsl/fsl_sai.c b/sound/soc/fsl/fsl_sai.c

index 79c23fd..42568d9 100644

--- a/sound/soc/fsl/fsl_sai.c

+++ b/sound/soc/fsl/fsl_sai.c

@@ -860,8 +860,8 @@ static int fsl_sai_probe(struct platform_device *pdev)

        }

 

        /* Sync Tx with Rx as default by following old DT binding */

-       sai->synchronous[RX] = true;

-       sai->synchronous[TX] = false;

+       sai->synchronous[RX] = false;

+       sai->synchronous[TX] = true;

        fsl_sai_dai.symmetric_rates = 1;

        fsl_sai_dai.symmetric_channels = 1;

        fsl_sai_dai.symmetric_samplebits = 1;


Have a great day,
TIC   Weidong Sun

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

0 件の賞賛
返信

2,563件の閲覧回数
brucefang
Contributor I

Hello Wigros, 

Update the status on our side:

    On our board, SAI1 is for codec, and SAI2 is for Bluetooth audio, need to notice, the two SAI bus are using  the RX_BCLK and RX_SYNC.
    But we found that the play and record function are working on BT side, not working on codec.

    It's strange, the same connection(RX_BCLK/RX_SYNC), why the SAI2 works well, but SAI1 can't work?
    Please help to confirm the different.

0 件の賞賛
返信

2,563件の閲覧回数
frankyhsu
Contributor III

We had tried this solution via adding DTS "fsl,sai-synchronous-rx".
And with this config, the SAI driver will set RX=false, TX=ture.

If dump the register, we can get the RX has been set as sync mode, and TX as async mode.
But the SAI function still can not work.

pastedImage_2.png

0 件の賞賛
返信

2,563件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Franky,

    I am very sorry for my wrong answer!  I re-confirmed it with my colleague on the question. the following is the basic usage of SAI in i.MX7D. Let me correct it!

(1) For Master Mode and Slave Mode, Their connections are same on hardware design.

So connection should be:

SAI_TXC---->BCLK

SAI_TXF---->DACLRC

SAI_TXD---->DACDAT

SAI_RXD---->ADCDAT

(2) SAI_RXC & SAI_RXF signals

These 2 signals are only used to work at async mode.

So whoever is Master or Slave, connections must be the same for I2S mode.


Have a great day,
TIC  weidong sun

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

0 件の賞賛
返信

2,563件の閲覧回数
weidong_sun
NXP TechSupport
NXP TechSupport

Hello Franky,

   I confirmed it with my colleague from I.MX hardware AE team, Your connections should be OK, SAI will work at I2S mode.

Have a nice day!

Best Regards,

Weidong

0 件の賞賛
返信

2,563件の閲覧回数
frankyhsu
Contributor III

As you know, on IMX7 SABER board, it uses the TXC/TXFS for BCLK/LRCLK input with slave mode and codec as master mode. If using RXC/RXFS on our design, how to configure the SAI bus in machine driver based on IMX7 BSP code?

Meanwhile, we dump the value of register "SAI1 I2S1_RCR2" as below, please help to review:
 -------------------------------
   # memtool 0x308a0088 4
     Reading 0x4 count starting at address 0x308A0088
     0x308A0088:  42000000 00000000 00000018 00000000
   -------------------------------

0 件の賞賛
返信

2,563件の閲覧回数
frankyhsu
Contributor III

Hi,

We have rework the Saber board to the RX_bclk/FS. Before we rework, the aplay can work. We can see the clk and even the TX/RX DATA when aplay or record. Sure, for the new configuration on saber board, we have also modified the FW setting as the DRM document mentioned. Set RXBCLK to async and TXBCLK to sync mode. The result is fail and shows "shows "pcm_write error: Input/output error"".  Would you please help to check if there are further setting needing to modify?

1) DTS file: modify pin mux define for RX_BCLK/RX_FS

pastedImage_4.png

pastedImage_5.png

2) DTS file: change RX and TX sync mode

pastedImage_6.png

0 件の賞賛
返信