# Generic HDA devices for analog I/O
Define.LineDevice ""
+Define.spkvol "Speaker"
Define.hpvol "Headphone"
Define.hpjack "Headphone Jack"
Define.loctl "Line"
}
}
+If.nolineout {
+ Condition {
+ Type ControlExists
+ Control "name='Line Playback Switch'"
+ }
+ False.Define {
+ loctl ""
+ lovol ""
+ }
+}
+
If.lineout {
Condition {
Type ControlExists
- Control "name='Line Out Playback Volume'"
+ Control "name='Line Out Playback Switch'"
}
True.Define {
loctl "Line Out"
}
}
+If.spkvol {
+ Condition {
+ Type ControlExists
+ Control "name='Speaker Playback Switch'"
+ }
+ False.Define.spkvol ""
+}
+
+If.outnone {
+ Condition {
+ Type String
+ Empty "${var:hpvol}${var:spkvol}${var:lovol}"
+ }
+ True.If.master {
+ Condition {
+ Type ControlExists
+ Control "name='Master Playback Switch'"
+ }
+ True.Define.hpvol "Master"
+ }
+}
+
If.hp {
Condition {
Type String
PlaybackPriority 200
PlaybackPCM "hw:${CardId}"
PlaybackMixerElem "${var:hpvol}"
- PlaybackMasterElem "Master"
PlaybackVolume "${var:hpvol} Playback Volume"
- PlaybackSwitch "Headphone Playback Switch"
+ PlaybackSwitch "${var:hpvol} Playback Switch"
JackControl "${var:hpjack}"
}
+
+ If.master {
+ Condition {
+ Type String
+ String1 "${var:hpvol}"
+ String2 "Master"
+ }
+ False.Value.PlaybackMasterElem "Master"
+ }
}
}
If.spk {
Condition {
- Type ControlExists
- Control "name='Speaker Playback Switch'"
+ Type String
+ Empty "${var:spkvol}"
}
- True.SectionDevice."Speaker" {
+ False.SectionDevice."Speaker" {
Comment "Speaker"
If.seq {
}
False {
EnableSequence [
- cset "name='Speaker Playback Switch' on"
+ cset "name='${var:spkvol} Playback Switch' on"
]
DisableSequence [
- cset "name='Speaker Playback Switch' off"
+ cset "name='${var:spkvol} Playback Switch' off"
]
}
}
Value {
PlaybackPriority 100
PlaybackPCM "hw:${CardId}"
- PlaybackMixerElem "Speaker"
+ PlaybackMixerElem "${var:spkvol}"
PlaybackMasterElem "Master"
- PlaybackVolume "Speaker Playback Volume"
- PlaybackSwitch "Speaker Playback Switch"
+ PlaybackVolume "${var:spkvol} Playback Volume"
+ PlaybackSwitch "${var:spkvol} Playback Switch"
}
}
}
If.line {
Condition {
- Type ControlExists
- Control "name='${var:loctl} Playback Switch'"
+ Type String
+ Empty "${var:loctl}"
}
- True.SectionDevice."Line${var:LineDevice}" {
+ False.SectionDevice."Line${var:LineDevice}" {
Comment "Line Output"
If.conflict {
# Merge this to Headpones subtree in HDA/HiFi-analog.conf
If.hp {
Condition {
- Type ControlExists
- Control "name='Headphone Playback Switch'"
+ Type String
+ Empty "${var:hpvol}"
}
True.SectionDevice."Headphones" {
Macro.headphone.SofAnalogPlaybackControl "endpoint=Headphone drcswitch=off"
# Merge this to Speaker subtree in HDA/HiFi-analog.conf
If.spk {
Condition {
- Type ControlExists
- Control "name='Speaker Playback Switch'"
+ Type String
+ Empty "${var:spkvol}"
}
True.SectionDevice."Speaker" {
Macro.speaker.SofAnalogPlaybackControl "endpoint=Speaker drcswitch=on"