From: dathegreat Date: Mon, 15 Dec 2025 01:24:03 +0000 (-0700) Subject: USB-Audio: Add conditional channel count on Scarlett 18i20 version X-Git-Tag: v1.2.15.2~5 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=286507eea2a739fbbc3e4b05c757fe4fa3b4a33e;p=alsa-ucm-conf.git USB-Audio: Add conditional channel count on Scarlett 18i20 version Link: https://github.com/alsa-project/alsa-ucm-conf/pull/660 Signed-off-by: dathegreat 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 f770cc1..4ad0af1 100644 --- a/ucm2/USB-Audio/Focusrite/Scarlett-18i20-HiFi.conf +++ b/ucm2/USB-Audio/Focusrite/Scarlett-18i20-HiFi.conf @@ -9,7 +9,7 @@ Macro [ Direction Playback Format S24_3LE Channels 2 - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" HWChannelPos0 FL HWChannelPos1 FR HWChannelPos2 FL @@ -38,7 +38,7 @@ Macro [ Direction Capture Format S24_3LE Channels 1 - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" HWChannelPos0 MONO HWChannelPos1 MONO HWChannelPos2 MONO @@ -67,7 +67,7 @@ Macro [ Direction Capture Format S24_3LE Channels 2 - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" HWChannelPos0 FL HWChannelPos1 FR HWChannelPos2 FL @@ -96,7 +96,7 @@ Macro [ Direction Playback Format S24_3LE Channels 8 - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" HWChannelPos0 UNKNOWN HWChannelPos1 UNKNOWN HWChannelPos2 UNKNOWN @@ -125,7 +125,7 @@ Macro [ Direction Capture Format S24_3LE Channels 8 - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" HWChannelPos0 UNKNOWN HWChannelPos1 UNKNOWN HWChannelPos2 UNKNOWN @@ -163,7 +163,7 @@ SectionDevice."Line 1" { Macro.pcm_split.SplitPCMDevice { Name "18i20_stereo_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 2 Channel0 6 Channel1 7 @@ -182,7 +182,7 @@ SectionDevice."Line 2" { Macro.pcm_split.SplitPCMDevice { Name "18i20_stereo_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 2 Channel0 8 Channel1 9 @@ -201,7 +201,7 @@ SectionDevice."Line 3" { Macro.pcm_split.SplitPCMDevice { Name "18i20_stereo_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 2 Channel0 0 Channel1 1 @@ -220,7 +220,7 @@ SectionDevice."Line 4" { Macro.pcm_split.SplitPCMDevice { Name "18i20_stereo_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 2 Channel0 2 Channel1 3 @@ -239,7 +239,7 @@ SectionDevice."Line 5" { Macro.pcm_split.SplitPCMDevice { Name "18i20_stereo_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 2 Channel0 4 Channel1 5 @@ -262,7 +262,7 @@ SectionDevice."Line 6" { Macro.pcm_split.SplitPCMDevice { Name "18i20_stereo_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 2 Channel0 6 Channel1 7 @@ -281,7 +281,7 @@ SectionDevice."Line 7" { Macro.pcm_split.SplitPCMDevice { Name "18i20_stereo_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 2 Channel0 8 Channel1 9 @@ -302,7 +302,7 @@ SectionDevice."Mic 1" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 0 ChannelPos0 MONO @@ -319,7 +319,7 @@ SectionDevice."Mic 2" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 1 ChannelPos0 MONO @@ -336,7 +336,7 @@ SectionDevice."Line 8" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 2 ChannelPos0 MONO @@ -353,7 +353,7 @@ SectionDevice."Line 9" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 3 ChannelPos0 MONO @@ -370,7 +370,7 @@ SectionDevice."Line 10" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 4 ChannelPos0 MONO @@ -387,7 +387,7 @@ SectionDevice."Line 11" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 5 ChannelPos0 MONO @@ -404,7 +404,7 @@ SectionDevice."Line 12" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 6 ChannelPos0 MONO @@ -421,7 +421,7 @@ SectionDevice."Line 13" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 7 ChannelPos0 MONO @@ -440,7 +440,7 @@ SectionDevice."SPDIF 1" { Macro.pcm_split.SplitPCMDevice { Name "18i20_stereo_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 2 Channel0 10 Channel1 11 @@ -461,7 +461,7 @@ SectionDevice."Direct 1" { Macro.pcm_split.SplitPCMDevice { Name "18i20_adat_out" Direction Playback - HWChannels 20 + HWChannels "${var:DirectPlaybackChannels}" Channels 8 Channel0 12 Channel1 13 @@ -494,7 +494,7 @@ SectionDevice."SPDIF 2" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 10 ChannelPos0 MONO @@ -511,7 +511,7 @@ SectionDevice."SPDIF 3" { Macro.pcm_split.SplitPCMDevice { Name "18i20_mono_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 1 Channel0 11 ChannelPos0 MONO @@ -530,7 +530,7 @@ SectionDevice."Direct 2" { Macro.pcm_split.SplitPCMDevice { Name "18i20_adat_in" Direction Capture - HWChannels 20 + HWChannels "${var:DirectCaptureChannels}" Channels 8 Channel0 12 Channel1 13 diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-18i20.conf b/ucm2/USB-Audio/Focusrite/Scarlett-18i20.conf index e25521c..8bed7ea 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 capture channels each: +# The 18i20 provides 20 playback and 18 or 20 capture channels each: # # +----+---------------+-----------------+ # | Ch | Inputs | Outputs | @@ -56,6 +56,19 @@ # Define.Generation "1st" +Define.DirectPlaybackChannels 20 +Define.DirectCaptureChannels 20 # fallback; overridden per generation + +If.gen1 { + Condition { + Type RegexMatch + String "${CardComponents}" + Regex "USB1235:800c" + } + True.Define { + DirectCaptureChannels 18 + } +} If.gen2 { Condition { @@ -63,7 +76,10 @@ If.gen2 { String "${CardComponents}" Regex "USB1235:8201" } - True.Define.Generation "2nd" + True.Define { + Generation "2nd" + DirectCaptureChannels 18 + } } If.gen3 { @@ -72,7 +88,10 @@ If.gen3 { String "${CardComponents}" Regex "USB1235:8215" } - True.Define.Generation "3rd" + True.Define { + Generation "3rd" + DirectCaptureChannels 20 + } } If.gen4 { @@ -81,7 +100,10 @@ If.gen4 { String "${CardComponents}" Regex "USB1235:821d" } - True.Define.Generation "4th" + True.Define { + Generation "4th" + DirectCaptureChannels 20 + } } Comment "Focusrite Scarlett 18i20 ${var:Generation} Gen" @@ -91,7 +113,4 @@ SectionUseCase."HiFi" { File "/USB-Audio/Focusrite/Scarlett-18i20-HiFi.conf" } -Define.DirectPlaybackChannels 20 -Define.DirectCaptureChannels 20 - Include.dhw.File "/common/direct.conf"