From ca19a6d56437b81827cbf213ce9fe3b16b1a090a Mon Sep 17 00:00:00 2001 From: Patrick Lang Date: Mon, 22 Aug 2022 23:03:43 -0700 Subject: [PATCH] USB-Audio: Adding Focusrite Scarlett 2i4 gen2 Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/203 Signed-off-by: Patrick Lang Signed-off-by: Jaroslav Kysela --- .../Focusrite/Scarlett-2i4-gen2-HiFi.conf | 95 +++++++++++++++++++ .../Focusrite/Scarlett-2i4-gen2.conf | 11 +++ ucm2/USB-Audio/USB-Audio.conf | 11 +++ 3 files changed, 117 insertions(+) create mode 100644 ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf create mode 100644 ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf new file mode 100644 index 0000000..5ee5076 --- /dev/null +++ b/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf @@ -0,0 +1,95 @@ +Include.pcm_split.File "/common/pcm/split.conf" + +Macro [ + { + SplitPCM { + Name "scarlett2i4_stereo_out" + Direction Playback + Format S32_LE + Channels 2 + HWChannels 4 + HWChannelPos0 FL + HWChannelPos1 FR + HWChannelPos2 FL + HWChannelPos3 FR + } + } + { + SplitPCM { + Name "scarlett2i4_mono_in" + Direction Capture + Format S32_LE + Channels 1 + HWChannels 2 + HWChannelPos0 MONO + HWChannelPos1 MONO + } + } +] + +SectionDevice."Line1" { + Comment "Line 1-2" + Value { + PlaybackPriority 200 + } + Macro.pcm_split.SplitPCMDevice { + Name "scarlett2i4_stereo_out" + Direction Playback + HWChannels 4 + Channels 2 + Channel0 0 + Channel1 1 + ChannelPos0 FL + ChannelPos1 FR + } +} + +SectionDevice."Line2" { + Comment "Line 3-4" + + Value { + PlaybackPriority 100 + } + Macro.pcm_split.SplitPCMDevice { + Name "scarlett2i4_stereo_out" + Direction Playback + HWChannels 4 + Channels 2 + Channel0 2 + Channel1 3 + ChannelPos0 FL + ChannelPos1 FR + } +} + +SectionDevice."Mic1" { + Comment "Input 1" + + Value { + CapturePriority 200 + } + Macro.pcm_split.SplitPCMDevice { + Name "scarlett2i4_mono_in" + Direction Capture + HWChannels 2 + Channels 1 + Channel0 0 + ChannelPos0 MONO + } +} + +SectionDevice."Mic2" { + Comment "Input 2" + + Value { + CapturePriority 100 + } + Macro.pcm_split.SplitPCMDevice { + Name "scarlett2i4_mono_in" + Direction Capture + HWChannels 2 + Channels 1 + Channel0 1 + ChannelPos0 MONO + } +} diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf new file mode 100644 index 0000000..ffc296d --- /dev/null +++ b/ucm2/USB-Audio/Focusrite/Scarlett-2i4-gen2.conf @@ -0,0 +1,11 @@ +Comment "Focusrite Scarlett 2i4 Gen 2" + +SectionUseCase."HiFi" { + Comment "Default" + File "/USB-Audio/Focusrite/Scarlett-2i4-gen2-HiFi.conf" +} + +Define.DirectPlaybackChannels 4 +Define.DirectCaptureChannels 2 + +Include.dhw.File "/common/direct.conf" diff --git a/ucm2/USB-Audio/USB-Audio.conf b/ucm2/USB-Audio/USB-Audio.conf index 5bdcf0c..673ebdb 100644 --- a/ucm2/USB-Audio/USB-Audio.conf +++ b/ucm2/USB-Audio/USB-Audio.conf @@ -120,6 +120,17 @@ If.goxlr { True.Define.ProfileName "GoXLR/GoXLR" } +If.focusrite-scarlett-2i4-gen2 { + Condition { + Type String + Haystack "${CardComponents}" + Needle "USB1235:8200" + } + True.Define { + ProfileName "Focusrite/Scarlett-2i4-gen2" + } +} + If.behringer-umc204hd { Condition { Type String -- 2.47.1