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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Some machines machine cause a severe CORB/RIRB stall in certain
weird conditions, such as PA access at the start up together with
fglrx driver. This seems unable to be recovered without the controller
reset.
This patch allows the bus controller reset at critical errors so
that the communication gets recovered again.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ICH6_GCTL_RESET was wrongly set to another bit by the commit
b21fadb9c1. This caused a problem when
the codec needs really a reset (e.g. recovering from the communication
error at probe).
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added some missing register bits definitions to reduce magic numbers.
Also renamed some to follow the names on the datasheet.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
In the single_cmd mode, the hardware cannot store the multiple replies
like on RIRB, thus each verb has to sync and wait for the response no
matter whether the return value is needed or not. Otherwise it may
result in a wrong return value from the previous verb.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
In the single_cmd mode, the current driver code doesn't do any update
for RIRB just for any safety reason. But, actually the RIRB and
single_cmd mode don't conflict. Unsolicited events can be delivered
even while using the single_cmd mode.
This patch allows the handling of unsolicited events with single_cmd
mode, just always checking RIRB independent from single_cmd flag.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
When a codec communication error occurs, the CORB/RIRB counters should
be reset first before re-issuing the verb. Simply call azx_free_cmd_io()
and azx_init_cmd_io() to achieve that.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
ASUS W5Fm needs the fixed codec-slots to probe to override the BIOS
problem like W5F.
Tested-by: Alp Kılıç <kilic.alp@gmail.com>
Signed-off-by: Ozan Çağlayan <ozan@pardus.org.tr>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Add proper prefix to each kernel message in hda_intel.c.
Also, avoid the unneeded prefix when CONFIG_SND_VERBOSE_PRINTK is used
together with snd_print*().
Reference: bko#13207
http://bugzilla.kernel.org/show_bug.cgi?id=13207
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The PCI entries of Creative with HD-audio class can be the devices
with emu20k1/emu20k2 chips. These are supported better by snd-ctxfi
driver. With that driver, the device will mutate from HD-audio to
its native class.
This patch adds a simple ifdef to avoid the conflict of device probe
between snd-hda-intel and snd-ctxfi drivers. 1102:0009 seems still
OK to be added as it has no emu20kx chip, and is a pure HD-audio
device.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The current error-recovery scheme for the codec communication errors
doesn't work always well. Especially falling back to the
single-command mode causes the fatal problem on many systems.
In this patch, the problematic verb is re-issued again after the error
(even with polling mode) instead of the single-cmd mode. The
single-cmd mode will be used only when specified via the command
option explicitly, mainly just for testing.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Check the length to copy via strlen() beforehand to avoid the stack
corruption, or use strlcpy() to be safe in HD-audio codes.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Added the support for Creative SB X-Fi boards with UAA (HD-audio) mode.
In the HD-audio mode, no multiple streams are supported by just it
behaves like a normal HD-audio device.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commit fa00e046b4
added a new bitfield not adjacent to other
bitfields in the same struct. Moved the new one.
Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>