Documentation/sound/alsa-configuration.rst | 12 ++++++ sound/usb/mixer.c | 60 +++++++++++++++++++++++++----- sound/usb/mixer.h | 1 + sound/usb/quirks.c | 5 +++ sound/usb/usbaudio.h | 13 +++++++ 5 files changed, 81 insertions(+), 10 deletions(-)
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.
As the sticky check can't distinguish between sticky mixers and working
SET_CUR but broken GET_CUR, add QUIRK_FLAG_MIXER_GET_CUR_BROKEN to tell
that the device should fall into the second category when GET_CUR
returns a constant value. In this case, the sticky check becomes
non-fatal and only disables GET_CUR instead of the whole mixer. The
current volume will then be provided by the internal cache that stores
the last set volume.
An info message prompting users to check MIXER_GET_CUR_BROKEN for
potential sticky mixers is also added, so that users can learn how to do
some experiments to determine what's going on. If the mixer surprisingly
turns out to be non-sticky, they can submit a patch for a new quirk
table entry.
The Sennheiser MOMENTUM 3 and Edifier MF200 need the quirk flag. Though
their UAC mixers respond to SET_CUR by tuning the volume, the
corresponding GET_CUR methods are somehow stubbed and return constant
values, resulting in them being disabled by the sticky check.
Signed-off-by: Rong Zhang <i@rong.moe>
---
Changes in v4:
- Rebase since a patch improving the error path of the sticky check has
been applied earlier
- https://patch.msgid.link/20260531-uac-sticky-error-path-v1-1-12c2329d17ef@rong.moe
- Integrate a follow-up series into this one
- https://patch.msgid.link/20260531-uac-edifier-mf200-v1-0-be69657c3f87@rong.moe
- Link to v3: https://patch.msgid.link/20260529-uac-quirk-get-cur-vol-v3-0-bde363188ca4@rong.moe
Changes in v3:
- Make the log less noisy (thanks Takashi Iwai)
- Do not propagate mixer values written by sanity checks when GET_CUR is
broken, nor restore the garbage backed-up value. Instead, rely on
init_cur_mix_raw() to initialize the mixer properly
- Gate cache invalidation as well, so that the current volume is always
available to userspace
- Update the comment of check_sticky_volume_control()
- Link to v2: https://patch.msgid.link/20260528-uac-quirk-get-cur-vol-v2-0-84d3c8f48150@rong.moe
Changes in v2:
- Turn the approach into a less radical one
- Rename the quirk flag to QUIRK_FLAG_MIXER_GET_CUR_BROKEN
- Add a flag `get_cur_broken' to `struct usb_mixer_elem_info'
- When the sticky check fails, check quirk flags. Gate further GET_CUR
by setting `cval->get_cur_broken' if QUIRK_FLAG_MIXER_GET_CUR_BROKEN
is set, otherwise disable the mixer as usual
- 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
- Link to v1: https://patch.msgid.link/20260527-uac-quirk-get-cur-vol-v1-0-e9362b712e5e@rong.moe
---
Rong Zhang (3):
ALSA: usb-audio: Add QUIRK_FLAG_MIXER_GET_CUR_BROKEN
ALSA: usb-audio: Add quirk flag for Sennheiser MOMENTUM 3
ALSA: usb-audio: Add quirk flag for Edifier MF200
Documentation/sound/alsa-configuration.rst | 12 ++++++
sound/usb/mixer.c | 60 +++++++++++++++++++++++++-----
sound/usb/mixer.h | 1 +
sound/usb/quirks.c | 5 +++
sound/usb/usbaudio.h | 13 +++++++
5 files changed, 81 insertions(+), 10 deletions(-)
---
base-commit: f52b1b0506c6a209c10a741d031944d1ed19548c
change-id: 20260527-uac-quirk-get-cur-vol-d0b292c3e796
Thanks,
Rong
On Sun, 31 May 2026 17:45:19 +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.
>
> As the sticky check can't distinguish between sticky mixers and working
> SET_CUR but broken GET_CUR, add QUIRK_FLAG_MIXER_GET_CUR_BROKEN to tell
> that the device should fall into the second category when GET_CUR
> returns a constant value. In this case, the sticky check becomes
> non-fatal and only disables GET_CUR instead of the whole mixer. The
> current volume will then be provided by the internal cache that stores
> the last set volume.
>
> An info message prompting users to check MIXER_GET_CUR_BROKEN for
> potential sticky mixers is also added, so that users can learn how to do
> some experiments to determine what's going on. If the mixer surprisingly
> turns out to be non-sticky, they can submit a patch for a new quirk
> table entry.
>
> The Sennheiser MOMENTUM 3 and Edifier MF200 need the quirk flag. Though
> their UAC mixers respond to SET_CUR by tuning the volume, the
> corresponding GET_CUR methods are somehow stubbed and return constant
> values, resulting in them being disabled by the sticky check.
>
> Signed-off-by: Rong Zhang <i@rong.moe>
> ---
> Changes in v4:
> - Rebase since a patch improving the error path of the sticky check has
> been applied earlier
> - https://patch.msgid.link/20260531-uac-sticky-error-path-v1-1-12c2329d17ef@rong.moe
> - Integrate a follow-up series into this one
> - https://patch.msgid.link/20260531-uac-edifier-mf200-v1-0-be69657c3f87@rong.moe
> - Link to v3: https://patch.msgid.link/20260529-uac-quirk-get-cur-vol-v3-0-bde363188ca4@rong.moe
>
> Changes in v3:
> - Make the log less noisy (thanks Takashi Iwai)
> - Do not propagate mixer values written by sanity checks when GET_CUR is
> broken, nor restore the garbage backed-up value. Instead, rely on
> init_cur_mix_raw() to initialize the mixer properly
> - Gate cache invalidation as well, so that the current volume is always
> available to userspace
> - Update the comment of check_sticky_volume_control()
> - Link to v2: https://patch.msgid.link/20260528-uac-quirk-get-cur-vol-v2-0-84d3c8f48150@rong.moe
>
> Changes in v2:
> - Turn the approach into a less radical one
> - Rename the quirk flag to QUIRK_FLAG_MIXER_GET_CUR_BROKEN
> - Add a flag `get_cur_broken' to `struct usb_mixer_elem_info'
> - When the sticky check fails, check quirk flags. Gate further GET_CUR
> by setting `cval->get_cur_broken' if QUIRK_FLAG_MIXER_GET_CUR_BROKEN
> is set, otherwise disable the mixer as usual
> - 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
> - Link to v1: https://patch.msgid.link/20260527-uac-quirk-get-cur-vol-v1-0-e9362b712e5e@rong.moe
>
> ---
> Rong Zhang (3):
> ALSA: usb-audio: Add QUIRK_FLAG_MIXER_GET_CUR_BROKEN
> ALSA: usb-audio: Add quirk flag for Sennheiser MOMENTUM 3
> ALSA: usb-audio: Add quirk flag for Edifier MF200
Now took all three patches onto for-next branch. Thanks.
Takashi
On 5/31/26 17:50, Takashi Iwai wrote:
> On Sun, 31 May 2026 17:45:19 +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.
> [...]
>
> Now took all three patches onto for-next branch. Thanks.
I noticed that patch 1 is somewhat on the larger side, nevertheless
allow me to ask: wouldn't it be better to mainline this for -rc7, as
this fixes a regression from the 7.1 cycle? Or did I misjudge this? Then
don't hesitate to tell me!
Ciao, Thorsten
On Fri, 05 Jun 2026 14:00:02 +0200,
Thorsten Leemhuis wrote:
>
> On 5/31/26 17:50, Takashi Iwai wrote:
> > On Sun, 31 May 2026 17:45:19 +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.
> > [...]
> >
> > Now took all three patches onto for-next branch. Thanks.
>
> I noticed that patch 1 is somewhat on the larger side, nevertheless
> allow me to ask: wouldn't it be better to mainline this for -rc7, as
> this fixes a regression from the 7.1 cycle? Or did I misjudge this? Then
> don't hesitate to tell me!
A regression fix will be included in the upcoming PR by another commit
aa2f4addab44407c7aa742321de5dc1914ab5762.
Takashi
Hi Takashi,
On Sun, 2026-05-31 at 17:50 +0200, Takashi Iwai wrote:
> On Sun, 31 May 2026 17:45:19 +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.
> >
> > As the sticky check can't distinguish between sticky mixers and working
> > SET_CUR but broken GET_CUR, add QUIRK_FLAG_MIXER_GET_CUR_BROKEN to tell
> > that the device should fall into the second category when GET_CUR
> > returns a constant value. In this case, the sticky check becomes
> > non-fatal and only disables GET_CUR instead of the whole mixer. The
> > current volume will then be provided by the internal cache that stores
> > the last set volume.
> >
> > An info message prompting users to check MIXER_GET_CUR_BROKEN for
> > potential sticky mixers is also added, so that users can learn how to do
> > some experiments to determine what's going on. If the mixer surprisingly
> > turns out to be non-sticky, they can submit a patch for a new quirk
> > table entry.
> >
> > The Sennheiser MOMENTUM 3 and Edifier MF200 need the quirk flag. Though
> > their UAC mixers respond to SET_CUR by tuning the volume, the
> > corresponding GET_CUR methods are somehow stubbed and return constant
> > values, resulting in them being disabled by the sticky check.
> >
> > Signed-off-by: Rong Zhang <i@rong.moe>
> > ---
> > Changes in v4:
> > - Rebase since a patch improving the error path of the sticky check has
> > been applied earlier
> > - https://patch.msgid.link/20260531-uac-sticky-error-path-v1-1-12c2329d17ef@rong.moe
> > - Integrate a follow-up series into this one
> > - https://patch.msgid.link/20260531-uac-edifier-mf200-v1-0-be69657c3f87@rong.moe
> > - Link to v3: https://patch.msgid.link/20260529-uac-quirk-get-cur-vol-v3-0-bde363188ca4@rong.moe
> >
> > Changes in v3:
> > - Make the log less noisy (thanks Takashi Iwai)
> > - Do not propagate mixer values written by sanity checks when GET_CUR is
> > broken, nor restore the garbage backed-up value. Instead, rely on
> > init_cur_mix_raw() to initialize the mixer properly
> > - Gate cache invalidation as well, so that the current volume is always
> > available to userspace
> > - Update the comment of check_sticky_volume_control()
> > - Link to v2: https://patch.msgid.link/20260528-uac-quirk-get-cur-vol-v2-0-84d3c8f48150@rong.moe
> >
> > Changes in v2:
> > - Turn the approach into a less radical one
> > - Rename the quirk flag to QUIRK_FLAG_MIXER_GET_CUR_BROKEN
> > - Add a flag `get_cur_broken' to `struct usb_mixer_elem_info'
> > - When the sticky check fails, check quirk flags. Gate further GET_CUR
> > by setting `cval->get_cur_broken' if QUIRK_FLAG_MIXER_GET_CUR_BROKEN
> > is set, otherwise disable the mixer as usual
> > - 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
> > - Link to v1: https://patch.msgid.link/20260527-uac-quirk-get-cur-vol-v1-0-e9362b712e5e@rong.moe
> >
> > ---
> > Rong Zhang (3):
> > ALSA: usb-audio: Add QUIRK_FLAG_MIXER_GET_CUR_BROKEN
> > ALSA: usb-audio: Add quirk flag for Sennheiser MOMENTUM 3
> > ALSA: usb-audio: Add quirk flag for Edifier MF200
>
> Now took all three patches onto for-next branch. Thanks.
Thanks a lot! :)
Thanks,
Rong
>
>
> Takashi
© 2016 - 2026 Red Hat, Inc.