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 <d.a.thegreat123@gmail.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
dathegreat 2025-12-14 18:24:03 -07:00 committed by Jaroslav Kysela
commit 286507eea2
2 changed files with 51 additions and 32 deletions

View file

@ -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

View file

@ -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"