From d57d800c6a5a77e6c475719b0297bebb098f7533 Mon Sep 17 00:00:00 2001 From: Maciej Strozek Date: Tue, 9 Dec 2025 13:00:44 +0000 Subject: [PATCH] sof-soundwire: third fix for multi-codec Ensure MultiCodec-based actions are only done when MultiCodec1 is not empty Closes: https://github.com/alsa-project/alsa-ucm-conf/pull/658 Signed-off-by: Maciej Strozek Signed-off-by: Jaroslav Kysela --- ucm2/sof-soundwire/sof-soundwire.conf | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/ucm2/sof-soundwire/sof-soundwire.conf b/ucm2/sof-soundwire/sof-soundwire.conf index 7f9c7dc..895f479 100644 --- a/ucm2/sof-soundwire/sof-soundwire.conf +++ b/ucm2/sof-soundwire/sof-soundwire.conf @@ -72,8 +72,9 @@ If.multi_init { If.multi_speaker { Condition { Type RegexMatch - Regex "(${var:MultiCodec1}(-sdca)?)" - String "${var:SpeakerCodec1}" + # guard with "=" to avoid empty string matching + Regex "=(${var:MultiCodec1}(-sdca)?)=" + String "=${var:SpeakerCodec1}=" } True { Define.SpeakerCodec1 "" @@ -83,8 +84,9 @@ If.multi_speaker { If.multi_mic { Condition { Type RegexMatch - Regex "(${var:MultiCodec1}(-sdca)?)" - String "${var:MicCodec1}" + # guard with "=" to avoid empty string matching + Regex "=(${var:MultiCodec1}(-sdca)?)=" + String "=${var:MicCodec1}=" } True { Define.MicCodec1 "" @@ -94,8 +96,9 @@ If.multi_mic { If.multi_headset { Condition { Type RegexMatch - Regex "(${var:MultiCodec1}(-sdca)?)" - String "${var:HeadsetCodec1}" + # guard with "=" to avoid empty string matching + Regex "=(${var:MultiCodec1}(-sdca)?)=" + String "=${var:HeadsetCodec1}=" } True { Define.HeadsetCodec1 "" -- 2.47.3