From: Andreas Pape Date: Wed, 2 Feb 2022 13:35:15 +0000 (+0100) Subject: jack: implement pcm operation sw_params X-Git-Tag: v1.2.7.1~2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=66d6bc75f16d08b8e4909cf7015376f80ec31f97;p=alsa-plugins.git jack: implement pcm operation sw_params Alsa-lib commit 88e4ae27 introduced a dynamic recalculation of the avail_min value on the underlaying slave devices. This updated avail_min value is not reaching the alsa-jack plugin due to lack of the sw_params operation. This patch adds this missing operation to correctly apply an updated avail_min setting during runtime. Fixes: https://github.com/alsa-project/alsa-plugins/pull/43 Signed-off-by: Andreas Pape Signed-off-by: Jaroslav Kysela --- diff --git a/jack/pcm_jack.c b/jack/pcm_jack.c index 436aefe..9aa051a 100644 --- a/jack/pcm_jack.c +++ b/jack/pcm_jack.c @@ -430,6 +430,13 @@ static int snd_pcm_jack_hw_free(snd_pcm_ioplug_t *io) return 0; } +static int snd_pcm_jack_sw_params(snd_pcm_ioplug_t *io, snd_pcm_sw_params_t *params) +{ + snd_pcm_jack_t *jack = io->private_data; + snd_pcm_sw_params_get_avail_min(params, &jack->min_avail); + return 0; +} + static snd_pcm_ioplug_callback_t jack_pcm_callback = { .close = snd_pcm_jack_close, .start = snd_pcm_jack_start, @@ -438,6 +445,7 @@ static snd_pcm_ioplug_callback_t jack_pcm_callback = { .hw_free = snd_pcm_jack_hw_free, .prepare = snd_pcm_jack_prepare, .poll_revents = snd_pcm_jack_poll_revents, + .sw_params = snd_pcm_jack_sw_params, }; #define ARRAY_SIZE(ary) (sizeof(ary)/sizeof(ary[0]))