RT595 : Swapping of Left and Right Audio Channels

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

RT595 : Swapping of Left and Right Audio Channels

1,210件の閲覧回数
adc_6_6
Contributor III

Hello,

While inputting a 2-channel (L/R) audio signal via I2S, an issue occurred where the received signals for the left and right channels (Lch and Rch) were swapped due to static electricity.
At that time, the SLVFRMERR flag was set to 1, indicating that a Slave Frame Error had occurred.

What could be the possible causes of Lch and Rch being swapped?
Also, how is the determination of Lch and Rch made?
Is there a way to prevent this issue from occurring?

The main settings are as follows:

MasterSlave = Slave

frameLength = 32

const uint32_t CODEC_BCLK = (/* Pin is configured as FC6_SCK */
IOPCTL_PIO_FUNC1 |
/* Disable pull-up / pull-down function */
IOPCTL_PIO_PUPD_DI |
/* Enable pull-down function */
IOPCTL_PIO_PULLDOWN_EN |
/* Enables input buffer function */
IOPCTL_PIO_INBUF_EN |
/* Normal mode */
IOPCTL_PIO_SLEW_RATE_NORMAL |
/* Full drive enable */
IOPCTL_PIO_FULLDRIVE_DI |
/* Analog mux is disabled */
IOPCTL_PIO_ANAMUX_DI |
/* Pseudo Output Drain is disabled */
IOPCTL_PIO_PSEDRAIN_DI |
/* Input function is not inverted */
IOPCTL_PIO_INV_DI);

const uint32_t CODEC_LRCK = (/* Pin is configured as FC6_TXD_SCL_MISO_WS */
IOPCTL_PIO_FUNC1 |
/* Disable pull-up / pull-down function */
IOPCTL_PIO_PUPD_DI |
/* Enable pull-down function */
IOPCTL_PIO_PULLDOWN_EN |
/* Enables input buffer function */
IOPCTL_PIO_INBUF_EN |
/* Normal mode */
IOPCTL_PIO_SLEW_RATE_NORMAL |
/* Normal drive */
IOPCTL_PIO_FULLDRIVE_DI |
/* Analog mux is disabled */
IOPCTL_PIO_ANAMUX_DI |
/* Pseudo Output Drain is disabled */
IOPCTL_PIO_PSEDRAIN_DI |
/* Input function is not inverted */
IOPCTL_PIO_INV_DI);


Best regards

ラベル(1)
0 件の賞賛
返信
6 返答(返信)

727件の閲覧回数
adc_6_6
Contributor III

Hi @Gavin_Jia 

Thank you for your response.

In our setup, the CPU outputs MCLK to the CODEC, and receives BCLK and LRCK (WS) from the CODEC.
Injecting noise into the MCLK or LRCK (WS) signals does not cause any issues, but when noise is introduced into the BCLK signal, the problem occurs.
Once the left and right channels are swapped, they do not revert on their own, so it seems that restarting the I2S interface is the only solution.

Best regards

0 件の賞賛
返信

1,159件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @adc_6_6 ,

Thanks for your interest in NXP MIMXRT series!

Static induced channel identification failures may be best approached from an ESD perspective by adding TVS diodes or specialized ESD protection devices for the WS, BCLK, and data lines in close proximity to the I2S interface connectors. Also, consider routing the PCB with I2S and Codec away from sources of noise interference.

If SLVFRMERR is still detected in the software, you can only try to clear the FIFO and reset the I2S.

 

Best regards,
Gavin

 

0 件の賞賛
返信

1,147件の閲覧回数
adc_6_6
Contributor III

Hi Gavin_Jia

Thank you for your response.
I understand the suggested countermeasure.

However, I would like to understand the underlying mechanism of why this phenomenon occurs.
The settings are as follows:

Classic I2S mode

MODE = 0

POSITION = 0

SCK_POL = 0

WS_POL = 0

I suspect that the system may not determine the left channel based on the falling edge of the WS (Word Select) signal, but rather by using a counter or similar mechanism.
I imagine that a counter is initialized when I2S starts, and thereafter, the channel is determined by checking the counter on each edge.
Therefore, if a falling edge is incorrectly detected (e.g., due to noise or ESD), it might cause a misalignment.

I would just like to clarify the reason behind this behavior, so if you have any information, please let me know.

Best regards

タグ(1)
0 件の賞賛
返信

993件の閲覧回数
adc_6_6
Contributor III

Hi Gavin_Jia

I would like a clear reason for this issue.

Do you have any information?

 

Best regards

タグ(1)
0 件の賞賛
返信

961件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

Hi @adc_6_6 ,

Thank you for your question.

It still takes me a little while to confirm with the internal team at this time, thank you in advance for your understanding!

Best regards,
Gavin

868件の閲覧回数
Gavin_Jia
NXP TechSupport
NXP TechSupport

The response from the experts was:

According to the information we have,I2S does use WS instead of the so-called counter to determine the left and right channels.

Thanks & Regards,
Gavin

0 件の賞賛
返信