Hi All,
We have a custom board with a DM365 and a TLV320AIC3254 codec, the codec is connected to the DM365 using the McBSP port.
We are running a custom root filesystem using the 2.6.32 kernel from the PSP 03.01.01.39 with a patch to implement the Ping-Pong SRAM buffer technique.
There are two issues we face, the first being Overrun's while recording, debugging suggests that overloaded IO is the cause of this issue with our user space application failing to service the kernel space buffer enough.
While we can live with the occasional Overrun, it does cause our second issue which is channel swapping. Currently we use ALSA with an asynchronous callback and when it is determined that we have Overrun, we use the recover -> open to kick off the audio transfer again, we are finding that more often than not the channels are then been switched. I have printed out the first few frames that are captured after an Overrun, and found that more often than not the first channel sample is 0. I am assuming that this is caused due to the double buffering, and the fact that the peripheral was reset and it's assuming that the RBR has valid data???
Interestingly enough we do not see this when the peripheral is first started, the only difference being that potentially not as much DMA activity is occurring at the start of the recorder application.
As indicated in this (http://processors.wiki.ti.com/index.php/McBSP_Channel_Swapping) document, I have ensured that the master EDMA channel is the highest priority, and that the McBSP is the only peripheral utilising this queue.
I am wondering if anyone could offer some suggestions as to how to ensure that each time the peripheral is started that it aligns with the correct channel??
Should we be modifying the davinci-i2s.c file to suit our codec, or should it work fine with the TLV320AIC3254??
While we see most of our problems at our highest profile we wish to record at ( 48 kHz, 24 bit, Stereo ) we have noticed that starting/stopping can cause the channels to switch also from startup.
I have included our codec files, glue driver (davinci-board.c, our equivilent to davinci-evm.c) and a print out of the codec's registers at the prepare stage (after hw params etc.) in a zip file. I also included the davinci-i2s.c and davinci-pcm.c from our kernel.
Thanks!
Geoff