Hello,
I'm capturing an 8-channel TDM stream on McASP0 (just record, no playback). My ALSA driver seem to work porperly when CPU load is low, however, I'm experiencing some very strange behaviour when CPU load (and/or SDcard access) increases: suddenly channels are swapping randomly (signal from channel 1 is now on channel 2 etc.).
The reason seems to be, that some time-slots (4 byte) get lost along the way such that the recorded signal looks like
FRAME1: ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch8
FRAME2: ch1 ch2 ch3 ch4 ch5 ch6 ch7 ch1 (<= ch8 slot missing!)
FRAME3: ch2 ch3 ch4 ch5 ch6 ch7 ch8 ch1
FRAME4: ch2 ch3 ch4 ch5 ch6 ch7 ch8 ch1
and so on...
Since this problem seems to correlate with cpu/disc usage, I'm pretty sure that the problem isn't in the codec but in the processor side (also due to the fact that there are no bit shifts - only entirely missing time-slots) . The problem is, that I have no clue how to debug this error - it just seems that somwhere on the way from McASP serializer0 via DMA buffer to the ALSA API those 4 Bytes are lost.
Can anyone suggest a way to debug this behaviour?
Also it seems that the McASP driver isn't using ping pong buffering since davinci_pcm_enqueue_dma (sound/soc/davinci/davinci-pcm.c) is called on every DMA interrupt. Should ping/pong buffering be used, and if so, how can I enable it?
best,
Chris