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):
On the first one, we see that the TX0 line is undriven for 1 slot (resulting in channel swap).
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.
Hello,
Do you try this on our released BSP?
Here is the BSP release