[PATCH] ALSA: usb-audio: Do not drop per-channel feature controls marked get_cur_broken

From: Agustin Luzardo

Date: Tue Jul 07 2026 - 14:33:58 EST


When a per-channel Feature Unit control (e.g. a stereo PCM Playback
Volume control) hits the sticky-mixer check during get_min_max_with_quirks(),
and the device carries QUIRK_FLAG_MIXER_GET_CUR_BROKEN, the sticky
check marks the control as cval->get_cur_broken and returns -ENXIO
instead of disabling it outright.

However, __build_feature_ctl() does not know about this and treats
any negative return other than -EAGAIN as fatal, discarding the
kcontrol entirely:

if ((ret < 0 && ret != -EAGAIN) || cval->max <= cval->min) {
...
snd_ctl_free_one(kctl);
return;
}

For a stereo device where only some channels trip the sticky check,
this silently drops the per-channel (stereo) control while the
master-only control (built separately, without going through the
same channel-specific GET_CUR negotiation) survives. The result is
that the user is left with a single mono/master volume control
instead of the independent per-channel controls the device actually
supports, with no visible error (usb_audio_dbg is typically compiled
out).

This was observed on a Weltrend Semiconductor 040b:0897 device (sold
as the Redragon H510-PRO Wireless headset), which reports a genuine
stereo Feature Unit (bNrChannels = 2, bmaControls with Volume set for
both channels) but ends up exposing only a single-channel "PCM
Playback Volume" control once QUIRK_FLAG_MIXER_GET_CUR_BROKEN is
applied for that device.

Skip the discard when the control was already marked get_cur_broken,
as long as a sane range was otherwise established.

Signed-off-by: Agustin Luzardo <agustinluzardo09@xxxxxxxxx>
---
sound/usb/mixer.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c
index 0000000..0000000 100644
--- a/sound/usb/mixer.c
+++ b/sound/usb/mixer.c
@@ -1970,8 +1970,10 @@ static void __build_feature_ctl(struct usb_mixer_interface *mixer,
/* get min/max values */
ret = get_min_max_with_quirks(cval, 0, kctl);

- /* skip a bogus volume range */
- if ((ret < 0 && ret != -EAGAIN) || cval->max <= cval->min) {
+ /* skip a bogus volume range, unless the sticky check already
+ * marked this control as usable via the driver's cached value
+ * (QUIRK_FLAG_MIXER_GET_CUR_BROKEN) */
+ if ((ret < 0 && ret != -EAGAIN && !cval->get_cur_broken) ||
+ cval->max <= cval->min) {
usb_audio_dbg(mixer->chip,
"[%d] FU [%s] skipped due to invalid volume\n",
cval->head.id, kctl->id.name);
--
2.46.1