mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-31 22:25:35 -04:00
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> |
||
|---|---|---|
| .. | ||
| alisp | ||
| compat | ||
| conf | ||
| control | ||
| hwdep | ||
| mixer | ||
| pcm | ||
| rawmidi | ||
| seq | ||
| timer | ||
| ucm | ||
| async.c | ||
| conf.c | ||
| confmisc.c | ||
| dlmisc.c | ||
| error.c | ||
| input.c | ||
| Makefile.am | ||
| names.c | ||
| output.c | ||
| shmarea.c | ||
| socket.c | ||
| userfile.c | ||
| Versions.in | ||