]> git.karo-electronics.de Git - linux-beck.git/commit
ALSA: pcm: detect xruns in no-period-wakeup mode
authorClemens Ladisch <clemens@ladisch.de>
Thu, 18 Nov 2010 08:43:52 +0000 (09:43 +0100)
committerTakashi Iwai <tiwai@suse.de>
Mon, 22 Nov 2010 07:14:06 +0000 (08:14 +0100)
commit59ff878ffb26bc0be812ca8295799164f413ae88
treed3e8c044e3094fb95027fe669dc392dedb1d2d1c
parent075140ea8bf1405057c072a84ccf4e0d3f2c76f5
ALSA: pcm: detect xruns in no-period-wakeup mode

When period wakeups are disabled, successive calls to the pointer update
function do not have a maximum allowed distance, so xruns cannot be
detected with the pointer value only.

To detect xruns, compare the actually elapsed time with the time that
should have theoretically elapsed since the last update.  When the
hardware pointer has wrapped around due to an xrun, the actually elapsed
time will be too big by about hw_ptr_buffer_jiffies.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
sound/core/pcm_lib.c