]> git.alsa-project.org Git - alsa-plugins.git/commitdiff
jack: implement pcm operation sw_params
authorAndreas Pape <apape@de.adit-jv.com>
Wed, 2 Feb 2022 13:35:15 +0000 (14:35 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 17 Jun 2022 08:19:57 +0000 (10:19 +0200)
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 <apape@de.adit-jv.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
jack/pcm_jack.c

index 436aefe255dc51c94843a512bd74aef79c00874f..9aa051ac419bedda93f318ef31dcd8d837687cfa 100644 (file)
@@ -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]))