ucm2: HDA: Headphone output may be optional
Check for 'Headphone Playback Volume' or 'Headphone+LO Playback Volume' controls. If they not present, don't create 'Headphone' UCM device. Link: https://github.com/alsa-project/alsa-ucm-conf/issues/673 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
46f30b3f9f
commit
c8b55418ff
1 changed files with 37 additions and 23 deletions
|
|
@ -42,6 +42,14 @@ If.linefront {
|
|||
}
|
||||
}
|
||||
|
||||
If.hpvol {
|
||||
Condition {
|
||||
Type ControlExists
|
||||
Control "name='Headphone Playback Volume'"
|
||||
}
|
||||
False.Define.hpvol ""
|
||||
}
|
||||
|
||||
If.hplo {
|
||||
Condition {
|
||||
Type ControlExists
|
||||
|
|
@ -53,32 +61,38 @@ If.hplo {
|
|||
}
|
||||
}
|
||||
|
||||
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"
|
||||
]
|
||||
}
|
||||
If.hp {
|
||||
Condition {
|
||||
Type String
|
||||
Empty "${var:hpvol}"
|
||||
}
|
||||
False.SectionDevice."Headphones" {
|
||||
Comment "Headphones"
|
||||
|
||||
Value {
|
||||
PlaybackPriority 200
|
||||
PlaybackPCM "hw:${CardId}"
|
||||
PlaybackMixerElem "${var:hpvol}"
|
||||
PlaybackMasterElem "Master"
|
||||
PlaybackVolume "${var:hpvol} Playback Volume"
|
||||
PlaybackSwitch "Headphone Playback Switch"
|
||||
JackControl "${var:hpjack}"
|
||||
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}"
|
||||
PlaybackMasterElem "Master"
|
||||
PlaybackVolume "${var:hpvol} Playback Volume"
|
||||
PlaybackSwitch "Headphone Playback Switch"
|
||||
JackControl "${var:hpjack}"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue