The HP laptops with ALC268 codec seem working better with model=auto
than model=toshiba; e.g. the auto model fixes missing digital outputs.
Let's fix quirk entry to choose auto model explicitly.
Tested-by: Jens Jorgensen <jbj1@ultraemail.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix minimum period size for cs46xx cards. This fixes a problem in the
case where neither a period size nor a buffer size is passed to ALSA;
this is the case in Audacious, OpenAL, and others.
Signed-off-by: Sophie Hamilton <kernel@theblob.org>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When the volume is changed continuously (e.g., when the user drags a
volume slider with the mouse), the driver does lots of I2C writes.
Apparently, the sound chip can get confused when we poll the I2C status
register too much, and fails to complete a read from it. On the PCI-E
models, the PCI-E/PCI bridge gets upset by this and generates a machine
check exception.
To avoid this, this patch replaces the polling with an unconditional
wait that is guaranteed to be long enough.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Tested-by: Johann Messner <johann.messner at jku.at>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The model clevo-m540r was created with 6-channel and digital support. All
functions verified except spdif. Tested with a VIT D2000 laptop which has:
[lspci extract]
Audio device [0403]: Intel Corporation 82801H (ICH8 Family) HD Audio
Controller [8086:284b] (rev 03)
Subsystem: CLEVO/KAPOK Computer Device [1558:5409]
[/proc/asound/card0/codec\#0 header]
Codec: Realtek ALC883
Address: 0
Function Id: 0x1
Vendor Id: 0x10ec0883
Subsystem Id: 0x15585409
Revision Id: 0x100002
[Added a comment about HP mute and the model description by tiwai]
Signed-off-by: Dhionel Diaz <ddiaz@cenditel.gob.ve>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The card model detection code introduced in 2.6.30 that tries to work
around partially broken EEPROM contents by reading the EEPROM directly
does not handle cards where the EEPROM has been omitted. In this case,
we have to use the default ID to allow the driver to load.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Reported-and-tested-by: Ozan Çağlayan <ozan@pardus.org.tr>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added the quirk for Alienware M17x with IDT 92HD73* codec chip.
It has two HP and one line-out jack, one mic jack, a built-in
speaker and a built-in mic.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Due to the previous fix of input source for IDT92HD73xx, the amp mux
and amp vol stuff became unused. Let's rip off dead codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the mux_nids to select directly the input source instead of mux
mixers so that it works with the current mux enum handler for IDT
92HD73xx codecs.
Also, clean up useless / unnecessary mixer controls and init verbs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Unmute the docking-station line-out as default on machines with
AD1984A codec chip. It can be still muted via "Dock" mixer switch.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Do not forget to program the MCLK ratio for the I2S output.
Otherwise, the master clock frequency can be too high for
the DACs at sample frequencies above 96 kHz.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add the support of automatic mute and mic-switching of the docking
station HP and mic plugs for AD1984A laptop model for some HP machines.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the headphone pin routing of ALC268/ALC269 codecs. Using alc882
routine doesn't work because alc268/alc269 parser assumes the
independent DACs for both HP and speaker outputs. Need to assign the
DAC depending on the pin.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch fixes the wrong headphone output routing for MacBookPro 3,1/4,1
quirk with ALC889A codec, which caused the silent headphone output.
Also, this gives the individual Headphone and Speaker volume controls.
Reference: kernel bug#14078
http://bugzilla.kernel.org/show_bug.cgi?id=14078
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
In patch_vt1708(), the check of MUX nids is missing and this results in
the -EINVAL error in accessing Input Source mixer element. Simpliy
adding the call of get_mux_nids() fixes the problem.
Reference: Novell bnc#534904
https://bugzilla.novell.com/show_bug.cgi?id=534904
Signed-off-by: Takashi Iwai <tiwai@suse.de>
So far, the digital mic capture volume wasn't created. This is because
IDT codecs have output amps for digital mics, not input amps, while
input amps should be used for other analog pins. Thus the automatic
capture volume creation should check both directions for digital mics.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
1) Added support of internal subwoofer (it sounds!!!)
2) Auto muting front speakers and internal subwoofer on headphones plug.
3) Internal mic works.
4) 3 channel mods (jack maps):
black pink blue
2ch: front ext mic line in
4ch: front ext mic surround
6ch: front CLFE surround
Can be changed in mixer.
5) Sound can be recorded from:
Internal mic
Ext mic
Cd
Line in
6) 2 separate capture channels.
Signed-off-by: Denis Kuplyakov <dener.kup@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
One more patch to give a better name for the primary output controls,
this time for ALC861-VD codec. The change is simple, just checking the
pin connection whether it's a speaker-out. When both speaker and HP
are assigned, we name the volume as "PCM" as this influences on both
outputs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Similar improvements for ALC262 codec like previous two commits:
assign a better name, either Master or Speaker, for the primary output
controls.
However, in the case of ALC262 codec, the necessary changes are larger
than others because we need to check the possibility of different mixer
amps depending on the pins. The pin 0x16 is mono, and bound with the
dedicated mixer 0x0e while other pins are bound with 0x0c. Thus, there
are two possible volumes.
When only one of them is used, we can name it as "Master". OTOH, when
both are used at the same time, they have to be named uniquely.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of fixed "Front" mixer name, try to assign a better name, e.g.
"Master" or "Speaker" fot the primary output volume controls of ALC260
codec.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When there is only one DAC is used for ALC880, try to assign a better
name, either Speaker or Front, depending on the output pin type.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Provide a standard parser for input pins to create the input mixer
and input source controls instead of having a difference one for each
Realtek codec. The new helper parses the codec connections dynamically
isntead of fixed indicies.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reuse a part of the code of ALC268 parser for ALC269.
This will change the default output volume either to Front or Speaker
depending on the pin configuration.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix a logic error in the range check of the input level control that
would prevent setting any volume less than the maximum.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Modify loops in such way that the register value is checked also after
the timeout condition, just in case the heavy interrupt load etc. caused
the thread to sleep for the time period exceeding the timeout value.
While at it remove an extra ALI_STIMER read from snd_ali_stimer_ready().
Reported-by: Jack Byer <ojbyer@usa.net>
Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
There are many variants of Toshiba laptops with ALC268 codec, and
it seems that a few of them don't work with model=toshiba preset
since they have the secondary ALC268 codec just for HDMI output.
This is a regression due to the previous clean-up work to merge all
Toshiba quirk entries into a single check.
This patch adds the identification of such laptops to apply the
standard BIOS-probing method. Unfortunately, Toshiba laptops have
all the same PCI SSID, so we need to check the codec SSID to identify
each device.
Tested-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The BIOS pin configs are in fact correct and shall not be overwritten.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
HP Compaq 6530s and 6531s internal speaker is silence or becomes silence
within 1 minute after fresh boot. It is found that pin 0x1c must be set to
PIN_OUT mode to make the speaker work. This is weird - line-in pin 0x1c and
speaker pin 0x16 seem to be unrelated.
The codec differences before/after patch are:
@@ Node 0x17 [Pin Complex] wcaps 0x40020b:
Pin Default 0x41a6e130: [N/A] Mic at Ext Rear
Conn = Digital, Color = White
DefAssociation = 0x3, Sequence = 0x0
Misc = NO_PRESENCE
- Pin-ctls: 0x24: IN
+ Pin-ctls: 0x40: OUT
@@ Node 0x1c [Pin Complex] wcaps 0x40018d:
Pin Default 0x41813021: [N/A] Line In at Ext Rear
Conn = 1/8, Color = Blue
DefAssociation = 0x2, Sequence = 0x1
- Pin-ctls: 0x24: IN VREF_80
+ Pin-ctls: 0x40: OUT VREF_HIZ
Unsolicited: tag=00, enabled=0
Connection: 1
0x24
Tests show that it won't impact (external) Mic recording.
Reported-by: "Lin, Ming M" <ming.m.lin@intel.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The auto-mic clean-up patches caused regressions on some ALC268 models
that have no proper input_mux but with "Input Source" mixer elements.
Such a combination results in Oops when accessed.
[A reason why set_capture_mixer() isn't used in patch_alc268() is that
ALC268 codec have HDA_OUTPUT direction for capture volumes unlike other
codecs. Thus it needs own definitions of capture elements.]
This patch fixes the issues:
- Add a capture mixer definition without input-source
- Use the new capture mixer appropriately
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The previous fix removed the definition of num_adc_nids wrongly, and
this resulted in the missing input-source control. Now readded again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A few improvements for IDT 92HD83xxx codec pareser:
- Remove unused / deprecated mixer-amp controls
- Handle d-mics as normal inputs since this codec has no separate
MUXes for analog and digital
- Don't create duplicated controls for capture volumes with Mux
capture volumes
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Enable line-out detection for IDT/STAC codecs only when speaker pins
exist. In some cases, the speaker itself is identified as line-out,
and this confuses the situation. Only the extra line-outs should do
auto-muting.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
the hdsp driver refuses to report any information via the proc
interface, if the io box is not connected. with this patch, the
content of the control and status registers is printed before the
iobox check.
Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
With auto config model of alc268 realtek codec, it allows to select any
of possible available digital microphone inputs when only one is
available. For example, when only digital mic in nid 0x12 is available,
on second input source it will allow you to select unavailable digital
mic in nid 0x13. The problem is that selecting unavailable digital mic
creates a source of noise when recording (I'm not sure if this happens
on all machines with alc268 and only one digital mic input, but testing
on a quanta uw1 netbook a lot of noise is introduced in recording from
digital mic 0x12/first input source, when you select the unavailable
digital mic 0x13 for capture source 0x24 in the second input source in
mixer).
Then to avoid noise when recording from digital mic with auto model in
this case, prevent a digital mic input source to be selected if
microphone is not available.
Signed-off-by: Herton Ronaldo Krzesinski <herton@mandriva.com.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Move static codes to setup from init_hook for each model.
Also, use the common auto-mic selection helper for devices that support
auto-mic selection. They just need to set up ext_mic, int_mic and
auto_mic flag in the setup section.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added setup hook to ALC preset struct to be called at in the parser
but not at each init callback.
This can be used for setting up the static pins, etc, while the
init hook should be used for updating the status again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Created a white-list to enable MSI since some devices require MSI
explicitly due to BIOS/ACPI problems. Simply using a quirk list.
As the first case, take HP Compaq CQ40.
Reference: Novell bnc#529971
https://bugzilla.novell.com/show_bug.cgi?id=529971
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Some Realtek codecs don't provide the full connections for certain pins
from each ADC; e.g. ACL662/ALC272 gives only one of two digital-mic pins
for each ADC. Thus, depending on the digital mic pin, the ADC/MUX to be
used has to be chosen properly.
This patch adds the check of the connectivity of pins at auto-mic mode.
If no proper connectivity is found, auto_mic flag is turned off to be
sure.
Also the mux_idx is determined during this check so it won't be checked
in the unsol event any more.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALC269 and ALC861-VD parsers override the ADC definitions
unconditionally without checking the spec definition. This causes
the problem when any inconsistent ADC is set up in the device quirk
(like ALC272 with digital-mic).
This patch avoids the overriding by adding the proper checks.
Reference: Novell bnc#529467
https://bugzilla.novell.com/show_bug.cgi?id=529467
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added the support for automatic mic selection via plugging for
Realtek codecs (in auto-probing mode). The auto-mic mode is enabled
only when one internal mic and one external mic are present.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Allow the interval timer to be programmed with its full 96 kHz
precision.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Without the initialization of vmaster NID, the dB information got
confused for ALC269 codec.
Reference: Novell bnc#527361
https://bugzilla.novell.com/show_bug.cgi?id=527361
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
The previous auto-mic patch for STAC/IDT codecs causes the Oops on
machines without digital mic pins. This patch fixes the problem.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
* 'fix/hda' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
ALSA: hda - Read buffer overflow
ALSA: hda: Correct EAPD for Dell Inspiron 1525
ALSA: hda: warn on spurious response
ALSA: hda: remember last command for each codec
ALSA: hda: read CORBWP inside reg_lock
ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
ALSA: hda: take cmd_mutex in probe_codec()
ALSA: hda: track CIRB/CORB command/response states for each codec
ALSA: hda - Fix quirk for Toshiba Satellite A135-S4527
When the line-out jack is plugged/unplugged, the driver needs to check
the headphone plug, not only the line-out jack itself. Otherwise the
headphone or the speaker may be wrongly muted/unmuted.
As a result, both STAC_HP_EVENT and STAC_LO_EVENT need to call the
same function, stac92xx_hp_detect().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The commit fefd67f31e
ALSA: hda - Add line-out jack detection on IDT/STAC codecs
enabled wrong pins for jack detections. Fixed to the correct ones.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The new IbexPeak HDMI codec has 3 pin nodes and 2 converter nodes.
Here we assume only the first ones will be used.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Check whether index is within bounds before testing the element.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The commit 24918b61b5 statically changes
the model from dell-bios to dell-3stack to solve the sound decreasing
regression (http://lkml.org/lkml/2008/9/12/203), however it leads to another
problem that the 2nd headphone jack doesn't work
(https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3987). So I think
the commit 249**2dc is just a workaround. I would like to give a true solution
here.
The datasheet for STAC9228 says, GPIO2 is the same pin as VOL DOWN, and
the EAPD pin is GPIO0. This is why the sound decreases if we set EAPD as
GPIO2. This patch changes EAPD to GPIO0 to solve the problem.
Signed-off-by: Chengu Wang <wangchengu@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This converts the last CORBWP access outside of reg_lock.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Just for safety. azx_init_cmd_io() and azx_free_cmd_io() may be
called when switching to single command mode.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Now that each codec will have its own module, it is possible
for the user to load one codec while another one is running.
So cmd_mutex would be a safe addition to probe_codec().
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Recently we hit a bug in our dev board, whose HDMI codec#3 may emit
redundant/spurious responses, which were then taken as responses to
command for another onboard Realtek codec#2, and mess up both codecs.
Extend the azx_rb.cmds and azx_rb.res to array and track each codec's
commands/responses separately. This helps keep good codec safe from
broken ones.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Use model=lenovo instead of model=dallas for Toshiba Satellite A135-S4527
with ALC861-VD codec.
Reference: Novell bnc#526325
https://bugzilla.novell.com/show_bug.cgi?id=526325
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The name buf with size 16 is too short for some codec names, e.g.
truncated like "ALC861-VD Analo". Now the size is doubled.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add the automatic mute of speakers via line-out jack plugging on
STAC/IDT codecs. The feature is enabled when the HP detect is present.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The patch below, to be applied on the latest sound-unstable-2.6.git,
enables headphones output on my MacBookPro 5,5, together with the
automuting feature.
Here is the exact soundcard id:
Vendor Id: 0x10134206
Subsystem Id: 0x106b4d00
Revision Id: 0x100301
Signed-off-by: Takashi Iwai <tiwai@suse.de>
STAC/IDT codecs provide both "Input Source" and "Digital Input Source"
controls to choose the analog input source and the digital input source.
But this is far user-unfriendly.
This patch merges the input source selections into one "Input Source"
control. To have separate digital and analog input source controls,
you can pass "separate_dmux = 1 " hint string.
At the same time, this patch gets rid of analog mixer stuff that was
already disabled in previous patches.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
It auto mutes all 8-channel outputs at rear panel when
the front panel headphone is connected.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This 2-channel mode is useful in that it will broadcast
a 2-channel audio stream to all front/side/... ports.
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The analog mix is disabled now as default (unless "analog_mixer" hint
is given), so it shoudn't appear in the digital input source as well.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added the missing initialization of DMUX connection (to analog input)
for auto-mic mode with STAC/IDT codecs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
We don't need any more static connection to the port F (which is often
used for docking stations) since its connection is done dynamically via
DAC assignment now.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
e->sad[] is declared with size ELD_MAX_SAD=16, but the guard
allows range 0-31.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Support the automatic mic-switching with some devices with IDT/STAC
codecs. The condition is that the device has only two inputs, one
for an external mic and one for an internal mic.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Since only one event can be associated to a (pin) widget, it's safer
to avoid the multiple mapping. This patch fixes the behavior of the
STAC/IDT codec driver.
Now stac_get_event() doesn't take the type argument but simply returns
the first hit element. Then enable_pin_detect() checks the validity
of the type, and returns non-zero only if a valid entry. The caller
can call stac_issue_unsol_event() after checking the return value.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The analog mixer unit on IDT 92HD71Bxx codecs is almost useless
since we use only the direct connections from DAC to pin.
Remove the controls to avoid unneeded confusion as default now.
This can be still back via "analog_mixer = 1" hint.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of static snd_kcontrol_new arrays, create "Capture Volume"
and "Capture Switch" controls dynamically based on the mixer attr
values (made via HDA_COMPOSE_AMP_VAL()).
This reduces the code size and gives more flexibility to change
the number of controls later.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The current driver creates always the digital input source mixer
elements for IDT 92HD71x codecs no matter whether digital mics are
present. This patch adds the proper check to avoid the creation of
these controls if unnecessary.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The sentense "Unknown model for xxx, ..." makes people too nervous
and drives them to a direction to a wrong "fix" by giving any
mismatching model option.
Let's rephrase the messages to be more nice and easy (at least that
won't make people suspect conspiracies).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Volume-knob widgets may have connections even if they have no CONN_LIST
cap bit. Allow the query exceptionally in snd_hda_get_connections().
Signed-off-by: Takashi Iwai <tiwai@suse.de>
* fix/hda:
ALSA: hda - Fix mute control with some ALC262 models
ALSA: hda - Restore GPIO1 properly at resume with AD1984A
ALSA: hda - Use snprintf() to be safer
The master mute switch is wrongly implemented as checking the pointer
instead of its value, thus it can be never muted. This patch fixes
the issue.
Reference: Novell bnc#404873
https://bugzilla.novell.com/show_bug.cgi?id=404873
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
Here are the new sound enabling patches for IbexPeak.
Summary of tested features:
- playback
- Front Headphone: OK
- 8 channel audio: Front/Rear/CLFE/Side all OK
- recording
- Front Mic/Rear Mic: both OK
(front/rear/line mics are selectable in the "Input source" alsamixer control)
- Line In: not working
(in 6ch mode, its amp/mute, direction and route all looks fine,
so I'm a little puzzled)
(hopefully no one will care this feature)
- digital SPDIF input/output: not tested (no equipment)
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The commit 099db17e66 introduced a
regression at suspend/resume where the GPIO1 bit isn't properly
restored, thus the speaker output gets muted initially after resume.
The fix is simple, use the cached write for storing GPIO data.
Reference: Novell bnc#522764
https://bugzilla.novell.com/show_bug.cgi?id=522764
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix a few uninitialized error checks that were introduced recently
mistakenlly during the clean-up:
sound/pci/ctxfi/ctamixer.c: In function ‘get_amixer_rsc’:
sound/pci/ctxfi/ctamixer.c:261: warning: ‘err’ may be used uninitialized in this function
sound/pci/ctxfi/ctamixer.c: In function ‘get_sum_rsc’:
sound/pci/ctxfi/ctamixer.c:415: warning: ‘err’ may be used uninitialized in this function
sound/pci/ctxfi/ctsrc.c: In function ‘get_srcimp_rsc’:
sound/pci/ctxfi/ctsrc.c:742: warning: ‘err’ may be used uninitialized in this function
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This patch adds a check to snd_hda_get_connections() routine for
presence of AC_WCAP_CONN_LIST. Also, make sure that negative error
codes from noted route are handled on all places as errors.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Previous patch used widget type, but the presence flag of the connection
list is in the widget capabilities.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Reading node connections for an unknown widget can confuse HDA codec bus.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the logic of ALC861 auto-mode parser for the outputs.
Instead of assuming the fixed DAC list, parse the conection and assign
the DAC dynamically.
Also, unmute the unused output connections to avoid noises on inputs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add some tricks to reduce the click noise at powering down to D3
in the power saving mode on STAC/IDT codecs.
The key seems to be to reset PINs before the power-down, and some
delay before entering D3. The needed delay is significantly long,
but I don't know why.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
* fix/misc:
ALSA: ca0106 - Fix the max capture buffer size
ALSA: OSS sequencer should be initialized after snd_seq_system_client_init
ALSA: sound/isa: convert nested spin_lock_irqsave to spin_lock
* fix/hda:
ALSA: hda - Fix pin-setup for Sony VAIO with STAC9872 codecs
ALSA: hda - Add quirk for Gateway T6834c laptop
ALSA: hda_codec: Check for invalid zero connections
On Soundblaster X-FI Titanium with emu20k2 the SIDE and SURROUND
channels were swapped and wrong.
I double checked it with connector colors and creative soundblaster
windows drivers.
So I swapped them to the true order.
Now "speaker-test -c6" and "speaker-test -c8" are working fine.
Signed-off-by: Frank Roth <frashman@freenet.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The capture buffer size with 64kB seems broken with CA0106.
At least, either the update timing or the DMA position is wrong,
and this screws up pulseaudio badly.
This patch restricts the max buffer size less than that to make life
a bit easier.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
The recent rewrite of the codec parser for STAC9872 caused a regression
for some Sony VAIO models that don't give proper pin default configs
by BIOS. Even using model=vaio doesn't work because the pin definitions
are set after the pin overrides.
This patch fixes the pin definitions in patch_stac9872() to be put
in the right place before the pin overrides. Also the patch adds the
new quirk entry for VAIO F/S to have the correct pin default configs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Cc: <stable@kernel.org>
Added the native timer support for emu20k2, which gives much more
accurate update timing than the system timer.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Gateway T6834c laptops need EAPD always on while the default behavior
for the STAC9205 reference board is to turn it off upon every HP plug.
By using the special "eapd" model, which is first introduced for Gateway
T1616 laptops for this same reason, this peculiarity can be properly
handled.
Signed-off-by: Hao Song <baritono.tux@gmail.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
To prevent "Too many connections" message and the error path for some HDMI
codecs (which makes onboard audio unusable), check for invalid zero
connections for CONNECT_LIST verb.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
- Parse the mono output pin 0x16 correctly even as the primary output
- Create "Speaker" volume control if the primary output is a speaker
- Fix the wrong direction of (optional) "Mono" switch
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The newly added sanity-check for a codec verb can be better written
with logical ORs. Also, the parameter can be more than 8bit.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A recent bug involves passing auto detected >0x7f NID to codec command,
creating an invalid codec addr field, and finally lead to cmd timeout
and fall back into single command mode. Jaroslav fixed that bug in
alc880_parse_auto_config().
It would be safer to further check the bounds of all cmd fields.
Cc: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add support for new AMD HD audio devices. Use generic driver to detect HD audio
devices with Vendor ID AMD.
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This adds support for the Conexant CX20582 codec, based on code from
http://www.linuxant.com/alsa-driver/alsa-driver-linuxant-1.0.19ppch12-1.noarch.rpm.zip
This is the codec to be shipped in the OLPC XO-1.5, so this patch also
includes an XO-specific profile. Resultant configuration:
http://dev.laptop.org/~dsd/20090713/codec0.txthttp://dev.laptop.org/~dsd/20090713/codec0.svg
As the Linuxant code is structured differently to the other codecs,
I was unable to cleanly reimplement everything in the generic and Dell
profiles as more info is needed (e.g. codec graphs). I simplified those
profiles so that hopefully it will not break anyone's audio. If it does,
it may be worth returning -ENODEV from patch_cx5066 on non-OLPC systems,
and then fixing snd_hda_codec_configure() to fall back on the generic
parser, at least until support for other systems is figured out.
Signed-off-by: Daniel Drake <dsd@laptop.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
We need to check returning error for pci_register_driver(&joystick_driver)
On failure, we should unregister formerly registered audio drivers
This also fixed the compiler warning :
CC [M] sound/pci/riptide/riptide.o
sound/pci/riptide/riptide.c: In function ‘alsa_card_riptide_init’:
sound/pci/riptide/riptide.c:2200: warning: ignoring return value of ‘__pci_register_driver’, declared with attribute warn_unused_result
Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
- fix my previous codec activity breakage (_non-warned_ variable assignment
issue)
- convert suspend/resume to 32bit I/O access (I/O is painful; to improve
suspend/resume performance)
- change DEBUG_PLAY_REC to DEBUG_CODEC for consistency
- printk cleanup
- some logging improvements
- minor cleanup/improvements
The variable assignment issue above was a conditional assignment to the
call_function variable (this ended with the non-preinitialized variable
not getting assigned in some cases, thus a dangling stack value, yet gcc 4.3.3
unbelievably did _NOT_ warn about it in this case!!),
needed to change this into _always_ assigning the check result.
Practical result of this bug was that when shutting down
_either_ playback or capture, _both_ streams dropped dead :P
Tested, working (plus resume) and checkpatch.pl:ed on 2.6.30-rc5,
applies cleanly to 2.6.30 proper with my previous (committed)
patches applied.
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The codec read errors in snd_hda_get_connections() are ignored so far,
and it causes a problem like the bug in the commit
9d30937acc
ALSA: hda_intel: more strict alc880_parse_auto_config dig_nid checking
Better to check errors in the function and returns a proper error code
rather than passing bogus NID values.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
On some IbexPeak systems with ALC889A errors like "azx_get_response
timeout, switching to polling mode: last cmd=0xaf9f000b" are produced,
because non-existent codec #10 is wrongly accessed.
The problem is that snd_hda_get_connections() returns out-of-range result
for NID 0x1c (something like 0xf8f9 or 0xffff).
This patch adds a check to alc880_parse_auto_config() to avoid using
of this out-of-range NIDs. A better fix maybe to improve
snd_hda_get_connections() routine to check for valid NID ranges if
NIDs are expected as result.
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Fix the merge error at the commit 305355aad8,
an addition of the missing alc880_gpio3_init_verbs to ALC882_TARGA model.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Simplify ALC882_TARGA and return gpio3 to ALC883_TARGA_DIG and
ALC883_TARGA_2ch_DIG, which I accidentally removed in commit id
64a8be7435
Signed-off-by: David Heidelberger <d.okias@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
In the beep tone calculation for IDT/STAC codecs, lower numbers correspond
to higher frequencies and vice versa. The current code has this backwards,
resulting in beep frequencies which are way too high (and sound bad on
tinny laptop speakers, resulting in complaints).
[Also added hz <= 0 check by tiwai]
Signed-off-by: Paul Vojta <vojta@math.berkeley.edu>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commit 5fd29d6ccb ("printk: clean up
handling of log-levels and newlines") changed printk semantics. printk
lines with multiple KERN_<level> prefixes are no longer emitted as
before the patch.
<level> is now included in the output on each additional use.
Remove all uses of multiple KERN_<level>s in formats.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
There is a regression, introduced in aa202455ee
(in alsa-kernel) which I noticed when trying to use the headphone socket on
my EeeCPC 901: the output was *very* quiet, practically silent.
This patch corrects the control types to that which was obviously intended in
the referenced commit.
Signed-off-by: Darren Salt <linux@youmustbejoking.demon.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
HDA driver disabled HD audio 64bit address support for all AMD
SB600/SB700/SB800 platforms with commit
09240cf429 due to one SB600 issue
reported by community, but we do not see the similar issue on
SB700/SB800 platforms.
This patch is to refine the workaround for SB600 only.
Signed-off-by: Andiry Xu <andiry.xu@amd.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Check the widget type and don't take invalid widgets while parsing
the capture source in patch_via.c.
Also, fixed some compile warnings introduced in the previous commit.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The fixed widget NIDs in patch_via.c seem wrong for some codecs,
and it resulted in the invalid capture source selection.
This patch adds the code to parse the topology instead of using
fixed numbers in order to get the right MUX widget id corresponding
to the ADCs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
If the output pin is used and EAPD capability is present, turn on
the EAPD bit. This fixes the silent output problem on ASUS laptops
with VT1708S codec.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The parser wasn't called in the proper order.
Split now the parser to be called in patch_cirrus(), and the rest
are just for building PCMs and controls.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
- fully separate codec I/O port handling, enabling the use of a single
function each for all codecs (playback, capture, I2S out)
- add a new separate pcm for I2S out port (UNTESTED, no I2S DAC
available yet)
- switch gameport to low frequency while idle, to try to reduce noise/power
- improve snd_azf3328_codec_setdmaa() calculation
- minor variable type cleanup (u16, bool etc.)
- add some doc updates (help those lost Windows users, debug help, ...)
Note that due to the large cleanup aspect of the codec I/O change,
I was able to fit everything including all improvements into the
same binary size!! (a measly 10 bytes more or so)
This should now be the almost last patch to this driver
(minus some possible kernel clocksource patch and x86_64 fixes or so).
I just felt like taking a break from the usual stuff and wanted to
get this driver's structure finished, and it's rather clean now...
Tested, working and checkpatch.pl:ed on 2.6.30-rc5,
applies cleanly to 2.6.30 proper.
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
This driver is about as far from being experimental as it can ever get
for an undocumented card, thus create this patch (interestingly it was the only
EXPERIMENTAL remaining in the entire Kconfig file).
Signed-off-by: Andreas Mohr <andi@lisas.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
* fix/hda:
ALSA: hda - Add sanity check in PCM open callback
ALSA: hda - Call snd_pcm_lib_hw_rates() again after codec open callback
ALSA: hda - Avoid invalid formats and rates with shared SPDIF
ALSA: hda - Improve ASUS eeePC 1000 mixer
ALSA: hda - Add GPIO1 control at muting with HP laptops
When FLOAT PCM format is available but together with other linear
PCM formats, don't override maxbps value. For FLOAT format, it's always
32, thus it can be better checked in snd_hda_calc_stream_format().
Otherwise the maxbps 32 might be used wrongly even if the linear PCM
doesn't support it.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add some sanity checks of struct snd_pcm_hardware fields in the PCM
open callback of hda driver. This makes a bit easier to debug any PCM
setup errors in the codec side.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The PCM rates bit field may have been changed by the codec open callback.
In that case, we need to reset rate_min and rate_max. So, simply call
snd_pcm_lib_hw_rates() again after the codec open callback.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Check whether formats and rates don't result in zero due to the
restriction of SPDIF sharing. If any of them can be zero, disable
the SPDIF sharing mode instead. Otherwise it will lead to a PCM
configuration error.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The mixer elements created for ASUS eeePC 1000 with ALC269 aren't
standard but strange words like "LineOut". Rename the element names
to follow the standard one like "Headphone" and "Speaker".
Also, split the volumes to each so that the virtual master can control
them.
The alc269_fujitsu_mixer is removed because it's now identical with
the new eeepc mixer.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
HP laptops with AD1984A codecs (at least mobile models) need to set
GPIO1 appropriately to indicate the mute state. The BIOS checks this
bit to judge whether the mute on or off is sent via F8 key.
Without changing this bit, the BIOS can be confused and may toggle
the mute wrongly.
Reference: Novell bnc#515266
https://bugzilla.novell.com/show_bug.cgi?id=515266
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Instead of expanding alc882_init_verbs to two elements via a macro,
manually expand to each entry. This makes clear that some have already
the full slot for init_verbs array (currently 5).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
After merting patch_alc882() and patch_alc883(), the initialization of
mixer amp 0x0b was missing in alc882_base_init_verbs[].
This is usually no critical problem, but it can disable the power-saving
as the default state, so better to put to mute these channels.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When resuming, we better take the DACs out of the reset state before
trying to use them.
Reference: kernel bug #13599http://bugzilla.kernel.org/show_bug.cgi?id=13599
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
So far, the FLOAT PCM format is used only exclusivley set. But
this can be a combination with other formats.
This patch changes the parser to allow the FLOAT format in addition
to other PCM formats.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
alc882_auto_init_analog_input() sets the input pins to VREF-80 regardless
of the input pin types although it shouldn't be for line-in pins.
This patch fixes the behavior to follow other codecs.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Merge patch_alc882() and patch_alc883() to the former one since both
codecs have fairly similar connections but just a slight difference.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
During the changes to clean up / fix the realtek codec initialization
routines in commit 4a79ba34ca,
I forgot to add the check for ALC268 and ALC269.
This resulted in the missing EAPD and COEF setup for these codecs.
This patch adds the missing checks for these codecs.
Reference: bko#13633
http://bugzilla.kernel.org/show_bug.cgi?id=13633
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Check the hint "beep" in snd_hda_attach_beep_device() to avoid the beep
device creation if user doesn't want.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The Line In connector is set up as PIN_IN by default, using
VREF_HIZ. It is connected to both ADCs, so add it to both
input selectors.
Also add the ability to use the input mix (on a SoundBlaster
one would call this "What You Hear").
Signed-off-by: Tony Vroon <tony@linx.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The microphone input and its volume register have only one channel, so
we have to make the corresponding mixer control a mono control.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
as long as the io channel number is not set by the driver, the card
is not visible from the ethersound network
Signed-off-by: Tim Blechmann <tim@klingt.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>