ALSA: hda: mic: add initial support for driver source auto-switching
Some checks are pending
Validate UCM configuration / ucm_validate (push) Waiting to run
Some checks are pending
Validate UCM configuration / ucm_validate (push) Waiting to run
Use boost volume controls to detect this case. Link: https://github.com/alsa-project/alsa-ucm-conf/pull/792 Signed-off-by: Jaroslav Kysela <perex@perex.cz>
This commit is contained in:
parent
c2d5f60c32
commit
c17dfb63ae
1 changed files with 58 additions and 25 deletions
|
|
@ -6,14 +6,16 @@
|
|||
|
||||
# Microphone related variables as used internally
|
||||
# HDA codecs can offer input source selection (mux) via "Input Source" or
|
||||
# "Capture Source" with varying options:
|
||||
# 'Internal Mic'
|
||||
# 'Headset Mic'
|
||||
# 'Headphone Mic'
|
||||
# 'Mic'
|
||||
# "Capture Source" with varying options '[PREFIX ]Mic' where PREFIX is
|
||||
# <Empty>,Internal,Headset,Headphone.
|
||||
#
|
||||
# or there can be 'Mic' and optional 'Front Mic' available
|
||||
#
|
||||
# There is also third variant - driver supports auto-switching. In
|
||||
# this case, the '[Prefix ]Mic Boost Volume' controls exists. There are also
|
||||
# phantom jacks exported by the driver in this case, but it's not
|
||||
# necessary to use them. Prefixes: <Empty>,Internal,Front
|
||||
#
|
||||
# This leads to up to maximum of four possible input devices.
|
||||
|
||||
Define.SourceControl ""
|
||||
|
|
@ -162,7 +164,7 @@ DefineMacro.HDAMicSwitch.SectionDevice."${var:__DevName}" {
|
|||
CaptureVolume "${var:__Name} Volume"
|
||||
CaptureSwitch "${var:__Name} Switch"
|
||||
CaptureMasterElem "${var:__Name} Boost"
|
||||
JackControl "${var:__Jack}"
|
||||
JackControl "${var:-__Jack}"
|
||||
}
|
||||
}
|
||||
|
||||
|
|
@ -202,7 +204,12 @@ If.micsetup {
|
|||
Jack "${var:MicHSJackControl}"
|
||||
}
|
||||
}
|
||||
True {
|
||||
True.If.autoswitch {
|
||||
Condition {
|
||||
Type ControlExists
|
||||
Control "name='Internal Mic Boost Volume'"
|
||||
}
|
||||
False {
|
||||
# the input selection is via switches, the possible types are
|
||||
# Mic and Front Mic
|
||||
Macro.mic.HDAMicSwitch {
|
||||
|
|
@ -226,4 +233,30 @@ If.micsetup {
|
|||
}
|
||||
}
|
||||
}
|
||||
True {
|
||||
# third variant - the driver does auto-switching
|
||||
# note that we should assign right Jack controls to
|
||||
# allow expose the boost volume
|
||||
Macro.mic.HDAMicSwitch {
|
||||
DevName "Mic:hda-int"
|
||||
Comment "Internal Stereo Microphone"
|
||||
Name "Internal Mic"
|
||||
Priority 100
|
||||
}
|
||||
If.mic {
|
||||
# external microphone
|
||||
Condition {
|
||||
Type ControlExists
|
||||
Control "name='Mic Boost Volume'"
|
||||
}
|
||||
True.Macro.mic.HDAMicSwitch {
|
||||
DevName "Mic:hda"
|
||||
Comment "Stereo Microphone"
|
||||
Name "Mic"
|
||||
Priority 200
|
||||
Jack "${var:MicJackControl}"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue