[alsa-devel] xrun on sdp340 with small buffers

Lopez Cruz, Misael x0052729 at ti.com
Fri Mar 27 05:02:29 CET 2009


I use the sdp3430 machine driver for my board, which connects twl4030
codec and OMAP McBSP/DMA drivers. Everything works fine, I can play
audio files (using aplay).

However, I tried to force 'aplay' to use a different buffer size and
period count, and it misbehaves. My experiment was setting buffer time
to 10ms and periods to 4, and play a 8kHz sample file; this only
generates underrun messages. Under that configuration, for 8kHz, it
means a buffer size of 320B (16-bits, stereo) divided into 4 periods of
80B each. omap-pcm driver will report interrupts each 80B, as it uses a
single DMA transfer for the buffer and generates interrupts each frame.

I enabled the SND_PCM_XRUN_DEBUG option in the kernel and set
xrun_debug proc-entry to 1. And this is what I get:

# aplay audio_8000.wav --buffer-time=10000 --period-time=2500
Playing WAVE 'audio_8000.wav' : Signed 16 bit Little Endian, Rate 8000
Hz, Stereo
Unexpected hw_pointer value [1] (stream = 0, delta: -67, max jitter = 
80): wrong interrupt acknowledge?
Unexpected hw_pointer value [1] (stream = 0, delta: -6, max jitter = 
80): wrong interrupt acknowledge?

What I understand it reports is that when an interrupt happens, the
position of the transfer queried (using a dma get_pos) is lower than
the position it (at least) should be. Let's say if in the third period
(80B/period) of the buffer I should get at least a position greater
than 240, and the position returned by query is -67B behind. Is my
understanding correct? If so, does that mean the issue is with the DMA
mechanism?

Don't know if it's worth to say that adding the xrun_debung only prints
some debug messages and then playback works. But disabling the debug
shows only underrun messages.

-Misa   


More information about the Alsa-devel mailing list