From: Jaroslav Kysela Date: Mon, 5 Jan 2026 15:24:13 +0000 (+0100) Subject: USB-Audio: Scarlett 18i20 gen4 - improve channel detection X-Git-Tag: v1.2.15.2~4 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=637959e48ad8ed1e2a2f6c6501c938129cdee511;p=alsa-ucm-conf.git 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 --- 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 + } } }