stereo I2S and DMA issue

Discussion created by lpcware Employee on Jun 15, 2016
Latest reply on Jun 15, 2016 by lpcware
Content originally posted in LPCWare by ameares on Mon May 05 15:38:31 MST 2014
I am having a problem with transferring stereo audio data from the I2S peripheral to memory on my LPC1766FDB100 chip.  I have a seen a few posts regarding I2S and DMA, so maybe someone out there will have some experience that can help me out or maybe we can replicate the problem.

I have a program that is transferring 32-bit stereo data from the I2S peripheral to memory.  I use the TC interrupt to set up the DMA transfers.  Sometimes my program has to pause the DMA transfers for a few milliseconds to perform an unrelated bit of code.  I just want to throw away the I2S data for a little while and when I am ready, start transferring data again.  So, every once in a while when I restart the DMA, it doesn't start on the left channel.  I would guess this is 1 in 100 or 1 in 1000 times that the transfer is restarted after missing a few 10s of milliseconds of samples.  I have tried stopping and resetting the I2S periphal using its I2SDAI bits.  Still it seems that almost randomly the left and right channels get confused.  I would guess that there is a small possibility that if I powered on my project 1000 times, it would get the left and right channels mixed up at least once.  This is turning into a bit of a problem.

I realize this is difficult to explain.

Is there a specific procedure for stopping peripheral to memory DMA and the I2S receiver for some time and then restarting it?

Is there any possibility that the left and right channels on 32-bit DMA transfers could get misaligned for any reason?

Andrew, MidNite Solar