hda: mixer and audio paths fixes
* avoid mixing input and output paths when building a tree. In fact, an audio input shouldn't use only a mixer used for output. * in case an audio input has more than one input, use these inputs to build a mux control. * should help with #8270, #8333
This commit is contained in:
@@ -897,7 +897,8 @@ hda_widget_find_input_path(hda_audio_group* audioGroup, hda_widget* widget,
|
|||||||
switch (widget->type) {
|
switch (widget->type) {
|
||||||
case WT_PIN_COMPLEX:
|
case WT_PIN_COMPLEX:
|
||||||
// already used
|
// already used
|
||||||
if (widget->flags & WIDGET_FLAG_INPUT_PATH)
|
if ((widget->flags & (WIDGET_FLAG_INPUT_PATH
|
||||||
|
| WIDGET_FLAG_OUTPUT_PATH)) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (PIN_CAP_IS_INPUT(widget->d.pin.capabilities)) {
|
if (PIN_CAP_IS_INPUT(widget->d.pin.capabilities)) {
|
||||||
@@ -917,7 +918,8 @@ TRACE(" %*sinput: added input widget %ld\n", (int)depth * 2, "", widget->no
|
|||||||
case WT_AUDIO_SELECTOR:
|
case WT_AUDIO_SELECTOR:
|
||||||
{
|
{
|
||||||
// already used
|
// already used
|
||||||
if (widget->flags & WIDGET_FLAG_INPUT_PATH)
|
if ((widget->flags & (WIDGET_FLAG_INPUT_PATH
|
||||||
|
| WIDGET_FLAG_OUTPUT_PATH)) != 0)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// search for pin complex in this path
|
// search for pin complex in this path
|
||||||
|
|||||||
@@ -442,7 +442,7 @@ hda_create_control_for_complex(hda_multi* multi, uint32* index, uint32 parent,
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((widget.type & WT_AUDIO_MIXER) != 0) {
|
if (widget.type == WT_AUDIO_MIXER) {
|
||||||
hda_create_channel_control(multi, index, parent, 0,
|
hda_create_channel_control(multi, index, parent, 0,
|
||||||
widget, true, widget.capabilities.input_amplifier, 0, gain, mute);
|
widget, true, widget.capabilities.input_amplifier, 0, gain, mute);
|
||||||
if (!gain && !mute) {
|
if (!gain && !mute) {
|
||||||
@@ -451,8 +451,7 @@ hda_create_control_for_complex(hda_multi* multi, uint32* index, uint32 parent,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((widget.type & WT_AUDIO_OUTPUT) == 0
|
if (widget.type != WT_AUDIO_OUTPUT && widget.num_inputs > 0) {
|
||||||
&& widget.num_inputs > 0) {
|
|
||||||
hda_widget& child = *hda_audio_group_get_widget(audioGroup,
|
hda_widget& child = *hda_audio_group_get_widget(audioGroup,
|
||||||
widget.inputs[widget.active_input]);
|
widget.inputs[widget.active_input]);
|
||||||
hda_create_control_for_complex(multi, index, parent, child, gain, mute);
|
hda_create_control_for_complex(multi, index, parent, child, gain, mute);
|
||||||
@@ -543,6 +542,12 @@ hda_create_controls_list(hda_multi* multi)
|
|||||||
hda_create_channel_control(multi, &index, parent2, 0,
|
hda_create_channel_control(multi, &index, parent2, 0,
|
||||||
widget, true, capabilities, 0, gain, mute);
|
widget, true, capabilities, 0, gain, mute);
|
||||||
|
|
||||||
|
if (widget.num_inputs > 1) {
|
||||||
|
TRACE(" create mux for nid %lu\n", widget.node_id);
|
||||||
|
hda_create_mux_control(multi, &index, parent2, widget);
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
hda_widget *mixer = hda_audio_group_get_widget(audioGroup,
|
hda_widget *mixer = hda_audio_group_get_widget(audioGroup,
|
||||||
widget.inputs[0]);
|
widget.inputs[0]);
|
||||||
if (mixer->type != WT_AUDIO_MIXER && mixer->type != WT_AUDIO_SELECTOR)
|
if (mixer->type != WT_AUDIO_MIXER && mixer->type != WT_AUDIO_SELECTOR)
|
||||||
|
|||||||
Reference in New Issue
Block a user