Re: [DISCUSSION] ALSA: usb-audio: Card naming for composite devices
From: Takashi Iwai
Date: Sat Oct 31 2026 - 12:57:41 EST
On Fri, 30 Oct 2026 13:17:39 +0100,
RenPanpan wrote:
>
> Hello,
>
> I'd like to discuss an issue with USB audio card naming for composite
> devices and propose a possible improvement.
>
> Problem
> -------
>
> For USB composite devices containing both non-audio and UAC audio
> functions, the ALSA card shortname is derived from the device-level
> iProduct string, which describes the entire device rather than the
> audio function.
>
> For example, the CVT Touch Device (1ff7:0f33) is a composite device
> with HID touch interfaces and UAC audio interfaces. Its iProduct is
> "Touch Device", which is the name for the whole device. The UAC
> OUTPUT_TERMINAL descriptor defines the audio function name as
> "MAXHUB Speaker" via the iTerminal string descriptor (index 14).
>
> Currently, the ALSA card name shows "Touch Device", which does not
> identify the audio function. The UAC mixer code already reads
> iTerminal for mixer control names (e.g. "MAXHUB Mic" from the
> Microphone INPUT_TERMINAL's iTerminal=17), but the card naming
> function (usb_audio_make_shortname) does not use iTerminal.
>
> Proposed approach
> -----------------
>
> When the USB device is composite (i.e. it has non-audio interfaces),
> prefer the Speaker OUTPUT_TERMINAL's iTerminal string as the card
> shortname, instead of the device-level iProduct. If iTerminal is not
> set (zero) or not readable via usb_string(), fall back to iProduct
> (existing behavior).
>
> Non-composite (dedicated audio) devices are not affected and continue
> to use iProduct.
>
> The composite device detection checks whether any interface has a
> non-Audio class. The iTerminal reading uses the existing
> snd_usb_find_csint_desc() helper to parse OUTPUT_TERMINAL descriptors
> in the Audio Control interface's extra data. The iTerminal field is
> the last byte of the descriptor, common to both UAC1 (bLength=9) and
> UAC2 (bLength=12).
>
> As an immediate fix, I have also prepared a quirk entry for 1ff7:0f33
> to override the card shortname to "MAXHUB Speaker" directly.
>
> Questions for the community
> ----------------------------
>
> 1. Is this approach reasonable for composite devices, or should it
> remain a per-device quirk?
>
> 2. Are there concerns about changing card names for existing composite
> USB audio devices that have iTerminal set? For example, UCM profile
> matching or PulseAudio device identification.
>
> 3. Would it be preferable to also check the IAD's iFunction field
> before falling back to iTerminal, or is iTerminal sufficient?
>
> 4. Are there known composite USB audio devices where the iTerminal
> string might be empty or contain unexpected content?
>
> I have tested the quirk approach on a MT81C device (Kylin V10-SP1)
> and it works correctly. The iTerminal approach compiles but has not
> been tested on multiple devices yet.
>
> Any feedback would be appreciated.
>
> Best regards,
> RenPanpan
I took your first fix patch as it was simple enough.
(It took time just because I was traveling in the last week.)
If it still doesn't suffice, let us know. Thanks.
Takashi