]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
USB-Audio: Scarlett 18i20 fix ADAT capture channel count for Gen 1/2
authorDerek Keith <derek@codeurge.com>
Mon, 23 Mar 2026 11:11:58 +0000 (05:11 -0600)
committerJaroslav Kysela <perex@perex.cz>
Fri, 27 Mar 2026 13:56:44 +0000 (14:56 +0100)
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 <derek@codeurge.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/Focusrite/Scarlett-18i20-HiFi.conf

index 4ad0af18d1f44fc6a490f496e8d247a239840de4..aced27b14c544dd80ee19608b98b0bb2ef8f489e 100644 (file)
@@ -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
+               }
        }
 }