21261 sometimes swaps left and right I2S data?

I have a 21261 project that uses SPORT1 to read the I2S data from a stereo codec and SPORT3 to write the I2S data to the codec.

The SPORT DMAs are in use. An ISR is used to process the I2S data on a sample by sample basis.

Normally, everything works fine. The data is read in, processed, and sent out correctly. However, occasionally the left and right I2S data gets swapped. IE the data coming in on the left channel gets written out on the right channel. It can sit and run for several hours with no problem, and then all of a sudden, the data is swapped. It will stay this way for hours and might switch back eventually, or might not. It does not always happen, in fact it usually doesnt, but it does sometimes.

I verified that the data from the codec is never swapped, so it is happening in the DSP.

Any ideas?


  • 0
    •  Analog Employees 
    on Feb 11, 2014 8:49 AM


    Can you provide more details regarding your application code.

    Are you using external clock and frame sync for the SPORT operation in I2S mode? Kindly explain how are you initializing SPORT in your code.

    Also you can refer to the talkthrough code which runs on ADSP-21262 EZ-Kit lite in the following directory:

    …\Program Files (x86)\Analog Devices\VisualDSP 5.1\212xx\examples\ADSP-21262 EZ-KIT Lite\Talkthru Analog In-Out (ASM)

    Here the SPORT is configured in I2S mode. You can use this as reference and check the initialization of SPORT with your code.

    Please let us know in case above code does not help you out with the issue.



  • 0
    •  Analog Employees 
    on Aug 2, 2018 2:34 PM
    This question has been assumed as answered either offline via email or with a multi-part answer. This question has now been closed out. If you have an inquiry related to this topic please post a new question in the applicable product forum.

    Thank you,
    EZ Admin