]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
chtnau8824: Fix mono speaker config not working
authorHans de Goede <hdegoede@redhat.com>
Sun, 6 Dec 2020 12:47:16 +0000 (13:47 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 14 Dec 2020 08:21:15 +0000 (09:21 +0100)
Fix the Speaker define / var being changed from "Speaker" to "MonoSpeaker"
not having any effect because the variable gets expanded before the if
making the change is interpreted.

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/chtnau8824/HiFi.conf

index 3ccd6b149517d2539b0562b094b47547082f8571..d7a5f63f97740f6932dbf4cb4b808c9e49956759 100644 (file)
@@ -34,8 +34,15 @@ SectionVerb {
        }
 }
 
-Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
-Include.hp.File "/codecs/nau8824/HeadPhones.conf"
+# The includes using $vars in there path must be conditional otherwise the
+# $var gets expanded before the other If-s above can change the vars.
+If.cfg-includes {
+       Condition { Type String Empty "" }
+       True {
+               Include.spk.File "/codecs/nau8824/${var:Speaker}.conf"
+               Include.hp.File "/codecs/nau8824/HeadPhones.conf"
 
-Include.mic.File "/codecs/nau8824/InternalMic.conf"
-Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
+               Include.mic.File "/codecs/nau8824/InternalMic.conf"
+               Include.hsmic.File "/codecs/nau8824/HeadsetMic.conf"
+       }
+}