Commit d2afbe78 authored by Takashi Iwai's avatar Takashi Iwai

ALSA: hda - Update documentation

Minor typo-fixes and improvements on HD-Audio.txt.
Signed-off-by: default avatarTakashi Iwai <tiwai@suse.de>
parent 30bc4481
...@@ -9,22 +9,25 @@ GENERAL ...@@ -9,22 +9,25 @@ GENERAL
HD-audio is the new standard on-board audio component on modern PCs HD-audio is the new standard on-board audio component on modern PCs
after AC97. Although Linux has been supporting HD-audio since long after AC97. Although Linux has been supporting HD-audio since long
time ago, there are often problems with new machines. A part of the time ago, there are often problems with new machines. A part of the
problem is broken BIOS, and rest is the driver implementation. This problem is broken BIOS, and the rest is the driver implementation.
document explains the trouble-shooting and debugging methods for the This document explains the brief trouble-shooting and debugging
HD-audio hardware. methods for the HD-audio hardware.
The HD-audio component consists of two parts: the controller chip and The HD-audio component consists of two parts: the controller chip and
the codec chips on the HD-audio bus. Linux provides a single driver the codec chips on the HD-audio bus. Linux provides a single driver
for all controllers, snd-hda-intel. Since the HD-audio controllers for all controllers, snd-hda-intel. Although the driver name contains
are supposed to be compatible, the single snd-hda-driver should work a word of a well-known harware vendor, it's not specific to it but for
in most cases. But, not surprisingly, there are known bugs and issues all controller chips by other companies. Since the HD-audio
specific to each controller type. The snd-hda-intel driver has a controllers are supposed to be compatible, the single snd-hda-driver
bunch of workarounds for these as described below. should work in most cases. But, not surprisingly, there are known
bugs and issues specific to each controller type. The snd-hda-intel
driver has a bunch of workarounds for these as described below.
A controller may have multiple codecs. Usually you have one audio A controller may have multiple codecs. Usually you have one audio
codec and optionally one modem codec. In some cases, there can be codec and optionally one modem codec. In theory, there might be
multiple audio codecs, e.g. for analog and digital outputs, but the multiple audio codecs, e.g. for analog and digital outputs, and the
driver might not work properly. driver might not work properly because of conflict of mixer elements.
This should be fixed in future if such hardware really exists.
The snd-hda-intel driver has several different codec parsers depending The snd-hda-intel driver has several different codec parsers depending
on the codec. It has a generic parser as a fallback, but this on the codec. It has a generic parser as a fallback, but this
...@@ -48,15 +51,16 @@ DMA-Position Problem ...@@ -48,15 +51,16 @@ DMA-Position Problem
The most common problem of the controller is the inaccurate DMA The most common problem of the controller is the inaccurate DMA
pointer reporting. The DMA pointer for playback and capture can be pointer reporting. The DMA pointer for playback and capture can be
read in two ways, either via a LPIB register or via a position-buffer read in two ways, either via a LPIB register or via a position-buffer
map. As default the driver tries to reads from the io-mapped map. As default the driver tries to read from the io-mapped
position-buffer, and falls back to LPIB if it appears unupdated. position-buffer, and falls back to LPIB if the position-buffer appears
However, this detection isn't perfect on some devices. In such a dead. However, this detection isn't perfect on some devices. In such
case, you can change the default method via `position_fix` option. a case, you can change the default method via `position_fix` option.
`position_fix=1` means to use LPIB method explicitly. `position_fix=1` means to use LPIB method explicitly.
`position_fix=2` means to use the position-buffer. 0 is the default `position_fix=2` means to use the position-buffer. 0 is the default
value, the automatic check. If you get a problem of repeated sounds, value, the automatic check and fallback to LPIB as described in the
this option might help. above. If you get a problem of repeated sounds, this option might
help.
In addition to that, every controller is known to be broken regarding In addition to that, every controller is known to be broken regarding
the wake-up timing. It wakes up a few samples before actually the wake-up timing. It wakes up a few samples before actually
...@@ -67,9 +71,9 @@ via `bdl_pos_adj` option. ...@@ -67,9 +71,9 @@ via `bdl_pos_adj` option.
When `bdl_pos_adj` is a negative value (as default), it's assigned to When `bdl_pos_adj` is a negative value (as default), it's assigned to
an appropriate value depending on the controller chip. For Intel an appropriate value depending on the controller chip. For Intel
chip, it'd be 1 while it'd be 32 for others. Usually this works. chips, it'd be 1 while it'd be 32 for others. Usually this works.
Only in case it doesn't work and you get warning messages, you should Only in case it doesn't work and you get warning messages, you should
change to other values. change this parameter to other values.
Codec-Probing Problem Codec-Probing Problem
...@@ -77,13 +81,13 @@ Codec-Probing Problem ...@@ -77,13 +81,13 @@ Codec-Probing Problem
A less often but a more severe problem is the codec probing. When A less often but a more severe problem is the codec probing. When
BIOS reports the available codec slots wrongly, the driver gets BIOS reports the available codec slots wrongly, the driver gets
confused and tries to access the non-existing codec slot. This often confused and tries to access the non-existing codec slot. This often
results in the total screw-up, and destruct the further communication results in the total screw-up, and destructs the further communication
with the codec chips. The symptom appears usually as the error with the codec chips. The symptom appears usually as error messages
message like: like:
------------------------------------------------------------------------ ------------------------------------------------------------------------
hda_intel: azx_get_response timeout, switching to polling mode: \ hda_intel: azx_get_response timeout, switching to polling mode:
last cmd=0x12345678 last cmd=0x12345678
hda_intel: azx_get_response timeout, switching to single_cmd mode: \ hda_intel: azx_get_response timeout, switching to single_cmd mode:
last cmd=0x12345678 last cmd=0x12345678
------------------------------------------------------------------------ ------------------------------------------------------------------------
...@@ -98,9 +102,9 @@ accessing a non-existing codec slot. ...@@ -98,9 +102,9 @@ accessing a non-existing codec slot.
Thus, if the second error message appears, try to narrow the probed Thus, if the second error message appears, try to narrow the probed
codec slots via `probe_mask` option. It's a bitmask, and each bit codec slots via `probe_mask` option. It's a bitmask, and each bit
corresponding to the codec slot. For example, to probe only the corresponds to the codec slot. For example, to probe only the first
first slot, pass `probe_mask=1`. For the first and the third slots, slot, pass `probe_mask=1`. For the first and the third slots, pass
pass `probe_mask=5` (where 5 = 1 | 4), and so on. `probe_mask=5` (where 5 = 1 | 4), and so on.
Since 2.6.29 kernel, the driver has a more robust probing method, so Since 2.6.29 kernel, the driver has a more robust probing method, so
this error might happen rarely, though. this error might happen rarely, though.
...@@ -119,10 +123,10 @@ HD-AUDIO CODEC ...@@ -119,10 +123,10 @@ HD-AUDIO CODEC
Model Option Model Option
~~~~~~~~~~~~ ~~~~~~~~~~~~
The most common problems with the HD-audio driver is the unsupported The most common problem regarding the HD-audio driver is the
codec features or the mismatched device configuration. Most of unsupported codec features or the mismatched device configuration.
codec-specific code has several preset models, either to override the Most of codec-specific code has several preset models, either to
BIOS setup or to provide more comprehensive features. override the BIOS setup or to provide more comprehensive features.
The driver checks PCI SSID and looks through the static configuration The driver checks PCI SSID and looks through the static configuration
table until any matching entry is found. If you have a new machine, table until any matching entry is found. If you have a new machine,
...@@ -130,44 +134,44 @@ you may see a message like below: ...@@ -130,44 +134,44 @@ you may see a message like below:
------------------------------------------------------------------------ ------------------------------------------------------------------------
hda_codec: Unknown model for ALC880, trying auto-probe from BIOS... hda_codec: Unknown model for ALC880, trying auto-probe from BIOS...
------------------------------------------------------------------------ ------------------------------------------------------------------------
Even if you such a message, DON'T PANIC. Take a deep breath (and keep Even if you see such a message, DON'T PANIC. Take a deep breath and
your towel). First of all, it's an informational message, no warning, keep your towel. First of all, it's an informational message, no
no error. This means that the PCI SSID of your device isn't listed in warning, no error. This means that the PCI SSID of your device isn't
the known preset model list. But, this doesn't mean that the driver listed in the known preset model (white-)list. But, this doesn't mean
is broken. Many codec-driver provides the automatic configuration that the driver is broken. Many codec-drivers provide the automatic
based on the BIOS setup. configuration mechanism based on the BIOS setup.
The HD-audio codec has usually "pin" widgets, and BIOS sets the default The HD-audio codec has usually "pin" widgets, and BIOS sets the default
configuration of each pin, which indicates the location, the configuration of each pin, which indicates the location, the
connection type, the jack color, etc. The HD-audio driver can guess connection type, the jack color, etc. The HD-audio driver can guess
the right connection judging from these default configuration values. the right connection judging from these default configuration values.
However -- some codec support codes, such as patch_analog.c, don't However -- some codec-support codes, such as patch_analog.c, don't
support the automatic probing (yet as of 2.6.28). And, BIOS is often, support the automatic probing (yet as of 2.6.28). And, BIOS is often,
yes, pretty often broken. It sets up wrong values and screws up the yes, pretty often broken. It sets up wrong values and screws up the
driver. driver.
The preset model is provided basically to override such a situation. The preset model is provided basically to overcome such a situation.
When the matching preset model is found in the list, the driver When the matching preset model is found in the white-list, the driver
assumes the static configuration of that preset and builds the mixer assumes the static configuration of that preset and builds the mixer
and PCM based on the static information. Thus, if you have a newer elements and PCM streams based on the static information. Thus, if
machine with a slightly different PCI SSID from the existing one, you you have a newer machine with a slightly different PCI SSID from the
may have a good chance to re-use the same model. You can pass the existing one, you may have a good chance to re-use the same model.
`model` option to specify the preset model instead of PCI SSID You can pass the `model` option to specify the preset model instead of
look-up. PCI SSID look-up.
What `model` option values are available depends on the codec chip. What `model` option values are available depends on the codec chip.
Check your codec chip from the codec proc file (see "Codec Proc-File" Check your codec chip from the codec proc file (see "Codec Proc-File"
section below). It will show the vendor/product name of your codec section below). It will show the vendor/product name of your codec
chip. Then, see Documentation/sound/alsa/ALSA-Configuration.txt file. chip. Then, see Documentation/sound/alsa/ALSA-Configuration.txt
In the section of HD-audio driver, you can find a list of codecs and file, the section of HD-audio driver. You can find a list of codecs
`model` options belonging to each codec. For example, for Realtek and `model` options belonging to each codec. For example, for Realtek
ALC262 codec chip, pass `model=ultra` for devices that are compatible ALC262 codec chip, pass `model=ultra` for devices that are compatible
with Samsung Q1 Ultra. with Samsung Q1 Ultra.
Thus, the first thing you can do for any brand-new, unsupported Thus, the first thing you can do for any brand-new, unsupported and
HD-audio hardware is to check HD-audio codec and several different non-working HD-audio hardware is to check HD-audio codec and several
`model` option values. If you have a luck, some of them might suit different `model` option values. If you have a luck, some of them
with your device well. might suit with your device well.
Some codecs such as ALC880 have a special model option `model=test`. Some codecs such as ALC880 have a special model option `model=test`.
This configures the driver to provide as many mixer controls as This configures the driver to provide as many mixer controls as
...@@ -188,12 +192,14 @@ One of the most frequent (and obvious) bugs with HD-audio is the ...@@ -188,12 +192,14 @@ One of the most frequent (and obvious) bugs with HD-audio is the
silent output from either or both of a built-in speaker and a silent output from either or both of a built-in speaker and a
headphone jack. In general, you should try a headphone output at headphone jack. In general, you should try a headphone output at
first. A speaker output often requires more additional controls like first. A speaker output often requires more additional controls like
the amplifier. Thus a headphone output has a slightly better chance. the external amplifier bits. Thus a headphone output has a slightly
better chance.
Before making a bug report, double-check whether the mixer is set up Before making a bug report, double-check whether the mixer is set up
correctly. The recent version of snd-hda-intel driver provides mostly correctly. The recent version of snd-hda-intel driver provides mostly
"Master" volume control as well as "Front" volume. In addition, there "Master" volume control as well as "Front" volume (where Front
are individual "Headphone" and "Speaker" controls. indicates the front-channels). In addition, there can be individual
"Headphone" and "Speaker" controls.
Ditto for the speaker output. There can be "External Amplifier" Ditto for the speaker output. There can be "External Amplifier"
switch on some codecs. Turn on this if present. switch on some codecs. Turn on this if present.
...@@ -214,7 +220,7 @@ following: ...@@ -214,7 +220,7 @@ following:
external amplifier. This can be set usually via EAPD verb or a external amplifier. This can be set usually via EAPD verb or a
certain GPIO. If the codec pin supports EAPD, you have a better certain GPIO. If the codec pin supports EAPD, you have a better
chance via SET_EAPD_BTL verb (0x70c). On others, GPIO pin (mostly chance via SET_EAPD_BTL verb (0x70c). On others, GPIO pin (mostly
it's either GPIO0 or GPIO1) can turn on/off EAPD. it's either GPIO0 or GPIO1) may turn on/off EAPD.
- Some Realtek codecs require special vendor-specific coefficients to - Some Realtek codecs require special vendor-specific coefficients to
turn on the amplifier. See patch_realtek.c. turn on the amplifier. See patch_realtek.c.
- IDT codecs may have extra power-enable/disable controls on each - IDT codecs may have extra power-enable/disable controls on each
...@@ -227,29 +233,29 @@ following: ...@@ -227,29 +233,29 @@ following:
Capture Problems Capture Problems
~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~
The capture problems are often missing setups of mixers. Thus, before The capture problems are often because of missing setups of mixers.
submitting a bug report, make sure that you set up the mixer Thus, before submitting a bug report, make sure that you set up the
correctly. For example, both "Capture Volume" and "Capture Switch" mixer correctly. For example, both "Capture Volume" and "Capture
have to be set properly in addition to the right "Capture Source" or Switch" have to be set properly in addition to the right "Capture
"Input Source" selection. Some devices have "Mic Boost" volume or Source" or "Input Source" selection. Some devices have "Mic Boost"
switch. volume or switch.
When the PCM device is opened via "default" PCM (without pulse-audio When the PCM device is opened via "default" PCM (without pulse-audio
plugin), you'll likely have "Digital Capture Volume" control as well. plugin), you'll likely have "Digital Capture Volume" control as well.
This is provided for the extra gain/attenuation of the signal in This is provided for the extra gain/attenuation of the signal in
software, especially for the inputs without the hardware volume software, especially for the inputs without the hardware volume
control such as digital microphones. Unless really needed, this control such as digital microphones. Unless really needed, this
should be set to exactly 50%, corresponding to 0dB. When you use "hw" should be set to exactly 50%, corresponding to 0dB -- neither extra
PCM, i.e., a raw access PCM, this control will have no influence, gain nor attenuation. When you use "hw" PCM, i.e., a raw access PCM,
though. this control will have no influence, though.
It's known that some codecs / devices have fairly bad analog circuits, It's known that some codecs / devices have fairly bad analog circuits,
and the recorded sound contains a certain DC-offset. This is no bug and the recorded sound contains a certain DC-offset. This is no bug
of the driver. of the driver.
Most of modern laptops have no analog CD-input connection. Thus, the Most of modern laptops have no analog CD-input connection. Thus, the
recording from CD input won't work in many cases although the driver recording from CD input won't work in many cases although the driver
provides it as the capture source. provides it as the capture source. Use CDDA instead.
The automatic switching of the built-in and external mic per plugging The automatic switching of the built-in and external mic per plugging
is implemented on some codec models but not on every model. Partly is implemented on some codec models but not on every model. Partly
...@@ -264,7 +270,7 @@ to fight again the evil, try debugging via hitting the raw HD-audio ...@@ -264,7 +270,7 @@ to fight again the evil, try debugging via hitting the raw HD-audio
codec verbs to the device. Some tools are available: hda-emu and codec verbs to the device. Some tools are available: hda-emu and
hda-analyzer. The detailed description is found in the sections hda-analyzer. The detailed description is found in the sections
below. You'd need to enable hwdep for using these tools. See "Kernel below. You'd need to enable hwdep for using these tools. See "Kernel
Configuration". Configuration" section.
OTHER ISSUES OTHER ISSUES
...@@ -284,15 +290,16 @@ sure to want it. ...@@ -284,15 +290,16 @@ sure to want it.
Don't forget to turn on the appropriate `CONFIG_SND_HDA_CODEC_*` Don't forget to turn on the appropriate `CONFIG_SND_HDA_CODEC_*`
options. Note that each of them corresponds to the codec chip, not options. Note that each of them corresponds to the codec chip, not
the controller chip. Thus, even if lspci shows the Nvidia controller, the controller chip. Thus, even if lspci shows the Nvidia controller,
you may choose the option for other vendors. If you are unsure, just you may need to choose the option for other vendors. If you are
choose all yes. unsure, just select all yes.
`CONFIG_SND_HDA_HWDEP` is a useful option for debugging the driver. `CONFIG_SND_HDA_HWDEP` is a useful option for debugging the driver.
When this is enabled, the driver creates hardware-dependent devices When this is enabled, the driver creates hardware-dependent devices
(one per each codec), and you have a raw access to the device via (one per each codec), and you have a raw access to the device via
hda-verb program. For example, `hwC0D2` will be created for the card these device files. For example, `hwC0D2` will be created for the
0 codec slot #2. For debug tools such as hda-verb and hda-analyzer, codec slot #2 of the first card (#0). For debug-tools such as
the hwdep device has to be enabled. Thus, turn this on always. hda-verb and hda-analyzer, the hwdep device has to be enabled.
Thus, it'd be better to turn this on always.
`CONFIG_SND_HDA_RECONFIG` is a new option, and this depends on the `CONFIG_SND_HDA_RECONFIG` is a new option, and this depends on the
hwdep option above. When enabled, you'll have some sysfs files under hwdep option above. When enabled, you'll have some sysfs files under
...@@ -436,7 +443,7 @@ details. ...@@ -436,7 +443,7 @@ details.
hda-verb hda-verb
~~~~~~~~ ~~~~~~~~
hda-verb is a tiny program that allows you to access the HD-audio hda-verb is a tiny program that allows you to access the HD-audio
codec directly. It executes a HD-audio codec verb directly. codec directly. You can execute a raw HD-audio codec verb with this.
This program accesses the hwdep device, thus you need to enable the This program accesses the hwdep device, thus you need to enable the
kernel config `CONFIG_SND_HDA_HWDEP=y` beforehand. kernel config `CONFIG_SND_HDA_HWDEP=y` beforehand.
...@@ -486,7 +493,7 @@ hda-analyzer ...@@ -486,7 +493,7 @@ hda-analyzer
~~~~~~~~~~~~ ~~~~~~~~~~~~
hda-analyzer provides a graphical interface to access the raw HD-audio hda-analyzer provides a graphical interface to access the raw HD-audio
control, based on pyGTK2 binding. It's a more powerful version of control, based on pyGTK2 binding. It's a more powerful version of
hda-verb. The program gives you a easy-to-use GUI stuff for showing hda-verb. The program gives you an easy-to-use GUI stuff for showing
the widget information and adjusting the amp values, as well as the the widget information and adjusting the amp values, as well as the
proc-compatible output. proc-compatible output.
...@@ -498,7 +505,7 @@ alsa-project.org: ...@@ -498,7 +505,7 @@ alsa-project.org:
hda-emu hda-emu
~~~~~~~ ~~~~~~~
hda-emu is a HD-audio emulator. The main purpose of this program is hda-emu is an HD-audio emulator. The main purpose of this program is
to debug an HD-audio codec without the real hardware. Thus, it to debug an HD-audio codec without the real hardware. Thus, it
doesn't emulate the behavior with the real audio I/O, but it just doesn't emulate the behavior with the real audio I/O, but it just
dumps the codec register changes and the ALSA-driver internal changes dumps the codec register changes and the ALSA-driver internal changes
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment