This is huge cleanup using new device labels in 'Syntax 8' to remove a lot of conditions. The future extensions will be simplier. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
250 lines
4.3 KiB
Text
250 lines
4.3 KiB
Text
# Generic HDA devices for analog I/O
|
|
|
|
Define.spkvol "Speaker"
|
|
Define.hpvol "Headphone"
|
|
Define.hpjack "Headphone Jack"
|
|
Define.loctl "Line"
|
|
Define.lovol "Line"
|
|
|
|
If.hpjack {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "iface=CARD,name='Headphone Mic Jack'"
|
|
}
|
|
True.Define.hpjack "Headphone Mic Jack"
|
|
False.If.front {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "iface=CARD,name='Front Headphone Jack'"
|
|
}
|
|
True.Define.hpjack "Front Headphone Jack"
|
|
}
|
|
}
|
|
|
|
If.nolineout {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "name='Line Playback Switch'"
|
|
}
|
|
False.Define {
|
|
loctl ""
|
|
lovol ""
|
|
}
|
|
}
|
|
|
|
If.lineout {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "name='Line Out Playback Switch'"
|
|
}
|
|
True.Define {
|
|
loctl "Line Out"
|
|
lovol "Line Out"
|
|
}
|
|
}
|
|
|
|
If.hpvol {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "name='Headphone Playback Switch'"
|
|
}
|
|
False.Define.hpvol ""
|
|
}
|
|
|
|
If.hplo {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "name='Headphone+LO Playback Volume'"
|
|
}
|
|
True.Define {
|
|
hpvol "Headphone+LO"
|
|
lovol "Headphone+LO"
|
|
}
|
|
}
|
|
|
|
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.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.none {
|
|
Condition {
|
|
Type String
|
|
Empty "${var:spkvol}${var:lovol}"
|
|
}
|
|
True.If.default {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "name='Master Playback Switch'"
|
|
}
|
|
True.Define.hpvol "Master"
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
If.hp {
|
|
Condition {
|
|
Type String
|
|
Empty "${var:hpvol}"
|
|
}
|
|
False.SectionDevice."Headphones" {
|
|
Comment "Headphones"
|
|
|
|
If.headphone_switch {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "name='Headphone Playback Switch'"
|
|
}
|
|
True {
|
|
EnableSequence [
|
|
cset "name='Headphone Playback Switch' on"
|
|
]
|
|
DisableSequence [
|
|
cset "name='Headphone Playback Switch' off"
|
|
]
|
|
}
|
|
}
|
|
|
|
Value {
|
|
PlaybackPriority 200
|
|
PlaybackPCM "hw:${CardId}"
|
|
PlaybackMixerElem "${var:hpvol}"
|
|
PlaybackVolume "${var:hpvol} Playback Volume"
|
|
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 String
|
|
Empty "${var:spkvol}"
|
|
}
|
|
False.Include.hifi-spk.File "/HDA/HiFi-spk.conf"
|
|
}
|
|
|
|
If.cap-sw {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "name='Capture Switch'"
|
|
}
|
|
True.Include.hifi-mic.File "/HDA/HiFi-mic.conf"
|
|
}
|
|
|
|
If.line {
|
|
Condition {
|
|
Type String
|
|
Empty "${var:loctl}"
|
|
}
|
|
False.SectionDevice."Line:main" {
|
|
Comment "Line Output"
|
|
|
|
If.conflict {
|
|
Condition {
|
|
Type String
|
|
String1 "${var:lovol}"
|
|
String2 "Headphone+LO"
|
|
}
|
|
True.ConflictingDevice [
|
|
"Headphones"
|
|
]
|
|
}
|
|
|
|
EnableSequence [
|
|
cset "name='${var:loctl} Playback Switch' on"
|
|
]
|
|
DisableSequence [
|
|
cset "name='${var:loctl} Playback Switch' off"
|
|
]
|
|
|
|
Value {
|
|
PlaybackPriority 300
|
|
PlaybackPCM "hw:${CardId}"
|
|
PlaybackMixerElem "${var:lovol}"
|
|
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"
|
|
}
|
|
}
|
|
}
|
|
|
|
If.linefront {
|
|
Condition {
|
|
Type ControlExists
|
|
Control "name='Front Playback Switch'"
|
|
}
|
|
True.SectionDevice."Line:front" {
|
|
Comment "Second Line Output"
|
|
|
|
ConflictingDevice [
|
|
"Line:main"
|
|
]
|
|
|
|
EnableSequence [
|
|
cset "name='Front Playback Switch' on"
|
|
]
|
|
DisableSequence [
|
|
cset "name='Front Playback Switch' off"
|
|
]
|
|
|
|
Value {
|
|
PlaybackPriority 250
|
|
PlaybackPCM "hw:${CardId}"
|
|
PlaybackMixerElem "Front"
|
|
PlaybackMasterElem "Master"
|
|
PlaybackVolume "Front Playback Volume"
|
|
PlaybackSwitch "Front Playback Switch"
|
|
JackControl "Line Out Front Jack"
|
|
}
|
|
}
|
|
}
|