From: Jaroslav Kysela Date: Fri, 20 Jun 2025 10:45:46 +0000 (+0200) Subject: codecs/hda/hdmi.conf - add support for zero device X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=alsa-ucm-conf.git codecs/hda/hdmi.conf - add support for zero device 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 --- diff --git a/ucm2/codecs/hda/hdmi.conf b/ucm2/codecs/hda/hdmi.conf index 5bd9f03..f26bdb6 100644 --- a/ucm2/codecs/hda/hdmi.conf +++ b/ucm2/codecs/hda/hdmi.conf @@ -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" } } }