aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <[email protected]>2024-06-16 09:34:46 +0200
committerTakashi Iwai <[email protected]>2024-06-18 12:00:19 +0200
commit210e6a844112bd7e28a04faedac677918e1f3040 (patch)
tree6994f70e4cd971da5663a8cbbc22a393b8349f44
parent1b1285e4759e4d9df4f8e46d92802ff87ce8709b (diff)
ALSA: chmap: Mark Channel Map controls as volatile
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 <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Reviewed-by: Jaroslav Kysela <[email protected]> Signed-off-by: Takashi Iwai <[email protected]> Link: https://lore.kernel.org/[email protected]
-rw-r--r--sound/core/pcm_lib.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/sound/core/pcm_lib.c b/sound/core/pcm_lib.c
index 6f73b3c2c205..071c67cbc479 100644
--- a/sound/core/pcm_lib.c
+++ b/sound/core/pcm_lib.c
@@ -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,