From: Jaroslav Kysela Date: Mon, 12 Jan 2026 13:55:49 +0000 (+0100) Subject: HDA-analog: Use phantom jacks to determine the device for single output X-Git-Tag: v1.2.15.3~2 X-Git-Url: https://git.alsa-project.org/?a=commitdiff_plain;h=4ead6a971c8df45a036739cdc0aca227a6650072;p=alsa-ucm-conf.git HDA-analog: Use phantom jacks to determine the device for single output Improve previous commit (change) to determine the output type (device). Link: https://github.com/alsa-project/alsa-ucm-conf/issues/685 Signed-off-by: Jaroslav Kysela --- diff --git a/ucm2/HDA/HiFi-analog.conf b/ucm2/HDA/HiFi-analog.conf index e7e4aff..894d026 100644 --- a/ucm2/HDA/HiFi-analog.conf +++ b/ucm2/HDA/HiFi-analog.conf @@ -86,12 +86,35 @@ If.outnone { Type String Empty "${var:hpvol}${var:spkvol}${var:lovol}" } - True.If.master { - Condition { - Type ControlExists - Control "name='Master Playback Switch'" + True { + If.spk { + Condition { + Type ControlExists + Control "iface=CARD,name='Speaker Phantom Jack'" + } + True.Define.spkvol "Master" + } + If.line { + Condition { + Type ControlExists + Control "iface=CARD,name='Line Phantom Jack'" + } + True.Define.lovol "Master" + } + If.lineout { + Condition { + Type ControlExists + Control "iface=CARD,name='Line Out Phantom Jack'" + } + True.Define.lovol "Master" + } + If.last { + Condition { + Type ControlExists + Control "name='Master Playback Switch'" + } + True.Define.hpvol "Master" } - True.Define.hpvol "Master" } } @@ -177,10 +200,18 @@ If.spk { PlaybackPriority 100 PlaybackPCM "hw:${CardId}" PlaybackMixerElem "${var:spkvol}" - PlaybackMasterElem "Master" PlaybackVolume "${var:spkvol} Playback Volume" PlaybackSwitch "${var:spkvol} Playback Switch" } + + If.master { + Condition { + Type String + String1 "${var:spkvol}" + String2 "Master" + } + False.Value.PlaybackMasterElem "Master" + } } } @@ -222,11 +253,19 @@ If.line { PlaybackPriority 300 PlaybackPCM "hw:${CardId}" PlaybackMixerElem "${var:lovol}" - PlaybackMasterElem "Master" PlaybackVolume "${var:lovol} Playback Volume" PlaybackSwitch "${var:loctl} Playback Switch" JackControl "${var:loctl} Jack" } + + If.master { + Condition { + Type String + String1 "${var:lovol}" + String2 "Master" + } + False.Value.PlaybackMasterElem "Master" + } } }