From d42e1d149ba14084617819b85ef3cb824d177112 Mon Sep 17 00:00:00 2001 From: Jaroslav Kysela Date: Thu, 29 Jun 2023 18:08:03 +0200 Subject: [PATCH] USB-Audio: Do not use 4ch playback stream for stereo Focusrite Scarlet devices 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 --- .../USB-Audio/Focusrite/Scarlett-2i-HiFi.conf | 64 ++++++++++++------- 1 file changed, 42 insertions(+), 22 deletions(-) diff --git a/ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf b/ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf index d370c2e..0484dc7 100644 --- a/ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf +++ b/ucm2/USB-Audio/Focusrite/Scarlett-2i-HiFi.conf @@ -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}" + } } } -- 2.47.1