Re: [PATCH] USB Audio Class 2 Mixer unit support for GET_CUR, SET_CUR and RANGE

From: Takashi Iwai

Date: Thu Sep 17 2026 - 15:31:05 EST


On Thu, 17 Sep 2026 18:33:50 +0200,
Zipdox wrote:
>
> On 9/17/26 6:15 PM, Takashi Iwai wrote:
> > Good to hear. If you have a chance to test my last series of patches,
> > it'd be appreciated.
> >
> > BTW, I'll be off from tomorrow, and the issue is no new bug to be
> > urgently fixed, so I'll handle after back to work again :)
> >
> >
> > thanks,
> >
> > Takashi
>
> I have compiled your patches and the mixer unit control seems to work
> correctly.
>
> Another thing on my mind is the following section from section
> 5.2.5.5.1 from the spec:
> > A Mixer Unit consists of a number of Mixer Controls, either programmable or fixed. A Mixer Control must
> > support the CUR and RANGE(MIN, MAX, RES) attributes. The settings for the CUR, MIN, and MAX
> > attributes can range from +127.9961 dB (0x7FFF) down to -127.9961 dB (0x8001) in steps of 1/256 dB or
> > 0.00390625 dB (0x0001). The settings for the RES attribute can only have positive values and range from
> > 1/256 dB (0x0001) to +127.9961 dB (0x7FFF).
> > In addition, code 0x8000, representing silence (i.e., -∞ dB), must always be implemented. However, it must
> > never be reported as the MIN attribute value.
>
> Is this presently handled? For reference, 0x8000 is -32768. When I use
> qasmixer or alsamixer, for example, it only goes down to -32767. This
> is the same in UAC1 by the way. Should we add a mute control to mixer
> nodes? Or perhaps extend the reported range downward by one, and
> overwrite the lowest value to -32768 when writing to a mixer unit. The
> latter is my preferred solution.

I guess it's not; there is cval->min_mute flag, but it's for another
case (the minimal volume = mute) for the statically mapped mixer
elements, and not for this mixer unit case.

Maybe they should be implemented by additional mute switches.

Overall, the mixer unit controls have been rarely used by the devices,
so far, and that's the reason we didn't hit this over years :)


Takashi