Unmute DAC on front speaker path when Independent HP is enabled.
When to enable Independent HP, the front speaker won't output any sound
for VT1708, VT1708B, VT1708S and VT1702.
I find the via_independent_hp_put() routine will mute DAC 0 path in Mixer 0.
For these codecs, when using Independent HP, there could have two
independent streams, one is from DAC0-->Mixer0-->Front Pin, the other is
from DAC3-->GainSW3-->Side Pin.
So I added a check for DAC-->Mixer path in activate_output_path().
If current path is DAC-->Mixer, no need to mute DAC index in Mixer.
In fact, to change connection of Headphone pin or Mux connected with HP
is enough.
Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds the re-implementation of Independent-HP mode in the
case where the DAC is shared between HP and side-channel streams.
Now the driver tries to parse the output-path using the pre-parsed
side-channel DAC for the independent HP output, too.
When a playback PCM stream is opened with this shared mode, the
Independent-HP mixer switch can't be changed for avoiding the conflict,
thus it returns -EBUSY error.
One remaining unintuitive issue is that the DAC volume is still
controlled as "Side" volume although it's shared by both independent-HP
and side streams.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move codec init verb which is only applicatable for VT1708.
I've found the root cause that jack plugged in can't be detected.
The verb in vt1708_init_verbs is used to power down jack detect circuit.
This verb is only applicable to VT1708. vt1708 didn't implement jack
detect function in hardware, so we should shut down this function to
avoid noise. But for other codecs, hardware implement jack detect
function. If sending this verb during initialization, jack detect will
be invalid. So I move this verb from via_parse_auto_config() to
patch_vt1708().
Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Create snd_hda_get_conn_index() helper function for obtaining the
connection index of the widget. Replaced the similar codes used in
several codec-drivers with this common helper.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix a issue to enable unsolicited response to line-out pins.
Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Some VIA codecs like VT1702 provide the input-route only to specific
ADCs such as digital-mic inputs. These routes aren't covered by the
normal primary ADC, and for now, user had to open the capture stream
assigned to that special ADC manually for using such inputs.
This patch implements a way to switch the current ADC dynamically per
the input-source selection in such a case. When this workaround is
activated, the driver provides only one capture stream and one input-
source control but with the full possible inputs. The driver switches
the ADC to be used (or being used) according to the input-source on the
fly.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When smart51 mode is enabled, auto-mute these surround outputs
as well as the primary line-out. Also this patch includes minor
clean-ups.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Unify the VT1709 10ch and 6ch parsers, as well as VT1708B 8ch and 4ch
parsers. They have no difference now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The codecs like VT1708 needs more complicated routing using the mixer
widget rather than the simple selector widgets.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The surround/CLFE/side DACs on VT1708B and co have no amp but the
connected selector widgets have the amp instead. Fix the parser to
check these selector widgets for the possible mixer controls as well.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the check of the multiple loopback-mixer, which gave sometimes
a wrong index assigned to an element even for different names, e.g.
Mic and Front Mic. Now check the label properly for avoid duplication.
Reported-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The input jacks assigned as the smart51 outputs must be in the same
stack, either rear, front or other. Also, prefer line-in as the surround
to mic-in.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix a issue to create playback volume control if pin has amplifier capability
but not DAC.
Signed-off-by: Lydia Wang <lydiawang@viatech.com.cn>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Change the order of the output-path list in a way from the DAC to the
target pin. Also now the list include the target pin, too.
Together with this format change, simplify the arguments of
parse_output_path() function, and fix the initialization in
via_auto_init_output().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Drop "Capture" prefix from the mic-boost names.
Otherwise some control names can overflow the max name length.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use the existing aa-loop list for simplifying the check for analog
low-current mode. Also fix the stream count test for playback streams.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Issue the init verbs of unsolicited events dynamically from the parsed
results for VIA codecs. Also, consolidate the unsol handlers for HP
and line-out mutes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Similarly like the previous commit, initialize the input-paths dynamically
from the parsed results instead of the fixed array for VIA codecs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of fixed array for each codec type, initialize the output path
dynamically from the parsed results.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix races in handling of HP DAC and independent streams for VIA codecs.
Also, allow the HP output path without front-DAC, and removed
unnecessary activation of HP mixer elements.
This also removes the handling of shared side/HP stream; it's anyway
implemented in a broken way, so we need to re-implement the feature
later...
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of ignoring the invalid pin configuration, return the error.
This will avoid unexpected crash, anyway.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Create capture-related mixer elements dynamically from the parsed
ADCs and input-pins instead of fixed values for each codec.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of using the secondary substream, create an individual PCM
stream for HP-independent PCM. Otherwise it's difficult to handle
different channel numbers with multi-channel stream in the sam PCM
stream structure.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
For VIA codecs, we shouldn't create a substream for independent HP mode,
when no individual HP DAC is found.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Parse the output-paths more dynamically, i.e. traverse the paths
from each output pin instead of fixed assignment for each codec.
Now all codecs are using the same output parser code.
The smart51 setup doesn't work with this change, and will be fixed
in the next commits.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mute the outputs via pin-controls instead of amps for the auto-mute
handling. This makes our life easier as it avoids conflict of the states
between the mixer elements and the auto-mute toggles.
With this change, we can use vmaster for the master control easily now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The jack-detect control should be created at the time of build_controls
callback instead of calling snd_hda_add_ctls() at the tree-parsing time.
For that, copy the control to the temporary array like other cases.
Also, fixed typos of vt1708_jack_detect in all places.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of giving the fixed ADC list, parse the widgets and fill in
ADCs dynamically.
Also, probe the stereo-mixer input more dynamically, too.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Currently VIA driver controls the power-state of each pin per jack
detection. But, it means that the power-state mismatch may occur when
the machine doesn't give the proper jack-detection.
For avoiding this problem, a new control element "Dynamic Power-Control"
is provided so that user can turn on/off the pin-power control.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The SPDIF output controls apply to converter widgets. A future change
will create a PCM device per pin widget, and hence a set of SPDIF output
controls per pin widget, for certain HDMI codecs. To support this, we
need the ability to virtualize the SPDIF output controls. Specifically:
* Controls can be "unassigned" from real hardware when a converter is
not used for the PCM the control was created for.
* Control puts only write to hardware when they are assigned.
* Controls can be "assigned" to real hardware when a converter is picked
to support output for a particular PCM.
* When a converter is assigned, the hardware is updated to the cached
configuration.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Currently, the data that backs the kcontrols created by
snd_hda_create_spdif_out_ctls is stored directly in struct hda_codec. When
multiple sets of these controls are stored, they will all manipulate the
same data, causing confusion. Instead, store an array of this data, one
copy per converter, to isolate the controls.
This patch would cause a behavioural change in the case where
snd_hda_create_spdif_out_ctls was called multiple times for a single codec.
As best I can tell, this is never the case for any codec.
This will be relevant at least for some HDMI audio codecs, such as the
NVIDIA GeForce 520 and Intel Ibex Peak. A future change will modify the
driver's handling of those codecs to create multiple PCMs per codec. Note
that this issue isn't affected by whether one creates a PCM-per-converter
or PCM-per-pin; there are multiple of both within a single codec in both
of those codecs.
Note that those codecs don't currently create multiple PCMs for the codec
due to the default HW mux state of all pins being to point at the same
converter, hence there is only a single converter routed to any pin, and
hence only a single PCM.
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>