From: Takashi Iwai Date: Tue, 20 Nov 2007 14:29:10 +0000 (+0100) Subject: pcm - Limit the avail_min minimum size X-Git-Tag: v1.0.16rc1~47 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=b0b7d0280f977dee1bbff0a1b4cd0c50068d2371;p=alsa-lib.git pcm - Limit the avail_min minimum size Fix avail_min if it's less than period_size. The too small avail_min is simply useless and the cause of CPU hog with rate plugin. --- diff --git a/src/pcm/pcm.c b/src/pcm/pcm.c index 9ac132b6..142b4c62 100644 --- a/src/pcm/pcm.c +++ b/src/pcm/pcm.c @@ -5577,6 +5577,12 @@ int snd_pcm_sw_params_set_avail_min(snd_pcm_t *pcm, snd_pcm_sw_params_t *params, #endif { assert(pcm && params); + /* Fix avail_min if it's below period size. The period_size + * defines the minimal wake-up timing accuracy, so it doesn't + * make sense to set below that. + */ + if (val < pcm->period_size) + val = pcm->period_size; params->avail_min = val; return 0; }