]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
USB-Audio: Do not use 4ch playback stream for stereo Focusrite Scarlet devices
authorJaroslav Kysela <perex@perex.cz>
Thu, 29 Jun 2023 16:08:03 +0000 (18:08 +0200)
committerJaroslav Kysela <perex@perex.cz>
Thu, 29 Jun 2023 16:09:02 +0000 (18:09 +0200)
Link: https://github.com/alsa-project/alsa-ucm-conf/pull/309
Link: https://github.com/alsa-project/alsa-ucm-conf/issues/329
Link: https://github.com/alsa-project/alsa-ucm-conf/issues/314
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf

index d370c2e81fb12e7a8267b5b0486103fab63525dd..0484dc78ff022b536977c86a6ca81b4e94b4c850 100644 (file)
@@ -1,19 +1,6 @@
 Include.pcm_split.File "/common/pcm/split.conf"
 
 Macro [
-       {
-               SplitPCM {
-                       Name "scarlett2i_stereo_out"
-                       Direction Playback
-                       Format S32_LE
-                       Channels 2
-                       HWChannels 4
-                       HWChannelPos0 FL
-                       HWChannelPos1 FR
-                       HWChannelPos2 FL
-                       HWChannelPos3 FR
-               }
-       }
        {
                SplitPCM {
                        Name "scarlett2i_mono_in"
@@ -27,21 +14,54 @@ Macro [
        }
 ]
 
+If.2i4 {
+       Condition {
+               Type String
+               String1 "${var:PlaybackChannels}"
+               String2 "4"
+       }
+       True.Macro [
+               {
+                       SplitPCM {
+                               Name "scarlett2i_stereo_out"
+                               Direction Playback
+                               Format S32_LE
+                               Channels 2
+                               HWChannels 4
+                               HWChannelPos0 FL
+                               HWChannelPos1 FR
+                               HWChannelPos2 FL
+                               HWChannelPos3 FR
+                       }
+               }
+       ]
+}
+
 SectionDevice."Line1" {
        Comment "${var:Playback1Name}"
 
        Value {
                PlaybackPriority 200
        }
-       Macro.pcm_split.SplitPCMDevice {
-               Name "scarlett2i_stereo_out"
-               Direction Playback
-               HWChannels 4
-               Channels 2
-               Channel0 0
-               Channel1 1
-               ChannelPos0 FL
-               ChannelPos1 FR
+       If.2i4 {
+               Condition {
+                       Type String
+                       String1 "${var:PlaybackChannels}"
+                       String2 "4"
+               }
+               True.Macro.pcm_split.SplitPCMDevice {
+                       Name "scarlett2i_stereo_out"
+                       Direction Playback
+                       HWChannels 4
+                       Channels 2
+                       Channel0 0
+                       Channel1 1
+                       ChannelPos0 FL
+                       ChannelPos1 FR
+               }
+               False.Value {
+                       PlaybackPCM "hw:${CardId}"
+               }
        }
 }