[alsa-devel] [RFC 3/4] OMAP3: McBSP: Add interface for transmit FIFO state query

Peter Ujfalusi peter.ujfalusi at nokia.com
Tue Mar 2 15:02:47 CET 2010


On Tuesday 02 March 2010 15:52:00 Nurkkala Eero.An (EXT-Offcode/Oulu) wrote:
> On Tue, 2010-03-02 at 14:39 +0100, Ujfalusi Peter (Nokia-D/Tampere)
> 
> wrote:
> > New function for reading the XBUFFSTAT register, which holds
> > the fill state of the transmit buffer on McBSP.
> > 
> > Signed-off-by: Peter Ujfalusi <peter.ujfalusi at nokia.com>
> > ---
> 
> Reading the XBUFFSTAT register is by no means accurate.
> IIRC, it reports the buffer status incorrectly about 1/50 times
> on average (@ 48000khz); with simple math, it may be read during the DMA
> burst. Or is it guaranteed not being read during DMA transfer / have
> you otherwise verified the behavior?

That is one side, the other is that since the interface is running on the L4 
domain, the actual buffer fill level might be different inside...
But it is not guarantied that the DMA is not running.
The pointer callback is usually called after the driver calls the elapsed, which 
in our case is when the DMA finished it's burst.
So, yes it is not going to be precise, but it is still going to be better than 
it is now.
I did run some tests, and the delay numbers reported looked reasonable.
In element mode on McBSP2 the delay was 640 samples in some cases dropped to 
639.
In threshold mode, hmm I lost the log. But it was fluctuating, but that is 
expected. I'll do some tests on this.


> 
> - Eero
> 

-- 
Péter


More information about the Alsa-devel mailing list