From: Derek Keith Date: Mon, 23 Mar 2026 11:11:58 +0000 (-0600) Subject: USB-Audio: Scarlett 18i20 fix ADAT capture channel count for Gen 1/2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=17b48b1aa77401bbe084cad3dd17dd98ba676ad1;p=alsa-ucm-conf.git USB-Audio: Scarlett 18i20 fix ADAT capture channel count for Gen 1/2 The Scarlett 18i20 Gen 1 (0x800c) and Gen 2 (0x8201) have 18 capture channels, but the ADAT Optical Input device ("Direct 2") unconditionally maps 8 channels (indices 12-19). Channel indices 18 and 19 exceed the available capture channels, causing WirePlumber/PipeWire to reject the UCM profile: spa.alsa: Error in ALSA UCM profile for _ucm0003.hw:USB,0 (Direct2): CaptureChannel6=18 >= CaptureChannels=18 Conditionally size the ADAT capture device based on DirectCaptureChannels: - Gen 1/2 (18 channels): 6-channel ADAT (indices 12-17) - Gen 3+ (20+ channels): 8-channel ADAT (indices 12-19) Tested on a Scarlett 18i20 Gen 2 (USB1235:8201) running PipeWire 1.4 with WirePlumber on CachyOS. Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/731 Signed-off-by: Derek Keith Signed-off-by: Jaroslav Kysela --- diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-18i20-HiFi.conf b/ucm2/USB-Audio/Focusrite/Scarlett-18i20-HiFi.conf index 4ad0af1..aced27b 100644 --- a/ucm2/USB-Audio/Focusrite/Scarlett-18i20-HiFi.conf +++ b/ucm2/USB-Audio/Focusrite/Scarlett-18i20-HiFi.conf @@ -519,34 +519,71 @@ SectionDevice."SPDIF 3" { } # Digital (Professional) Inputs +# +# Gen 1/2 have 18 capture channels (ADAT 1-6), Gen 3+ have 20 (ADAT 1-8). +# Channel indices 18-19 are out of bounds when DirectCaptureChannels is 18, +# so conditionally size the ADAT capture device. + +If.adat_in_18ch { + Condition { + Type String + String1 "${var:DirectCaptureChannels}" + String2 "18" + } + True.SectionDevice."Direct 2" { + Comment "ADAT Optical Input" + + Value { + CapturePriority 48 + } -SectionDevice."Direct 2" { - Comment "ADAT Optical Input" - - Value { - CapturePriority 48 + Macro.pcm_split.SplitPCMDevice { + Name "18i20_adat_in" + Direction Capture + HWChannels "${var:DirectCaptureChannels}" + Channels 6 + Channel0 12 + Channel1 13 + Channel2 14 + Channel3 15 + Channel4 16 + Channel5 17 + ChannelPos0 UNKNOWN + ChannelPos1 UNKNOWN + ChannelPos2 UNKNOWN + ChannelPos3 UNKNOWN + ChannelPos4 UNKNOWN + ChannelPos5 UNKNOWN + } } + False.SectionDevice."Direct 2" { + Comment "ADAT Optical Input" - Macro.pcm_split.SplitPCMDevice { - Name "18i20_adat_in" - Direction Capture - HWChannels "${var:DirectCaptureChannels}" - Channels 8 - Channel0 12 - Channel1 13 - Channel2 14 - Channel3 15 - Channel4 16 - Channel5 17 - Channel6 18 - Channel7 19 - ChannelPos0 UNKNOWN - ChannelPos1 UNKNOWN - ChannelPos2 UNKNOWN - ChannelPos3 UNKNOWN - ChannelPos4 UNKNOWN - ChannelPos5 UNKNOWN - ChannelPos6 UNKNOWN - ChannelPos7 UNKNOWN + Value { + CapturePriority 48 + } + + Macro.pcm_split.SplitPCMDevice { + Name "18i20_adat_in" + Direction Capture + HWChannels "${var:DirectCaptureChannels}" + Channels 8 + Channel0 12 + Channel1 13 + Channel2 14 + Channel3 15 + Channel4 16 + Channel5 17 + Channel6 18 + Channel7 19 + ChannelPos0 UNKNOWN + ChannelPos1 UNKNOWN + ChannelPos2 UNKNOWN + ChannelPos3 UNKNOWN + ChannelPos4 UNKNOWN + ChannelPos5 UNKNOWN + ChannelPos6 UNKNOWN + ChannelPos7 UNKNOWN + } } }