alsa-lib/src
Takashi Iwai 3fd4ab9be0 PCM: Avoid busy loop in snd_pcm_write_areas() with rate plugin
snd_pcm_write_areas() tries to wait until avail >= avail_min condition
is satisfied.  This doesn't work always well when a rate plugin is in
the play.

When a partial data with a smaller size than a period is written, the
rate plugin doesn't transfer the data immediately to the slave PCM,
but kept in an internal buffer and it changes only the hwptr of the
plugin.  Thus, the condition "avail < avail_min" is triggered for a
wait check although the underlying slave PCM has enough room.  This
results in a call of snd_pcm_wait() which returns immediately after
poll() call, and the snd_pcm_write_areas() loop continues.  As a
consequence, it falls into a CPU hog.

This patch fixes that busy loop by introducing a new fast_ops to check
the availability for wait of avail_min.  Then a plugin can ask the
slave PCM whether the wait is required (or possible).

A few plugins like multi plugin need a special handling.  Otherwise a
generic plugin function can be used.

Reported-by: Trent Piepho <tpiepho@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-11-13 16:16:26 +01:00
..
alisp Reduce compilation warnings 2012-10-30 13:09:10 +01:00
compat Corrections by Kevin Conder <kconder@interaccess.com> 2002-03-12 20:14:33 +00:00
conf conf: Add chmap definitions to TRIDENT and SI7018 configurations 2012-09-13 08:24:59 +02:00
control ucm: Improve cset command parsing 2012-08-10 14:14:28 +02:00
hwdep alsa-lib: fixed coverity reported issues under "FORWARD_NULL" checker. 2011-05-04 09:11:46 +02:00
mixer Reduce compilation warnings 2012-10-30 13:09:10 +01:00
pcm PCM: Avoid busy loop in snd_pcm_write_areas() with rate plugin 2012-11-13 16:16:26 +01:00
rawmidi alsa-lib: fixed coverity reported issues under "FORWARD_NULL" checker. 2011-05-04 09:11:46 +02:00
seq Reduce compilation warnings 2012-10-30 13:09:10 +01:00
timer Remove redefinition of _GNU_SOURCE and __USE_GNU 2009-11-08 09:28:07 +01:00
ucm ucm: Add const to execute_cset() argument 2012-08-10 14:19:17 +02:00
async.c Make some static tables and strings constants. 2008-11-21 13:04:41 +01:00
conf.c build: Fallback to alphasort() if versionsort() isn't available 2012-07-17 14:56:14 +02:00
confmisc.c Mark static tables as constant when possible. 2008-11-21 22:39:38 +01:00
dlmisc.c general: recoded snd_dlobj_ functions 2010-08-23 17:10:16 +02:00
error.c Change assert condition in error message handler 2007-10-24 12:53:08 +02:00
input.c Make all the remaining ops structure constants. 2008-11-21 20:48:33 +01:00
Makefile.am real fix for the UCM code compilation issue 2011-01-27 14:56:53 +01:00
names.c Remove docs for snd_names_list and snd_names_list_free 2012-01-19 12:35:20 +01:00
output.c fix doc errors 2009-08-04 09:17:20 +02:00
shmarea.c Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
socket.c Move snd_is_local() to socket.c 2005-11-30 11:31:18 +00:00
userfile.c Changed Jaroslav Kysela's e-mail from perex@suse.cz to perex@perex.cz 2007-10-15 10:24:55 +02:00
Versions.in Fix wrong exported functions 2008-02-04 14:15:44 +01:00