Re: [PATCH 2/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL

From: Takashi Iwai

Date: Wed May 27 2026 - 01:37:58 EST


On Tue, 26 May 2026 19:49:24 +0200,
Rong Zhang wrote:
>
> Since commit 86aa1ea1f15c ("ALSA: usb-audio: Do not expose sticky
> mixers"), the UAC mixer core utilizes volume SET_CUR and GET_CUR to
> identify devices with sticky mixers. Unfortunately, even though most
> devices with sticky GET_CUR also have corresponding sticky SET_CUR,
> which I actually met more since the commit had been merged, there is
> also a rare case that some devices may have volume mixers that responds
> to SET_CUR properly but with its GET_CUR stubbed. This cause the sticky
> check to consider the mixer to be sticky and unnecessarily disable it.
>
> Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL to prevent sending GET_CUR to
> mixers by returning -ENXIO early. The error effectively skips the sticky
> check as it's only meaningful when the mixer has some sort of self-
> awareness. Similar to QUIRK_FLAG_GET_SAMPLE_RATE, this should also help
> if some unmet devices can't tolerate volume GET_CUR in other ways.
>
> Signed-off-by: Rong Zhang <i@xxxxxxxx>
> ---
> Documentation/sound/alsa-configuration.rst | 4 ++++
> sound/usb/mixer.c | 5 +++++
> sound/usb/quirks.c | 1 +
> sound/usb/usbaudio.h | 6 ++++++
> 4 files changed, 16 insertions(+)
>
> diff --git a/Documentation/sound/alsa-configuration.rst b/Documentation/sound/alsa-configuration.rst
> index 4b30cd63c5a5..bc3bc65c379a 100644
> --- a/Documentation/sound/alsa-configuration.rst
> +++ b/Documentation/sound/alsa-configuration.rst
> @@ -2389,6 +2389,10 @@ quirk_flags
> from snd_usb_handle_sync_urb. Instead fall through and enqueue a
> packet_info containing only size-0 packets, so the OUT ring keeps
> moving (emits silence). Needed by Behringer Flow 8 (1397:050c).
> + * bit 30: ``mixer_skip_get_cur_vol``
> + Skip reading current volume for mixers, as some devices return
> + constant values or errors but otherwise works fine, i.e., setting
> + volume takes desired effect.
>
> This module supports multiple devices, autoprobe and hotplugging.
>
> diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
> index d61bde654219..3b745aebb181 100644
> --- a/sound/usb/mixer.c
> +++ b/sound/usb/mixer.c
> @@ -420,6 +420,11 @@ static int get_cur_ctl_value(struct usb_mixer_elem_info *cval,
> static inline int get_cur_mix_raw(struct usb_mixer_elem_info *cval,
> int channel, int *value)
> {
> + struct snd_usb_audio *chip = cval->head.mixer->chip;
> +
> + if (chip->quirk_flags & QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL)
> + return -ENXIO;

So this workaround is applied to all mixer controls?

We can put it as a common quirk as you've done, but the question is
how many devices need this, too...


thanks,

Takashi