iMX6QP ESAI is not stable in slave mode (channel swap)

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

iMX6QP ESAI is not stable in slave mode (channel swap)

427 Views
camilio69
Contributor II

On a custom board with iMX6QP, we use a codec to generate the audio clocks (bit and frame), which are connected to ESAI.

After some time (from 10 minutes to few hours), we see a glitch or a channel swap on the ESAI TX line going to the codec. This happens randomly.

We investigate to determinate if it was related to ERR008000, but it is not : we checked and the FIFO level in ESAI never goes below 64 words, and the TUE bit is never set, the interrupt never reached, nothing can reset the TUE bit. So there is no under run in the FIFO.

We use software loop back with a sine wave on the left input only, so we can trigger on channel swap.

Using a scope, we see the following pattern happened (1 is FS, 2 is TX0):

ESAI Error.PNG

On the first one, we see that the TX0 line is undriven for 1 slot (resulting in channel swap).

ESAI Error 2 zoom.PNG

In the second one that the data is repeated in 2 successive slots (resulting in channel swap also).

The only solution we found is to modify the hardware, and put the ESAI as master of bit and frame clocks. With exactly all the same frequencies, we did not have a single error on the TX output.

This eliminates the possibility that the problem comes from the OS or the SDMA, leaving only the ESAI output as responsible for this problem.

Details on clocks : we send 48kHz audio in I2S mode, so 3.072MHz bit clock, 48kHz FS. The esai_ipg clock is at 132MHz. We are based on a vanilla Linux 5.10.90 with rt60.

Labels (2)
0 Kudos
1 Reply

383 Views
jimmychan
NXP TechSupport
NXP TechSupport

Hello,

 

Do you try this on our released BSP?

Here is the BSP release

https://www.nxp.com/design/software/embedded-software/i-mx-software/embedded-linux-for-i-mx-applicat...

 

 

0 Kudos