]> www.infradead.org Git - linux.git/commitdiff
ALSA: chmap: Mark Channel Map controls as volatile
authorTakashi Iwai <tiwai@suse.de>
Sun, 16 Jun 2024 07:34:46 +0000 (09:34 +0200)
committerTakashi Iwai <tiwai@suse.de>
Tue, 18 Jun 2024 10:00:19 +0000 (12:00 +0200)
The values returned from Playback Channel Map and Capture Channel Map
controls may vary dynamically depending on the corresponding PCM
stream.  Mark those as volatile to indicate the values are unstable
and not suitable for testing.

Note that we may change the driver to return -EINVAL, but this would
bring other side effects, such as "alsactl restore" would start
receiving unexpected errors.  So we still keep returning 0 for those
invalid inputs.

Reported-by: Paul Menzel <pmenzel@molgen.mpg.de>
Closes: https://lore.kernel.org/r/1d44be36-9bb9-4d82-8953-5ae2a4f09405@molgen.mpg.de
Reviewed-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Link: https://lore.kernel.org/20240616073454.16512-6-tiwai@suse.de
sound/core/pcm_lib.c

index 6f73b3c2c205ee201552fb4fb1b2efbc6a63b1d0..071c67cbc479051eca440d66bb919c75e564c79b 100644 (file)
@@ -2556,6 +2556,7 @@ int snd_pcm_add_chmap_ctls(struct snd_pcm *pcm, int stream,
        struct snd_kcontrol_new knew = {
                .iface = SNDRV_CTL_ELEM_IFACE_PCM,
                .access = SNDRV_CTL_ELEM_ACCESS_READ |
+                       SNDRV_CTL_ELEM_ACCESS_VOLATILE |
                        SNDRV_CTL_ELEM_ACCESS_TLV_READ |
                        SNDRV_CTL_ELEM_ACCESS_TLV_CALLBACK,
                .info = pcm_chmap_ctl_info,