Linux Documentation
 help / color / mirror / Atom feed
* [PATCH 0/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL for Sennheiser MOMENTUM 3
@ 2026-05-26 17:49 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
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Rong Zhang @ 2026-05-26 17:49 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, Shuah Khan
  Cc: Gordon Chen, linux-sound, linux-doc, linux-kernel, Rong Zhang

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.

The Sennheiser MOMENTUM 3 needs the quirk flag. Though its UAC mixer
works fine and precisely corresponds to the reported dB range, the
mixer's volume GET_CUR method is somehow stubbed and returns a constant
value (15dB), resulting in it being disabled by the sticky check.

Signed-off-by: Rong Zhang <i@rong.moe>
---
Rong Zhang (3):
      ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_IFB_SILENCE_ON_EMPTY
      ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL
      ALSA: usb-audio: Add quirk flag for Sennheiser MOMENTUM 3

 Documentation/sound/alsa-configuration.rst | 10 ++++++++++
 sound/usb/mixer.c                          |  5 +++++
 sound/usb/quirks.c                         |  3 +++
 sound/usb/usbaudio.h                       |  6 ++++++
 4 files changed, 24 insertions(+)
---
base-commit: a23812004228d4b041a858b927db787a7ff80f50
change-id: 20260527-uac-quirk-get-cur-vol-d0b292c3e796

Thanks,
Rong


^ permalink raw reply	[flat|nested] 7+ messages in thread

* [PATCH 1/3] ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_IFB_SILENCE_ON_EMPTY
  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 ` 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-26 17:49 ` [PATCH 3/3] ALSA: usb-audio: Add quirk flag for Sennheiser MOMENTUM 3 Rong Zhang
  2 siblings, 1 reply; 7+ messages in thread
From: Rong Zhang @ 2026-05-26 17:49 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, Shuah Khan
  Cc: Gordon Chen, linux-sound, linux-doc, linux-kernel, Rong Zhang

QUIRK_FLAG_IFB_SILENCE_ON_EMPTY was introduced into usb-audio before
without appropriate documentation, so add it.

Fixes: a23812004228 ("ALSA: usb-audio: add IFB_SILENCE_ON_EMPTY quirk for Behringer Flow 8")
Signed-off-by: Rong Zhang <i@rong.moe>
---
 Documentation/sound/alsa-configuration.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/sound/alsa-configuration.rst b/Documentation/sound/alsa-configuration.rst
index f75f08763941..4b30cd63c5a5 100644
--- a/Documentation/sound/alsa-configuration.rst
+++ b/Documentation/sound/alsa-configuration.rst
@@ -2383,6 +2383,12 @@ quirk_flags
           ``V(x) = k * x``; ``dB(x) = 20 * log10(x)``. Overrides bit 24
         * bit 28: ``mixer_capture_linear_vol``
           Similar to bit 27 but for capture streams. Overrides bit 25
+        * bit 29: ``ifb_silence_on_empty``
+          In implicit feedback mode, when an entire capture URB returns with
+          all iso_frame_desc[i].status != 0 (bytes==0), do not silently return
+          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).
 
 This module supports multiple devices, autoprobe and hotplugging.
 

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 2/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL
  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-26 17:49 ` Rong Zhang
  2026-05-27  5:37   ` Takashi Iwai
  2026-05-26 17:49 ` [PATCH 3/3] ALSA: usb-audio: Add quirk flag for Sennheiser MOMENTUM 3 Rong Zhang
  2 siblings, 1 reply; 7+ messages in thread
From: Rong Zhang @ 2026-05-26 17:49 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, Shuah Khan
  Cc: Gordon Chen, linux-sound, linux-doc, linux-kernel, Rong Zhang

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;
+
 	return get_ctl_value(cval, UAC_GET_CUR,
 			     (cval->control << 8) | channel,
 			     value);
diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index e2c95be38aca..fbd44baace68 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -2605,6 +2605,7 @@ static const char *const snd_usb_audio_quirk_flag_names[] = {
 	QUIRK_STRING_ENTRY(MIXER_PLAYBACK_LINEAR_VOL),
 	QUIRK_STRING_ENTRY(MIXER_CAPTURE_LINEAR_VOL),
 	QUIRK_STRING_ENTRY(IFB_SILENCE_ON_EMPTY),
+	QUIRK_STRING_ENTRY(MIXER_SKIP_GET_CUR_VOL),
 	NULL
 };
 
diff --git a/sound/usb/usbaudio.h b/sound/usb/usbaudio.h
index 9afcad8f143a..f4e048788f0b 100644
--- a/sound/usb/usbaudio.h
+++ b/sound/usb/usbaudio.h
@@ -242,6 +242,10 @@ extern bool snd_usb_skip_validation;
  *  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).
+ * QUIRK_FLAG_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.
  */
 
 enum {
@@ -275,6 +279,7 @@ enum {
 	QUIRK_TYPE_MIXER_PLAYBACK_LINEAR_VOL	= 27,
 	QUIRK_TYPE_MIXER_CAPTURE_LINEAR_VOL	= 28,
 	QUIRK_TYPE_IFB_SILENCE_ON_EMPTY		= 29,
+	QUIRK_TYPE_MIXER_SKIP_GET_CUR_VOL	= 30,
 /* Please also edit snd_usb_audio_quirk_flag_names */
 };
 
@@ -310,5 +315,6 @@ enum {
 #define QUIRK_FLAG_MIXER_PLAYBACK_LINEAR_VOL	QUIRK_FLAG(MIXER_PLAYBACK_LINEAR_VOL)
 #define QUIRK_FLAG_MIXER_CAPTURE_LINEAR_VOL	QUIRK_FLAG(MIXER_CAPTURE_LINEAR_VOL)
 #define QUIRK_FLAG_IFB_SILENCE_ON_EMPTY		QUIRK_FLAG(IFB_SILENCE_ON_EMPTY)
+#define QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL	QUIRK_FLAG(MIXER_SKIP_GET_CUR_VOL)
 
 #endif /* __USBAUDIO_H */

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* [PATCH 3/3] ALSA: usb-audio: Add quirk flag for Sennheiser MOMENTUM 3
  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-26 17:49 ` [PATCH 2/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL Rong Zhang
@ 2026-05-26 17:49 ` Rong Zhang
  2 siblings, 0 replies; 7+ messages in thread
From: Rong Zhang @ 2026-05-26 17:49 UTC (permalink / raw)
  To: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, Shuah Khan
  Cc: Gordon Chen, linux-sound, linux-doc, linux-kernel, Rong Zhang

The Sennheiser MOMENTUM 3 is a wireless around-ear headphones featuring
ANC, which can be connected via Bluetooth or USB-C.

When connecting via USB-C, its UAC mixer works fine and precisely
corresponds to the reported dB range. However, the mixer's volume
GET_CUR method is somehow stubbed and returns a constant value (15dB).
Since commit 86aa1ea1f15c ("ALSA: usb-audio: Do not expose sticky
mixers"), the sticky check considers the mixer to be sticky and
unnecessarily disables the mixer.

Add a quirk table entry matching VID/PID=0x1377/0x6004 and applying
the MIXER_SKIP_GET_CUR_VOL quirk flag, so that the mixer is usable
again.

Quirky device sample:

  usb 7-1.4.4.1.1.1: new full-speed USB device number 30 using xhci_hcd
  usb 7-1.4.4.1.1.1: New USB device found, idVendor=1377, idProduct=6004, bcdDevice=38.85
  usb 7-1.4.4.1.1.1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
  usb 7-1.4.4.1.1.1: Product: MOMENTUM 3
  usb 7-1.4.4.1.1.1: Manufacturer: Sennheiser electronic GmbH & Co. KG
  usb 7-1.4.4.1.1.1: SerialNumber: <REDACTED>
  usb 7-1.4.4.1.1.1: Found last interface = 0
  usb 7-1.4.4.1.1.1: 1:1: add audio endpoint 0x3
  usb 7-1.4.4.1.1.1: Creating new data endpoint #3
  usb 7-1.4.4.1.1.1: 1:1 Set sample rate 48000, clock 0
  usb 7-1.4.4.1.1.1: 6:0: sticky mixer values (0/11520/768 => 3840), disabling
  usb 7-1.4.4.1.1.1: [6] FU [PCM Playback Volume] skipped due to invalid volume
  input: Sennheiser electronic GmbH & Co. KG MOMENTUM 3 as /devices/pci0000:00/0000:00:08.3/0000:67:00.4/usb7/7-1/7-1.4/7-1.4.4/7-1.4.4.1/7-1.4.4.1.1/7-1.4.4.1.1.1/7-1.4.4.1.1.1:1.2/0003:1377:6004.002B/input/input208
  input: Sennheiser electronic GmbH & Co. KG MOMENTUM 3 Consumer Control as /devices/pci0000:00/0000:00:08.3/0000:67:00.4/usb7/7-1/7-1.4/7-1.4.4/7-1.4.4.1/7-1.4.4.1.1/7-1.4.4.1.1.1/7-1.4.4.1.1.1:1.2/0003:1377:6004.002B/input/input209
  hid-generic 0003:1377:6004.002B: input,hiddev99,hidraw12: USB HID v1.11 Device [Sennheiser electronic GmbH & Co. KG MOMENTUM 3] on usb-0000:67:00.4-1.4.4.1.1.1/input2

Signed-off-by: Rong Zhang <i@rong.moe>
---
 sound/usb/quirks.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c
index fbd44baace68..8cd8f475ec1f 100644
--- a/sound/usb/quirks.c
+++ b/sound/usb/quirks.c
@@ -2357,6 +2357,8 @@ static const struct usb_audio_quirk_flags_table quirk_flags_table[] = {
 		   QUIRK_FLAG_FORCE_IFACE_RESET | QUIRK_FLAG_IFACE_DELAY),
 	DEVICE_FLG(0x1224, 0x2a25, /* Jieli Technology USB PHY 2.0 */
 		   QUIRK_FLAG_GET_SAMPLE_RATE | QUIRK_FLAG_MIC_RES_16),
+	DEVICE_FLG(0x1377, 0x6004, /* Sennheiser MOMENTUM 3 */
+		   QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL),
 	DEVICE_FLG(0x1395, 0x740a, /* Sennheiser DECT */
 		   QUIRK_FLAG_GET_SAMPLE_RATE),
 	DEVICE_FLG(0x1397, 0x0507, /* Behringer UMC202HD */

-- 
2.53.0


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL
  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
  2026-05-27 17:58     ` Rong Zhang
  0 siblings, 1 reply; 7+ messages in thread
From: Takashi Iwai @ 2026-05-27  5:37 UTC (permalink / raw)
  To: Rong Zhang
  Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, Shuah Khan,
	Gordon Chen, linux-sound, linux-doc, linux-kernel

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

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 1/3] ALSA: doc: usb-audio: Add doc for QUIRK_FLAG_IFB_SILENCE_ON_EMPTY
  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
  0 siblings, 0 replies; 7+ messages in thread
From: Takashi Iwai @ 2026-05-27  5:38 UTC (permalink / raw)
  To: Rong Zhang
  Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, Shuah Khan,
	Gordon Chen, linux-sound, linux-doc, linux-kernel

On Tue, 26 May 2026 19:49:23 +0200,
Rong Zhang wrote:
> 
> QUIRK_FLAG_IFB_SILENCE_ON_EMPTY was introduced into usb-audio before
> without appropriate documentation, so add it.
> 
> Fixes: a23812004228 ("ALSA: usb-audio: add IFB_SILENCE_ON_EMPTY quirk for Behringer Flow 8")
> Signed-off-by: Rong Zhang <i@rong.moe>

I take this patch now as it's basically irrelevant with your code
change itself.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH 2/3] ALSA: usb-audio: Add QUIRK_FLAG_MIXER_SKIP_GET_CUR_VOL
  2026-05-27  5:37   ` Takashi Iwai
@ 2026-05-27 17:58     ` Rong Zhang
  0 siblings, 0 replies; 7+ messages in thread
From: Rong Zhang @ 2026-05-27 17:58 UTC (permalink / raw)
  To: Takashi Iwai
  Cc: Jaroslav Kysela, Takashi Iwai, Jonathan Corbet, Shuah Khan,
	Gordon Chen, linux-sound, linux-doc, linux-kernel

Hi Takashi,

Thanks for your review.

On Wed, 2026-05-27 at 07:37 +0200, Takashi Iwai wrote:
> 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?

Hmm, it is indeed not very optimal. My initial idea was to prevent
returning bogus values at all, so I gated GET_CUR here. But as you've
said this could have a wide impact on other mixers...

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

While I am not sure if more devices need this (my intuition says yes),
how about a less radical approach that still relies on the sticky check?

- Rename the quirk flag to QUIRK_FLAG_MIXER_GET_CUR_BROKEN.
- Add a flag to struct usb_mixer_elem_info to gate GET_CUR.
- When the sticky check fails, check quirk flags. Gate further GET_CUR
if the quirk flag is set, otherwise disable the mixer as usual.
- A mixer with GET_CUR gated will solely relies on the internal cache of
last set volume.

The quirk flag still applies to all mixers, but as long as a mixer makes
the sticky check happy, it won't be affected at all. Only those mixers
with constant GET_CUR values will have their GET_CUR gated. I assume the
impact is minimal, since it's very unlikely a device would have sticky
mixers (broken SET_CUR) along with mixers with working SET_CUR but
broken GET_CUR at the same time.

Thanks,
Rong

> 
> 
> thanks,
> 
> Takashi

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-05-27 18:03 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox