[alsa-devel] Channel swapping problem on Atmel SSC audio

Ryan Mallon ryan at bluewatersys.com
Wed Nov 10 23:49:34 CET 2010

Hi all,

I'm working on a custom board using the AT91SAM9G45 processor and a
TLV320AIC26 SPI attached audio codec using I2S format audio. When doing
audio playback on the board the left and right channels are occasionally

I have verified this by generating a custom wav file which has constant
data on one channel and an incrementing counter on the other channel.
The digitial out from the CPU shows that no data is being lost, but
around 1/5 times the audio channels will be flipped. The problem appears
to be that the DMA is starting on the wrong edge of the LRCLK.

I have using both SND_SOC_DAIFMT_CBM_CFM (Codec provides clocks) and
SND_SOC_DAIFMT_CBS_CFS (CPU provides clocks) but the problem occurs in
both situations. I have also tried changing TCMR:CKO to SSC_CKO_TRANSFER
and TCMR:START to SSC_START_LOW_RF, but the problem still occurs. I have
looked through the PCM/SSC DMA code and cannot find any obvious bugs.

I have checked the errata for the At91SAM9G45 processor (our chip
marking is CU-1004-A), but can't find anything which relates directly to
the problem we are seeing.

Has anybody else had this problem, or does anybody have any AT91/Atmel
hardware that they could test to see if it occurs on other hardware also?


Bluewater Systems Ltd - ARM Technology Solution Centre

Ryan Mallon         		5 Amuri Park, 404 Barbadoes St
ryan at bluewatersys.com         	PO Box 13 889, Christchurch 8013
http://www.bluewatersys.com	New Zealand
Phone: +64 3 3779127		Freecall: Australia 1800 148 751 
Fax:   +64 3 3779135			  USA 1800 261 2934

More information about the Alsa-devel mailing list