Commit Graph

240 Commits

Author SHA1 Message Date
Paul Menzel 0708cc582f ALSA: hda-intel: Add position_fix quirk for ASUS M2V-MX SE.
With PulseAudio and an application accessing an input device like `gnome-volume-manager` both have high CPU load as reported in [1].

Loading `snd-hda-intel` with `position_fix=1` fixes this issue. Therefore add a quirk for ASUS M2V-MX SE.

The only downside is, when now exiting for example MPlayer when it is playing an audio file a high pitched sound is outputted by the speaker.

$ lspci -vvnn | grep -A10 Audio
20:01.0 Audio device [0403]: VIA Technologies, Inc. VT1708/A [Azalia HDAC] (VIA High Definition Audio Controller) [1106:3288] (rev 10)
	Subsystem: ASUSTeK Computer Inc. Device [1043:8290]
	Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
	Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=fast >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
	Latency: 0, Cache Line Size: 64 bytes
	Interrupt: pin A routed to IRQ 17
	Region 0: Memory at fbffc000 (64-bit, non-prefetchable) [size=16K]
	Capabilities: <access denied>
	Kernel driver in use: HDA Intel

[1] http://sourceforge.net/mailarchive/forum.php?thread_name=1265550675.4642.24.camel%40mattotaupa&forum_name=alsa-user

Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-22 08:37:15 +01:00
Paul Menzel 2448158ed2 ALSA: Typo. s/distrubs/disturbs/
Signed-off-by: Paul Menzel <paulepanter@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-22 08:36:56 +01:00
Takashi Iwai b2d6efe7fa Merge branch 'fix/hda' into topic/hda 2010-02-09 21:34:18 +01:00
Jody Bruchon fed08d036f ALSA: hda-intel: Avoid divide by zero crash
On my AMD780V chipset, hda_intel.c can crash the kernel with a divide by
zero
for as-yet unknown reasons. A simple check for zero prevents it, though
the problem that causes it remains. Since the workaround is harmless and
won't affect anyone except victims of this bug, it should be safe;
moreover,
because this crash can be triggered by a user-mode application, there are
denial of service implications on the systems affected by the bug without
the patch.

Signed-off-by: Jody Bruchon <jody@nctritech.com>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-09 21:33:33 +01:00
Takashi Iwai 794d620650 Merge branch 'fix/hda' into topic/hda 2010-02-05 09:09:25 +01:00
Maxim Levitsky 9492837a6f ALSA: cosmetic: make hda intel interrupt name consistent with others
This renames the interrupt name in /proc/interrupt.
HDA Intel -> hda_intel

This also eliminates space from the name, probably helping some
parsers.
Don't think anybody depends on this name in userspace

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-05 09:08:14 +01:00
Maxim Levitsky 1eb6dc7dab ALSA: hda - Delay switching to polling mode if an interrupt was missing
My sound codec seems sometimes (very rarely) to omit interrupts (ALC268)
However, interrupt mode still works.
Thus if we get timeout, poll the codec once.

If we get 3 such polls in a row, then switch to polling mode.

This patch is maybe an bandaid, but this might be a workaround for hardware bug.

Signed-off-by: Maxim Levitsky <maximlevitsky@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-05 09:07:21 +01:00
Takashi Iwai c893622251 ALSA: hda - Define max number of PCM devices in hda_codec.h
Define the constant rather in the common header file.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-28 17:08:53 +01:00
Wei Ni 7b36ea967c ALSA: hda - Change the AZX_MAX_PCMS to 10
In hda_codec.c, it has define
"[HDA_PCM_TYPE_HDMI]  = { 3, 7, 8, 9, -1 },",
it support up to device 9 for HDMI.
But in hda_intel.c, it only define AZX_MAX_PCMS as 8.
So if it have 4 hdmi codecs, when run azx_attach_pcm_stream(),
it will show error "Invalid PCM device number 8", and "... number 9",
and return "-EINVAL".
We should change the AZX_MAX_PCMS to 10.

Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-28 17:06:19 +01:00
Takashi Iwai 8ce28d6abf ALSA: hda - Add an ASUS mobo to MSI blacklist
Sid Boyce reported that his machine locks up without enable_msi=0 option.
This looks like another ASUS mobo with Nvidia combo.

Reported-by: Sid Boyce <sboyce@blueyonder.co.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-27 20:26:08 +01:00
Wei Ni ccc5df058d ALSA: hda - Add support for more the 8 streams
In azx_stream_start() and azx_stream_stop(),
it use azx_readb/azx_writeb to read/write SIE,
it just enable/disable 8 streams.
But according to the HDA spec, it support 30 streams,
and the new HDA controller will support more then 8
streams. So we should use azx_readl/azx_writel to
read/write SIE.

Signed-off-by: Wei Ni <wni@nvidia.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-26 10:40:03 +01:00
Seth Heasley d2f2fcd254 ALSA: hda_intel: ALSA HD Audio patch for Intel Cougar Point DeviceIDs
This patch adds the Intel Cougar Point (PCH) HD Audio Controller DeviceIDs.

Signed-off-by: Seth Heasley <seth.heasley@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-01-13 08:34:34 +01:00
Takashi Iwai 15e7f8b92a Merge branch 'fix/hda' into topic/hda 2009-12-25 14:17:48 +01:00
Wu Fengguang ef18beded8 ALSA: hda - HDMI sticky stream tag support
When we run the following commands in turn (with
CONFIG_SND_HDA_POWER_SAVE_DEFAULT=0),

	speaker-test -Dhw:0,3 -c2 -twav  # HDMI
	speaker-test -Dhw:0,0 -c2 -twav  # Analog

The second command will produce sound in the analog lineout _as well as_
HDMI sink. The root cause is, device 0 "reuses" the same stream tag that
was used by device 3, and the "intelhdmi - sticky stream id" patch leaves
the HDMI codec in a functional state. So the HDMI codec happily accepts
the audio samples which reuse its stream tag.

The proposed solution is to remember the last device each azx_dev was
assigned to, and prefer to
1) reuse the azx_dev (and hence the stream tag) the HDMI codec last used
2) or assign a never-used azx_dev for HDMI

With this patch and the above two speaker-test commands,
HDMI codec will use stream tag 8 and Analog codec will use 5.

The stream tag used by HDMI codec won't be reused by others, as long
as we don't run out of the 4 playback azx_dev's. The legacy Analog
codec will continue to use stream tag 5 because its device id is 0
(this is a bit tricky).

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-25 14:17:36 +01:00
Takashi Iwai 524027916e Merge branch 'fix/hda' into topic/hda 2009-12-23 08:38:23 +01:00
Takashi Iwai 9dc8398bab ALSA: hda - Add MSI blacklist
A machine with AMD CPU with Nvidia board doesn't work with MSI.

Reported-by: Robert J. King <peritus@gurunetwork.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-22 08:15:01 +01:00
Takashi Iwai 0c2fd1bf4c ALSA: hda - Check class to identify Nvidia controller chips
Instead of listing all individual PCI IDs, check the matching with
the PCI class together with the vendor id for Nvidia.
This simplifies the pci id entries.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-18 16:41:39 +01:00
Stefan Ringel 6dd7dc767e ALSA: hda - Add PCI IDs for Nvidia G2xx-series
Signed-off-by: Stefan Ringel <stefan.ringel@arcor.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-14 11:27:11 +01:00
Wu Fengguang 0287d97065 intelhdmi - dont power off HDA link
For codecs without EPSS support (G45/IbexPeak), the hotplug event will
be lost if the HDA is powered off during the time. After that the pin
presence detection verb returns inaccurate info.

So always power-on HDA link for !EPSS codecs.

KarL offers the fact and Takashi recommends to flag hda_bus. Thanks!

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-11 14:06:18 +01:00
Jaroslav Kysela 396087eaea ALSA: hda - Terradici HDA controllers does not support 64-bit mode
Confirmed from vendor and tests in RedHat bugzilla #536782 .

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-09 12:29:25 +01:00
Takashi Iwai 2f703e7a2e ALSA: hda - Add position_fix quirk for HP dv3
HP dv3 requires position_fix=1.

Reference: Novell bnc#555935
	https://bugzilla.novell.com/show_bug.cgi?id=555935

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-01 14:17:37 +01:00
Takashi Iwai 45d4ebf1a6 ALSA: hda - Add a position_fix quirk for MSI Wind U115
MSI Wind U115 seems to require position_fix=1 explicitly.
Otherwise it screws up PulseAudio.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-30 11:59:17 +01:00
Jaroslav Kysela 2dca0bba70 ALSA: hda - add beep_mode module parameter
The beep_mode parameter for snd-hda-intel module allows to choose among
different digital beep device registation to the input layer.

0 = do not register to the input layer
1 = register to the input layer all time
2 = use "Beep Switch" control exported to user space mixer applications

Also, introduce CONFIG_SND_HDA_INPUT_BEEP_MODE for default value.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-16 11:35:10 +01:00
Takashi Iwai 7d1794e81b Merge branch 'fix/hda' into topic/hda 2009-11-16 11:33:35 +01:00
Takashi Iwai fb8d1a344d ALSA: hda - Add reboot notifier to each codec
Add reboot notifier to each codec so that it can do some workarounds
needed for reboot.

So far, patch_sigmatel.c calls its shutup routine for avoiding noises
at reboot on some HP machines.

References: Novell bnc#544779
	http://bugzilla.novell.com/show_bug.cgi?id=544779

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-10 16:02:29 +01:00
Takashi Iwai 1a6969788e ALSA: hda - Don't initialize CORB/RIRB for single_cmd mode
So far, CORB/RIRB still remains even if the driver is switched to the
single_cmd mode.  The specification says that this should be disabled,
but I hoped this isn't the case; indeed most devices worked together with
CORB/RIRB.

However, Poulsbo (US15W) seems problematic with this setup, and it
requires to disable CORB/RIRB when single_cmd is used.

Now this patch disables CORB/RIRB initialization when the single_cmd
mode is used.  Also the unsolicited event is disabled because it can't
work without RIRB.

Reported-and-tested-by: Troy Kisky <troy.kisky@boundarydevices.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-07 09:49:04 +01:00
Takashi Iwai 7d5ab41870 Merge branch 'fix/hda' into topic/hda 2009-11-05 08:56:20 +01:00
Takashi Iwai 23c4a8812a ALSA: hda - Switch to polling mode before disabling MSI
When any codec communication error happens, try to switch to the polling
mode first before turning off MSI.  MSI gets more stable nowadays, thus
we should keep it on as much as possible.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 13:21:49 +01:00
peer chen db32f99816 ALSA: hda_intel: Add the Linux device ID for NVIDIA HDA controller
Add the generic device ID for NVIDIA HDA controller.

Signed-off-by: Peer Chen <peerchen@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 11:59:12 +01:00
Takashi Iwai 71623855e2 ALSA: hda - Enable MSI as default
Since the recent kernel can handle MSI properly on non-Intel platforms,
let's enable MSI as default.

If any borken device is found, we can add the quirk entry to the list,
which is currently empty.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-28 13:15:30 +02:00
Daniel T Chen 3d80dcaca1 ALSA: hda - Add HP Pavilion dv4t-1300 to MSI whitelist
BugLink: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=547994

Enable MSI by default for this Pavilion model.

Signed-off-by: Daniel T Chen <crimsun@ubuntu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-24 12:14:37 +02:00
Takashi Iwai 4d8e22e0f6 ALSA: hda - Add a white-list for MSI option
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>
2009-08-11 14:25:46 +02:00
Takashi Iwai e44d4e4cee Merge branch 'fix/hda' into topic/hda 2009-08-03 08:37:17 +02:00
Wu Fengguang e310bb0646 ALSA: hda: warn on spurious response
To help disclose hardware bugs.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:27:53 +02:00
Wu Fengguang feb273404f ALSA: hda: remember last command for each codec
Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-08-03 08:27:39 +02:00
Wu Fengguang c32649feb4 ALSA: hda: read CORBWP inside reg_lock
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>
2009-08-03 08:26:55 +02:00
Wu Fengguang cdb1fbf231 ALSA: hda: take reg_lock in azx_init_cmd_io/azx_free_cmd_io
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>
2009-08-03 08:26:42 +02:00
Wu Fengguang a678cdee25 ALSA: hda: take cmd_mutex in probe_codec()
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>
2009-08-03 08:26:23 +02:00
Wu Fengguang deadff1665 ALSA: hda: track CIRB/CORB command/response states for each codec
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>
2009-08-03 08:26:13 +02:00
Andiry Brienza 9176b672c2 ALSA: hda - Add support for new AMD HD audio devices
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>
2009-07-17 11:16:51 +02:00
Takashi Iwai 305355aad8 Merge branch 'fix/hda' into topic/hda
Conflicts:
	sound/pci/hda/patch_realtek.c

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-09 18:48:38 +02:00
Andiry Brienza dc4c2e6bde ALSA: hda - Disable AMD SB600 64bit address support only
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>
2009-07-08 08:01:47 +02:00
Takashi Iwai aba6653617 ALSA: hda - Fix error path in the sanity check in azx_pcm_open()
Release resources cleanly after errors in the sanity check in
azx_pcm_open().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-05 11:44:46 +02:00
Takashi Iwai 1475ef0f03 Merge branch 'fix/hda' into topic/hda 2009-07-04 12:20:25 +02:00
Takashi Iwai c470331e69 ALSA: hda - Add sanity check in PCM open callback
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>
2009-07-03 23:10:23 +02:00
Takashi Iwai 70d321e638 ALSA: hda - Call snd_pcm_lib_hw_rates() again after codec open callback
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>
2009-07-03 23:06:45 +02:00
Takashi Iwai 4ea6fbc8eb ALSA: hda - Add patch module option
Added the patch module option to apply a "patch" as a firmware to
modify pin configurations or give additional hints to the driver
before actually initializing and configuring the codec.

This can be used as a workaround when the BIOS doesn't give sufficient
information or give wrong information that doesn't match with the real
hardware setup, until it's fixed statically in the driver via a quirk.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-24 11:53:43 +02:00
Takashi Iwai a1e21c9078 ALSA: hda - Don't call snd_hda_codec_configure in snd_hda_codec_new()
The codec setup call via snd_hda_codec_configure() isn't necessarily
called in snd_hda_codec_new().  For the later added feature, it's better
to change the code flow like:
 - create all codec instances
 - configure each codec

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-24 11:52:59 +02:00
Alexander Beregalov 65f7598311 ALSA: hda_intel: fix build error when !PM
Fix this build error when CONFIG_PM is not set:
ound/pci/hda/hda_intel.c: In function 'azx_bus_reset':
sound/pci/hda/hda_intel.c:1270: error: implicit declaration of function 'snd_pcm_suspend_all'
sound/pci/hda/hda_intel.c:1271: error: implicit declaration of function 'snd_hda_suspend'
sound/pci/hda/hda_intel.c:1272: error: implicit declaration of function 'snd_hda_resume'

Signed-off-by: Alexander Beregalov <a.beregalov@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-04 14:21:11 +02:00
Takashi Iwai b20f3b8346 ALSA: hda - Limit codec-verb retry to limited hardwares
The reset of a BUS controller during operations is somehow risky and
shouldn't be done inevitably for devices that have apparently no such
codec-communication problems.

This patch adds the check of the hardware and limits the bus-reset
capability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 01:21:30 +02:00