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 <perex@perex.cz>
This commit is contained in:
Jaroslav Kysela 2026-01-12 14:55:49 +01:00
commit 4ead6a971c

View file

@ -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"
}
}
}