# 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 ""
CaptureVolume "${var:__Name} Volume"
CaptureSwitch "${var:__Name} Switch"
CaptureMasterElem "${var:__Name} Boost"
- JackControl "${var:__Jack}"
+ JackControl "${var:-__Jack}"
}
}
Jack "${var:MicHSJackControl}"
}
}
- True {
- # the input selection is via switches, the possible types are
- # Mic and Front Mic
- Macro.mic.HDAMicSwitch {
- DevName "Mic:hda"
- Comment "Stereo Microphone"
- Name "Mic"
- Priority 100
- Jack "${var:MicJackControl}"
+ 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 {
+ DevName "Mic:hda"
+ Comment "Stereo Microphone"
+ Name "Mic"
+ Priority 100
+ Jack "${var:MicJackControl}"
+ }
+ If.fmic {
+ Condition {
+ Type ControlExists
+ Control "name='Front Mic Playback Switch'"
+ }
+ True.Macro.fmic.HDAMicSwitch {
+ DevName "Mic:hda-front"
+ Comment "Front Stereo Microphone"
+ Name "Front Mic"
+ Priority 200
+ Jack "Front Mic Jack"
+ }
+ }
}
- If.fmic {
- Condition {
- Type ControlExists
- Control "name='Front Mic Playback Switch'"
+ 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
}
- True.Macro.fmic.HDAMicSwitch {
- DevName "Mic:hda-front"
- Comment "Front Stereo Microphone"
- Name "Front Mic"
- Priority 200
- Jack "Front Mic Jack"
+ 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}"
+ }
}
}
}