]> git.alsa-project.org Git - alsa-lib.git/commit
pcm: plugin - fix avail_min calculation on rate plugin
authorAndreas Pape <apape@de.adit-jv.com>
Tue, 22 Mar 2022 11:45:37 +0000 (12:45 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 20 May 2022 08:35:45 +0000 (10:35 +0200)
commitd21e0e01c66c627c38496027ba6757ea13e65999
tree90977a5e4dc41d009f4a9e7cc9aaabe921d0a8ea
parentea15c8352518cdfb53d56932218f0d31b7980b87
pcm: plugin - fix avail_min calculation on rate plugin

commit 88e4ae27ff1f669d introduced a dynamic recalculation of the slave's
avail_min value.
The calculated avail_min setting did not take into account, that the avail_min value
depends on the used sampling rate and must be adapted accordingly
if the slave is using a different sampling rate.
That leads to too large/too small calculated avail_min settings and inaccurate
period wake-up events if a rate converter plugin is used.

This patch is adapting the avail_min calculation to consider a different
sampling rate between actual pcm and it's slave.

Fixes: https://github.com/alsa-project/alsa-lib/pull/218
Signed-off-by: Andreas Pape <apape@de.adit-jv.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/pcm/pcm_local.h
src/pcm/pcm_plugin.c
src/pcm/pcm_rate.c