From e3636a0e75512f8fab5aa669930920499c9175ee Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Mon, 23 May 2022 14:34:50 +0200 Subject: [PATCH] USB-Audio: Arturia Minifuse 2 - rewrite to use the SplitPCM macros More minor cleanups: - use the standard UCM device names (see use-case.h) - add ConflictingDevice to Mic1 and Mic2 - try to avoid duplicate priorities Signed-off-by: Jaroslav Kysela --- ucm2/USB-Audio/Arturia/Minifuse-2-HiFi.conf | 250 +++++++++----------- 1 file changed, 108 insertions(+), 142 deletions(-) diff --git a/ucm2/USB-Audio/Arturia/Minifuse-2-HiFi.conf b/ucm2/USB-Audio/Arturia/Minifuse-2-HiFi.conf index 282fb5e..1343220 100644 --- a/ucm2/USB-Audio/Arturia/Minifuse-2-HiFi.conf +++ b/ucm2/USB-Audio/Arturia/Minifuse-2-HiFi.conf @@ -1,179 +1,145 @@ -LibraryConfig.pcm.Config { - - pcm.minifuse2_stereo_p { - @args [ CARD CHN0 CHN1 ] - @args { - CARD.type string - CHN0.type integer - CHN1.type integer - } - type dshare - ipc_key 583542 - slave { - pcm { - type hw - card $CARD - device 0 - } - channels 4 +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 } - bindings.0 $CHN0 - bindings.1 $CHN1 } - - pcm.minifuse2_stereo_c { - @args [ CARD CHN0 CHN1 ] - @args { - CARD.type string - CHN0.type integer - CHN1.type integer + { + SplitPCM { + Name "minifuse2_stereo_in" + Direction Capture + Channels 2 + HWChannels 4 + HWChannelPos0 FL + HWChannelPos1 FR + HWChannelPos2 FL + HWChannelPos3 FR } - type dsnoop - ipc_key 583542 - slave { - pcm { - type hw - card $CARD - device 0 - } - channels 4 - } - bindings.0 $CHN0 - bindings.1 $CHN1 } - - pcm.minifuse2_mono_c { - @args [ CARD CHN0 ] - @args { - CARD.type string - CHN0.type integer - } - type dsnoop - ipc_key 583542 - slave { - pcm { - type hw - card $CARD - device 0 - } - channels 4 + { + SplitPCM { + Name "minifuse2_mono_in" + Direction Capture + Channels 1 + HWChannels 4 + HWChannelPos0 MONO + HWChannelPos1 MONO + HWChannelPos2 MONO + HWChannelPos3 MONO } - bindings.0 $CHN0 } +] - pcm.minifuse2_main_p { - @args [ CARD ] - @args.CARD.type string - type empty - slave.pcm { - @func concat - strings [ "minifuse2_stereo_p:" $CARD ",0,1" ] - } - } - - pcm.minifuse2_loopback_p { - @args [ CARD ] - @args.CARD.type string - type empty - slave.pcm { - @func concat - strings [ "minifuse2_stereo_p:" $CARD ",2,3" ] - } - } +SectionDevice."Line1" { + Comment "Main Output L/R" - pcm.minifuse2_loopback_c { - @args [ CARD ] - @args.CARD.type string - type empty - slave.pcm { - @func concat - strings [ "minifuse2_stereo_c:" $CARD ",2,3" ] - } - } - - pcm.minifuse2_mic1_c { - @args [ CARD ] - @args.CARD.type string - type empty - slave.pcm { - @func concat - strings [ "minifuse2_mono_c:" $CARD ",0" ] - } - } - - pcm.minifuse2_mic2_c { - @args [ CARD ] - @args.CARD.type string - type empty - slave.pcm { - @func concat - strings [ "minifuse2_mono_c:" $CARD ",1" ] - } - } - - pcm.minifuse2_combo_c { - @args [ CARD ] - @args.CARD.type string - type empty - slave.pcm { - @func concat - strings [ "minifuse2_stereo_c:" $CARD ",0,1" ] - } - } -} - -SectionDevice."Main" { - Comment "Main Playback L/R" Value { PlaybackPriority 300 - PlaybackChannels 2 - PlaybackPCM "minifuse2_main_p:${CardId}" } -} - -SectionDevice."Loopback_p" { - Comment "Loopback Playback L/R" - Value { - PlaybackPriority 200 - PlaybackChannels 2 - PlaybackPCM "minifuse2_loopback_p:${CardId}" + Macro.pcm_split.SplitPCMDevice { + Name "minifuse2_stereo_out" + Direction Playback + HWChannels 4 + Channels 2 + Channel0 0 + Channel1 1 + ChannelPos0 FL + ChannelPos1 FR } } -SectionDevice."Loopback_c" { - Comment "Loopback Capture L/R" +SectionDevice."Line2" { + Comment "Loopback L/R" + Value { + PlaybackPriority 200 CapturePriority 200 - CaptureChannels 2 - CapturePCM "minifuse2_loopback_c:${CardId}" + } + 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."Combo_c" { - Comment "Stereo Capture 1+2 L/R" +SectionDevice."Line3" { + Comment "Stereo Input 1+2 L/R" + Value { CapturePriority 100 - CaptureChannels 2 - CapturePCM "minifuse2_combo_c:${CardId}" + } + 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 300 - CaptureChannels 1 - CapturePCM "minifuse2_mic1_c:${CardId}" + 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 200 - CaptureChannels 1 - CapturePCM "minifuse2_mic2_c:${CardId}" + CapturePriority 300 + } + Macro.pcm_split2.SplitPCMDevice { + Name "minifuse2_mono_in" + Direction Capture + HWChannels 4 + Channels 1 + Channel0 1 + ChannelPos0 MONO } } -- 2.47.1