]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
codecs/hda/hdmi.conf - add support for zero device master
authorJaroslav Kysela <perex@perex.cz>
Fri, 20 Jun 2025 10:45:46 +0000 (12:45 +0200)
committerJaroslav Kysela <perex@perex.cz>
Tue, 24 Jun 2025 13:30:09 +0000 (15:30 +0200)
If device is zero, driver does not append ',pcm=' string to
the mixer control.

Link: https://github.com/alsa-project/alsa-ucm-conf/pull/571
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
ucm2/codecs/hda/hdmi.conf

index 5bd9f03394fa465894d0af1fe75694d7fa9b8b2f..f26bdb649cb7eb058d4397df0555664f14b4098f 100644 (file)
@@ -8,13 +8,22 @@
 #   Priority      UCM device priority
 #
 
-DefineMacro.HDMI.If.hdmi {
-       Condition {
-               Type ControlExists
-               Control "iface=CARD,name='HDMI/DP,pcm=${var:__Device} Jack'"
+DefineMacro.HDMI {
+       If.1 {
+               Condition {
+                       Type RegexMatch
+                       Regex "(^$|0)"
+                       String "${var:-__Device}"
+               }
+               True.Define.__Suffix ""
+               False.Define.__Suffix ",pcm=${var:__Device}"
        }
-       True {
-               SectionDevice."HDMI${var:__Number}" {
+       If.2 {
+               Condition {
+                       Type ControlExists
+                       Control "iface=CARD,name='HDMI/DP${var:__Suffix} Jack'"
+               }
+               True.SectionDevice."HDMI${var:__Number}" {
                        Comment "HDMI / DisplayPort ${var:__Number} Output"
 
                        EnableSequence [
@@ -28,7 +37,7 @@ DefineMacro.HDMI.If.hdmi {
                        Value {
                                PlaybackPriority "${var:__Priority}"
                                PlaybackPCM "hw:${CardId},${var:__Device}"
-                               JackControl "HDMI/DP,pcm=${var:__Device} Jack"
+                               JackControl "HDMI/DP${var:__Suffix} Jack"
                        }
                }
        }