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.
#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;
}