alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* xrun on sdp340 with small buffers
@ 2009-03-27  4:02 Lopez Cruz, Misael
  2009-03-27  6:56 ` Jarkko Nikula
  0 siblings, 1 reply; 5+ messages in thread
From: Lopez Cruz, Misael @ 2009-03-27  4:02 UTC (permalink / raw)
  To: alsa-devel@alsa-project.org; +Cc: Jarkko Nikula

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   

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-03-27 16:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-27  4:02 xrun on sdp340 with small buffers Lopez Cruz, Misael
2009-03-27  6:56 ` Jarkko Nikula
2009-03-27 13:32   ` (no subject) Jarkko Nikula
2009-03-27 13:32     ` [PATCH] ASoC: OMAP: Set minimum buffer size constraint for McBSP2 in OMAP3 Jarkko Nikula
2009-03-27 16:31     ` (no subject) Mark Brown

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).