Lydia Wang [Fri, 1 Jul 2011 02:55:07 +0000 (10:55 +0800)]
ALSA: hda - Fix the silent front with independent-HP for VIA codecs
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>
Takashi Iwai [Thu, 30 Jun 2011 15:24:47 +0000 (17:24 +0200)]
ALSA: hda - Re-implementation of VIA Independent-HP sharing with side stream
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.
Lydia Wang [Wed, 29 Jun 2011 05:52:02 +0000 (13:52 +0800)]
ALSA: hda - Fix jack-detection on non-VT1708 VIA codecs
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>
Takashi Iwai [Tue, 28 Jun 2011 10:45:47 +0000 (12:45 +0200)]
ALSA: hda - Create snd_hda_get_conn_index() helper function
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.
Takashi Iwai [Tue, 28 Jun 2011 06:59:30 +0000 (08:59 +0200)]
ALSA: hda - Fix warnings with CONFIG_SND_POWER_SAVE=n
Use static inline for dummy function to fix the warnings like below
sound/pci/hda/patch_sigmatel.c: In function ‘stac92xx_init’:
sound/pci/hda/patch_sigmatel.c:4387:3: warning: statement with no effect
sound/pci/hda/patch_sigmatel.c: In function ‘stac92xx_resume’:
sound/pci/hda/patch_sigmatel.c:4927:3: warning: statement with no effect
Takashi Iwai [Mon, 27 Jun 2011 14:17:07 +0000 (16:17 +0200)]
ALSA: hda - More volume-init fixes for ALC267 codec
More similar fixes like previous commits: handle the exceptional case
like ALC267 where no volume amp is found in ADC widget but in the
capsrc widget instead.
Also minor checks for avoiding possible erros: no connection-select
when the pin has a single selection, and add beep verbs only when the
0x1d is used for beep.
Takashi Iwai [Mon, 27 Jun 2011 13:53:38 +0000 (15:53 +0200)]
ALSA: hda - Fix volume-init for ALC259 with invalid widget caps
ALC259 seems to provide an invalid widget capability for the input-src
selector widget. The widget shows the input-amp while it's a selector,
and this confuses the current ALC882 initialization code that is used
for ALC259, too. For fixing this, check the amp capability and handle
the connection selection individually.
Also, ALC259 has no mute bit in DAC volume, so we need to initialize
it as ZERO instead of MUTE.
Takashi Iwai [Mon, 27 Jun 2011 13:48:17 +0000 (15:48 +0200)]
ALSA: hda - Fix volume-init of ALC299 & co
ALC269 and compatible codecs have the output volume in DACs, thus we
can't use the ALC880's code as is. Fixed by checking the amp caps and
picking up the right widget for initialization.
The input amps of mixer widgets should be unmuted as default (as
usually they have no assigned mixer switches).
More fixes in this commit are, however, for ALC260: ALC260 codec can
have multiple output mixers connnected to a single DAC althouh the
driver didn't pick up them properly.
Takashi Iwai [Mon, 27 Jun 2011 10:34:01 +0000 (12:34 +0200)]
ALSA: hda - Check hard-wired DACs at first for ALC662 & co
Some Realtek codecs have the output pins hardwired with certain DACs.
These DACs have to be assigned at first and assign the rest for
multi-DAC pins so that all DACs can be assigned properly.
Without such an optimization, speaker outputs may be assigned to the
same DAC as the headphone or others.
Takashi Iwai [Mon, 27 Jun 2011 09:32:07 +0000 (11:32 +0200)]
ALSA: hda - Call proper DAC-filler function for Realtek auto-parser
In alc_auto_add_multi_channel_mode(), when the primary HP workaround
is enabled, it re-initializes the DAC list but calls alc662's function
in a fixed way. This isn't pretty suitable for other codecs, of course.
Now we call it with fill_dac function pointer so that the proper
function can be called at that point.
Takashi Iwai [Fri, 24 Jun 2011 12:10:28 +0000 (14:10 +0200)]
ALSA: hda - Add snd_hda_get_conn_list() helper function
Add a new helper function snd_hda_get_conn_list().
Unlike snd_hda_get_connections(), this function doesn't copy the
connection-list but gives the raw pointer for the cached list.
Jesper Juhl [Thu, 23 Jun 2011 21:54:40 +0000 (23:54 +0200)]
ALSA: Remove unneeded version.h includes from sound/
In the sound/ directory there are two files (flagged by 'make
versioncheck'); sound/pci/asihpi/asihpi.c and
sound/soc/codecs/wm8991.c that include linux/version.h although they
don't need it. This patch removes the unneeded includes.
Takashi Iwai [Fri, 24 Jun 2011 09:03:58 +0000 (11:03 +0200)]
ALSA: hda - Clean up multi-channel mixer name assignment in patch_realtek.c
Change alc_get_line_out_pfx() in patch_realtek.c to provide the channel
specific name and assign the index so that each caller doesn't have to
set the channel name by itself.
Also, check the multi-io case with the primary hp-out; for the multi-io
channels, assign the channel name instead of "Headphone" with indices.
This makes the mixer names more intuitive and reduces confusion.
Takashi Iwai [Fri, 24 Jun 2011 08:43:03 +0000 (10:43 +0200)]
ALSA: hda - Add a workaround for invalid line-out setups
Some BIOS set up the pin config wrongly as line-out although it's
supposed to be a speaker out. In most cases, though, we can judge
the validity by checking the connection type -- when it's FIXED,
mostly it's an invalid line-out but a speaker.
Daniel Mack [Wed, 22 Jun 2011 18:48:25 +0000 (20:48 +0200)]
ASoC: pxa-ssp: Correct check for stream presence
Don't rely on the codec's channels_min information to decide wheter or
not allocate a substream's DMA buffer. Rather check if the substream
itself was allocated previously.
Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Liam Girdwood <lrg@ti.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@kernel.org
Takashi Iwai [Wed, 22 Jun 2011 13:23:25 +0000 (15:23 +0200)]
ALSA: hda - Implement dynamic-ADC switching for VIA codecs
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.
Takashi Iwai [Tue, 21 Jun 2011 12:22:14 +0000 (14:22 +0200)]
ALSA: hda - Fix surround-volume parsing for VT1708B codecs
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.
Takashi Iwai [Tue, 21 Jun 2011 10:57:22 +0000 (12:57 +0200)]
ALSA: hda - Fix the check of loopback-mixer element index in patch_via.c
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>
Takashi Iwai [Tue, 21 Jun 2011 10:51:33 +0000 (12:51 +0200)]
ALSA: hda - Assign smart51 only in the same stack for VIA codecs
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.
Tony Vroon [Mon, 20 Jun 2011 21:11:11 +0000 (22:11 +0100)]
ALSA: hda - Remove ALC268 model override for CPR2000
The "diverse" Quanta ID 0x0763 is overridden to ALC268_ACER.
This keeps headphone automute and microphone input from operating
on at least one laptop from Opti Systems.
Without the override, the BIOS parser does a fine job setting the
card up and everything works.
Tested-By: Peter Schneider <e.at.chi.kaen@googlemail.com> Signed-off-by: Tony Vroon <tony@linx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 20 Jun 2011 10:39:26 +0000 (12:39 +0200)]
ALSA: hda - Initialize unsol events dynamically in patch_via.c
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.
Takashi Iwai [Sun, 19 Jun 2011 14:24:21 +0000 (16:24 +0200)]
ALSA: hda - Fix independent-HP handling in patch_via.c
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...
Takashi Iwai [Sat, 18 Jun 2011 14:40:14 +0000 (16:40 +0200)]
ALSA: hda - Assign HP-independent PCM to individual stream
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.
Takashi Iwai [Fri, 17 Jun 2011 15:53:38 +0000 (17:53 +0200)]
ALSA: hda - Unify output-control parsing in patch_via.c
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.
Takashi Iwai [Fri, 17 Jun 2011 14:37:45 +0000 (16:37 +0200)]
ALSA: hda - Change pin-ctl for auto-muting in patch_via.c
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.
Takashi Iwai [Fri, 17 Jun 2011 13:46:13 +0000 (15:46 +0200)]
ALSA: hda - Defer mixer element creation to the right time in patch_via.c
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.
Takashi Iwai [Fri, 17 Jun 2011 14:59:21 +0000 (16:59 +0200)]
ALSA: hda - Add control to suppress the dynamic pin-power for VIA
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.
ALSA: HDA: Remove redundant LPIB quirks for ATI chipset
Now that we have changed the position_fix default for ATI and AMD
to be LPIB (see commit 50e3bbf989), we can remove the quirks that
were added for ATI chipsets.
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Fri, 17 Jun 2011 12:23:46 +0000 (14:23 +0200)]
ALSA: hda - Fix no NID error with VIA codecs
The via driver spews warnigs like
hda-codec: no NID for mapping control Independent HP:0:0
with some codecs because snd_hda_add_nid() is called with nid=0.
This patch fixes it by skipping the call when no corresponding widget
is found.
Clemens Ladisch [Fri, 17 Jun 2011 06:18:35 +0000 (08:18 +0200)]
ALSA: isight: adjust for new queueing API
Since commit 13882a82ee16 (optimize iso queueing by setting
wake only after the last packet), drivers are required to call
fw_iso_context_queue_flush() after queueing a batch of packets.
The missing call would have an effect only if the controller
queue underruns, but then the DMA would stop completely.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Torsten Schenk [Thu, 16 Jun 2011 19:06:27 +0000 (21:06 +0200)]
ALSA: 6fire - Fix signedness bug
Fixed remaining issues of the signedness bug discovered by Dan Carpenter.
A check was remaining that tests if unsigned rt->rate is >= 0.
Changed that so that rt->rate now consistently uses ARRAY_SIZE(rates)
as invalid rate value and not -1.
Jesper Juhl [Mon, 13 Jun 2011 21:52:02 +0000 (23:52 +0200)]
ALSA: 6fire: Fix double-free bug in usb6fire_fw_ezusb_upload()
We have a double-free bug in
sound/usb/6fire/firmware.c::usb6fire_fw_ezusb_upload().
We already call release_firmware(fw) on line 258, so when we then do it
again after usb6fire_fw_ezusb_write() returns <0, we have a double-free.
Easily fixed by just removing the last call to release_firmware().
Florian Zeitz [Sat, 11 Jun 2011 23:15:42 +0000 (01:15 +0200)]
ALSA: emu10k1: Add details for E-mu 0404 PCIe version
This patch adds the necessary details to support the PCIe version of
E-MU's 0404 card.
From comparing the PCBs it seems the PCIe version just added a PCIe
chipset and left all other components pretty much in place.
For anyone intrigued to take a look at the PCB there are pictures I took
at <http://babelmonkeys.de/~florob/E-MU%200404/>.
Adrian Knoth [Sun, 12 Jun 2011 15:26:18 +0000 (17:26 +0200)]
ALSA: hdspm - Fix jumping external wordclock frequency in AutoSync mode
When using Word Clock on RME MADI cards, AutoSync mode was alternating
betweeen MADI and WC due to a typo: AutoSync is indicated in the second
status register (status2), not the first one (status).
While the proc output was always correct, the reported WC frequency to
ALSA was unstable as mentioned in
Adrian Knoth [Sun, 12 Jun 2011 15:26:17 +0000 (17:26 +0200)]
ALSA: hdspm - Fix locking in snd_hdspm_midi_input_read
For the MIDI part, we need to acquire (and release) the hmidi->lock,
access to the global hdspm structure is serialized through
hmidi->hdspm->lock instead.
Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
BugLink: https://launchpad.net/bugs/761171
The original reporter needs the model=auto quirk for his internal
speakers to be audible in the latest daily snapshot, so add an entry in
the quirk table for his PCI SSID.
A trivially different version of this patch using the model=asus quirk
should be applied to the 2.6.38 and 2.6.39 stable kernels. We don't use
the asus quirk in 3.0-rc2, because 3.0-rc2's autoparser is much
improved.
Reported-and-tested-by: tomdeering7 Signed-off-by: Daniel T Chen <crimsun@ubuntu.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>