Re: [PATCH] USB Audio Class 2 Mixer unit support for GET_CUR, SET_CUR and RANGE
From: Zipdox
Date: Mon Oct 05 2026 - 06:07:21 EST
On 9/28/26 12:59 PM, Takashi Iwai wrote:
A mute switch could work if you add the necessary state management code. For now I think that's the most straightforward solution, seeing I don't know how ALSA would handle a misaligned range and resolution in the case of my proposal. Could you write a patch?From a UX perspective, I would prefer if the lowest setting on the
control equals mute. This makes the most sense for a "mixer". Like I
mentioned before, extending the range down by 1 and making that
translate to -32768 seems like a convenient solution. When setting,
simply check if it's a mixer unit (UAC1 or UAC2, both do this) and if
the set value is equal to the minimum, and set the value to
-32768. For getting, check if it's a mixer unit and check if the
retrieved value is -32768, and then set the value to the minimum. The
only caveat is that the resolution might not align anymore with the
range. What do you think of this idea?
I thought of it, too. OTOH, it'll be a bit tricky, because the range
isn't usually covering -32767 but only a part. So -32768 won't be
reached continuously.
I'm inclined to have a simple mute switch in addition.
thanks,
Takashi