]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
USB-Audio: Scarlett 18i20 gen4 - improve channel detection
authorJaroslav Kysela <perex@perex.cz>
Mon, 5 Jan 2026 15:24:13 +0000 (16:24 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 6 Jan 2026 19:34:52 +0000 (20:34 +0100)
Use bcdDevice number (using sysfs) to detect the right
channel count. Information is taken from the pull request
comments bellow.

Link: https://github.com/alsa-project/alsa-ucm-conf/pull/660
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/Focusrite/Scarlett-18i20.conf

index 8bed7eab9d35749b9e951932f65506e088a3a7b4..cbc581c5ccf570394949d443ed6a4b306ba35035 100644 (file)
@@ -1,4 +1,4 @@
-# The 18i20 provides 20 playback and 18 or 20 capture channels each:
+# Channel mapping
 #
 # +----+---------------+-----------------+
 # | Ch |     Inputs    |      Outputs    |
@@ -100,9 +100,31 @@ If.gen4 {
                String "${CardComponents}"
                Regex "USB1235:821d"
        }
-       True.Define {
-               Generation "4th"
-               DirectCaptureChannels 20
+       True {
+               Define {
+                       Generation "4th"
+                       DirectPlaybackChannels 26
+                       DirectCaptureChannels 26
+                       bcdDevice "${sys-card:device/../bcdDevice}"
+               }
+               If.fwp {
+                       # bcdNumbers 0900-097a
+                       Condition {
+                               Type RegexMatch
+                               String "${var:bcdDevice}"
+                               Regex "(09[0-6].|097[0-9a])"
+                       }
+                       True.Define.DirectPlaybackChannels 24
+               }
+               If.fwc {
+                       # bcdNumbers 0000-08ff, 0900-097a
+                       Condition {
+                               Type RegexMatch
+                               String "${var:bcdDevice}"
+                               Regex "(0[0-8]..|09[0-6].|097[0-9a])"
+                       }
+                       True.Define.DirectCaptureChannels 20
+               }
        }
 }