From: Jaroslav Kysela Date: Mon, 3 Aug 2026 10:45:57 +0000 (+0200) Subject: ALSA: hda: mic: fix HDAMicEnum macro X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=441f0a2581edb2f3417860b33bc1a7ff7fd3be10;p=alsa-ucm-conf.git ALSA: hda: mic: fix HDAMicEnum macro Expose devices only for existing enums in the source control. Signed-off-by: Jaroslav Kysela --- diff --git a/ucm2/HDA/HiFi-mic.conf b/ucm2/HDA/HiFi-mic.conf index e084700..f6b3f4b 100644 --- a/ucm2/HDA/HiFi-mic.conf +++ b/ucm2/HDA/HiFi-mic.conf @@ -115,35 +115,44 @@ If.micdevs { # Comment - Long name of the SectionDevice # Jack - Jack control if available # Priority - CapturePriority -DefineMacro.HDAMicEnum.SectionDevice."${var:__DevName}" { - Comment "${var:__Comment}" +DefineMacro.HDAMicEnum.If.enum { + Condition { + Type ControlExists + Control "name='${var:SourceControl}'" + ControlEnum "${var:__Enum}" + } + True.SectionDevice."${var:__DevName}" { + Comment "${var:__Comment}" - EnableSequence [ - cset "name='${var:SourceControl}' '${var:__Enum}'" - ] - Value { - CapturePriority "${eval:($__Priority+$MicExtraPriority)}" - CapturePCM "hw:${CardId}" - CaptureMixerElem "Capture" - CaptureVolume "Capture Volume" - CaptureSwitch "Capture Switch" - CaptureMasterElem "${var:__Enum} Boost" - } - If.jack { - Condition { - Type String - Empty "${var:-__Jack}" + + EnableSequence [ + cset "name='${var:SourceControl}' '${var:__Enum}'" + ] + + Value { + CapturePriority "${eval:($__Priority+$MicExtraPriority)}" + CapturePCM "hw:${CardId}" + CaptureMixerElem "Capture" + CaptureVolume "Capture Volume" + CaptureSwitch "Capture Switch" + CaptureMasterElem "${var:__Enum} Boost" + } + If.jack { + Condition { + Type String + Empty "${var:-__Jack}" + } + False.Value.JackControl "${var:__Jack}" } - False.Value.JackControl "${var:__Jack}" - } - ConflictingDevice [ - "Mic:hda-int" - "Mic:hda-hp" - "Mic:hda" - "Headset:hda-mic" - ] + ConflictingDevice [ + "Mic:hda-int" + "Mic:hda-hp" + "Mic:hda" + "Headset:hda-mic" + ] + } } # Macro HDAMicSwitch - Create the SectionDevice for HDA inputs (switches)