]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
USB-Audio: Improve support for Focusrite 4th Gen devices
authorJaroslav Kysela <perex@perex.cz>
Mon, 10 Mar 2025 16:11:49 +0000 (17:11 +0100)
committerJaroslav Kysela <perex@perex.cz>
Sat, 15 Mar 2025 14:24:37 +0000 (15:24 +0100)
There are 4 capture channels (additional ones for mixer monitor).

Closes: https://github.com/alsa-project/alsa-ucm-conf/issues/515
Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/516
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf
ucm2/USB-Audio/Focusrite/Scarlett-2i-gen4-HiFi.conf [new file with mode: 0644]
ucm2/USB-Audio/Focusrite/Scarlett-2i.conf

index 0484dc78ff022b536977c86a6ca81b4e94b4c850..0fdd55c42f2b4fca027e7dfb8131b59fee6e525d 100644 (file)
@@ -14,7 +14,7 @@ Macro [
        }
 ]
 
-If.2i4 {
+If.pch4 {
        Condition {
                Type String
                String1 "${var:PlaybackChannels}"
@@ -65,7 +65,7 @@ SectionDevice."Line1" {
        }
 }
 
-If.2i4 {
+If.line2 {
        Condition {
                Type String
                String1 "${var:PlaybackChannels}"
diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen4-HiFi.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i-gen4-HiFi.conf
new file mode 100644 (file)
index 0000000..087239b
--- /dev/null
@@ -0,0 +1,124 @@
+Include.pcm_split.File "/common/pcm/split.conf"
+
+Macro [
+       {
+               SplitPCM {
+                       Name "scarlett2i_mono_in"
+                       Direction Capture
+                       Format S32_LE
+                       Channels 1
+                       HWChannels 4
+                       HWChannelPos0 MONO
+                       HWChannelPos1 MONO
+               }
+       }
+       {
+               SplitPCM {
+                       Name "scarlett2i_stereo_in"
+                       Direction Capture
+                       Format S32_LE
+                       Channels 2
+                       HWChannels 4
+                       HWChannelPos0 MONO
+                       HWChannelPos1 MONO
+                       HWChannelPos2 FL
+                       HWChannelPos3 FR
+               }
+       }
+]
+
+SectionDevice."Line1" {
+       Comment "${var:Playback1Name}"
+
+       Value {
+               PlaybackPriority 200
+               PlaybackPCM "hw:${CardId}"
+       }
+}
+
+SectionDevice."Mic1" {
+       Comment "${var:Capture1Name}"
+
+       Value {
+               CapturePriority 500
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "scarlett2i_mono_in"
+               Direction Capture
+               HWChannels 4
+               Channels 1
+               Channel0 0
+               ChannelPos0 MONO
+       }
+}
+
+SectionDevice."Mic2" {
+       Comment "${var:Capture2Name}"
+
+       Value {
+               CapturePriority 400
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "scarlett2i_mono_in"
+               Direction Capture
+               HWChannels 4
+               Channels 1
+               Channel0 1
+               ChannelPos0 MONO
+       }
+}
+
+SectionDevice."Line2" {
+       Comment "Monitor Input 3+4 (stereo)"
+
+       ConflictingDevice [
+               "Line3"
+               "Line4"
+       ]
+
+       Value {
+               CapturePriority 300
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "scarlett2i_stereo_in"
+               Direction Capture
+               HWChannels 4
+               Channels 2
+               Channel0 2
+               Channel1 3
+               ChannelPos0 FL
+               ChannelPos1 FR
+       }
+}
+
+SectionDevice."Line3" {
+       Comment "Monitor Input 3"
+
+       Value {
+               CapturePriority 200
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "scarlett2i_mono_in"
+               Direction Capture
+               HWChannels 4
+               Channels 1
+               Channel0 2
+               ChannelPos0 MONO
+       }
+}
+
+SectionDevice."Line4" {
+       Comment "Monitor Input 4"
+
+       Value {
+               CapturePriority 100
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "scarlett2i_mono_in"
+               Direction Capture
+               HWChannels 4
+               Channels 1
+               Channel0 3
+               ChannelPos0 MONO
+       }
+}
index fa032297c8b6cee5640aac5f78bf95cac5dabfe2..a27c7f9110f2bf8966147bf7e3f46d47f9cabc60 100644 (file)
@@ -1,13 +1,14 @@
 Define {
        PlaybackChannels 2
-       DirectPlaybackChannels 2
-       DirectCaptureChannels 2
+       CaptureChannels 2
        Model "2i2"
        Playback1Name "Headphones / Line 1-2"
        Playback2Name "Line 3-4"
        Capture1Name "Input 1 Mic/Inst/Line"
        Capture2Name "Input 2 Mic/Inst/Line"
+       CaptureMonitor ""
        Generation "1st"
+       Profile "Scarlett-2i-HiFi"
 }
 
 If.solo {
@@ -55,20 +56,47 @@ If.gen3 {
        True.Define.Generation "3rd"
 }
 
-If.gen4 {
+If.gen4-solo {
        Condition {
                Type RegexMatch
                String "${CardComponents}"
-               Regex "USB1235:821[89]"
+               Regex "USB1235:8218"
+       }
+       True.Define {
+               Generation "4th"
+               Capture1Name "Input 1 Inst/Line"
+               Capture2Name "Input 2 Mic"
+               CaptureChannels 4
+               Profile "Scarlett-2i-gen4-HiFi"
+       }
+}
+
+If.gen4-2i2 {
+       Condition {
+               Type RegexMatch
+               String "${CardComponents}"
+               Regex "USB1235:8219"
+       }
+       True.Define {
+               Generation "4th"
+               CaptureChannels 4
+               Profile "Scarlett-2i-gen4-HiFi"
        }
-       True.Define.Generation "4th"
 }
 
 Comment "Focusrite Scarlett ${var:Model} ${var:Generation} Gen"
 
 SectionUseCase."HiFi" {
        Comment "Default"
-       File "/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf"
+       File "/USB-Audio/Focusrite/${var:Profile}.conf"
+}
+
+If.dhw {
+       Condition { Type AlwaysTrue }
+       True.Define {
+               DirectPlaybackChannels "${var:PlaybackChannels}"
+               DirectCaptureChannels "${var:CaptureChannels}"
+       }
 }
 
 Include.dhw.File "/common/direct.conf"