Re: trouble with alsa, wolfson, and TI OMAP35xx McBSP

Juha Kuikka
2009-04-23T18:16:14Z

On Thu, Apr 23, 2009 at 2:20 AM, Peter Ujfalusi <peter.ujfalusi@nokia.com>wrote:

> On Wednesday 22 April 2009 20:58:01 ext twebb wrote:
> > Problem 2:
> > Test tone is being presented by the user application, providing a 1Khz
> > tone sampled at 44.1Khz. The data are S16_LE, right channel only. Left
> > channel is quiet. The data seems to slip back and forth from left to
> > right channel. This is reproducable and verified with a scope trace.
> >
> > Anybody have any ideas what might be going wrong here? Traces for
> > codec reg dump and mcbsp are attached.
>
> As Jarkko already asked: are you seeing the channel switch while running or
> is
> it happens on playback start?
>
> AFAIK this phenomena can be also seen on Beagle board.
>
> I have done some investigation regarding to these, but so far I can not say
> that I know what causes it.
>
> BTW: these are separate issues (startup switch and runtime switch).
>

I have seen the startup switch happening and I investigated it a bit.
The XDISABLE bit solution discussed on the list earlier did not solve the
problem fully, additionally I needed to add check for the FIFO state before
clearing XDISABLE.

Simplified:

1. Set XDISABLE bit
2. Start DMA
3. Start serial port.
4. Wait for the DMA to put data into McBSP FIFO (there is status you can
poll for this)
5. Clear XDISABLE bit.

I found that without step #4 the FIFO would sometimes be empty on step #5
and switching happened because first word sent was bogus and second was the
first audio word.

This was on OMAP2430.

- Juha

--
Madness takes it's toll. Please have exact change.