]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
USB-Audio: Add support for Arturia Minifuse 1
authorJaroslav Kysela <perex@perex.cz>
Wed, 19 Oct 2022 07:48:38 +0000 (09:48 +0200)
committerJaroslav Kysela <perex@perex.cz>
Wed, 19 Oct 2022 07:52:03 +0000 (09:52 +0200)
Recode Minifuse 2 config to support Minifuse 1, too.

BugLink: https://github.com/alsa-project/alsa-ucm-conf/issues/220
Fixes: https://github.com/alsa-project/alsa-ucm-conf/pull/226
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/Arturia/Minifuse-12-HiFi.conf [new file with mode: 0644]
ucm2/USB-Audio/Arturia/Minifuse-12.conf [moved from ucm2/USB-Audio/Arturia/Minifuse-2.conf with 67% similarity]
ucm2/USB-Audio/Arturia/Minifuse-2-HiFi.conf [deleted file]
ucm2/USB-Audio/USB-Audio.conf

diff --git a/ucm2/USB-Audio/Arturia/Minifuse-12-HiFi.conf b/ucm2/USB-Audio/Arturia/Minifuse-12-HiFi.conf
new file mode 100644 (file)
index 0000000..644a0bb
--- /dev/null
@@ -0,0 +1,189 @@
+Include.pcm_split.File "/common/pcm/split.conf"
+
+Define {
+       HasLine3 "y"
+       HasMic1 "y"
+       HasMic2 "y"
+}
+
+If.minifuse1 {
+       Condition {
+               Type String
+               Haystack "${CardComponents}"
+               Needle "USB1c75:af80"
+       }
+       True.Define {
+               HasLine3 ""
+               HasMic2 ""
+       }
+}
+
+Macro [
+       {
+               SplitPCM {
+                       Name "minifuse12_stereo_out"
+                       Direction Playback
+                       Channels 2
+                       HWChannels 4
+                       HWChannelPos0 FL
+                       HWChannelPos1 FR
+                       HWChannelPos2 FL
+                       HWChannelPos3 FR
+               }
+       }
+       {
+               SplitPCM {
+                       Name "minifuse12_stereo_in"
+                       Direction Capture
+                       Channels 2
+                       HWChannels 4
+                       HWChannelPos0 FL
+                       HWChannelPos1 FR
+                       HWChannelPos2 FL
+                       HWChannelPos3 FR
+               }
+       }
+       {
+               SplitPCM {
+                       Name "minifuse12_mono_in"
+                       Direction Capture
+                       Channels 1
+                       HWChannels 4
+                       HWChannelPos0 MONO
+                       HWChannelPos1 MONO
+                       HWChannelPos2 MONO
+                       HWChannelPos3 MONO
+               }
+       }
+]
+
+DefineMacro.ConflictingLine3 {
+       If.0 {
+               Condition {
+                       Type String
+                       Empty "${var:HasLine3}"
+               }
+               False.ConflictingDevice [
+                       "Line3"
+               ]
+       }
+}
+
+SectionDevice."Line1" {
+       Comment "Main Output L/R"
+
+       Value {
+               PlaybackPriority 300
+       }
+       Macro.pcm_split.SplitPCMDevice {
+               Name "minifuse12_stereo_out"
+               Direction Playback
+               HWChannels 4
+               Channels 2
+               Channel0 0
+               Channel1 1
+               ChannelPos0 FL
+               ChannelPos1 FR
+       }
+}
+
+SectionDevice."Line2" {
+       Comment "Loopback L/R"
+
+       Value {
+               PlaybackPriority 200
+               CapturePriority 200
+       }
+       Macro.pcm_split1.SplitPCMDevice {
+               Name "minifuse12_stereo_out"
+               Direction Playback
+               HWChannels 4
+               Channels 2
+               Channel0 2
+               Channel1 3
+               ChannelPos0 FL
+               ChannelPos1 FR
+       }
+       Macro.pcm_split2.SplitPCMDevice {
+               Name "minifuse12_stereo_in"
+               Direction Capture
+               HWChannels 4
+               Channels 2
+               Channel0 2
+               Channel1 3
+               ChannelPos0 FL
+               ChannelPos1 FR
+       }
+}
+
+If.line3 {
+       Condition {
+               Type String
+               Empty "${var:HasLine3}"
+       }
+       False.SectionDevice."Line3" {
+               Comment "Stereo Input 1+2 L/R"
+
+               Value {
+                       CapturePriority 100
+               }
+               Macro.pcm_split.SplitPCMDevice {
+                       Name "minifuse12_stereo_in"
+                       Direction Capture
+                       HWChannels 4
+                       Channels 2
+                       Channel0 0
+                       Channel1 1
+                       ChannelPos0 FL
+                       ChannelPos1 FR
+               }
+       }
+}
+
+If.mic1 {
+       Condition {
+               Type String
+               Empty "${var:HasMic1}"
+       }
+       False.SectionDevice."Mic1" {
+               Comment "Mic/Line/Inst 1 (L)"
+
+               Macro.conflict.ConflictingLine3 { }
+
+               Value {
+                       CapturePriority 400
+               }
+               Macro.pcm_split2.SplitPCMDevice {
+                       Name "minifuse12_mono_in"
+                       Direction Capture
+                       HWChannels 4
+                       Channels 1
+                       Channel0 0
+                       ChannelPos0 MONO
+               }
+       }
+}
+
+If.mic2 {
+       Condition {
+               Type String
+               Empty "${var:HasMic2}"
+       }
+       False.SectionDevice."Mic2" {
+               Comment "Mic/Line/Inst 2 (R)"
+
+               Macro.conflict.ConflictingLine3 { }
+
+               Value {
+                       CapturePriority 300
+               }
+               Macro.pcm_split2.SplitPCMDevice {
+                       Name "minifuse12_mono_in"
+                       Direction Capture
+                       HWChannels 4
+                       Channels 1
+                       Channel0 1
+                       ChannelPos0 MONO
+               }
+       }
+}
similarity index 67%
rename from ucm2/USB-Audio/Arturia/Minifuse-2.conf
rename to ucm2/USB-Audio/Arturia/Minifuse-12.conf
index f761d46ff541b40d8548681b029e6ce33e30d428..627ffa95261b6b082e5b69f7117a39c4da0f01d1 100644 (file)
@@ -1,8 +1,8 @@
-Comment "Arturia Minifuse 2"
+Comment "Arturia Minifuse 1/2"
 
 SectionUseCase."HiFi" {
        Comment "Default Alsa Profile"
-       File "/USB-Audio/Arturia/Minifuse-2-HiFi.conf"
+       File "/USB-Audio/Arturia/Minifuse-12-HiFi.conf"
 }
 
 Define.DirectPlaybackChannels 4
diff --git a/ucm2/USB-Audio/Arturia/Minifuse-2-HiFi.conf b/ucm2/USB-Audio/Arturia/Minifuse-2-HiFi.conf
deleted file mode 100644 (file)
index 1343220..0000000
+++ /dev/null
@@ -1,145 +0,0 @@
-Include.pcm_split.File "/common/pcm/split.conf"
-
-Macro [
-       {
-               SplitPCM {
-                       Name "minifuse2_stereo_out"
-                       Direction Playback
-                       Channels 2
-                       HWChannels 4
-                       HWChannelPos0 FL
-                       HWChannelPos1 FR
-                       HWChannelPos2 FL
-                       HWChannelPos3 FR
-               }
-       }
-       {
-               SplitPCM {
-                       Name "minifuse2_stereo_in"
-                       Direction Capture
-                       Channels 2
-                       HWChannels 4
-                       HWChannelPos0 FL
-                       HWChannelPos1 FR
-                       HWChannelPos2 FL
-                       HWChannelPos3 FR
-               }
-       }
-       {
-               SplitPCM {
-                       Name "minifuse2_mono_in"
-                       Direction Capture
-                       Channels 1
-                       HWChannels 4
-                       HWChannelPos0 MONO
-                       HWChannelPos1 MONO
-                       HWChannelPos2 MONO
-                       HWChannelPos3 MONO
-               }
-       }
-]
-
-SectionDevice."Line1" {
-       Comment "Main Output L/R"
-
-       Value {
-               PlaybackPriority 300
-       }
-       Macro.pcm_split.SplitPCMDevice {
-               Name "minifuse2_stereo_out"
-               Direction Playback
-               HWChannels 4
-               Channels 2
-               Channel0 0
-               Channel1 1
-               ChannelPos0 FL
-               ChannelPos1 FR
-       }
-}
-
-SectionDevice."Line2" {
-       Comment "Loopback L/R"
-
-       Value {
-               PlaybackPriority 200
-               CapturePriority 200
-       }
-       Macro.pcm_split1.SplitPCMDevice {
-               Name "minifuse2_stereo_out"
-               Direction Playback
-               HWChannels 4
-               Channels 2
-               Channel0 2
-               Channel1 3
-               ChannelPos0 FL
-               ChannelPos1 FR
-       }
-       Macro.pcm_split2.SplitPCMDevice {
-               Name "minifuse2_stereo_in"
-               Direction Capture
-               HWChannels 4
-               Channels 2
-               Channel0 2
-               Channel1 3
-               ChannelPos0 FL
-               ChannelPos1 FR
-       }
-}
-
-SectionDevice."Line3" {
-       Comment "Stereo Input 1+2 L/R"
-
-       Value {
-               CapturePriority 100
-       }
-       Macro.pcm_split.SplitPCMDevice {
-               Name "minifuse2_stereo_in"
-               Direction Capture
-               HWChannels 4
-               Channels 2
-               Channel0 0
-               Channel1 1
-               ChannelPos0 FL
-               ChannelPos1 FR
-       }
-}
-
-SectionDevice."Mic1" {
-       Comment "Mic/Line/Inst 1 (L)"
-
-       ConflictingDevice [
-               "Line3"
-       ]
-
-       Value {
-               CapturePriority 400
-       }
-       Macro.pcm_split2.SplitPCMDevice {
-               Name "minifuse2_mono_in"
-               Direction Capture
-               HWChannels 4
-               Channels 1
-               Channel0 0
-               ChannelPos0 MONO
-       }
-}
-
-SectionDevice."Mic2" {
-       Comment "Mic/Line/Inst 2 (R)"
-
-       ConflictingDevice [
-               "Line3"
-       ]
-
-       Value {
-               CapturePriority 300
-       }
-       Macro.pcm_split2.SplitPCMDevice {
-               Name "minifuse2_mono_in"
-               Direction Capture
-               HWChannels 4
-               Channels 1
-               Channel0 1
-               ChannelPos0 MONO
-       }
-}
index bea07492d5116a3f3528347bf1ca31c62ca6f2e7..90a88d4557bc38396ed17c896d822db77ea86142 100644 (file)
@@ -224,13 +224,13 @@ If.kontrolz1 {
        True.Define.ProfileName "NativeInstruments/Traktor-Kontrol-Z1"
 }
 
-If.minifuse2 {
+If.minifuse12 {
        Condition {
-               Type String
-               Haystack "${CardComponents}"
-               Needle "USB1c75:af90"
+               Type RegexMatch
+               String "${CardComponents}"
+               Regex "USB1c75:af[89]0"
        }
-       True.Define.ProfileName "Arturia/Minifuse-2"
+       True.Define.ProfileName "Arturia/Minifuse-12"
 }
 
 If.id4-0003 {