Problem with audio streaming to external Codec with Beagleboard‏

I am a newbie to ALSA driver. I am trying to playback and capture
audio stream to and from an external Audio CODEC instead of using the
twl4030 codec came with the Beagleboard. I have successfully created
sub device and added into the existing sound device and configured the
external codec to be master. I am able to hear only one channel audio
output from external codec board when playing with aplay -D hw:1,1
my_sine.wav file.
The Master clock of the external codec is running at 12.288MHz and it
internally generates BCLK and FS providing to CLKR and FSR for mcbsp1
port. The FS clock is 48KHz and BCLK is 64 x fs = 3.072Mhz. Which
means there is going to be 64 BCLKs per frame.
The external codec connects to the MCBSP1 port of beagleboad via
expansion header. The mcbsp driver is used as is. I have used the
following format to configure the mcbsp port :


Therefore, the mcbsp port is configured as:
- dual-phase frame
- word length is 16-bit (PCM format is 16 bit
- Frame size: 2 (channel) * 16 (word length) = 32
- FPER = frame size - 1 = 31
- FWID - frame size >> 1 - 1 = 16

The following is the mcbsp port dump after calling the
omap-mcbsp omap-mcbsp.1: **** McBSP1 regs ****
omap-mcbsp omap-mcbsp.1: DRR2: 0x9dffca01
omap-mcbsp omap-mcbsp.1: DRR1: 0x0000
omap-mcbsp omap-mcbsp.1: DXR2: 0x0000
omap-mcbsp omap-mcbsp.1: DXR1: 0x0000
omap-mcbsp omap-mcbsp.1: SPCR2: 0x0235
omap-mcbsp omap-mcbsp.1: SPCR1: 0x0030
omap-mcbsp omap-mcbsp.1: RCR2: 0x8041
omap-mcbsp omap-mcbsp.1: RCR1: 0x0040
omap-mcbsp omap-mcbsp.1: XCR2: 0x8041
omap-mcbsp omap-mcbsp.1: XCR1: 0x0040
omap-mcbsp omap-mcbsp.1: SRGR2: 0x001f
omap-mcbsp omap-mcbsp.1: SRGR1: 0x0f00
omap-mcbsp omap-mcbsp.1: PCR0: 0x000f
omap-mcbsp omap-mcbsp.1: ***********************

Could any expert in this forum give me any hint on why I am only
getting one channel output? Could that be the mismatch of the frame
size between mcbsp port (16 * 2 = 32 bit) and codec (64 bits) ? The
minimum frame size of the external codec is 64 (2 channel x 32 bit).
Isn't the mcbsp sending the first 16 (left channel) and then padding
zeros for the rest of 16 bits for one phase and sends the right
channel 16 bit in the other phase of the frame and pads with the

Any comment?


I've been trying to do just this and haven't even gotten as far as you
have. Any chance I could get a look at your source? I'd love to help
debug this and get it going.

Eric Brombaugh