]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
USB-Audio: add MOTU M2 config
authorThomas <thomas.weisshaar@proton.me>
Sun, 17 Jul 2022 22:49:10 +0000 (23:49 +0100)
committerJaroslav Kysela <perex@perex.cz>
Tue, 26 Jul 2022 09:16:46 +0000 (11:16 +0200)
MOTU M2 and M4 has similiar USB ID. Use the long card name to
identify the M4 variant.

Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/191
Fixes: https://github.com/alsa-project/alsa-ucm-conf/issues/190
Signed-off-by: Thomas Weisshaar <thomas.weisshaar@proton.me>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/MOTU/M2-HiFi.conf [new file with mode: 0644]
ucm2/USB-Audio/MOTU/M2.conf [new file with mode: 0644]
ucm2/USB-Audio/USB-Audio.conf

diff --git a/ucm2/USB-Audio/MOTU/M2-HiFi.conf b/ucm2/USB-Audio/MOTU/M2-HiFi.conf
new file mode 100644 (file)
index 0000000..bca8ff7
--- /dev/null
@@ -0,0 +1,87 @@
+Include.pcm_split.File "/common/pcm/split.conf"
+
+Macro [
+       {
+               SplitPCM {
+                       Name "m2_mono_in"
+                       Direction Capture
+                       Channels 1
+                       HWChannels 2
+                       HWChannelPos0 MONO
+                       HWChannelPos1 MONO
+               }
+       }
+       {
+               SplitPCM {
+                       Name "m2_stereo_in"
+                       Direction Capture
+                       Channels 2
+                       HWChannels 2
+                       HWChannelPos0 FL
+                       HWChannelPos1 FR
+               }
+       }
+]
+
+SectionDevice."Line1" {
+       Comment "Headphone + Monitor Out"
+       Value {
+               PlaybackPriority 200
+               PlaybackPCM "hw:${CardId}"
+       }
+}
+
+SectionDevice."Mic1" {
+       Comment "Mic In 1L"
+
+       Value {
+               CapturePriority 200
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "m2_mono_in"
+               Direction Capture
+               HWChannels 2
+               Channels 1
+               Channel0 0
+               ChannelPos0 MONO
+       }
+}
+
+SectionDevice."Mic2" {
+       Comment "Mic In 2R"
+
+       Value {
+               CapturePriority 100
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "m2_mono_in"
+               Direction Capture
+               HWChannels 2
+               Channels 1
+               Channel0 1
+               ChannelPos0 MONO
+       }
+}
+
+SectionDevice."Mic3" {
+       Comment "Stereo Mic In 1L+2R"
+
+       ConflictingDevice [
+               "Mic1"
+               "Mic2"
+       ]
+
+       Value {
+               CapturePriority 100
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "m2_stereo_in"
+               Direction Capture
+               HWChannels 2
+               Channels 2
+               Channel0 0
+               Channel1 1
+               ChannelPos0 FL
+               ChannelPos1 FR
+       }
+}
diff --git a/ucm2/USB-Audio/MOTU/M2.conf b/ucm2/USB-Audio/MOTU/M2.conf
new file mode 100644 (file)
index 0000000..9c4bc76
--- /dev/null
@@ -0,0 +1,12 @@
+Comment "MOTU M2"
+
+SectionUseCase."HiFi" {
+       Comment "Analog Stereo Outputs + Inputs"
+       File "/USB-Audio/MOTU/M2-HiFi.conf"
+}
+
+Define.DirectPlaybackChannels 2
+Define.DirectCaptureChannels 2
+
+Include.dhw.File "/common/direct.conf"
+
index 1f5bf0054d13c4e85a5d3b993646899e9b3a9deb..7d9b72bc81d21f18eca7f734d635dae71c65aa6c 100644 (file)
@@ -65,13 +65,21 @@ If.steinberg-ur44 {
        True.Define.ProfileName "Steinberg/UR44"
 }
 
-If.M4 {
+If.motu-m24 {
        Condition {
                Type String
                Haystack "${CardComponents}"
                Needle "USB07fd:000b"
        }
-       True.Define.ProfileName "MOTU/M4"
+       True.If.M4 {
+               Condition {
+                       Type String
+                       Haystack "${CardLongName}"
+                       Needle "MOTU M4"
+               }
+               True.Define.ProfileName "MOTU/M4"
+               False.Define.ProfileName "MOTU/M2"
+       }
 }
 
 If.dell-wd15 {