Linux Documentation
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Rong Zhang <i@rong.moe>
Cc: Jaroslav Kysela <perex@perex.cz>, Takashi Iwai <tiwai@suse.com>,
	Jonathan Corbet <corbet@lwn.net>,
	Shuah Khan <skhan@linuxfoundation.org>,
	Gordon Chen <chengordon326@gmail.com>,
	linux-sound@vger.kernel.org, linux-doc@vger.kernel.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL
Date: Wed, 27 May 2026 07:37:47 +0200	[thread overview]
Message-ID: <87tsrtwgyc.wl-tiwai@suse.de> (raw)
In-Reply-To: <20260527-uac-quirk-get-cur-vol-v1-2-e9362b712e5e@rong.moe>

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@rong.moe>
> ---
>  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

  reply	other threads:[~2026-05-27  5:37 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-26 17:49 [PATCH 0/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL for Sennheiser MOMENTUM 3 Rong Zhang
2026-05-26 17:49 ` [PATCH 1/3] ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_IFB_SILENCE_ON_EMPTY Rong Zhang
2026-05-27  5:38   ` Takashi Iwai
2026-05-26 17:49 ` [PATCH 2/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL Rong Zhang
2026-05-27  5:37   ` Takashi Iwai [this message]
2026-05-27 17:58     ` Rong Zhang
2026-05-26 17:49 ` [PATCH 3/3] ALSA: usb-audio: Add quirk flag for Sennheiser MOMENTUM 3 Rong Zhang

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=87tsrtwgyc.wl-tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=chengordon326@gmail.com \
    --cc=corbet@lwn.net \
    --cc=i@rong.moe \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-sound@vger.kernel.org \
    --cc=perex@perex.cz \
    --cc=skhan@linuxfoundation.org \
    --cc=tiwai@suse.com \
    /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