]> git.alsa-project.org Git - alsa-ucm-conf.git/commitdiff
HDA-analog: Use phantom jacks to determine the device for single output
authorJaroslav Kysela <perex@perex.cz>
Mon, 12 Jan 2026 13:55:49 +0000 (14:55 +0100)
committerJaroslav Kysela <perex@perex.cz>
Mon, 12 Jan 2026 13:59:39 +0000 (14:59 +0100)
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>
ucm2/HDA/HiFi-analog.conf

index e7e4aff715eb4260d1ba1486c2d4966423583cd8..894d026e34acc57024e56112eebf55d88c5f6017 100644 (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"
+               }
        }
 }