From: Takashi Iwai <tiwai@suse.de>
To: linux-sound@vger.kernel.org
Cc: Paul Menzel <pmenzel@molgen.mpg.de>,
Mark Brown <broonie@kernel.org>, Jaroslav Kysela <perex@perex.cz>,
linux-kselftest@vger.kernel.org
Subject: [PATCH 5/5] ALSA: chmap: Mark Channel Map controls as volatile
Date: Fri, 14 Jun 2024 14:47:27 +0200 [thread overview]
Message-ID: <20240614124728.27901-6-tiwai@suse.de> (raw)
In-Reply-To: <20240614124728.27901-1-tiwai@suse.de>
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
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
sound/core/pcm_lib.c | 1 +
1 file changed, 1 insertion(+)
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,
--
2.43.0
next prev parent reply other threads:[~2024-06-14 12:47 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-14 12:47 [PATCH 0/5] ALSA: some driver fixes for control input validations Takashi Iwai
2024-06-14 12:47 ` [PATCH 1/5] ALSA: vmaster: Return error for invalid input values Takashi Iwai
2024-06-14 12:47 ` [PATCH 2/5] ALSA: hda: Return -EINVAL for invalid volume/switch inputs Takashi Iwai
2024-06-14 12:47 ` [PATCH 3/5] ALSA: control: Apply sanity check of input values for user elements Takashi Iwai
2024-06-14 13:06 ` Jaroslav Kysela
2024-06-14 14:25 ` Mark Brown
2024-06-14 12:47 ` [PATCH 4/5] kselftest/alsa: mixer-test: Skip write tests for volatile controls Takashi Iwai
2024-06-14 14:29 ` Mark Brown
2024-06-14 14:40 ` Takashi Iwai
2024-06-14 12:47 ` Takashi Iwai [this message]
2024-06-14 13:06 ` [PATCH 0/5] ALSA: some driver fixes for control input validations Jaroslav Kysela
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240614124728.27901-6-tiwai@suse.de \
--to=tiwai@suse.de \
--cc=broonie@kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-sound@vger.kernel.org \
--cc=perex@perex.cz \
--cc=pmenzel@molgen.mpg.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox