From 637959e48ad8ed1e2a2f6c6501c938129cdee511 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 5 Jan 2026 16:24:13 +0100 Subject: [PATCH] USB-Audio: Scarlett 18i20 gen4 - improve channel detection 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 --- ucm2/USB-Audio/Focusrite/Scarlett-18i20.conf | 30 +++++++++++++++++--- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-18i20.conf b/ucm2/USB-Audio/Focusrite/Scarlett-18i20.conf index 8bed7ea..cbc581c 100644 --- a/ucm2/USB-Audio/Focusrite/Scarlett-18i20.conf +++ b/ucm2/USB-Audio/Focusrite/Scarlett-18i20.conf @@ -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 + } } } -- 2.47.3