ALSA: usb-audio: second configuration of the Steinberg UR22C
cover ALSA: usb-audio: second configuration of the Steinberg UR22C
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(+)
Signature · 1 line
2.56.0
PATCH 1/2 ALSA: usb-audio: name the interfaces of the Steinberg UR22C
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.
--- sound/usb/quirks-table.h | 14 ++++++++++++++ 1 file changed, 14 insertions(+)
sound/usb/quirks-table.h +14 -0
@@ -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 |
Signature · 1 line
2.56.0
PATCH 2/2 ALSA: usb-audio: fix the format bits of the Steinberg UR22C
In reply to Xinyu WeiIn 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.
--- sound/usb/format.c | 5 +++++ 1 file changed, 5 insertions(+)
sound/usb/format.c +5 -0
@@ -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 */
Signature · 1 line
2.56.0
Takashi Iwai
AppliedQuoted 7 lines · 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.
Quoted 8 lines
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 asFLOAT_LEdoes 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
Applied both to for-next branch now. Thanks.
Takashi