diff options
Diffstat (limited to 'Documentation/sound')
-rw-r--r-- | Documentation/sound/alsa/HD-Audio.txt | 159 |
1 files changed, 83 insertions, 76 deletions
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/alsa/HD-Audio.txt index e758f24017bf..ca8187de52d8 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/alsa/HD-Audio.txt | |||
@@ -9,22 +9,25 @@ GENERAL | |||
9 | HD-audio is the new standard on-board audio component on modern PCs | 9 | HD-audio is the new standard on-board audio component on modern PCs |
10 | after AC97. Although Linux has been supporting HD-audio since long | 10 | after AC97. Although Linux has been supporting HD-audio since long |
11 | time ago, there are often problems with new machines. A part of the | 11 | time ago, there are often problems with new machines. A part of the |
12 | problem is broken BIOS, and rest is the driver implementation. This | 12 | problem is broken BIOS, and the rest is the driver implementation. |
13 | document explains the trouble-shooting and debugging methods for the | 13 | This document explains the brief trouble-shooting and debugging |
14 | HD-audio hardware. | 14 | methods for the HD-audio hardware. |
15 | 15 | ||
16 | The HD-audio component consists of two parts: the controller chip and | 16 | The HD-audio component consists of two parts: the controller chip and |
17 | the codec chips on the HD-audio bus. Linux provides a single driver | 17 | the codec chips on the HD-audio bus. Linux provides a single driver |
18 | for all controllers, snd-hda-intel. Since the HD-audio controllers | 18 | for all controllers, snd-hda-intel. Although the driver name contains |
19 | are supposed to be compatible, the single snd-hda-driver should work | 19 | a word of a well-known harware vendor, it's not specific to it but for |
20 | in most cases. But, not surprisingly, there are known bugs and issues | 20 | all controller chips by other companies. Since the HD-audio |
21 | specific to each controller type. The snd-hda-intel driver has a | 21 | controllers are supposed to be compatible, the single snd-hda-driver |
22 | bunch of workarounds for these as described below. | 22 | should work in most cases. But, not surprisingly, there are known |
23 | bugs and issues specific to each controller type. The snd-hda-intel | ||
24 | driver has a bunch of workarounds for these as described below. | ||
23 | 25 | ||
24 | A controller may have multiple codecs. Usually you have one audio | 26 | A controller may have multiple codecs. Usually you have one audio |
25 | codec and optionally one modem codec. In some cases, there can be | 27 | codec and optionally one modem codec. In theory, there might be |
26 | multiple audio codecs, e.g. for analog and digital outputs, but the | 28 | multiple audio codecs, e.g. for analog and digital outputs, and the |
27 | driver might not work properly. | 29 | driver might not work properly because of conflict of mixer elements. |
30 | This should be fixed in future if such hardware really exists. | ||
28 | 31 | ||
29 | The snd-hda-intel driver has several different codec parsers depending | 32 | The snd-hda-intel driver has several different codec parsers depending |
30 | on the codec. It has a generic parser as a fallback, but this | 33 | on the codec. It has a generic parser as a fallback, but this |
@@ -48,15 +51,16 @@ DMA-Position Problem | |||
48 | The most common problem of the controller is the inaccurate DMA | 51 | The most common problem of the controller is the inaccurate DMA |
49 | pointer reporting. The DMA pointer for playback and capture can be | 52 | pointer reporting. The DMA pointer for playback and capture can be |
50 | read in two ways, either via a LPIB register or via a position-buffer | 53 | read in two ways, either via a LPIB register or via a position-buffer |
51 | map. As default the driver tries to reads from the io-mapped | 54 | map. As default the driver tries to read from the io-mapped |
52 | position-buffer, and falls back to LPIB if it appears unupdated. | 55 | position-buffer, and falls back to LPIB if the position-buffer appears |
53 | However, this detection isn't perfect on some devices. In such a | 56 | dead. However, this detection isn't perfect on some devices. In such |
54 | case, you can change the default method via `position_fix` option. | 57 | a case, you can change the default method via `position_fix` option. |
55 | 58 | ||
56 | `position_fix=1` means to use LPIB method explicitly. | 59 | `position_fix=1` means to use LPIB method explicitly. |
57 | `position_fix=2` means to use the position-buffer. 0 is the default | 60 | `position_fix=2` means to use the position-buffer. 0 is the default |
58 | value, the automatic check. If you get a problem of repeated sounds, | 61 | value, the automatic check and fallback to LPIB as described in the |
59 | this option might help. | 62 | above. If you get a problem of repeated sounds, this option might |
63 | help. | ||
60 | 64 | ||
61 | In addition to that, every controller is known to be broken regarding | 65 | In addition to that, every controller is known to be broken regarding |
62 | the wake-up timing. It wakes up a few samples before actually | 66 | the wake-up timing. It wakes up a few samples before actually |
@@ -67,9 +71,9 @@ via `bdl_pos_adj` option. | |||
67 | 71 | ||
68 | When `bdl_pos_adj` is a negative value (as default), it's assigned to | 72 | When `bdl_pos_adj` is a negative value (as default), it's assigned to |
69 | an appropriate value depending on the controller chip. For Intel | 73 | an appropriate value depending on the controller chip. For Intel |
70 | chip, it'd be 1 while it'd be 32 for others. Usually this works. | 74 | chips, it'd be 1 while it'd be 32 for others. Usually this works. |
71 | Only in case it doesn't work and you get warning messages, you should | 75 | Only in case it doesn't work and you get warning messages, you should |
72 | change to other values. | 76 | change this parameter to other values. |
73 | 77 | ||
74 | 78 | ||
75 | Codec-Probing Problem | 79 | Codec-Probing Problem |
@@ -77,13 +81,13 @@ Codec-Probing Problem | |||
77 | A less often but a more severe problem is the codec probing. When | 81 | A less often but a more severe problem is the codec probing. When |
78 | BIOS reports the available codec slots wrongly, the driver gets | 82 | BIOS reports the available codec slots wrongly, the driver gets |
79 | confused and tries to access the non-existing codec slot. This often | 83 | confused and tries to access the non-existing codec slot. This often |
80 | results in the total screw-up, and destruct the further communication | 84 | results in the total screw-up, and destructs the further communication |
81 | with the codec chips. The symptom appears usually as the error | 85 | with the codec chips. The symptom appears usually as error messages |
82 | message like: | 86 | like: |
83 | ------------------------------------------------------------------------ | 87 | ------------------------------------------------------------------------ |
84 | hda_intel: azx_get_response timeout, switching to polling mode: \ | 88 | hda_intel: azx_get_response timeout, switching to polling mode: |
85 | last cmd=0x12345678 | 89 | last cmd=0x12345678 |
86 | hda_intel: azx_get_response timeout, switching to single_cmd mode: \ | 90 | hda_intel: azx_get_response timeout, switching to single_cmd mode: |
87 | last cmd=0x12345678 | 91 | last cmd=0x12345678 |
88 | ------------------------------------------------------------------------ | 92 | ------------------------------------------------------------------------ |
89 | 93 | ||
@@ -98,9 +102,9 @@ accessing a non-existing codec slot. | |||
98 | 102 | ||
99 | Thus, if the second error message appears, try to narrow the probed | 103 | Thus, if the second error message appears, try to narrow the probed |
100 | codec slots via `probe_mask` option. It's a bitmask, and each bit | 104 | codec slots via `probe_mask` option. It's a bitmask, and each bit |
101 | corresponding to the codec slot. For example, to probe only the | 105 | corresponds to the codec slot. For example, to probe only the first |
102 | first slot, pass `probe_mask=1`. For the first and the third slots, | 106 | slot, pass `probe_mask=1`. For the first and the third slots, pass |
103 | pass `probe_mask=5` (where 5 = 1 | 4), and so on. | 107 | `probe_mask=5` (where 5 = 1 | 4), and so on. |
104 | 108 | ||
105 | Since 2.6.29 kernel, the driver has a more robust probing method, so | 109 | Since 2.6.29 kernel, the driver has a more robust probing method, so |
106 | this error might happen rarely, though. | 110 | this error might happen rarely, though. |
@@ -119,10 +123,10 @@ HD-AUDIO CODEC | |||
119 | 123 | ||
120 | Model Option | 124 | Model Option |
121 | ~~~~~~~~~~~~ | 125 | ~~~~~~~~~~~~ |
122 | The most common problems with the HD-audio driver is the unsupported | 126 | The most common problem regarding the HD-audio driver is the |
123 | codec features or the mismatched device configuration. Most of | 127 | unsupported codec features or the mismatched device configuration. |
124 | codec-specific code has several preset models, either to override the | 128 | Most of codec-specific code has several preset models, either to |
125 | BIOS setup or to provide more comprehensive features. | 129 | override the BIOS setup or to provide more comprehensive features. |
126 | 130 | ||
127 | The driver checks PCI SSID and looks through the static configuration | 131 | The driver checks PCI SSID and looks through the static configuration |
128 | table until any matching entry is found. If you have a new machine, | 132 | 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 | ------------------------------------------------------------------------ | 134 | ------------------------------------------------------------------------ |
131 | hda_codec: Unknown model for ALC880, trying auto-probe from BIOS... | 135 | hda_codec: Unknown model for ALC880, trying auto-probe from BIOS... |
132 | ------------------------------------------------------------------------ | 136 | ------------------------------------------------------------------------ |
133 | Even if you such a message, DON'T PANIC. Take a deep breath (and keep | 137 | Even if you see such a message, DON'T PANIC. Take a deep breath and |
134 | your towel). First of all, it's an informational message, no warning, | 138 | keep your towel. First of all, it's an informational message, no |
135 | no error. This means that the PCI SSID of your device isn't listed in | 139 | warning, no error. This means that the PCI SSID of your device isn't |
136 | the known preset model list. But, this doesn't mean that the driver | 140 | listed in the known preset model (white-)list. But, this doesn't mean |
137 | is broken. Many codec-driver provides the automatic configuration | 141 | that the driver is broken. Many codec-drivers provide the automatic |
138 | based on the BIOS setup. | 142 | configuration mechanism based on the BIOS setup. |
139 | 143 | ||
140 | The HD-audio codec has usually "pin" widgets, and BIOS sets the default | 144 | The HD-audio codec has usually "pin" widgets, and BIOS sets the default |
141 | configuration of each pin, which indicates the location, the | 145 | configuration of each pin, which indicates the location, the |
142 | connection type, the jack color, etc. The HD-audio driver can guess | 146 | connection type, the jack color, etc. The HD-audio driver can guess |
143 | the right connection judging from these default configuration values. | 147 | the right connection judging from these default configuration values. |
144 | However -- some codec support codes, such as patch_analog.c, don't | 148 | However -- some codec-support codes, such as patch_analog.c, don't |
145 | support the automatic probing (yet as of 2.6.28). And, BIOS is often, | 149 | support the automatic probing (yet as of 2.6.28). And, BIOS is often, |
146 | yes, pretty often broken. It sets up wrong values and screws up the | 150 | yes, pretty often broken. It sets up wrong values and screws up the |
147 | driver. | 151 | driver. |
148 | 152 | ||
149 | The preset model is provided basically to override such a situation. | 153 | The preset model is provided basically to overcome such a situation. |
150 | When the matching preset model is found in the list, the driver | 154 | When the matching preset model is found in the white-list, the driver |
151 | assumes the static configuration of that preset and builds the mixer | 155 | assumes the static configuration of that preset and builds the mixer |
152 | and PCM based on the static information. Thus, if you have a newer | 156 | elements and PCM streams based on the static information. Thus, if |
153 | machine with a slightly different PCI SSID from the existing one, you | 157 | you have a newer machine with a slightly different PCI SSID from the |
154 | may have a good chance to re-use the same model. You can pass the | 158 | existing one, you may have a good chance to re-use the same model. |
155 | `model` option to specify the preset model instead of PCI SSID | 159 | You can pass the `model` option to specify the preset model instead of |
156 | look-up. | 160 | PCI SSID look-up. |
157 | 161 | ||
158 | What `model` option values are available depends on the codec chip. | 162 | What `model` option values are available depends on the codec chip. |
159 | Check your codec chip from the codec proc file (see "Codec Proc-File" | 163 | Check your codec chip from the codec proc file (see "Codec Proc-File" |
160 | section below). It will show the vendor/product name of your codec | 164 | section below). It will show the vendor/product name of your codec |
161 | chip. Then, see Documentation/sound/alsa/ALSA-Configuration.txt file. | 165 | chip. Then, see Documentation/sound/alsa/ALSA-Configuration.txt |
162 | In the section of HD-audio driver, you can find a list of codecs and | 166 | file, the section of HD-audio driver. You can find a list of codecs |
163 | `model` options belonging to each codec. For example, for Realtek | 167 | and `model` options belonging to each codec. For example, for Realtek |
164 | ALC262 codec chip, pass `model=ultra` for devices that are compatible | 168 | ALC262 codec chip, pass `model=ultra` for devices that are compatible |
165 | with Samsung Q1 Ultra. | 169 | with Samsung Q1 Ultra. |
166 | 170 | ||
167 | Thus, the first thing you can do for any brand-new, unsupported | 171 | Thus, the first thing you can do for any brand-new, unsupported and |
168 | HD-audio hardware is to check HD-audio codec and several different | 172 | non-working HD-audio hardware is to check HD-audio codec and several |
169 | `model` option values. If you have a luck, some of them might suit | 173 | different `model` option values. If you have a luck, some of them |
170 | with your device well. | 174 | might suit with your device well. |
171 | 175 | ||
172 | Some codecs such as ALC880 have a special model option `model=test`. | 176 | Some codecs such as ALC880 have a special model option `model=test`. |
173 | This configures the driver to provide as many mixer controls as | 177 | 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 | silent output from either or both of a built-in speaker and a | 192 | silent output from either or both of a built-in speaker and a |
189 | headphone jack. In general, you should try a headphone output at | 193 | headphone jack. In general, you should try a headphone output at |
190 | first. A speaker output often requires more additional controls like | 194 | first. A speaker output often requires more additional controls like |
191 | the amplifier. Thus a headphone output has a slightly better chance. | 195 | the external amplifier bits. Thus a headphone output has a slightly |
196 | better chance. | ||
192 | 197 | ||
193 | Before making a bug report, double-check whether the mixer is set up | 198 | Before making a bug report, double-check whether the mixer is set up |
194 | correctly. The recent version of snd-hda-intel driver provides mostly | 199 | correctly. The recent version of snd-hda-intel driver provides mostly |
195 | "Master" volume control as well as "Front" volume. In addition, there | 200 | "Master" volume control as well as "Front" volume (where Front |
196 | are individual "Headphone" and "Speaker" controls. | 201 | indicates the front-channels). In addition, there can be individual |
202 | "Headphone" and "Speaker" controls. | ||
197 | 203 | ||
198 | Ditto for the speaker output. There can be "External Amplifier" | 204 | Ditto for the speaker output. There can be "External Amplifier" |
199 | switch on some codecs. Turn on this if present. | 205 | switch on some codecs. Turn on this if present. |
@@ -214,7 +220,7 @@ following: | |||
214 | external amplifier. This can be set usually via EAPD verb or a | 220 | external amplifier. This can be set usually via EAPD verb or a |
215 | certain GPIO. If the codec pin supports EAPD, you have a better | 221 | certain GPIO. If the codec pin supports EAPD, you have a better |
216 | chance via SET_EAPD_BTL verb (0x70c). On others, GPIO pin (mostly | 222 | chance via SET_EAPD_BTL verb (0x70c). On others, GPIO pin (mostly |
217 | it's either GPIO0 or GPIO1) can turn on/off EAPD. | 223 | it's either GPIO0 or GPIO1) may turn on/off EAPD. |
218 | - Some Realtek codecs require special vendor-specific coefficients to | 224 | - Some Realtek codecs require special vendor-specific coefficients to |
219 | turn on the amplifier. See patch_realtek.c. | 225 | turn on the amplifier. See patch_realtek.c. |
220 | - IDT codecs may have extra power-enable/disable controls on each | 226 | - IDT codecs may have extra power-enable/disable controls on each |
@@ -227,29 +233,29 @@ following: | |||
227 | 233 | ||
228 | Capture Problems | 234 | Capture Problems |
229 | ~~~~~~~~~~~~~~~~ | 235 | ~~~~~~~~~~~~~~~~ |
230 | The capture problems are often missing setups of mixers. Thus, before | 236 | The capture problems are often because of missing setups of mixers. |
231 | submitting a bug report, make sure that you set up the mixer | 237 | Thus, before submitting a bug report, make sure that you set up the |
232 | correctly. For example, both "Capture Volume" and "Capture Switch" | 238 | mixer correctly. For example, both "Capture Volume" and "Capture |
233 | have to be set properly in addition to the right "Capture Source" or | 239 | Switch" have to be set properly in addition to the right "Capture |
234 | "Input Source" selection. Some devices have "Mic Boost" volume or | 240 | Source" or "Input Source" selection. Some devices have "Mic Boost" |
235 | switch. | 241 | volume or switch. |
236 | 242 | ||
237 | When the PCM device is opened via "default" PCM (without pulse-audio | 243 | When the PCM device is opened via "default" PCM (without pulse-audio |
238 | plugin), you'll likely have "Digital Capture Volume" control as well. | 244 | plugin), you'll likely have "Digital Capture Volume" control as well. |
239 | This is provided for the extra gain/attenuation of the signal in | 245 | This is provided for the extra gain/attenuation of the signal in |
240 | software, especially for the inputs without the hardware volume | 246 | software, especially for the inputs without the hardware volume |
241 | control such as digital microphones. Unless really needed, this | 247 | control such as digital microphones. Unless really needed, this |
242 | should be set to exactly 50%, corresponding to 0dB. When you use "hw" | 248 | should be set to exactly 50%, corresponding to 0dB -- neither extra |
243 | PCM, i.e., a raw access PCM, this control will have no influence, | 249 | gain nor attenuation. When you use "hw" PCM, i.e., a raw access PCM, |
244 | though. | 250 | this control will have no influence, though. |
245 | 251 | ||
246 | It's known that some codecs / devices have fairly bad analog circuits, | 252 | It's known that some codecs / devices have fairly bad analog circuits, |
247 | and the recorded sound contains a certain DC-offset. This is no bug | 253 | and the recorded sound contains a certain DC-offset. This is no bug |
248 | of the driver. | 254 | of the driver. |
249 | 255 | ||
250 | Most of modern laptops have no analog CD-input connection. Thus, the | 256 | Most of modern laptops have no analog CD-input connection. Thus, the |
251 | recording from CD input won't work in many cases although the driver | 257 | recording from CD input won't work in many cases although the driver |
252 | provides it as the capture source. | 258 | provides it as the capture source. Use CDDA instead. |
253 | 259 | ||
254 | The automatic switching of the built-in and external mic per plugging | 260 | The automatic switching of the built-in and external mic per plugging |
255 | is implemented on some codec models but not on every model. Partly | 261 | 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 | codec verbs to the device. Some tools are available: hda-emu and | 270 | codec verbs to the device. Some tools are available: hda-emu and |
265 | hda-analyzer. The detailed description is found in the sections | 271 | hda-analyzer. The detailed description is found in the sections |
266 | below. You'd need to enable hwdep for using these tools. See "Kernel | 272 | below. You'd need to enable hwdep for using these tools. See "Kernel |
267 | Configuration". | 273 | Configuration" section. |
268 | 274 | ||
269 | 275 | ||
270 | OTHER ISSUES | 276 | OTHER ISSUES |
@@ -284,15 +290,16 @@ sure to want it. | |||
284 | Don't forget to turn on the appropriate `CONFIG_SND_HDA_CODEC_*` | 290 | Don't forget to turn on the appropriate `CONFIG_SND_HDA_CODEC_*` |
285 | options. Note that each of them corresponds to the codec chip, not | 291 | options. Note that each of them corresponds to the codec chip, not |
286 | the controller chip. Thus, even if lspci shows the Nvidia controller, | 292 | the controller chip. Thus, even if lspci shows the Nvidia controller, |
287 | you may choose the option for other vendors. If you are unsure, just | 293 | you may need to choose the option for other vendors. If you are |
288 | choose all yes. | 294 | unsure, just select all yes. |
289 | 295 | ||
290 | `CONFIG_SND_HDA_HWDEP` is a useful option for debugging the driver. | 296 | `CONFIG_SND_HDA_HWDEP` is a useful option for debugging the driver. |
291 | When this is enabled, the driver creates hardware-dependent devices | 297 | When this is enabled, the driver creates hardware-dependent devices |
292 | (one per each codec), and you have a raw access to the device via | 298 | (one per each codec), and you have a raw access to the device via |
293 | hda-verb program. For example, `hwC0D2` will be created for the card | 299 | these device files. For example, `hwC0D2` will be created for the |
294 | 0 codec slot #2. For debug tools such as hda-verb and hda-analyzer, | 300 | codec slot #2 of the first card (#0). For debug-tools such as |
295 | the hwdep device has to be enabled. Thus, turn this on always. | 301 | hda-verb and hda-analyzer, the hwdep device has to be enabled. |
302 | Thus, it'd be better to turn this on always. | ||
296 | 303 | ||
297 | `CONFIG_SND_HDA_RECONFIG` is a new option, and this depends on the | 304 | `CONFIG_SND_HDA_RECONFIG` is a new option, and this depends on the |
298 | hwdep option above. When enabled, you'll have some sysfs files under | 305 | hwdep option above. When enabled, you'll have some sysfs files under |
@@ -436,7 +443,7 @@ details. | |||
436 | hda-verb | 443 | hda-verb |
437 | ~~~~~~~~ | 444 | ~~~~~~~~ |
438 | hda-verb is a tiny program that allows you to access the HD-audio | 445 | hda-verb is a tiny program that allows you to access the HD-audio |
439 | codec directly. It executes a HD-audio codec verb directly. | 446 | codec directly. You can execute a raw HD-audio codec verb with this. |
440 | This program accesses the hwdep device, thus you need to enable the | 447 | This program accesses the hwdep device, thus you need to enable the |
441 | kernel config `CONFIG_SND_HDA_HWDEP=y` beforehand. | 448 | kernel config `CONFIG_SND_HDA_HWDEP=y` beforehand. |
442 | 449 | ||
@@ -486,7 +493,7 @@ hda-analyzer | |||
486 | ~~~~~~~~~~~~ | 493 | ~~~~~~~~~~~~ |
487 | hda-analyzer provides a graphical interface to access the raw HD-audio | 494 | hda-analyzer provides a graphical interface to access the raw HD-audio |
488 | control, based on pyGTK2 binding. It's a more powerful version of | 495 | control, based on pyGTK2 binding. It's a more powerful version of |
489 | hda-verb. The program gives you a easy-to-use GUI stuff for showing | 496 | hda-verb. The program gives you an easy-to-use GUI stuff for showing |
490 | the widget information and adjusting the amp values, as well as the | 497 | the widget information and adjusting the amp values, as well as the |
491 | proc-compatible output. | 498 | proc-compatible output. |
492 | 499 | ||
@@ -498,7 +505,7 @@ alsa-project.org: | |||
498 | 505 | ||
499 | hda-emu | 506 | hda-emu |
500 | ~~~~~~~ | 507 | ~~~~~~~ |
501 | hda-emu is a HD-audio emulator. The main purpose of this program is | 508 | hda-emu is an HD-audio emulator. The main purpose of this program is |
502 | to debug an HD-audio codec without the real hardware. Thus, it | 509 | to debug an HD-audio codec without the real hardware. Thus, it |
503 | doesn't emulate the behavior with the real audio I/O, but it just | 510 | doesn't emulate the behavior with the real audio I/O, but it just |
504 | dumps the codec register changes and the ALSA-driver internal changes | 511 | dumps the codec register changes and the ALSA-driver internal changes |