mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 0/2] ALSA: usb-audio: second configuration of the Steinberg UR22C
@ 2026-11-08 13:03 Xinyu Wei
  2026-11-08 13:03 ` [PATCH 1/2] ALSA: usb-audio: name the interfaces " Xinyu Wei
  2026-11-08 13:03 ` [PATCH 2/2] ALSA: usb-audio: fix the format bits " Xinyu Wei
  0 siblings, 2 replies; 3+ messages in thread
From: Xinyu Wei @ 2026-11-08 13:03 UTC (permalink / raw)
  To: Jaroslav Kysela, linux-kernel, linux-sound, Takashi Iwai; +Cc: Xinyu Wei

The Steinberg UR22C exposes two USB configurations: configuration 1 is
class-compliant (2 playback / 4 capture channels), while configuration 2
is UAC2 behind bInterfaceClass 0xFF (6 playback / 8 capture channels and
two MIDI interfaces).  Selecting configuration 2 on a stock kernel leaves
interfaces 0-2 unbound and registers no PCM.

Patch 1 adds a composite quirk entry for configuration 2's vendor-class
interfaces.  Patch 2 fixes a bogus bmFormats (0xffffffff) in
configuration 2's capture descriptor so opening capture as FLOAT_LE does
not lock out playback via implicit feedback sync.

Xinyu Wei (2):
  ALSA: usb-audio: name the interfaces of the Steinberg UR22C
  ALSA: usb-audio: fix the format bits of the Steinberg UR22C

 sound/usb/format.c       |  5 +++++
 sound/usb/quirks-table.h | 14 ++++++++++++++
 2 files changed, 19 insertions(+)

-- 
2.56.0


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

* [PATCH 1/2] ALSA: usb-audio: name the interfaces of the Steinberg UR22C
  2026-11-08 13:03 [PATCH 0/2] ALSA: usb-audio: second configuration of the Steinberg UR22C Xinyu Wei
@ 2026-11-08 13:03 ` Xinyu Wei
  2026-11-08 13:03 ` [PATCH 2/2] ALSA: usb-audio: fix the format bits " Xinyu Wei
  1 sibling, 0 replies; 3+ messages in thread
From: Xinyu Wei @ 2026-11-08 13:03 UTC (permalink / raw)
  To: Jaroslav Kysela, linux-kernel, linux-sound, Takashi Iwai; +Cc: Xinyu Wei

Configuration 2 of the Steinberg UR22C (0499:172f) exposes 6 playback
and 8 capture channels over standard UAC2 descriptors with
bInterfaceClass set to 0xFF.

Because the interfaces are vendor-class, they fall into the Yamaha
catch-all entry and QUIRK_AUTODETECT fails to set them up:
create_auto_pcm_quirk() rejects 6-byte UAC2 format descriptors, and
interface 0 (audiocontrol, 1 altsetting, 0 endpoints) is rejected by
both auto-PCM and auto-MIDI paths, leaving interfaces 0-2 unbound with
no PCM registered.

Add a USB_DEVICE_VENDOR_SPEC composite entry before the Yamaha catch-all:
 - interface 0: QUIRK_DATA_STANDARD_MIXER
 - interfaces 1, 2: QUIRK_DATA_STANDARD_AUDIO (6-ch playback, 8-ch capture)
 - interfaces 3, 4: QUIRK_DATA_MIDI_YAMAHA (DIN MIDI and DSP mixer
   control; both carry Yamaha-style CS_INTERFACE jack descriptors with
   no CS_ENDPOINT descriptor)

Configuration 1 uses bInterfaceClass 0x01 and is unaffected.  The
existing IMPLICIT_FB_FIXED_DEV(0x0499, 0x172f, 0x81, 2) entry in
implicit.c applies to both configurations unchanged.

Signed-off-by: Xinyu Wei <xinyuwei1024@gmail.com>
---
 sound/usb/quirks-table.h | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
index e85eeb536..cc2c1317a 100644
--- a/sound/usb/quirks-table.h
+++ b/sound/usb/quirks-table.h
@@ -455,6 +455,20 @@ YAMAHA_DEVICE(0x7000, "DTX"),
 YAMAHA_DEVICE(0x7010, "UB99"),
 #undef YAMAHA_DEVICE
 #undef YAMAHA_INTERFACE
+/* Steinberg UR22C (configuration 2) */
+{
+	USB_DEVICE_VENDOR_SPEC(0x0499, 0x172f),
+	QUIRK_DRIVER_INFO {
+		QUIRK_DATA_COMPOSITE {
+			{ QUIRK_DATA_STANDARD_MIXER(0) },
+			{ QUIRK_DATA_STANDARD_AUDIO(1) },
+			{ QUIRK_DATA_STANDARD_AUDIO(2) },
+			{ QUIRK_DATA_MIDI_YAMAHA(3) },
+			{ QUIRK_DATA_MIDI_YAMAHA(4) },
+			QUIRK_COMPOSITE_END
+		}
+	}
+},
 /* this catches most recent vendor-specific Yamaha devices */
 {
 	.match_flags = USB_DEVICE_ID_MATCH_VENDOR |
-- 
2.56.0


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

* [PATCH 2/2] ALSA: usb-audio: fix the format bits of the Steinberg UR22C
  2026-11-08 13:03 [PATCH 0/2] ALSA: usb-audio: second configuration of the Steinberg UR22C Xinyu Wei
  2026-11-08 13:03 ` [PATCH 1/2] ALSA: usb-audio: name the interfaces " Xinyu Wei
@ 2026-11-08 13:03 ` Xinyu Wei
  1 sibling, 0 replies; 3+ messages in thread
From: Xinyu Wei @ 2026-11-08 13:03 UTC (permalink / raw)
  To: Jaroslav Kysela, linux-kernel, linux-sound, Takashi Iwai; +Cc: Xinyu Wei

In configuration 2 of the Steinberg UR22C (0499:172f), the capture
AS_GENERAL descriptor reports bmFormats = 0xffffffff, causing the driver
to advertise U8, S32_LE, FLOAT_LE, MU_LAW, A_LAW and SPECIAL even though
the hardware only supports 32-bit PCM (S32_LE).

Because playback is implicit-feedback synced to the capture endpoint
(0x81 on interface 2), hw_rule_format() restricts playback to the active
capture stream's format.  If capture is opened first with a non-S32_LE
format such as FLOAT_LE, the intersection with playback's S32_LE-only
format mask is empty and playback fails to open with -EINVAL.

Clamp bmFormats to UAC2 PCM (1) in parse_audio_format_i_type() when
chip->usb_id is 0499:172f and format == 0xffffffff, matching the
existing DS4201 workaround below it.

Signed-off-by: Xinyu Wei <xinyuwei1024@gmail.com>
---
 sound/usb/format.c | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/sound/usb/format.c b/sound/usb/format.c
index 4830f9f93..7ca2b5d5c 100644
--- a/sound/usb/format.c
+++ b/sound/usb/format.c
@@ -57,6 +57,11 @@ static u64 parse_audio_format_i_type(struct snd_usb_audio *chip,
 		sample_width = fmt->bBitResolution;
 		sample_bytes = fmt->bSubslotSize;
 
+		/* Steinberg UR22C workaround: config 2 capture sets 0xffffffff */
+		if (chip->usb_id == USB_ID(0x0499, 0x172f) &&
+		    format == 0xffffffff)
+			format = 1;
+
 		if (format & UAC2_FORMAT_TYPE_I_RAW_DATA) {
 			pcm_formats |= SNDRV_PCM_FMTBIT_SPECIAL;
 			/* flag potentially raw DSD capable altsettings */
-- 
2.56.0


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

end of thread, other threads:[~2026-11-08 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-08 13:03 [PATCH 0/2] ALSA: usb-audio: second configuration of the Steinberg UR22C Xinyu Wei
2026-11-08 13:03 ` [PATCH 1/2] ALSA: usb-audio: name the interfaces " Xinyu Wei
2026-11-08 13:03 ` [PATCH 2/2] ALSA: usb-audio: fix the format bits " Xinyu Wei

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®