All of lore.kernel.org
 help / color / mirror / Atom feed
* [DISCUSSION] ALSA: usb-audio: Card naming for composite devices
@ 2026-10-29  9:35 rppxj178543
  0 siblings, 0 replies; 4+ messages in thread
From: rppxj178543 @ 2026-10-29  9:35 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, linux-usb, linux-kernel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [DISCUSSION] ALSA: usb-audio: Card naming for composite devices
@ 2026-10-30  1:34 RenPanpan
  0 siblings, 0 replies; 4+ messages in thread
From: RenPanpan @ 2026-10-30  1:34 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, linux-usb, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [DISCUSSION] ALSA: usb-audio: Card naming for composite devices
@ 2026-10-30  2:34 RenPanpan
  0 siblings, 0 replies; 4+ messages in thread
From: RenPanpan @ 2026-10-30  2:34 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, linux-usb, linux-kernel

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

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [DISCUSSION] ALSA: usb-audio: Card naming for composite devices
@ 2026-10-30 12:17 RenPanpan
  0 siblings, 0 replies; 4+ messages in thread
From: RenPanpan @ 2026-10-30 12:17 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, linux-usb, linux-kernel

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


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-10-30 12:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-30  1:34 [DISCUSSION] ALSA: usb-audio: Card naming for composite devices RenPanpan
  -- strict thread matches above, loose matches on Subject: below --
2026-10-30 12:17 RenPanpan
2026-10-30  2:34 RenPanpan
2026-10-29  9:35 rppxj178543

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.