Audio Capturing on BeagleBone (McASP) - Channels are wapping randomly


I’m capturing an 8-channel TDM stream (32 bit slots) on the BeagleBone running Ubuntu. My problem is, that when CPU is under heavy load, channels are swapping like crazy (ie. signal from channel one is suddenly on channel 8, then on 5, …).
Analyzing the recorded stream I found that the reason for this is that sometimes one time-slot within a frame is missing (is skipped). Since this behaviour correlates with the CPU load, I’m pretty sure that it’s not the codec that messes up the TDM stream. Rather I suspect the problem to be on the McASP or EDMA side of the ALSA driver.
Unfortunately I really have no idea how to track down this problem further - I only know that somewhere along the way from the McASP input pins to the ALSA API some timeslots (1 slot is 4 Byte long) get lost.

Has anyone ever experienced similar behaviour or can anyone suggest a way to debug this problem (I can’t seem to get any hints from kernel messages on this)?

Btw: It seems to me, that currently ping/pong buffering is not being used as davinci_pcm_enqueue_dma (sound/soc/davinci/davinci-pcm.c) is called on every DMA interrupt. Is that something to look into?

Any suggestion are very much appreciated!


Hi, I do wanna make a similar experiment like you, with 4 audio codecs. Are you able to provide some your wiring diagram, so I can create the same hardware to test for you too?

The wiring is pretty simple in my case: the codec is bitclock and frameclock master and is connected to the respective bitclock, frameclock and data input pins of McASP0 (serializer 0). I’m daisy-chaining two 4-channel ADCs (AD1974) such that the 8-channel TDM stream is output by the second ADC and fed to a single serializer on the BeagleBone. If you want to use four ADCs in parallel you’ll need 4 McASP serializers.

What kernel are you using?



Hi Tom,

I’m using Robert Nelsons kernel but with a modified version of davinci-mcasp.c - and that’s exactly where the problem was (yes, I think I have found it): when the capture stream is startet the WFIFO register was flushed instead of RFIFO (typo). I’m not entirely sure why not flushing the RFIFO register only produces strange behaviour when CPU load is high, but now it seems to work properly.


Hi, could you share the code of your project? I’m trying to connect only one ADC to the beaglebone (pcm1803) and i cant get it registered by alsa. I wrote a custom codec driver, and modified davinci.evm.c.
Any help would be appreciated.

Hey, did you manage to get your pcm1803 working? Can you give me some advice to get mine working? Thanks Fritz