diff options
author | Jonathan Corbet <corbet@lwn.net> | 2016-11-18 18:19:28 -0500 |
---|---|---|
committer | Jonathan Corbet <corbet@lwn.net> | 2016-11-18 18:19:28 -0500 |
commit | 726d661fea3e3f76d36515c74e4ce58e7789418e (patch) | |
tree | 0f996a1d5c0cca796b135378beb66e9829fae854 /Documentation/sound | |
parent | 917fef6f7ee8b2fe852692ac49771342bfef9433 (diff) | |
parent | c6ab9e57e84ee015bb9c5de213d9f85e5fd4e085 (diff) |
Merge remote-tracking branch 'sound/topic/restize-docs' into sound
Bring in the sphinxification of the sound documentation.
Diffstat (limited to 'Documentation/sound')
-rw-r--r-- | Documentation/sound/alsa-configuration.rst | 2683 | ||||
-rw-r--r-- | Documentation/sound/alsa/ALSA-Configuration.txt | 2330 | ||||
-rw-r--r-- | Documentation/sound/alsa/ControlNames.txt | 107 | ||||
-rw-r--r-- | Documentation/sound/alsa/HD-Audio-Models.txt | 324 | ||||
-rw-r--r-- | Documentation/sound/alsa/VIA82xx-mixer.txt | 8 | ||||
-rw-r--r-- | Documentation/sound/alsa/alsa-parameters.txt | 135 | ||||
-rw-r--r-- | Documentation/sound/alsa/seq_oss.html | 409 | ||||
-rw-r--r-- | Documentation/sound/cards/audigy-mixer.rst (renamed from Documentation/sound/alsa/Audigy-mixer.txt) | 297 | ||||
-rw-r--r-- | Documentation/sound/cards/audiophile-usb.rst (renamed from Documentation/sound/alsa/Audiophile-Usb.txt) | 258 | ||||
-rw-r--r-- | Documentation/sound/cards/bt87x.rst (renamed from Documentation/sound/alsa/Bt87x.txt) | 23 | ||||
-rw-r--r-- | Documentation/sound/cards/cmipci.rst (renamed from Documentation/sound/alsa/CMIPCI.txt) | 62 | ||||
-rw-r--r-- | Documentation/sound/cards/emu10k1-jack.rst (renamed from Documentation/sound/alsa/emu10k1-jack.txt) | 20 | ||||
-rw-r--r-- | Documentation/sound/cards/hdspm.rst (renamed from Documentation/sound/alsa/hdspm.txt) | 253 | ||||
-rw-r--r-- | Documentation/sound/cards/img-spdif-in.rst (renamed from Documentation/sound/alsa/img,spdif-in.txt) | 24 | ||||
-rw-r--r-- | Documentation/sound/cards/index.rst | 19 | ||||
-rw-r--r-- | Documentation/sound/cards/joystick.rst (renamed from Documentation/sound/alsa/Joystick.txt) | 71 | ||||
-rw-r--r-- | Documentation/sound/cards/maya44.rst (renamed from Documentation/sound/alsa/README.maya44) | 137 | ||||
-rw-r--r-- | Documentation/sound/cards/mixart.rst (renamed from Documentation/sound/alsa/MIXART.txt) | 26 | ||||
-rw-r--r-- | Documentation/sound/cards/sb-live-mixer.rst (renamed from Documentation/sound/alsa/SB-Live-mixer.txt) | 337 | ||||
-rw-r--r-- | Documentation/sound/cards/serial-u16550.rst (renamed from Documentation/sound/alsa/serial-u16550.txt) | 21 | ||||
-rw-r--r-- | Documentation/sound/cards/via82xx-mixer.rst | 8 | ||||
-rw-r--r-- | Documentation/sound/designs/channel-mapping-api.rst (renamed from Documentation/sound/alsa/Channel-Mapping-API.txt) | 77 | ||||
-rw-r--r-- | Documentation/sound/designs/compress-offload.rst (renamed from Documentation/sound/alsa/compress_offload.txt) | 127 | ||||
-rw-r--r-- | Documentation/sound/designs/control-names.rst | 142 | ||||
-rw-r--r-- | Documentation/sound/designs/index.rst | 15 | ||||
-rw-r--r-- | Documentation/sound/designs/jack-controls.rst (renamed from Documentation/sound/alsa/Jack-Controls.txt) | 13 | ||||
-rw-r--r-- | Documentation/sound/designs/oss-emulation.rst (renamed from Documentation/sound/alsa/OSS-Emulation.txt) | 169 | ||||
-rw-r--r-- | Documentation/sound/designs/powersave.rst (renamed from Documentation/sound/alsa/powersave.txt) | 16 | ||||
-rw-r--r-- | Documentation/sound/designs/procfile.rst (renamed from Documentation/sound/alsa/Procfile.txt) | 106 | ||||
-rw-r--r-- | Documentation/sound/designs/seq-oss.rst | 371 | ||||
-rw-r--r-- | Documentation/sound/designs/timestamping.rst (renamed from Documentation/sound/alsa/timestamping.txt) | 143 | ||||
-rw-r--r-- | Documentation/sound/hd-audio/controls.rst (renamed from Documentation/sound/alsa/HD-Audio-Controls.txt) | 33 | ||||
-rw-r--r-- | Documentation/sound/hd-audio/dp-mst.rst (renamed from Documentation/sound/alsa/HD-Audio-DP-MST-audio.txt) | 30 | ||||
-rw-r--r-- | Documentation/sound/hd-audio/index.rst | 10 | ||||
-rw-r--r-- | Documentation/sound/hd-audio/models.rst | 518 | ||||
-rw-r--r-- | Documentation/sound/hd-audio/notes.rst (renamed from Documentation/sound/alsa/HD-Audio.txt) | 635 | ||||
-rw-r--r-- | Documentation/sound/index.rst | 20 | ||||
-rw-r--r-- | Documentation/sound/kernel-api/alsa-driver-api.rst | 134 | ||||
-rw-r--r-- | Documentation/sound/kernel-api/index.rst | 8 | ||||
-rw-r--r-- | Documentation/sound/kernel-api/writing-an-alsa-driver.rst | 4219 | ||||
-rw-r--r-- | Documentation/sound/soc/clocking.rst (renamed from Documentation/sound/alsa/soc/clocking.txt) | 13 | ||||
-rw-r--r-- | Documentation/sound/soc/codec-to-codec.rst | 108 | ||||
-rw-r--r-- | Documentation/sound/soc/codec.rst (renamed from Documentation/sound/alsa/soc/codec.txt) | 75 | ||||
-rw-r--r-- | Documentation/sound/soc/dai.rst (renamed from Documentation/sound/alsa/soc/DAI.txt) | 28 | ||||
-rw-r--r-- | Documentation/sound/soc/dapm.rst (renamed from Documentation/sound/alsa/soc/dapm.txt) | 249 | ||||
-rw-r--r-- | Documentation/sound/soc/dpcm.rst (renamed from Documentation/sound/alsa/soc/DPCM.txt) | 280 | ||||
-rw-r--r-- | Documentation/sound/soc/index.rst | 20 | ||||
-rw-r--r-- | Documentation/sound/soc/jack.rst (renamed from Documentation/sound/alsa/soc/jack.txt) | 1 | ||||
-rw-r--r-- | Documentation/sound/soc/machine.rst (renamed from Documentation/sound/alsa/soc/machine.txt) | 22 | ||||
-rw-r--r-- | Documentation/sound/soc/overview.rst (renamed from Documentation/sound/alsa/soc/overview.txt) | 32 | ||||
-rw-r--r-- | Documentation/sound/soc/platform.rst (renamed from Documentation/sound/alsa/soc/platform.txt) | 31 | ||||
-rw-r--r-- | Documentation/sound/soc/pops-clicks.rst (renamed from Documentation/sound/alsa/soc/pops_clicks.txt) | 15 |
52 files changed, 10291 insertions, 4921 deletions
diff --git a/Documentation/sound/alsa-configuration.rst b/Documentation/sound/alsa-configuration.rst new file mode 100644 index 000000000000..aed6b4fb8e46 --- /dev/null +++ b/Documentation/sound/alsa-configuration.rst | |||
@@ -0,0 +1,2683 @@ | |||
1 | ============================================================== | ||
2 | Advanced Linux Sound Architecture - Driver Configuration guide | ||
3 | ============================================================== | ||
4 | |||
5 | |||
6 | Kernel Configuration | ||
7 | ==================== | ||
8 | |||
9 | To enable ALSA support you need at least to build the kernel with | ||
10 | primary sound card support (``CONFIG_SOUND``). Since ALSA can emulate | ||
11 | OSS, you don't have to choose any of the OSS modules. | ||
12 | |||
13 | Enable "OSS API emulation" (``CONFIG_SND_OSSEMUL``) and both OSS mixer | ||
14 | and PCM supports if you want to run OSS applications with ALSA. | ||
15 | |||
16 | If you want to support the WaveTable functionality on cards such as | ||
17 | SB Live! then you need to enable "Sequencer support" | ||
18 | (``CONFIG_SND_SEQUENCER``). | ||
19 | |||
20 | To make ALSA debug messages more verbose, enable the "Verbose printk" | ||
21 | and "Debug" options. To check for memory leaks, turn on "Debug memory" | ||
22 | too. "Debug detection" will add checks for the detection of cards. | ||
23 | |||
24 | Please note that all the ALSA ISA drivers support the Linux isapnp API | ||
25 | (if the card supports ISA PnP). You don't need to configure the cards | ||
26 | using isapnptools. | ||
27 | |||
28 | |||
29 | Module parameters | ||
30 | ================= | ||
31 | |||
32 | The user can load modules with options. If the module supports more than | ||
33 | one card and you have more than one card of the same type then you can | ||
34 | specify multiple values for the option separated by commas. | ||
35 | |||
36 | |||
37 | Module snd | ||
38 | ---------- | ||
39 | |||
40 | The core ALSA module. It is used by all ALSA card drivers. | ||
41 | It takes the following options which have global effects. | ||
42 | |||
43 | major | ||
44 | major number for sound driver; | ||
45 | Default: 116 | ||
46 | cards_limit | ||
47 | limiting card index for auto-loading (1-8); | ||
48 | Default: 1; | ||
49 | For auto-loading more than one card, specify this option | ||
50 | together with snd-card-X aliases. | ||
51 | slots | ||
52 | Reserve the slot index for the given driver; | ||
53 | This option takes multiple strings. | ||
54 | See `Module Autoloading Support`_ section for details. | ||
55 | debug | ||
56 | Specifies the debug message level; | ||
57 | (0 = disable debug prints, 1 = normal debug messages, | ||
58 | 2 = verbose debug messages); | ||
59 | This option appears only when ``CONFIG_SND_DEBUG=y``. | ||
60 | This option can be dynamically changed via sysfs | ||
61 | /sys/modules/snd/parameters/debug file. | ||
62 | |||
63 | Module snd-pcm-oss | ||
64 | ------------------ | ||
65 | |||
66 | The PCM OSS emulation module. | ||
67 | This module takes options which change the mapping of devices. | ||
68 | |||
69 | dsp_map | ||
70 | PCM device number maps assigned to the 1st OSS device; | ||
71 | Default: 0 | ||
72 | adsp_map | ||
73 | PCM device number maps assigned to the 2st OSS device; | ||
74 | Default: 1 | ||
75 | nonblock_open | ||
76 | Don't block opening busy PCM devices; | ||
77 | Default: 1 | ||
78 | |||
79 | For example, when ``dsp_map=2``, /dev/dsp will be mapped to PCM #2 of | ||
80 | the card #0. Similarly, when ``adsp_map=0``, /dev/adsp will be mapped | ||
81 | to PCM #0 of the card #0. | ||
82 | For changing the second or later card, specify the option with | ||
83 | commas, such like ``dsp_map=0,1``. | ||
84 | |||
85 | ``nonblock_open`` option is used to change the behavior of the PCM | ||
86 | regarding opening the device. When this option is non-zero, | ||
87 | opening a busy OSS PCM device won't be blocked but return | ||
88 | immediately with EAGAIN (just like O_NONBLOCK flag). | ||
89 | |||
90 | Module snd-rawmidi | ||
91 | ------------------ | ||
92 | |||
93 | This module takes options which change the mapping of devices. | ||
94 | similar to those of the snd-pcm-oss module. | ||
95 | |||
96 | midi_map | ||
97 | MIDI device number maps assigned to the 1st OSS device; | ||
98 | Default: 0 | ||
99 | amidi_map | ||
100 | MIDI device number maps assigned to the 2st OSS device; | ||
101 | Default: 1 | ||
102 | |||
103 | Common parameters for top sound card modules | ||
104 | -------------------------------------------- | ||
105 | |||
106 | Each of top level sound card module takes the following options. | ||
107 | |||
108 | index | ||
109 | index (slot #) of sound card; | ||
110 | Values: 0 through 31 or negative; | ||
111 | If nonnegative, assign that index number; | ||
112 | if negative, interpret as a bitmask of permissible indices; | ||
113 | the first free permitted index is assigned; | ||
114 | Default: -1 | ||
115 | id | ||
116 | card ID (identifier or name); | ||
117 | Can be up to 15 characters long; | ||
118 | Default: the card type; | ||
119 | A directory by this name is created under /proc/asound/ | ||
120 | containing information about the card; | ||
121 | This ID can be used instead of the index number in | ||
122 | identifying the card | ||
123 | enable | ||
124 | enable card; | ||
125 | Default: enabled, for PCI and ISA PnP cards | ||
126 | |||
127 | Module snd-adlib | ||
128 | ---------------- | ||
129 | |||
130 | Module for AdLib FM cards. | ||
131 | |||
132 | port | ||
133 | port # for OPL chip | ||
134 | |||
135 | This module supports multiple cards. It does not support autoprobe, so | ||
136 | the port must be specified. For actual AdLib FM cards it will be 0x388. | ||
137 | Note that this card does not have PCM support and no mixer; only FM | ||
138 | synthesis. | ||
139 | |||
140 | Make sure you have ``sbiload`` from the alsa-tools package available and, | ||
141 | after loading the module, find out the assigned ALSA sequencer port | ||
142 | number through ``sbiload -l``. | ||
143 | |||
144 | Example output: | ||
145 | :: | ||
146 | |||
147 | Port Client name Port name | ||
148 | 64:0 OPL2 FM synth OPL2 FM Port | ||
149 | |||
150 | Load the ``std.sb`` and ``drums.sb`` patches also supplied by ``sbiload``: | ||
151 | :: | ||
152 | |||
153 | sbiload -p 64:0 std.sb drums.sb | ||
154 | |||
155 | If you use this driver to drive an OPL3, you can use ``std.o3`` and ``drums.o3`` | ||
156 | instead. To have the card produce sound, use ``aplaymidi`` from alsa-utils: | ||
157 | :: | ||
158 | |||
159 | aplaymidi -p 64:0 foo.mid | ||
160 | |||
161 | Module snd-ad1816a | ||
162 | ------------------ | ||
163 | |||
164 | Module for sound cards based on Analog Devices AD1816A/AD1815 ISA chips. | ||
165 | |||
166 | clockfreq | ||
167 | Clock frequency for AD1816A chip (default = 0, 33000Hz) | ||
168 | |||
169 | This module supports multiple cards, autoprobe and PnP. | ||
170 | |||
171 | Module snd-ad1848 | ||
172 | ----------------- | ||
173 | |||
174 | Module for sound cards based on AD1848/AD1847/CS4248 ISA chips. | ||
175 | |||
176 | port | ||
177 | port # for AD1848 chip | ||
178 | irq | ||
179 | IRQ # for AD1848 chip | ||
180 | dma1 | ||
181 | DMA # for AD1848 chip (0,1,3) | ||
182 | |||
183 | This module supports multiple cards. It does not support autoprobe | ||
184 | thus main port must be specified!!! Other ports are optional. | ||
185 | |||
186 | The power-management is supported. | ||
187 | |||
188 | Module snd-ad1889 | ||
189 | ----------------- | ||
190 | |||
191 | Module for Analog Devices AD1889 chips. | ||
192 | |||
193 | ac97_quirk | ||
194 | AC'97 workaround for strange hardware; | ||
195 | See the description of intel8x0 module for details. | ||
196 | |||
197 | This module supports multiple cards. | ||
198 | |||
199 | Module snd-ali5451 | ||
200 | ------------------ | ||
201 | |||
202 | Module for ALi M5451 PCI chip. | ||
203 | |||
204 | pcm_channels | ||
205 | Number of hardware channels assigned for PCM | ||
206 | spdif | ||
207 | Support SPDIF I/O; | ||
208 | Default: disabled | ||
209 | |||
210 | This module supports one chip and autoprobe. | ||
211 | |||
212 | The power-management is supported. | ||
213 | |||
214 | Module snd-als100 | ||
215 | ----------------- | ||
216 | |||
217 | Module for sound cards based on Avance Logic ALS100/ALS120 ISA chips. | ||
218 | |||
219 | This module supports multiple cards, autoprobe and PnP. | ||
220 | |||
221 | The power-management is supported. | ||
222 | |||
223 | Module snd-als300 | ||
224 | ----------------- | ||
225 | |||
226 | Module for Avance Logic ALS300 and ALS300+ | ||
227 | |||
228 | This module supports multiple cards. | ||
229 | |||
230 | The power-management is supported. | ||
231 | |||
232 | Module snd-als4000 | ||
233 | ------------------ | ||
234 | |||
235 | Module for sound cards based on Avance Logic ALS4000 PCI chip. | ||
236 | |||
237 | joystick_port | ||
238 | port # for legacy joystick support; | ||
239 | 0 = disabled (default), 1 = auto-detect | ||
240 | |||
241 | This module supports multiple cards, autoprobe and PnP. | ||
242 | |||
243 | The power-management is supported. | ||
244 | |||
245 | Module snd-asihpi | ||
246 | ----------------- | ||
247 | |||
248 | Module for AudioScience ASI soundcards | ||
249 | |||
250 | enable_hpi_hwdep | ||
251 | enable HPI hwdep for AudioScience soundcard | ||
252 | |||
253 | This module supports multiple cards. | ||
254 | The driver requires the firmware loader support on kernel. | ||
255 | |||
256 | Module snd-atiixp | ||
257 | ----------------- | ||
258 | |||
259 | Module for ATI IXP 150/200/250/400 AC97 controllers. | ||
260 | |||
261 | ac97_clock | ||
262 | AC'97 clock (default = 48000) | ||
263 | ac97_quirk | ||
264 | AC'97 workaround for strange hardware; | ||
265 | See `AC97 Quirk Option`_ section below. | ||
266 | ac97_codec | ||
267 | Workaround to specify which AC'97 codec instead of probing. | ||
268 | If this works for you file a bug with your `lspci -vn` output. | ||
269 | (-2 = Force probing, -1 = Default behavior, 0-2 = Use the | ||
270 | specified codec.) | ||
271 | spdif_aclink | ||
272 | S/PDIF transfer over AC-link (default = 1) | ||
273 | |||
274 | This module supports one card and autoprobe. | ||
275 | |||
276 | ATI IXP has two different methods to control SPDIF output. One is | ||
277 | over AC-link and another is over the "direct" SPDIF output. The | ||
278 | implementation depends on the motherboard, and you'll need to | ||
279 | choose the correct one via spdif_aclink module option. | ||
280 | |||
281 | The power-management is supported. | ||
282 | |||
283 | Module snd-atiixp-modem | ||
284 | ----------------------- | ||
285 | |||
286 | Module for ATI IXP 150/200/250 AC97 modem controllers. | ||
287 | |||
288 | This module supports one card and autoprobe. | ||
289 | |||
290 | Note: The default index value of this module is -2, i.e. the first | ||
291 | slot is excluded. | ||
292 | |||
293 | The power-management is supported. | ||
294 | |||
295 | Module snd-au8810, snd-au8820, snd-au8830 | ||
296 | ----------------------------------------- | ||
297 | |||
298 | Module for Aureal Vortex, Vortex2 and Advantage device. | ||
299 | |||
300 | pcifix | ||
301 | Control PCI workarounds; | ||
302 | 0 = Disable all workarounds, | ||
303 | 1 = Force the PCI latency of the Aureal card to 0xff, | ||
304 | 2 = Force the Extend PCI#2 Internal Master for Efficient | ||
305 | Handling of Dummy Requests on the VIA KT133 AGP Bridge, | ||
306 | 3 = Force both settings, | ||
307 | 255 = Autodetect what is required (default) | ||
308 | |||
309 | This module supports all ADB PCM channels, ac97 mixer, SPDIF, hardware | ||
310 | EQ, mpu401, gameport. A3D and wavetable support are still in development. | ||
311 | Development and reverse engineering work is being coordinated at | ||
312 | http://savannah.nongnu.org/projects/openvortex/ | ||
313 | SPDIF output has a copy of the AC97 codec output, unless you use the | ||
314 | ``spdif`` pcm device, which allows raw data passthru. | ||
315 | The hardware EQ hardware and SPDIF is only present in the Vortex2 and | ||
316 | Advantage. | ||
317 | |||
318 | Note: Some ALSA mixer applications don't handle the SPDIF sample rate | ||
319 | control correctly. If you have problems regarding this, try | ||
320 | another ALSA compliant mixer (alsamixer works). | ||
321 | |||
322 | Module snd-azt1605 | ||
323 | ------------------ | ||
324 | |||
325 | Module for Aztech Sound Galaxy soundcards based on the Aztech AZT1605 | ||
326 | chipset. | ||
327 | |||
328 | port | ||
329 | port # for BASE (0x220,0x240,0x260,0x280) | ||
330 | wss_port | ||
331 | port # for WSS (0x530,0x604,0xe80,0xf40) | ||
332 | irq | ||
333 | IRQ # for WSS (7,9,10,11) | ||
334 | dma1 | ||
335 | DMA # for WSS playback (0,1,3) | ||
336 | dma2 | ||
337 | DMA # for WSS capture (0,1), -1 = disabled (default) | ||
338 | mpu_port | ||
339 | port # for MPU-401 UART (0x300,0x330), -1 = disabled (default) | ||
340 | mpu_irq | ||
341 | IRQ # for MPU-401 UART (3,5,7,9), -1 = disabled (default) | ||
342 | fm_port | ||
343 | port # for OPL3 (0x388), -1 = disabled (default) | ||
344 | |||
345 | This module supports multiple cards. It does not support autoprobe: | ||
346 | ``port``, ``wss_port``, ``irq`` and ``dma1`` have to be specified. | ||
347 | The other values are optional. | ||
348 | |||
349 | ``port`` needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240) | ||
350 | or the value stored in the card's EEPROM for cards that have an EEPROM and | ||
351 | their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can | ||
352 | be chosen freely from the options enumerated above. | ||
353 | |||
354 | If ``dma2`` is specified and different from ``dma1``, the card will operate in | ||
355 | full-duplex mode. When ``dma1=3``, only ``dma2=0`` is valid and the only way to | ||
356 | enable capture since only channels 0 and 1 are available for capture. | ||
357 | |||
358 | Generic settings are ``port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0 | ||
359 | mpu_port=0x330 mpu_irq=9 fm_port=0x388``. | ||
360 | |||
361 | Whatever IRQ and DMA channels you pick, be sure to reserve them for | ||
362 | legacy ISA in your BIOS. | ||
363 | |||
364 | Module snd-azt2316 | ||
365 | ------------------ | ||
366 | |||
367 | Module for Aztech Sound Galaxy soundcards based on the Aztech AZT2316 | ||
368 | chipset. | ||
369 | |||
370 | port | ||
371 | port # for BASE (0x220,0x240,0x260,0x280) | ||
372 | wss_port | ||
373 | port # for WSS (0x530,0x604,0xe80,0xf40) | ||
374 | irq | ||
375 | IRQ # for WSS (7,9,10,11) | ||
376 | dma1 | ||
377 | DMA # for WSS playback (0,1,3) | ||
378 | dma2 | ||
379 | DMA # for WSS capture (0,1), -1 = disabled (default) | ||
380 | mpu_port | ||
381 | port # for MPU-401 UART (0x300,0x330), -1 = disabled (default) | ||
382 | mpu_irq | ||
383 | IRQ # for MPU-401 UART (5,7,9,10), -1 = disabled (default) | ||
384 | fm_port | ||
385 | port # for OPL3 (0x388), -1 = disabled (default) | ||
386 | |||
387 | This module supports multiple cards. It does not support autoprobe: | ||
388 | ``port``, ``wss_port``, ``irq`` and ``dma1`` have to be specified. | ||
389 | The other values are optional. | ||
390 | |||
391 | ``port`` needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240) | ||
392 | or the value stored in the card's EEPROM for cards that have an EEPROM and | ||
393 | their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can | ||
394 | be chosen freely from the options enumerated above. | ||
395 | |||
396 | If ``dma2`` is specified and different from ``dma1``, the card will operate in | ||
397 | full-duplex mode. When ``dma1=3``, only ``dma2=0`` is valid and the only way to | ||
398 | enable capture since only channels 0 and 1 are available for capture. | ||
399 | |||
400 | Generic settings are ``port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0 | ||
401 | mpu_port=0x330 mpu_irq=9 fm_port=0x388``. | ||
402 | |||
403 | Whatever IRQ and DMA channels you pick, be sure to reserve them for | ||
404 | legacy ISA in your BIOS. | ||
405 | |||
406 | Module snd-aw2 | ||
407 | -------------- | ||
408 | |||
409 | Module for Audiowerk2 sound card | ||
410 | |||
411 | This module supports multiple cards. | ||
412 | |||
413 | Module snd-azt2320 | ||
414 | ------------------ | ||
415 | |||
416 | Module for sound cards based on Aztech System AZT2320 ISA chip (PnP only). | ||
417 | |||
418 | This module supports multiple cards, PnP and autoprobe. | ||
419 | |||
420 | The power-management is supported. | ||
421 | |||
422 | Module snd-azt3328 | ||
423 | ------------------ | ||
424 | |||
425 | Module for sound cards based on Aztech AZF3328 PCI chip. | ||
426 | |||
427 | joystick | ||
428 | Enable joystick (default off) | ||
429 | |||
430 | This module supports multiple cards. | ||
431 | |||
432 | Module snd-bt87x | ||
433 | ---------------- | ||
434 | |||
435 | Module for video cards based on Bt87x chips. | ||
436 | |||
437 | digital_rate | ||
438 | Override the default digital rate (Hz) | ||
439 | load_all | ||
440 | Load the driver even if the card model isn't known | ||
441 | |||
442 | This module supports multiple cards. | ||
443 | |||
444 | Note: The default index value of this module is -2, i.e. the first | ||
445 | slot is excluded. | ||
446 | |||
447 | Module snd-ca0106 | ||
448 | ----------------- | ||
449 | |||
450 | Module for Creative Audigy LS and SB Live 24bit | ||
451 | |||
452 | This module supports multiple cards. | ||
453 | |||
454 | |||
455 | Module snd-cmi8330 | ||
456 | ------------------ | ||
457 | |||
458 | Module for sound cards based on C-Media CMI8330 ISA chips. | ||
459 | |||
460 | isapnp | ||
461 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
462 | |||
463 | with ``isapnp=0``, the following options are available: | ||
464 | |||
465 | wssport | ||
466 | port # for CMI8330 chip (WSS) | ||
467 | wssirq | ||
468 | IRQ # for CMI8330 chip (WSS) | ||
469 | wssdma | ||
470 | first DMA # for CMI8330 chip (WSS) | ||
471 | sbport | ||
472 | port # for CMI8330 chip (SB16) | ||
473 | sbirq | ||
474 | IRQ # for CMI8330 chip (SB16) | ||
475 | sbdma8 | ||
476 | 8bit DMA # for CMI8330 chip (SB16) | ||
477 | sbdma16 | ||
478 | 16bit DMA # for CMI8330 chip (SB16) | ||
479 | fmport | ||
480 | (optional) OPL3 I/O port | ||
481 | mpuport | ||
482 | (optional) MPU401 I/O port | ||
483 | mpuirq | ||
484 | (optional) MPU401 irq # | ||
485 | |||
486 | This module supports multiple cards and autoprobe. | ||
487 | |||
488 | The power-management is supported. | ||
489 | |||
490 | Module snd-cmipci | ||
491 | ----------------- | ||
492 | |||
493 | Module for C-Media CMI8338/8738/8768/8770 PCI sound cards. | ||
494 | |||
495 | mpu_port | ||
496 | port address of MIDI interface (8338 only): | ||
497 | 0x300,0x310,0x320,0x330 = legacy port, | ||
498 | 0 = disable (default) | ||
499 | fm_port | ||
500 | port address of OPL-3 FM synthesizer (8x38 only): | ||
501 | 0x388 = legacy port, | ||
502 | 1 = integrated PCI port (default on 8738), | ||
503 | 0 = disable | ||
504 | soft_ac3 | ||
505 | Software-conversion of raw SPDIF packets (model 033 only) (default = 1) | ||
506 | joystick_port | ||
507 | Joystick port address (0 = disable, 1 = auto-detect) | ||
508 | |||
509 | This module supports autoprobe and multiple cards. | ||
510 | |||
511 | The power-management is supported. | ||
512 | |||
513 | Module snd-cs4231 | ||
514 | ----------------- | ||
515 | |||
516 | Module for sound cards based on CS4231 ISA chips. | ||
517 | |||
518 | port | ||
519 | port # for CS4231 chip | ||
520 | mpu_port | ||
521 | port # for MPU-401 UART (optional), -1 = disable | ||
522 | irq | ||
523 | IRQ # for CS4231 chip | ||
524 | mpu_irq | ||
525 | IRQ # for MPU-401 UART | ||
526 | dma1 | ||
527 | first DMA # for CS4231 chip | ||
528 | dma2 | ||
529 | second DMA # for CS4231 chip | ||
530 | |||
531 | This module supports multiple cards. This module does not support autoprobe | ||
532 | thus main port must be specified!!! Other ports are optional. | ||
533 | |||
534 | The power-management is supported. | ||
535 | |||
536 | Module snd-cs4236 | ||
537 | ----------------- | ||
538 | |||
539 | Module for sound cards based on CS4232/CS4232A, | ||
540 | CS4235/CS4236/CS4236B/CS4237B/CS4238B/CS4239 ISA chips. | ||
541 | |||
542 | isapnp | ||
543 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
544 | |||
545 | with ``isapnp=0``, the following options are available: | ||
546 | |||
547 | port | ||
548 | port # for CS4236 chip (PnP setup - 0x534) | ||
549 | cport | ||
550 | control port # for CS4236 chip (PnP setup - 0x120,0x210,0xf00) | ||
551 | mpu_port | ||
552 | port # for MPU-401 UART (PnP setup - 0x300), -1 = disable | ||
553 | fm_port | ||
554 | FM port # for CS4236 chip (PnP setup - 0x388), -1 = disable | ||
555 | irq | ||
556 | IRQ # for CS4236 chip (5,7,9,11,12,15) | ||
557 | mpu_irq | ||
558 | IRQ # for MPU-401 UART (9,11,12,15) | ||
559 | dma1 | ||
560 | first DMA # for CS4236 chip (0,1,3) | ||
561 | dma2 | ||
562 | second DMA # for CS4236 chip (0,1,3), -1 = disable | ||
563 | |||
564 | This module supports multiple cards. This module does not support autoprobe | ||
565 | (if ISA PnP is not used) thus main port and control port must be | ||
566 | specified!!! Other ports are optional. | ||
567 | |||
568 | The power-management is supported. | ||
569 | |||
570 | This module is aliased as snd-cs4232 since it provides the old | ||
571 | snd-cs4232 functionality, too. | ||
572 | |||
573 | Module snd-cs4281 | ||
574 | ----------------- | ||
575 | |||
576 | Module for Cirrus Logic CS4281 soundchip. | ||
577 | |||
578 | dual_codec | ||
579 | Secondary codec ID (0 = disable, default) | ||
580 | |||
581 | This module supports multiple cards. | ||
582 | |||
583 | The power-management is supported. | ||
584 | |||
585 | Module snd-cs46xx | ||
586 | ----------------- | ||
587 | |||
588 | Module for PCI sound cards based on CS4610/CS4612/CS4614/CS4615/CS4622/ | ||
589 | CS4624/CS4630/CS4280 PCI chips. | ||
590 | |||
591 | external_amp | ||
592 | Force to enable external amplifier. | ||
593 | thinkpad | ||
594 | Force to enable Thinkpad's CLKRUN control. | ||
595 | mmap_valid | ||
596 | Support OSS mmap mode (default = 0). | ||
597 | |||
598 | This module supports multiple cards and autoprobe. | ||
599 | Usually external amp and CLKRUN controls are detected automatically | ||
600 | from PCI sub vendor/device ids. If they don't work, give the options | ||
601 | above explicitly. | ||
602 | |||
603 | The power-management is supported. | ||
604 | |||
605 | Module snd-cs5530 | ||
606 | ----------------- | ||
607 | |||
608 | Module for Cyrix/NatSemi Geode 5530 chip. | ||
609 | |||
610 | Module snd-cs5535audio | ||
611 | ---------------------- | ||
612 | |||
613 | Module for multifunction CS5535 companion PCI device | ||
614 | |||
615 | The power-management is supported. | ||
616 | |||
617 | Module snd-ctxfi | ||
618 | ---------------- | ||
619 | |||
620 | Module for Creative Sound Blaster X-Fi boards (20k1 / 20k2 chips) | ||
621 | |||
622 | * Creative Sound Blaster X-Fi Titanium Fatal1ty Champion Series | ||
623 | * Creative Sound Blaster X-Fi Titanium Fatal1ty Professional Series | ||
624 | * Creative Sound Blaster X-Fi Titanium Professional Audio | ||
625 | * Creative Sound Blaster X-Fi Titanium | ||
626 | * Creative Sound Blaster X-Fi Elite Pro | ||
627 | * Creative Sound Blaster X-Fi Platinum | ||
628 | * Creative Sound Blaster X-Fi Fatal1ty | ||
629 | * Creative Sound Blaster X-Fi XtremeGamer | ||
630 | * Creative Sound Blaster X-Fi XtremeMusic | ||
631 | |||
632 | reference_rate | ||
633 | reference sample rate, 44100 or 48000 (default) | ||
634 | multiple | ||
635 | multiple to ref. sample rate, 1 or 2 (default) | ||
636 | subsystem | ||
637 | override the PCI SSID for probing; | ||
638 | the value consists of SSVID << 16 | SSDID. | ||
639 | The default is zero, which means no override. | ||
640 | |||
641 | This module supports multiple cards. | ||
642 | |||
643 | Module snd-darla20 | ||
644 | ------------------ | ||
645 | |||
646 | Module for Echoaudio Darla20 | ||
647 | |||
648 | This module supports multiple cards. | ||
649 | The driver requires the firmware loader support on kernel. | ||
650 | |||
651 | Module snd-darla24 | ||
652 | ------------------ | ||
653 | |||
654 | Module for Echoaudio Darla24 | ||
655 | |||
656 | This module supports multiple cards. | ||
657 | The driver requires the firmware loader support on kernel. | ||
658 | |||
659 | Module snd-dt019x | ||
660 | ----------------- | ||
661 | |||
662 | Module for Diamond Technologies DT-019X / Avance Logic ALS-007 (PnP | ||
663 | only) | ||
664 | |||
665 | This module supports multiple cards. This module is enabled only with | ||
666 | ISA PnP support. | ||
667 | |||
668 | The power-management is supported. | ||
669 | |||
670 | Module snd-dummy | ||
671 | ---------------- | ||
672 | |||
673 | Module for the dummy sound card. This "card" doesn't do any output | ||
674 | or input, but you may use this module for any application which | ||
675 | requires a sound card (like RealPlayer). | ||
676 | |||
677 | pcm_devs | ||
678 | Number of PCM devices assigned to each card (default = 1, up to 4) | ||
679 | pcm_substreams | ||
680 | Number of PCM substreams assigned to each PCM (default = 8, up to 128) | ||
681 | hrtimer | ||
682 | Use hrtimer (=1, default) or system timer (=0) | ||
683 | fake_buffer | ||
684 | Fake buffer allocations (default = 1) | ||
685 | |||
686 | When multiple PCM devices are created, snd-dummy gives different | ||
687 | behavior to each PCM device: | ||
688 | * 0 = interleaved with mmap support | ||
689 | * 1 = non-interleaved with mmap support | ||
690 | * 2 = interleaved without mmap | ||
691 | * 3 = non-interleaved without mmap | ||
692 | |||
693 | As default, snd-dummy drivers doesn't allocate the real buffers | ||
694 | but either ignores read/write or mmap a single dummy page to all | ||
695 | buffer pages, in order to save the resources. If your apps need | ||
696 | the read/ written buffer data to be consistent, pass fake_buffer=0 | ||
697 | option. | ||
698 | |||
699 | The power-management is supported. | ||
700 | |||
701 | Module snd-echo3g | ||
702 | ----------------- | ||
703 | |||
704 | Module for Echoaudio 3G cards (Gina3G/Layla3G) | ||
705 | |||
706 | This module supports multiple cards. | ||
707 | The driver requires the firmware loader support on kernel. | ||
708 | |||
709 | Module snd-emu10k1 | ||
710 | ------------------ | ||
711 | |||
712 | Module for EMU10K1/EMU10k2 based PCI sound cards. | ||
713 | |||
714 | * Sound Blaster Live! | ||
715 | * Sound Blaster PCI 512 | ||
716 | * Emu APS (partially supported) | ||
717 | * Sound Blaster Audigy | ||
718 | |||
719 | extin | ||
720 | bitmap of available external inputs for FX8010 (see bellow) | ||
721 | extout | ||
722 | bitmap of available external outputs for FX8010 (see bellow) | ||
723 | seq_ports | ||
724 | allocated sequencer ports (4 by default) | ||
725 | max_synth_voices | ||
726 | limit of voices used for wavetable (64 by default) | ||
727 | max_buffer_size | ||
728 | specifies the maximum size of wavetable/pcm buffers given in MB | ||
729 | unit. Default value is 128. | ||
730 | enable_ir | ||
731 | enable IR | ||
732 | |||
733 | This module supports multiple cards and autoprobe. | ||
734 | |||
735 | Input & Output configurations [extin/extout] | ||
736 | * Creative Card wo/Digital out [0x0003/0x1f03] | ||
737 | * Creative Card w/Digital out [0x0003/0x1f0f] | ||
738 | * Creative Card w/Digital CD in [0x000f/0x1f0f] | ||
739 | * Creative Card wo/Digital out + LiveDrive [0x3fc3/0x1fc3] | ||
740 | * Creative Card w/Digital out + LiveDrive [0x3fc3/0x1fcf] | ||
741 | * Creative Card w/Digital CD in + LiveDrive [0x3fcf/0x1fcf] | ||
742 | * Creative Card wo/Digital out + Digital I/O 2 [0x0fc3/0x1f0f] | ||
743 | * Creative Card w/Digital out + Digital I/O 2 [0x0fc3/0x1f0f] | ||
744 | * Creative Card w/Digital CD in + Digital I/O 2 [0x0fcf/0x1f0f] | ||
745 | * Creative Card 5.1/w Digital out + LiveDrive [0x3fc3/0x1fff] | ||
746 | * Creative Card 5.1 (c) 2003 [0x3fc3/0x7cff] | ||
747 | * Creative Card all ins and outs [0x3fff/0x7fff] | ||
748 | |||
749 | The power-management is supported. | ||
750 | |||
751 | Module snd-emu10k1x | ||
752 | ------------------- | ||
753 | |||
754 | Module for Creative Emu10k1X (SB Live Dell OEM version) | ||
755 | |||
756 | This module supports multiple cards. | ||
757 | |||
758 | Module snd-ens1370 | ||
759 | ------------------ | ||
760 | |||
761 | Module for Ensoniq AudioPCI ES1370 PCI sound cards. | ||
762 | |||
763 | * SoundBlaster PCI 64 | ||
764 | * SoundBlaster PCI 128 | ||
765 | |||
766 | joystick | ||
767 | Enable joystick (default off) | ||
768 | |||
769 | This module supports multiple cards and autoprobe. | ||
770 | |||
771 | The power-management is supported. | ||
772 | |||
773 | Module snd-ens1371 | ||
774 | ------------------ | ||
775 | |||
776 | Module for Ensoniq AudioPCI ES1371 PCI sound cards. | ||
777 | |||
778 | * SoundBlaster PCI 64 | ||
779 | * SoundBlaster PCI 128 | ||
780 | * SoundBlaster Vibra PCI | ||
781 | |||
782 | joystick_port | ||
783 | port # for joystick (0x200,0x208,0x210,0x218), 0 = disable | ||
784 | (default), 1 = auto-detect | ||
785 | |||
786 | This module supports multiple cards and autoprobe. | ||
787 | |||
788 | The power-management is supported. | ||
789 | |||
790 | Module snd-es1688 | ||
791 | ----------------- | ||
792 | |||
793 | Module for ESS AudioDrive ES-1688 and ES-688 sound cards. | ||
794 | |||
795 | isapnp | ||
796 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
797 | mpu_port | ||
798 | port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default) | ||
799 | mpu_irq | ||
800 | IRQ # for MPU-401 port (5,7,9,10) | ||
801 | fm_port | ||
802 | port # for OPL3 (option; share the same port as default) | ||
803 | |||
804 | with ``isapnp=0``, the following additional options are available: | ||
805 | |||
806 | port | ||
807 | port # for ES-1688 chip (0x220,0x240,0x260) | ||
808 | irq | ||
809 | IRQ # for ES-1688 chip (5,7,9,10) | ||
810 | dma8 | ||
811 | DMA # for ES-1688 chip (0,1,3) | ||
812 | |||
813 | This module supports multiple cards and autoprobe (without MPU-401 port) | ||
814 | and PnP with the ES968 chip. | ||
815 | |||
816 | Module snd-es18xx | ||
817 | ----------------- | ||
818 | |||
819 | Module for ESS AudioDrive ES-18xx sound cards. | ||
820 | |||
821 | isapnp | ||
822 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
823 | |||
824 | with ``isapnp=0``, the following options are available: | ||
825 | |||
826 | port | ||
827 | port # for ES-18xx chip (0x220,0x240,0x260) | ||
828 | mpu_port | ||
829 | port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default) | ||
830 | fm_port | ||
831 | port # for FM (optional, not used) | ||
832 | irq | ||
833 | IRQ # for ES-18xx chip (5,7,9,10) | ||
834 | dma1 | ||
835 | first DMA # for ES-18xx chip (0,1,3) | ||
836 | dma2 | ||
837 | first DMA # for ES-18xx chip (0,1,3) | ||
838 | |||
839 | This module supports multiple cards, ISA PnP and autoprobe (without MPU-401 | ||
840 | port if native ISA PnP routines are not used). | ||
841 | When ``dma2`` is equal with ``dma1``, the driver works as half-duplex. | ||
842 | |||
843 | The power-management is supported. | ||
844 | |||
845 | Module snd-es1938 | ||
846 | ----------------- | ||
847 | |||
848 | Module for sound cards based on ESS Solo-1 (ES1938,ES1946) chips. | ||
849 | |||
850 | This module supports multiple cards and autoprobe. | ||
851 | |||
852 | The power-management is supported. | ||
853 | |||
854 | Module snd-es1968 | ||
855 | ----------------- | ||
856 | |||
857 | Module for sound cards based on ESS Maestro-1/2/2E (ES1968/ES1978) chips. | ||
858 | |||
859 | total_bufsize | ||
860 | total buffer size in kB (1-4096kB) | ||
861 | pcm_substreams_p | ||
862 | playback channels (1-8, default=2) | ||
863 | pcm_substreams_c | ||
864 | capture channels (1-8, default=0) | ||
865 | clock | ||
866 | clock (0 = auto-detection) | ||
867 | use_pm | ||
868 | support the power-management (0 = off, 1 = on, 2 = auto (default)) | ||
869 | enable_mpu | ||
870 | enable MPU401 (0 = off, 1 = on, 2 = auto (default)) | ||
871 | joystick | ||
872 | enable joystick (default off) | ||
873 | |||
874 | This module supports multiple cards and autoprobe. | ||
875 | |||
876 | The power-management is supported. | ||
877 | |||
878 | Module snd-fm801 | ||
879 | ---------------- | ||
880 | |||
881 | Module for ForteMedia FM801 based PCI sound cards. | ||
882 | |||
883 | tea575x_tuner | ||
884 | Enable TEA575x tuner; | ||
885 | 1 = MediaForte 256-PCS, | ||
886 | 2 = MediaForte 256-PCPR, | ||
887 | 3 = MediaForte 64-PCR | ||
888 | High 16-bits are video (radio) device number + 1; | ||
889 | example: 0x10002 (MediaForte 256-PCPR, device 1) | ||
890 | |||
891 | This module supports multiple cards and autoprobe. | ||
892 | |||
893 | The power-management is supported. | ||
894 | |||
895 | Module snd-gina20 | ||
896 | ----------------- | ||
897 | |||
898 | Module for Echoaudio Gina20 | ||
899 | |||
900 | This module supports multiple cards. | ||
901 | The driver requires the firmware loader support on kernel. | ||
902 | |||
903 | Module snd-gina24 | ||
904 | ----------------- | ||
905 | |||
906 | Module for Echoaudio Gina24 | ||
907 | |||
908 | This module supports multiple cards. | ||
909 | The driver requires the firmware loader support on kernel. | ||
910 | |||
911 | Module snd-gusclassic | ||
912 | --------------------- | ||
913 | |||
914 | Module for Gravis UltraSound Classic sound card. | ||
915 | |||
916 | port | ||
917 | port # for GF1 chip (0x220,0x230,0x240,0x250,0x260) | ||
918 | irq | ||
919 | IRQ # for GF1 chip (3,5,9,11,12,15) | ||
920 | dma1 | ||
921 | DMA # for GF1 chip (1,3,5,6,7) | ||
922 | dma2 | ||
923 | DMA # for GF1 chip (1,3,5,6,7,-1=disable) | ||
924 | joystick_dac | ||
925 | 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
926 | voices | ||
927 | GF1 voices limit (14-32) | ||
928 | pcm_voices | ||
929 | reserved PCM voices | ||
930 | |||
931 | This module supports multiple cards and autoprobe. | ||
932 | |||
933 | Module snd-gusextreme | ||
934 | --------------------- | ||
935 | |||
936 | Module for Gravis UltraSound Extreme (Synergy ViperMax) sound card. | ||
937 | |||
938 | port | ||
939 | port # for ES-1688 chip (0x220,0x230,0x240,0x250,0x260) | ||
940 | gf1_port | ||
941 | port # for GF1 chip (0x210,0x220,0x230,0x240,0x250,0x260,0x270) | ||
942 | mpu_port | ||
943 | port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable | ||
944 | irq | ||
945 | IRQ # for ES-1688 chip (5,7,9,10) | ||
946 | gf1_irq | ||
947 | IRQ # for GF1 chip (3,5,9,11,12,15) | ||
948 | mpu_irq | ||
949 | IRQ # for MPU-401 port (5,7,9,10) | ||
950 | dma8 | ||
951 | DMA # for ES-1688 chip (0,1,3) | ||
952 | dma1 | ||
953 | DMA # for GF1 chip (1,3,5,6,7) | ||
954 | joystick_dac | ||
955 | 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
956 | voices | ||
957 | GF1 voices limit (14-32) | ||
958 | pcm_voices | ||
959 | reserved PCM voices | ||
960 | |||
961 | This module supports multiple cards and autoprobe (without MPU-401 port). | ||
962 | |||
963 | Module snd-gusmax | ||
964 | ----------------- | ||
965 | |||
966 | Module for Gravis UltraSound MAX sound card. | ||
967 | |||
968 | port | ||
969 | port # for GF1 chip (0x220,0x230,0x240,0x250,0x260) | ||
970 | irq | ||
971 | IRQ # for GF1 chip (3,5,9,11,12,15) | ||
972 | dma1 | ||
973 | DMA # for GF1 chip (1,3,5,6,7) | ||
974 | dma2 | ||
975 | DMA # for GF1 chip (1,3,5,6,7,-1=disable) | ||
976 | joystick_dac | ||
977 | 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
978 | voices | ||
979 | GF1 voices limit (14-32) | ||
980 | pcm_voices | ||
981 | reserved PCM voices | ||
982 | |||
983 | This module supports multiple cards and autoprobe. | ||
984 | |||
985 | Module snd-hda-intel | ||
986 | -------------------- | ||
987 | |||
988 | Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8, ICH9, ICH10, | ||
989 | PCH, SCH), ATI SB450, SB600, R600, RS600, RS690, RS780, RV610, RV620, | ||
990 | RV630, RV635, RV670, RV770, VIA VT8251/VT8237A, SIS966, ULI M5461 | ||
991 | |||
992 | [Multiple options for each card instance] | ||
993 | |||
994 | model | ||
995 | force the model name | ||
996 | position_fix | ||
997 | Fix DMA pointer; | ||
998 | -1 = system default: choose appropriate one per controller hardware, | ||
999 | 0 = auto: falls back to LPIB when POSBUF doesn't work, | ||
1000 | 1 = use LPIB, | ||
1001 | 2 = POSBUF: use position buffer, | ||
1002 | 3 = VIACOMBO: VIA-specific workaround for capture, | ||
1003 | 4 = COMBO: use LPIB for playback, auto for capture stream | ||
1004 | probe_mask | ||
1005 | Bitmask to probe codecs (default = -1, meaning all slots); | ||
1006 | When the bit 8 (0x100) is set, the lower 8 bits are used | ||
1007 | as the "fixed" codec slots; i.e. the driver probes the | ||
1008 | slots regardless what hardware reports back | ||
1009 | probe_only | ||
1010 | Only probing and no codec initialization (default=off); | ||
1011 | Useful to check the initial codec status for debugging | ||
1012 | bdl_pos_adj | ||
1013 | Specifies the DMA IRQ timing delay in samples. | ||
1014 | Passing -1 will make the driver to choose the appropriate | ||
1015 | value based on the controller chip. | ||
1016 | patch | ||
1017 | Specifies the early "patch" files to modify the HD-audio setup | ||
1018 | before initializing the codecs. | ||
1019 | This option is available only when ``CONFIG_SND_HDA_PATCH_LOADER=y`` | ||
1020 | is set. See hd-audio/notes.rst for details. | ||
1021 | beep_mode | ||
1022 | Selects the beep registration mode (0=off, 1=on); | ||
1023 | default value is set via ``CONFIG_SND_HDA_INPUT_BEEP_MODE`` kconfig. | ||
1024 | |||
1025 | [Single (global) options] | ||
1026 | |||
1027 | single_cmd | ||
1028 | Use single immediate commands to communicate with codecs | ||
1029 | (for debugging only) | ||
1030 | enable_msi | ||
1031 | Enable Message Signaled Interrupt (MSI) (default = off) | ||
1032 | power_save | ||
1033 | Automatic power-saving timeout (in second, 0 = disable) | ||
1034 | power_save_controller | ||
1035 | Reset HD-audio controller in power-saving mode (default = on) | ||
1036 | align_buffer_size | ||
1037 | Force rounding of buffer/period sizes to multiples of 128 bytes. | ||
1038 | This is more efficient in terms of memory access but isn't | ||
1039 | required by the HDA spec and prevents users from specifying | ||
1040 | exact period/buffer sizes. (default = on) | ||
1041 | snoop | ||
1042 | Enable/disable snooping (default = on) | ||
1043 | |||
1044 | This module supports multiple cards and autoprobe. | ||
1045 | |||
1046 | See hd-audio/notes.rst for more details about HD-audio driver. | ||
1047 | |||
1048 | Each codec may have a model table for different configurations. | ||
1049 | If your machine isn't listed there, the default (usually minimal) | ||
1050 | configuration is set up. You can pass ``model=<name>`` option to | ||
1051 | specify a certain model in such a case. There are different | ||
1052 | models depending on the codec chip. The list of available models | ||
1053 | is found in hd-audio/models.rst. | ||
1054 | |||
1055 | The model name ``generic`` is treated as a special case. When this | ||
1056 | model is given, the driver uses the generic codec parser without | ||
1057 | "codec-patch". It's sometimes good for testing and debugging. | ||
1058 | |||
1059 | If the default configuration doesn't work and one of the above | ||
1060 | matches with your device, report it together with alsa-info.sh | ||
1061 | output (with ``--no-upload`` option) to kernel bugzilla or alsa-devel | ||
1062 | ML (see the section `Links and Addresses`_). | ||
1063 | |||
1064 | ``power_save`` and ``power_save_controller`` options are for power-saving | ||
1065 | mode. See powersave.txt for details. | ||
1066 | |||
1067 | Note 2: If you get click noises on output, try the module option | ||
1068 | ``position_fix=1`` or ``2``. ``position_fix=1`` will use the SD_LPIB | ||
1069 | register value without FIFO size correction as the current | ||
1070 | DMA pointer. ``position_fix=2`` will make the driver to use | ||
1071 | the position buffer instead of reading SD_LPIB register. | ||
1072 | (Usually SD_LPIB register is more accurate than the | ||
1073 | position buffer.) | ||
1074 | |||
1075 | ``position_fix=3`` is specific to VIA devices. The position | ||
1076 | of the capture stream is checked from both LPIB and POSBUF | ||
1077 | values. ``position_fix=4`` is a combination mode, using LPIB | ||
1078 | for playback and POSBUF for capture. | ||
1079 | |||
1080 | NB: If you get many ``azx_get_response timeout`` messages at | ||
1081 | loading, it's likely a problem of interrupts (e.g. ACPI irq | ||
1082 | routing). Try to boot with options like ``pci=noacpi``. Also, you | ||
1083 | can try ``single_cmd=1`` module option. This will switch the | ||
1084 | communication method between HDA controller and codecs to the | ||
1085 | single immediate commands instead of CORB/RIRB. Basically, the | ||
1086 | single command mode is provided only for BIOS, and you won't get | ||
1087 | unsolicited events, too. But, at least, this works independently | ||
1088 | from the irq. Remember this is a last resort, and should be | ||
1089 | avoided as much as possible... | ||
1090 | |||
1091 | MORE NOTES ON ``azx_get_response timeout`` PROBLEMS: | ||
1092 | On some hardware, you may need to add a proper probe_mask option | ||
1093 | to avoid the ``azx_get_response timeout`` problem above, instead. | ||
1094 | This occurs when the access to non-existing or non-working codec slot | ||
1095 | (likely a modem one) causes a stall of the communication via HD-audio | ||
1096 | bus. You can see which codec slots are probed by enabling | ||
1097 | ``CONFIG_SND_DEBUG_VERBOSE``, or simply from the file name of the codec | ||
1098 | proc files. Then limit the slots to probe by probe_mask option. | ||
1099 | For example, ``probe_mask=1`` means to probe only the first slot, and | ||
1100 | ``probe_mask=4`` means only the third slot. | ||
1101 | |||
1102 | The power-management is supported. | ||
1103 | |||
1104 | Module snd-hdsp | ||
1105 | --------------- | ||
1106 | |||
1107 | Module for RME Hammerfall DSP audio interface(s) | ||
1108 | |||
1109 | This module supports multiple cards. | ||
1110 | |||
1111 | Note: The firmware data can be automatically loaded via hotplug | ||
1112 | when ``CONFIG_FW_LOADER`` is set. Otherwise, you need to load | ||
1113 | the firmware via hdsploader utility included in alsa-tools | ||
1114 | package. | ||
1115 | The firmware data is found in alsa-firmware package. | ||
1116 | |||
1117 | Note: snd-page-alloc module does the job which snd-hammerfall-mem | ||
1118 | module did formerly. It will allocate the buffers in advance | ||
1119 | when any HDSP cards are found. To make the buffer | ||
1120 | allocation sure, load snd-page-alloc module in the early | ||
1121 | stage of boot sequence. See `Early Buffer Allocation`_ | ||
1122 | section. | ||
1123 | |||
1124 | Module snd-hdspm | ||
1125 | ---------------- | ||
1126 | |||
1127 | Module for RME HDSP MADI board. | ||
1128 | |||
1129 | precise_ptr | ||
1130 | Enable precise pointer, or disable. | ||
1131 | line_outs_monitor | ||
1132 | Send playback streams to analog outs by default. | ||
1133 | enable_monitor | ||
1134 | Enable Analog Out on Channel 63/64 by default. | ||
1135 | |||
1136 | See hdspm.txt for details. | ||
1137 | |||
1138 | Module snd-ice1712 | ||
1139 | ------------------ | ||
1140 | |||
1141 | Module for Envy24 (ICE1712) based PCI sound cards. | ||
1142 | |||
1143 | * MidiMan M Audio Delta 1010 | ||
1144 | * MidiMan M Audio Delta 1010LT | ||
1145 | * MidiMan M Audio Delta DiO 2496 | ||
1146 | * MidiMan M Audio Delta 66 | ||
1147 | * MidiMan M Audio Delta 44 | ||
1148 | * MidiMan M Audio Delta 410 | ||
1149 | * MidiMan M Audio Audiophile 2496 | ||
1150 | * TerraTec EWS 88MT | ||
1151 | * TerraTec EWS 88D | ||
1152 | * TerraTec EWX 24/96 | ||
1153 | * TerraTec DMX 6Fire | ||
1154 | * TerraTec Phase 88 | ||
1155 | * Hoontech SoundTrack DSP 24 | ||
1156 | * Hoontech SoundTrack DSP 24 Value | ||
1157 | * Hoontech SoundTrack DSP 24 Media 7.1 | ||
1158 | * Event Electronics, EZ8 | ||
1159 | * Digigram VX442 | ||
1160 | * Lionstracs, Mediastaton | ||
1161 | * Terrasoniq TS 88 | ||
1162 | |||
1163 | model | ||
1164 | Use the given board model, one of the following: | ||
1165 | delta1010, dio2496, delta66, delta44, audiophile, delta410, | ||
1166 | delta1010lt, vx442, ewx2496, ews88mt, ews88mt_new, ews88d, | ||
1167 | dmx6fire, dsp24, dsp24_value, dsp24_71, ez8, | ||
1168 | phase88, mediastation | ||
1169 | omni | ||
1170 | Omni I/O support for MidiMan M-Audio Delta44/66 | ||
1171 | cs8427_timeout | ||
1172 | reset timeout for the CS8427 chip (S/PDIF transceiver) in msec | ||
1173 | resolution, default value is 500 (0.5 sec) | ||
1174 | |||
1175 | This module supports multiple cards and autoprobe. | ||
1176 | Note: The consumer part is not used with all Envy24 based cards (for | ||
1177 | example in the MidiMan Delta siree). | ||
1178 | |||
1179 | Note: The supported board is detected by reading EEPROM or PCI | ||
1180 | SSID (if EEPROM isn't available). You can override the | ||
1181 | model by passing ``model`` module option in case that the | ||
1182 | driver isn't configured properly or you want to try another | ||
1183 | type for testing. | ||
1184 | |||
1185 | Module snd-ice1724 | ||
1186 | ------------------ | ||
1187 | |||
1188 | Module for Envy24HT (VT/ICE1724), Envy24PT (VT1720) based PCI sound cards. | ||
1189 | |||
1190 | * MidiMan M Audio Revolution 5.1 | ||
1191 | * MidiMan M Audio Revolution 7.1 | ||
1192 | * MidiMan M Audio Audiophile 192 | ||
1193 | * AMP Ltd AUDIO2000 | ||
1194 | * TerraTec Aureon 5.1 Sky | ||
1195 | * TerraTec Aureon 7.1 Space | ||
1196 | * TerraTec Aureon 7.1 Universe | ||
1197 | * TerraTec Phase 22 | ||
1198 | * TerraTec Phase 28 | ||
1199 | * AudioTrak Prodigy 7.1 | ||
1200 | * AudioTrak Prodigy 7.1 LT | ||
1201 | * AudioTrak Prodigy 7.1 XT | ||
1202 | * AudioTrak Prodigy 7.1 HIFI | ||
1203 | * AudioTrak Prodigy 7.1 HD2 | ||
1204 | * AudioTrak Prodigy 192 | ||
1205 | * Pontis MS300 | ||
1206 | * Albatron K8X800 Pro II | ||
1207 | * Chaintech ZNF3-150 | ||
1208 | * Chaintech ZNF3-250 | ||
1209 | * Chaintech 9CJS | ||
1210 | * Chaintech AV-710 | ||
1211 | * Shuttle SN25P | ||
1212 | * Onkyo SE-90PCI | ||
1213 | * Onkyo SE-200PCI | ||
1214 | * ESI Juli@ | ||
1215 | * ESI Maya44 | ||
1216 | * Hercules Fortissimo IV | ||
1217 | * EGO-SYS WaveTerminal 192M | ||
1218 | |||
1219 | model | ||
1220 | Use the given board model, one of the following: | ||
1221 | revo51, revo71, amp2000, prodigy71, prodigy71lt, | ||
1222 | prodigy71xt, prodigy71hifi, prodigyhd2, prodigy192, | ||
1223 | juli, aureon51, aureon71, universe, ap192, k8x800, | ||
1224 | phase22, phase28, ms300, av710, se200pci, se90pci, | ||
1225 | fortissimo4, sn25p, WT192M, maya44 | ||
1226 | |||
1227 | This module supports multiple cards and autoprobe. | ||
1228 | |||
1229 | Note: The supported board is detected by reading EEPROM or PCI | ||
1230 | SSID (if EEPROM isn't available). You can override the | ||
1231 | model by passing ``model`` module option in case that the | ||
1232 | driver isn't configured properly or you want to try another | ||
1233 | type for testing. | ||
1234 | |||
1235 | Module snd-indigo | ||
1236 | ----------------- | ||
1237 | |||
1238 | Module for Echoaudio Indigo | ||
1239 | |||
1240 | This module supports multiple cards. | ||
1241 | The driver requires the firmware loader support on kernel. | ||
1242 | |||
1243 | Module snd-indigodj | ||
1244 | ------------------- | ||
1245 | |||
1246 | Module for Echoaudio Indigo DJ | ||
1247 | |||
1248 | This module supports multiple cards. | ||
1249 | The driver requires the firmware loader support on kernel. | ||
1250 | |||
1251 | Module snd-indigoio | ||
1252 | ------------------- | ||
1253 | |||
1254 | Module for Echoaudio Indigo IO | ||
1255 | |||
1256 | This module supports multiple cards. | ||
1257 | The driver requires the firmware loader support on kernel. | ||
1258 | |||
1259 | Module snd-intel8x0 | ||
1260 | ------------------- | ||
1261 | |||
1262 | Module for AC'97 motherboards from Intel and compatibles. | ||
1263 | |||
1264 | * Intel i810/810E, i815, i820, i830, i84x, MX440 ICH5, ICH6, ICH7, | ||
1265 | 6300ESB, ESB2 | ||
1266 | * SiS 7012 (SiS 735) | ||
1267 | * NVidia NForce, NForce2, NForce3, MCP04, CK804 CK8, CK8S, MCP501 | ||
1268 | * AMD AMD768, AMD8111 | ||
1269 | * ALi m5455 | ||
1270 | |||
1271 | ac97_clock | ||
1272 | AC'97 codec clock base (0 = auto-detect) | ||
1273 | ac97_quirk | ||
1274 | AC'97 workaround for strange hardware; | ||
1275 | See `AC97 Quirk Option`_ section below. | ||
1276 | buggy_irq | ||
1277 | Enable workaround for buggy interrupts on some motherboards | ||
1278 | (default yes on nForce chips, otherwise off) | ||
1279 | buggy_semaphore | ||
1280 | Enable workaround for hardware with buggy semaphores (e.g. on some | ||
1281 | ASUS laptops) (default off) | ||
1282 | spdif_aclink | ||
1283 | Use S/PDIF over AC-link instead of direct connection from the | ||
1284 | controller chip (0 = off, 1 = on, -1 = default) | ||
1285 | |||
1286 | This module supports one chip and autoprobe. | ||
1287 | |||
1288 | Note: the latest driver supports auto-detection of chip clock. | ||
1289 | if you still encounter too fast playback, specify the clock | ||
1290 | explicitly via the module option ``ac97_clock=41194``. | ||
1291 | |||
1292 | Joystick/MIDI ports are not supported by this driver. If your | ||
1293 | motherboard has these devices, use the ns558 or snd-mpu401 | ||
1294 | modules, respectively. | ||
1295 | |||
1296 | The power-management is supported. | ||
1297 | |||
1298 | Module snd-intel8x0m | ||
1299 | -------------------- | ||
1300 | |||
1301 | Module for Intel ICH (i8x0) chipset MC97 modems. | ||
1302 | |||
1303 | * Intel i810/810E, i815, i820, i830, i84x, MX440 ICH5, ICH6, ICH7 | ||
1304 | * SiS 7013 (SiS 735) | ||
1305 | * NVidia NForce, NForce2, NForce2s, NForce3 | ||
1306 | * AMD AMD8111 | ||
1307 | * ALi m5455 | ||
1308 | |||
1309 | ac97_clock | ||
1310 | AC'97 codec clock base (0 = auto-detect) | ||
1311 | |||
1312 | This module supports one card and autoprobe. | ||
1313 | |||
1314 | Note: The default index value of this module is -2, i.e. the first | ||
1315 | slot is excluded. | ||
1316 | |||
1317 | The power-management is supported. | ||
1318 | |||
1319 | Module snd-interwave | ||
1320 | -------------------- | ||
1321 | |||
1322 | Module for Gravis UltraSound PnP, Dynasonic 3-D/Pro, STB Sound Rage 32 | ||
1323 | and other sound cards based on AMD InterWave (tm) chip. | ||
1324 | |||
1325 | joystick_dac | ||
1326 | 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
1327 | midi | ||
1328 | 1 = MIDI UART enable, 0 = MIDI UART disable (default) | ||
1329 | pcm_voices | ||
1330 | reserved PCM voices for the synthesizer (default 2) | ||
1331 | effect | ||
1332 | 1 = InterWave effects enable (default 0); requires 8 voices | ||
1333 | isapnp | ||
1334 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1335 | |||
1336 | with ``isapnp=0``, the following options are available: | ||
1337 | |||
1338 | port | ||
1339 | port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260) | ||
1340 | irq | ||
1341 | IRQ # for InterWave chip (3,5,9,11,12,15) | ||
1342 | dma1 | ||
1343 | DMA # for InterWave chip (0,1,3,5,6,7) | ||
1344 | dma2 | ||
1345 | DMA # for InterWave chip (0,1,3,5,6,7,-1=disable) | ||
1346 | |||
1347 | This module supports multiple cards, autoprobe and ISA PnP. | ||
1348 | |||
1349 | Module snd-interwave-stb | ||
1350 | ------------------------ | ||
1351 | |||
1352 | Module for UltraSound 32-Pro (sound card from STB used by Compaq) | ||
1353 | and other sound cards based on AMD InterWave (tm) chip with TEA6330T | ||
1354 | circuit for extended control of bass, treble and master volume. | ||
1355 | |||
1356 | joystick_dac | ||
1357 | 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
1358 | midi | ||
1359 | 1 = MIDI UART enable, 0 = MIDI UART disable (default) | ||
1360 | pcm_voices | ||
1361 | reserved PCM voices for the synthesizer (default 2) | ||
1362 | effect | ||
1363 | 1 = InterWave effects enable (default 0); requires 8 voices | ||
1364 | isapnp | ||
1365 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1366 | |||
1367 | with ``isapnp=0``, the following options are available: | ||
1368 | |||
1369 | port | ||
1370 | port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260) | ||
1371 | port_tc | ||
1372 | tone control (i2c bus) port # for TEA6330T chip (0x350,0x360,0x370,0x380) | ||
1373 | irq | ||
1374 | IRQ # for InterWave chip (3,5,9,11,12,15) | ||
1375 | dma1 | ||
1376 | DMA # for InterWave chip (0,1,3,5,6,7) | ||
1377 | dma2 | ||
1378 | DMA # for InterWave chip (0,1,3,5,6,7,-1=disable) | ||
1379 | |||
1380 | This module supports multiple cards, autoprobe and ISA PnP. | ||
1381 | |||
1382 | Module snd-jazz16 | ||
1383 | ------------------- | ||
1384 | |||
1385 | Module for Media Vision Jazz16 chipset. The chipset consists of 3 chips: | ||
1386 | MVD1216 + MVA416 + MVA514. | ||
1387 | |||
1388 | port | ||
1389 | port # for SB DSP chip (0x210,0x220,0x230,0x240,0x250,0x260) | ||
1390 | irq | ||
1391 | IRQ # for SB DSP chip (3,5,7,9,10,15) | ||
1392 | dma8 | ||
1393 | DMA # for SB DSP chip (1,3) | ||
1394 | dma16 | ||
1395 | DMA # for SB DSP chip (5,7) | ||
1396 | mpu_port | ||
1397 | MPU-401 port # (0x300,0x310,0x320,0x330) | ||
1398 | mpu_irq | ||
1399 | MPU-401 irq # (2,3,5,7) | ||
1400 | |||
1401 | This module supports multiple cards. | ||
1402 | |||
1403 | Module snd-korg1212 | ||
1404 | ------------------- | ||
1405 | |||
1406 | Module for Korg 1212 IO PCI card | ||
1407 | |||
1408 | This module supports multiple cards. | ||
1409 | |||
1410 | Module snd-layla20 | ||
1411 | ------------------ | ||
1412 | |||
1413 | Module for Echoaudio Layla20 | ||
1414 | |||
1415 | This module supports multiple cards. | ||
1416 | The driver requires the firmware loader support on kernel. | ||
1417 | |||
1418 | Module snd-layla24 | ||
1419 | ------------------ | ||
1420 | |||
1421 | Module for Echoaudio Layla24 | ||
1422 | |||
1423 | This module supports multiple cards. | ||
1424 | The driver requires the firmware loader support on kernel. | ||
1425 | |||
1426 | Module snd-lola | ||
1427 | --------------- | ||
1428 | |||
1429 | Module for Digigram Lola PCI-e boards | ||
1430 | |||
1431 | This module supports multiple cards. | ||
1432 | |||
1433 | Module snd-lx6464es | ||
1434 | ------------------- | ||
1435 | |||
1436 | Module for Digigram LX6464ES boards | ||
1437 | |||
1438 | This module supports multiple cards. | ||
1439 | |||
1440 | Module snd-maestro3 | ||
1441 | ------------------- | ||
1442 | |||
1443 | Module for Allegro/Maestro3 chips | ||
1444 | |||
1445 | external_amp | ||
1446 | enable external amp (enabled by default) | ||
1447 | amp_gpio | ||
1448 | GPIO pin number for external amp (0-15) or -1 for default pin (8 | ||
1449 | for allegro, 1 for others) | ||
1450 | |||
1451 | This module supports autoprobe and multiple chips. | ||
1452 | |||
1453 | Note: the binding of amplifier is dependent on hardware. | ||
1454 | If there is no sound even though all channels are unmuted, try to | ||
1455 | specify other gpio connection via amp_gpio option. | ||
1456 | For example, a Panasonic notebook might need ``amp_gpio=0x0d`` | ||
1457 | option. | ||
1458 | |||
1459 | The power-management is supported. | ||
1460 | |||
1461 | Module snd-mia | ||
1462 | --------------- | ||
1463 | |||
1464 | Module for Echoaudio Mia | ||
1465 | |||
1466 | This module supports multiple cards. | ||
1467 | The driver requires the firmware loader support on kernel. | ||
1468 | |||
1469 | Module snd-miro | ||
1470 | --------------- | ||
1471 | |||
1472 | Module for Miro soundcards: miroSOUND PCM 1 pro, miroSOUND PCM 12, | ||
1473 | miroSOUND PCM 20 Radio. | ||
1474 | |||
1475 | port | ||
1476 | Port # (0x530,0x604,0xe80,0xf40) | ||
1477 | irq | ||
1478 | IRQ # (5,7,9,10,11) | ||
1479 | dma1 | ||
1480 | 1st dma # (0,1,3) | ||
1481 | dma2 | ||
1482 | 2nd dma # (0,1) | ||
1483 | mpu_port | ||
1484 | MPU-401 port # (0x300,0x310,0x320,0x330) | ||
1485 | mpu_irq | ||
1486 | MPU-401 irq # (5,7,9,10) | ||
1487 | fm_port | ||
1488 | FM Port # (0x388) | ||
1489 | wss | ||
1490 | enable WSS mode | ||
1491 | ide | ||
1492 | enable onboard ide support | ||
1493 | |||
1494 | Module snd-mixart | ||
1495 | ----------------- | ||
1496 | |||
1497 | Module for Digigram miXart8 sound cards. | ||
1498 | |||
1499 | This module supports multiple cards. | ||
1500 | Note: One miXart8 board will be represented as 4 alsa cards. | ||
1501 | See MIXART.txt for details. | ||
1502 | |||
1503 | When the driver is compiled as a module and the hotplug firmware | ||
1504 | is supported, the firmware data is loaded via hotplug automatically. | ||
1505 | Install the necessary firmware files in alsa-firmware package. | ||
1506 | When no hotplug fw loader is available, you need to load the | ||
1507 | firmware via mixartloader utility in alsa-tools package. | ||
1508 | |||
1509 | Module snd-mona | ||
1510 | --------------- | ||
1511 | |||
1512 | Module for Echoaudio Mona | ||
1513 | |||
1514 | This module supports multiple cards. | ||
1515 | The driver requires the firmware loader support on kernel. | ||
1516 | |||
1517 | Module snd-mpu401 | ||
1518 | ----------------- | ||
1519 | |||
1520 | Module for MPU-401 UART devices. | ||
1521 | |||
1522 | port | ||
1523 | port number or -1 (disable) | ||
1524 | irq | ||
1525 | IRQ number or -1 (disable) | ||
1526 | pnp | ||
1527 | PnP detection - 0 = disable, 1 = enable (default) | ||
1528 | |||
1529 | This module supports multiple devices and PnP. | ||
1530 | |||
1531 | Module snd-msnd-classic | ||
1532 | ----------------------- | ||
1533 | |||
1534 | Module for Turtle Beach MultiSound Classic, Tahiti or Monterey | ||
1535 | soundcards. | ||
1536 | |||
1537 | io | ||
1538 | Port # for msnd-classic card | ||
1539 | irq | ||
1540 | IRQ # for msnd-classic card | ||
1541 | mem | ||
1542 | Memory address (0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000) | ||
1543 | write_ndelay | ||
1544 | enable write ndelay (default = 1) | ||
1545 | calibrate_signal | ||
1546 | calibrate signal (default = 0) | ||
1547 | isapnp | ||
1548 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1549 | digital | ||
1550 | Digital daughterboard present (default = 0) | ||
1551 | cfg | ||
1552 | Config port (0x250, 0x260 or 0x270) default = PnP | ||
1553 | reset | ||
1554 | Reset all devices | ||
1555 | mpu_io | ||
1556 | MPU401 I/O port | ||
1557 | mpu_irq | ||
1558 | MPU401 irq# | ||
1559 | ide_io0 | ||
1560 | IDE port #0 | ||
1561 | ide_io1 | ||
1562 | IDE port #1 | ||
1563 | ide_irq | ||
1564 | IDE irq# | ||
1565 | joystick_io | ||
1566 | Joystick I/O port | ||
1567 | |||
1568 | The driver requires firmware files ``turtlebeach/msndinit.bin`` and | ||
1569 | ``turtlebeach/msndperm.bin`` in the proper firmware directory. | ||
1570 | |||
1571 | See Documentation/sound/oss/MultiSound for important information | ||
1572 | about this driver. Note that it has been discontinued, but the | ||
1573 | Voyetra Turtle Beach knowledge base entry for it is still available | ||
1574 | at | ||
1575 | http://www.turtlebeach.com | ||
1576 | |||
1577 | Module snd-msnd-pinnacle | ||
1578 | ------------------------ | ||
1579 | |||
1580 | Module for Turtle Beach MultiSound Pinnacle/Fiji soundcards. | ||
1581 | |||
1582 | io | ||
1583 | Port # for pinnacle/fiji card | ||
1584 | irq | ||
1585 | IRQ # for pinnalce/fiji card | ||
1586 | mem | ||
1587 | Memory address (0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000) | ||
1588 | write_ndelay | ||
1589 | enable write ndelay (default = 1) | ||
1590 | calibrate_signal | ||
1591 | calibrate signal (default = 0) | ||
1592 | isapnp | ||
1593 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1594 | |||
1595 | The driver requires firmware files ``turtlebeach/pndspini.bin`` and | ||
1596 | ``turtlebeach/pndsperm.bin`` in the proper firmware directory. | ||
1597 | |||
1598 | Module snd-mtpav | ||
1599 | ---------------- | ||
1600 | |||
1601 | Module for MOTU MidiTimePiece AV multiport MIDI (on the parallel | ||
1602 | port). | ||
1603 | |||
1604 | port | ||
1605 | I/O port # for MTPAV (0x378,0x278, default=0x378) | ||
1606 | irq | ||
1607 | IRQ # for MTPAV (7,5, default=7) | ||
1608 | hwports | ||
1609 | number of supported hardware ports, default=8. | ||
1610 | |||
1611 | Module supports only 1 card. This module has no enable option. | ||
1612 | |||
1613 | Module snd-mts64 | ||
1614 | ---------------- | ||
1615 | |||
1616 | Module for Ego Systems (ESI) Miditerminal 4140 | ||
1617 | |||
1618 | This module supports multiple devices. | ||
1619 | Requires parport (``CONFIG_PARPORT``). | ||
1620 | |||
1621 | Module snd-nm256 | ||
1622 | ---------------- | ||
1623 | |||
1624 | Module for NeoMagic NM256AV/ZX chips | ||
1625 | |||
1626 | playback_bufsize | ||
1627 | max playback frame size in kB (4-128kB) | ||
1628 | capture_bufsize | ||
1629 | max capture frame size in kB (4-128kB) | ||
1630 | force_ac97 | ||
1631 | 0 or 1 (disabled by default) | ||
1632 | buffer_top | ||
1633 | specify buffer top address | ||
1634 | use_cache | ||
1635 | 0 or 1 (disabled by default) | ||
1636 | vaio_hack | ||
1637 | alias buffer_top=0x25a800 | ||
1638 | reset_workaround | ||
1639 | enable AC97 RESET workaround for some laptops | ||
1640 | reset_workaround2 | ||
1641 | enable extended AC97 RESET workaround for some other laptops | ||
1642 | |||
1643 | This module supports one chip and autoprobe. | ||
1644 | |||
1645 | The power-management is supported. | ||
1646 | |||
1647 | Note: on some notebooks the buffer address cannot be detected | ||
1648 | automatically, or causes hang-up during initialization. | ||
1649 | In such a case, specify the buffer top address explicitly via | ||
1650 | the buffer_top option. | ||
1651 | For example, | ||
1652 | Sony F250: buffer_top=0x25a800 | ||
1653 | Sony F270: buffer_top=0x272800 | ||
1654 | The driver supports only ac97 codec. It's possible to force | ||
1655 | to initialize/use ac97 although it's not detected. In such a | ||
1656 | case, use ``force_ac97=1`` option - but *NO* guarantee whether it | ||
1657 | works! | ||
1658 | |||
1659 | Note: The NM256 chip can be linked internally with non-AC97 | ||
1660 | codecs. This driver supports only the AC97 codec, and won't work | ||
1661 | with machines with other (most likely CS423x or OPL3SAx) chips, | ||
1662 | even though the device is detected in lspci. In such a case, try | ||
1663 | other drivers, e.g. snd-cs4232 or snd-opl3sa2. Some has ISA-PnP | ||
1664 | but some doesn't have ISA PnP. You'll need to specify ``isapnp=0`` | ||
1665 | and proper hardware parameters in the case without ISA PnP. | ||
1666 | |||
1667 | Note: some laptops need a workaround for AC97 RESET. For the | ||
1668 | known hardware like Dell Latitude LS and Sony PCG-F305, this | ||
1669 | workaround is enabled automatically. For other laptops with a | ||
1670 | hard freeze, you can try ``reset_workaround=1`` option. | ||
1671 | |||
1672 | Note: Dell Latitude CSx laptops have another problem regarding | ||
1673 | AC97 RESET. On these laptops, reset_workaround2 option is | ||
1674 | turned on as default. This option is worth to try if the | ||
1675 | previous reset_workaround option doesn't help. | ||
1676 | |||
1677 | Note: This driver is really crappy. It's a porting from the | ||
1678 | OSS driver, which is a result of black-magic reverse engineering. | ||
1679 | The detection of codec will fail if the driver is loaded *after* | ||
1680 | X-server as described above. You might be able to force to load | ||
1681 | the module, but it may result in hang-up. Hence, make sure that | ||
1682 | you load this module *before* X if you encounter this kind of | ||
1683 | problem. | ||
1684 | |||
1685 | Module snd-opl3sa2 | ||
1686 | ------------------ | ||
1687 | |||
1688 | Module for Yamaha OPL3-SA2/SA3 sound cards. | ||
1689 | |||
1690 | isapnp | ||
1691 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1692 | |||
1693 | with ``isapnp=0``, the following options are available: | ||
1694 | |||
1695 | port | ||
1696 | control port # for OPL3-SA chip (0x370) | ||
1697 | sb_port | ||
1698 | SB port # for OPL3-SA chip (0x220,0x240) | ||
1699 | wss_port | ||
1700 | WSS port # for OPL3-SA chip (0x530,0xe80,0xf40,0x604) | ||
1701 | midi_port | ||
1702 | port # for MPU-401 UART (0x300,0x330), -1 = disable | ||
1703 | fm_port | ||
1704 | FM port # for OPL3-SA chip (0x388), -1 = disable | ||
1705 | irq | ||
1706 | IRQ # for OPL3-SA chip (5,7,9,10) | ||
1707 | dma1 | ||
1708 | first DMA # for Yamaha OPL3-SA chip (0,1,3) | ||
1709 | dma2 | ||
1710 | second DMA # for Yamaha OPL3-SA chip (0,1,3), -1 = disable | ||
1711 | |||
1712 | This module supports multiple cards and ISA PnP. It does not support | ||
1713 | autoprobe (if ISA PnP is not used) thus all ports must be specified!!! | ||
1714 | |||
1715 | The power-management is supported. | ||
1716 | |||
1717 | Module snd-opti92x-ad1848 | ||
1718 | ------------------------- | ||
1719 | |||
1720 | Module for sound cards based on OPTi 82c92x and Analog Devices AD1848 chips. | ||
1721 | Module works with OAK Mozart cards as well. | ||
1722 | |||
1723 | isapnp | ||
1724 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1725 | |||
1726 | with ``isapnp=0``, the following options are available: | ||
1727 | |||
1728 | port | ||
1729 | port # for WSS chip (0x530,0xe80,0xf40,0x604) | ||
1730 | mpu_port | ||
1731 | port # for MPU-401 UART (0x300,0x310,0x320,0x330) | ||
1732 | fm_port | ||
1733 | port # for OPL3 device (0x388) | ||
1734 | irq | ||
1735 | IRQ # for WSS chip (5,7,9,10,11) | ||
1736 | mpu_irq | ||
1737 | IRQ # for MPU-401 UART (5,7,9,10) | ||
1738 | dma1 | ||
1739 | first DMA # for WSS chip (0,1,3) | ||
1740 | |||
1741 | This module supports only one card, autoprobe and PnP. | ||
1742 | |||
1743 | Module snd-opti92x-cs4231 | ||
1744 | ------------------------- | ||
1745 | |||
1746 | Module for sound cards based on OPTi 82c92x and Crystal CS4231 chips. | ||
1747 | |||
1748 | isapnp | ||
1749 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1750 | |||
1751 | with ``isapnp=0``, the following options are available: | ||
1752 | |||
1753 | port | ||
1754 | port # for WSS chip (0x530,0xe80,0xf40,0x604) | ||
1755 | mpu_port | ||
1756 | port # for MPU-401 UART (0x300,0x310,0x320,0x330) | ||
1757 | fm_port | ||
1758 | port # for OPL3 device (0x388) | ||
1759 | irq | ||
1760 | IRQ # for WSS chip (5,7,9,10,11) | ||
1761 | mpu_irq | ||
1762 | IRQ # for MPU-401 UART (5,7,9,10) | ||
1763 | dma1 | ||
1764 | first DMA # for WSS chip (0,1,3) | ||
1765 | dma2 | ||
1766 | second DMA # for WSS chip (0,1,3) | ||
1767 | |||
1768 | This module supports only one card, autoprobe and PnP. | ||
1769 | |||
1770 | Module snd-opti93x | ||
1771 | ------------------ | ||
1772 | |||
1773 | Module for sound cards based on OPTi 82c93x chips. | ||
1774 | |||
1775 | isapnp | ||
1776 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1777 | |||
1778 | with ``isapnp=0``, the following options are available: | ||
1779 | |||
1780 | port | ||
1781 | port # for WSS chip (0x530,0xe80,0xf40,0x604) | ||
1782 | mpu_port | ||
1783 | port # for MPU-401 UART (0x300,0x310,0x320,0x330) | ||
1784 | fm_port | ||
1785 | port # for OPL3 device (0x388) | ||
1786 | irq | ||
1787 | IRQ # for WSS chip (5,7,9,10,11) | ||
1788 | mpu_irq | ||
1789 | IRQ # for MPU-401 UART (5,7,9,10) | ||
1790 | dma1 | ||
1791 | first DMA # for WSS chip (0,1,3) | ||
1792 | dma2 | ||
1793 | second DMA # for WSS chip (0,1,3) | ||
1794 | |||
1795 | This module supports only one card, autoprobe and PnP. | ||
1796 | |||
1797 | Module snd-oxygen | ||
1798 | ----------------- | ||
1799 | |||
1800 | Module for sound cards based on the C-Media CMI8786/8787/8788 chip: | ||
1801 | |||
1802 | * Asound A-8788 | ||
1803 | * Asus Xonar DG/DGX | ||
1804 | * AuzenTech X-Meridian | ||
1805 | * AuzenTech X-Meridian 2G | ||
1806 | * Bgears b-Enspirer | ||
1807 | * Club3D Theatron DTS | ||
1808 | * HT-Omega Claro (plus) | ||
1809 | * HT-Omega Claro halo (XT) | ||
1810 | * Kuroutoshikou CMI8787-HG2PCI | ||
1811 | * Razer Barracuda AC-1 | ||
1812 | * Sondigo Inferno | ||
1813 | * TempoTec HiFier Fantasia | ||
1814 | * TempoTec HiFier Serenade | ||
1815 | |||
1816 | This module supports autoprobe and multiple cards. | ||
1817 | |||
1818 | Module snd-pcsp | ||
1819 | --------------- | ||
1820 | |||
1821 | Module for internal PC-Speaker. | ||
1822 | |||
1823 | nopcm | ||
1824 | Disable PC-Speaker PCM sound. Only beeps remain. | ||
1825 | nforce_wa | ||
1826 | enable NForce chipset workaround. Expect bad sound. | ||
1827 | |||
1828 | This module supports system beeps, some kind of PCM playback and | ||
1829 | even a few mixer controls. | ||
1830 | |||
1831 | Module snd-pcxhr | ||
1832 | ---------------- | ||
1833 | |||
1834 | Module for Digigram PCXHR boards | ||
1835 | |||
1836 | This module supports multiple cards. | ||
1837 | |||
1838 | Module snd-portman2x4 | ||
1839 | --------------------- | ||
1840 | |||
1841 | Module for Midiman Portman 2x4 parallel port MIDI interface | ||
1842 | |||
1843 | This module supports multiple cards. | ||
1844 | |||
1845 | Module snd-powermac (on ppc only) | ||
1846 | --------------------------------- | ||
1847 | |||
1848 | Module for PowerMac, iMac and iBook on-board soundchips | ||
1849 | |||
1850 | enable_beep | ||
1851 | enable beep using PCM (enabled as default) | ||
1852 | |||
1853 | Module supports autoprobe a chip. | ||
1854 | |||
1855 | Note: the driver may have problems regarding endianness. | ||
1856 | |||
1857 | The power-management is supported. | ||
1858 | |||
1859 | Module snd-pxa2xx-ac97 (on arm only) | ||
1860 | ------------------------------------ | ||
1861 | |||
1862 | Module for AC97 driver for the Intel PXA2xx chip | ||
1863 | |||
1864 | For ARM architecture only. | ||
1865 | |||
1866 | The power-management is supported. | ||
1867 | |||
1868 | Module snd-riptide | ||
1869 | ------------------ | ||
1870 | |||
1871 | Module for Conexant Riptide chip | ||
1872 | |||
1873 | joystick_port | ||
1874 | Joystick port # (default: 0x200) | ||
1875 | mpu_port | ||
1876 | MPU401 port # (default: 0x330) | ||
1877 | opl3_port | ||
1878 | OPL3 port # (default: 0x388) | ||
1879 | |||
1880 | This module supports multiple cards. | ||
1881 | The driver requires the firmware loader support on kernel. | ||
1882 | You need to install the firmware file ``riptide.hex`` to the standard | ||
1883 | firmware path (e.g. /lib/firmware). | ||
1884 | |||
1885 | Module snd-rme32 | ||
1886 | ---------------- | ||
1887 | |||
1888 | Module for RME Digi32, Digi32 Pro and Digi32/8 (Sek'd Prodif32, | ||
1889 | Prodif96 and Prodif Gold) sound cards. | ||
1890 | |||
1891 | This module supports multiple cards. | ||
1892 | |||
1893 | Module snd-rme96 | ||
1894 | ---------------- | ||
1895 | |||
1896 | Module for RME Digi96, Digi96/8 and Digi96/8 PRO/PAD/PST sound cards. | ||
1897 | |||
1898 | This module supports multiple cards. | ||
1899 | |||
1900 | Module snd-rme9652 | ||
1901 | ------------------ | ||
1902 | |||
1903 | Module for RME Digi9652 (Hammerfall, Hammerfall-Light) sound cards. | ||
1904 | |||
1905 | precise_ptr | ||
1906 | Enable precise pointer (doesn't work reliably). (default = 0) | ||
1907 | |||
1908 | This module supports multiple cards. | ||
1909 | |||
1910 | Note: snd-page-alloc module does the job which snd-hammerfall-mem | ||
1911 | module did formerly. It will allocate the buffers in advance | ||
1912 | when any RME9652 cards are found. To make the buffer | ||
1913 | allocation sure, load snd-page-alloc module in the early | ||
1914 | stage of boot sequence. See `Early Buffer Allocation`_ | ||
1915 | section. | ||
1916 | |||
1917 | Module snd-sa11xx-uda1341 (on arm only) | ||
1918 | --------------------------------------- | ||
1919 | |||
1920 | Module for Philips UDA1341TS on Compaq iPAQ H3600 sound card. | ||
1921 | |||
1922 | Module supports only one card. | ||
1923 | Module has no enable and index options. | ||
1924 | |||
1925 | The power-management is supported. | ||
1926 | |||
1927 | Module snd-sb8 | ||
1928 | -------------- | ||
1929 | |||
1930 | Module for 8-bit SoundBlaster cards: SoundBlaster 1.0, SoundBlaster 2.0, | ||
1931 | SoundBlaster Pro | ||
1932 | |||
1933 | port | ||
1934 | port # for SB DSP chip (0x220,0x240,0x260) | ||
1935 | irq | ||
1936 | IRQ # for SB DSP chip (5,7,9,10) | ||
1937 | dma8 | ||
1938 | DMA # for SB DSP chip (1,3) | ||
1939 | |||
1940 | This module supports multiple cards and autoprobe. | ||
1941 | |||
1942 | The power-management is supported. | ||
1943 | |||
1944 | Module snd-sb16 and snd-sbawe | ||
1945 | ----------------------------- | ||
1946 | |||
1947 | Module for 16-bit SoundBlaster cards: SoundBlaster 16 (PnP), | ||
1948 | SoundBlaster AWE 32 (PnP), SoundBlaster AWE 64 PnP | ||
1949 | |||
1950 | mic_agc | ||
1951 | Mic Auto-Gain-Control - 0 = disable, 1 = enable (default) | ||
1952 | csp | ||
1953 | ASP/CSP chip support - 0 = disable (default), 1 = enable | ||
1954 | isapnp | ||
1955 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1956 | |||
1957 | with isapnp=0, the following options are available: | ||
1958 | |||
1959 | port | ||
1960 | port # for SB DSP 4.x chip (0x220,0x240,0x260) | ||
1961 | mpu_port | ||
1962 | port # for MPU-401 UART (0x300,0x330), -1 = disable | ||
1963 | awe_port | ||
1964 | base port # for EMU8000 synthesizer (0x620,0x640,0x660) (snd-sbawe | ||
1965 | module only) | ||
1966 | irq | ||
1967 | IRQ # for SB DSP 4.x chip (5,7,9,10) | ||
1968 | dma8 | ||
1969 | 8-bit DMA # for SB DSP 4.x chip (0,1,3) | ||
1970 | dma16 | ||
1971 | 16-bit DMA # for SB DSP 4.x chip (5,6,7) | ||
1972 | |||
1973 | This module supports multiple cards, autoprobe and ISA PnP. | ||
1974 | |||
1975 | Note: To use Vibra16X cards in 16-bit half duplex mode, you must | ||
1976 | disable 16bit DMA with dma16 = -1 module parameter. | ||
1977 | Also, all Sound Blaster 16 type cards can operate in 16-bit | ||
1978 | half duplex mode through 8-bit DMA channel by disabling their | ||
1979 | 16-bit DMA channel. | ||
1980 | |||
1981 | The power-management is supported. | ||
1982 | |||
1983 | Module snd-sc6000 | ||
1984 | ----------------- | ||
1985 | |||
1986 | Module for Gallant SC-6000 soundcard and later models: SC-6600 and | ||
1987 | SC-7000. | ||
1988 | |||
1989 | port | ||
1990 | Port # (0x220 or 0x240) | ||
1991 | mss_port | ||
1992 | MSS Port # (0x530 or 0xe80) | ||
1993 | irq | ||
1994 | IRQ # (5,7,9,10,11) | ||
1995 | mpu_irq | ||
1996 | MPU-401 IRQ # (5,7,9,10) ,0 - no MPU-401 irq | ||
1997 | dma | ||
1998 | DMA # (1,3,0) | ||
1999 | joystick | ||
2000 | Enable gameport - 0 = disable (default), 1 = enable | ||
2001 | |||
2002 | This module supports multiple cards. | ||
2003 | |||
2004 | This card is also known as Audio Excel DSP 16 or Zoltrix AV302. | ||
2005 | |||
2006 | Module snd-sscape | ||
2007 | ----------------- | ||
2008 | |||
2009 | Module for ENSONIQ SoundScape cards. | ||
2010 | |||
2011 | port | ||
2012 | Port # (PnP setup) | ||
2013 | wss_port | ||
2014 | WSS Port # (PnP setup) | ||
2015 | irq | ||
2016 | IRQ # (PnP setup) | ||
2017 | mpu_irq | ||
2018 | MPU-401 IRQ # (PnP setup) | ||
2019 | dma | ||
2020 | DMA # (PnP setup) | ||
2021 | dma2 | ||
2022 | 2nd DMA # (PnP setup, -1 to disable) | ||
2023 | joystick | ||
2024 | Enable gameport - 0 = disable (default), 1 = enable | ||
2025 | |||
2026 | This module supports multiple cards. | ||
2027 | |||
2028 | The driver requires the firmware loader support on kernel. | ||
2029 | |||
2030 | Module snd-sun-amd7930 (on sparc only) | ||
2031 | -------------------------------------- | ||
2032 | |||
2033 | Module for AMD7930 sound chips found on Sparcs. | ||
2034 | |||
2035 | This module supports multiple cards. | ||
2036 | |||
2037 | Module snd-sun-cs4231 (on sparc only) | ||
2038 | ------------------------------------- | ||
2039 | |||
2040 | Module for CS4231 sound chips found on Sparcs. | ||
2041 | |||
2042 | This module supports multiple cards. | ||
2043 | |||
2044 | Module snd-sun-dbri (on sparc only) | ||
2045 | ----------------------------------- | ||
2046 | |||
2047 | Module for DBRI sound chips found on Sparcs. | ||
2048 | |||
2049 | This module supports multiple cards. | ||
2050 | |||
2051 | Module snd-wavefront | ||
2052 | -------------------- | ||
2053 | |||
2054 | Module for Turtle Beach Maui, Tropez and Tropez+ sound cards. | ||
2055 | |||
2056 | use_cs4232_midi | ||
2057 | Use CS4232 MPU-401 interface | ||
2058 | (inaccessibly located inside your computer) | ||
2059 | isapnp | ||
2060 | ISA PnP detection - 0 = disable, 1 = enable (default) | ||
2061 | |||
2062 | with isapnp=0, the following options are available: | ||
2063 | |||
2064 | cs4232_pcm_port | ||
2065 | Port # for CS4232 PCM interface. | ||
2066 | cs4232_pcm_irq | ||
2067 | IRQ # for CS4232 PCM interface (5,7,9,11,12,15). | ||
2068 | cs4232_mpu_port | ||
2069 | Port # for CS4232 MPU-401 interface. | ||
2070 | cs4232_mpu_irq | ||
2071 | IRQ # for CS4232 MPU-401 interface (9,11,12,15). | ||
2072 | ics2115_port | ||
2073 | Port # for ICS2115 | ||
2074 | ics2115_irq | ||
2075 | IRQ # for ICS2115 | ||
2076 | fm_port | ||
2077 | FM OPL-3 Port # | ||
2078 | dma1 | ||
2079 | DMA1 # for CS4232 PCM interface. | ||
2080 | dma2 | ||
2081 | DMA2 # for CS4232 PCM interface. | ||
2082 | |||
2083 | The below are options for wavefront_synth features: | ||
2084 | |||
2085 | wf_raw | ||
2086 | Assume that we need to boot the OS (default:no); | ||
2087 | If yes, then during driver loading, the state of the board is | ||
2088 | ignored, and we reset the board and load the firmware anyway. | ||
2089 | fx_raw | ||
2090 | Assume that the FX process needs help (default:yes); | ||
2091 | If false, we'll leave the FX processor in whatever state it is | ||
2092 | when the driver is loaded. The default is to download the | ||
2093 | microprogram and associated coefficients to set it up for | ||
2094 | "default" operation, whatever that means. | ||
2095 | debug_default | ||
2096 | Debug parameters for card initialization | ||
2097 | wait_usecs | ||
2098 | How long to wait without sleeping, usecs (default:150); | ||
2099 | This magic number seems to give pretty optimal throughput | ||
2100 | based on my limited experimentation. | ||
2101 | If you want to play around with it and find a better value, be | ||
2102 | my guest. Remember, the idea is to get a number that causes us | ||
2103 | to just busy wait for as many WaveFront commands as possible, | ||
2104 | without coming up with a number so large that we hog the whole | ||
2105 | CPU. | ||
2106 | Specifically, with this number, out of about 134,000 status | ||
2107 | waits, only about 250 result in a sleep. | ||
2108 | sleep_interval | ||
2109 | How long to sleep when waiting for reply (default: 100) | ||
2110 | sleep_tries | ||
2111 | How many times to try sleeping during a wait (default: 50) | ||
2112 | ospath | ||
2113 | Pathname to processed ICS2115 OS firmware (default:wavefront.os); | ||
2114 | The path name of the ISC2115 OS firmware. In the recent | ||
2115 | version, it's handled via firmware loader framework, so it | ||
2116 | must be installed in the proper path, typically, | ||
2117 | /lib/firmware. | ||
2118 | reset_time | ||
2119 | How long to wait for a reset to take effect (default:2) | ||
2120 | ramcheck_time | ||
2121 | How many seconds to wait for the RAM test (default:20) | ||
2122 | osrun_time | ||
2123 | How many seconds to wait for the ICS2115 OS (default:10) | ||
2124 | |||
2125 | This module supports multiple cards and ISA PnP. | ||
2126 | |||
2127 | Note: the firmware file ``wavefront.os`` was located in the earlier | ||
2128 | version in /etc. Now it's loaded via firmware loader, and | ||
2129 | must be in the proper firmware path, such as /lib/firmware. | ||
2130 | Copy (or symlink) the file appropriately if you get an error | ||
2131 | regarding firmware downloading after upgrading the kernel. | ||
2132 | |||
2133 | Module snd-sonicvibes | ||
2134 | --------------------- | ||
2135 | |||
2136 | Module for S3 SonicVibes PCI sound cards. | ||
2137 | * PINE Schubert 32 PCI | ||
2138 | |||
2139 | reverb | ||
2140 | Reverb Enable - 1 = enable, 0 = disable (default); | ||
2141 | SoundCard must have onboard SRAM for this. | ||
2142 | mge | ||
2143 | Mic Gain Enable - 1 = enable, 0 = disable (default) | ||
2144 | |||
2145 | This module supports multiple cards and autoprobe. | ||
2146 | |||
2147 | Module snd-serial-u16550 | ||
2148 | ------------------------ | ||
2149 | |||
2150 | Module for UART16550A serial MIDI ports. | ||
2151 | |||
2152 | port | ||
2153 | port # for UART16550A chip | ||
2154 | irq | ||
2155 | IRQ # for UART16550A chip, -1 = poll mode | ||
2156 | speed | ||
2157 | speed in bauds (9600,19200,38400,57600,115200) | ||
2158 | 38400 = default | ||
2159 | base | ||
2160 | base for divisor in bauds (57600,115200,230400,460800) | ||
2161 | 115200 = default | ||
2162 | outs | ||
2163 | number of MIDI ports in a serial port (1-4) | ||
2164 | 1 = default | ||
2165 | adaptor | ||
2166 | Type of adaptor. | ||
2167 | 0 = Soundcanvas, 1 = MS-124T, 2 = MS-124W S/A, | ||
2168 | 3 = MS-124W M/B, 4 = Generic | ||
2169 | |||
2170 | This module supports multiple cards. This module does not support autoprobe | ||
2171 | thus the main port must be specified!!! Other options are optional. | ||
2172 | |||
2173 | Module snd-trident | ||
2174 | ------------------ | ||
2175 | |||
2176 | Module for Trident 4DWave DX/NX sound cards. | ||
2177 | * Best Union Miss Melody 4DWave PCI | ||
2178 | * HIS 4DWave PCI | ||
2179 | * Warpspeed ONSpeed 4DWave PCI | ||
2180 | * AzTech PCI 64-Q3D | ||
2181 | * Addonics SV 750 | ||
2182 | * CHIC True Sound 4Dwave | ||
2183 | * Shark Predator4D-PCI | ||
2184 | * Jaton SonicWave 4D | ||
2185 | * SiS SI7018 PCI Audio | ||
2186 | * Hoontech SoundTrack Digital 4DWave NX | ||
2187 | |||
2188 | pcm_channels | ||
2189 | max channels (voices) reserved for PCM | ||
2190 | wavetable_size | ||
2191 | max wavetable size in kB (4-?kb) | ||
2192 | |||
2193 | This module supports multiple cards and autoprobe. | ||
2194 | |||
2195 | The power-management is supported. | ||
2196 | |||
2197 | Module snd-ua101 | ||
2198 | ---------------- | ||
2199 | |||
2200 | Module for the Edirol UA-101/UA-1000 audio/MIDI interfaces. | ||
2201 | |||
2202 | This module supports multiple devices, autoprobe and hotplugging. | ||
2203 | |||
2204 | Module snd-usb-audio | ||
2205 | -------------------- | ||
2206 | |||
2207 | Module for USB audio and USB MIDI devices. | ||
2208 | |||
2209 | vid | ||
2210 | Vendor ID for the device (optional) | ||
2211 | pid | ||
2212 | Product ID for the device (optional) | ||
2213 | nrpacks | ||
2214 | Max. number of packets per URB (default: 8) | ||
2215 | device_setup | ||
2216 | Device specific magic number (optional); | ||
2217 | Influence depends on the device | ||
2218 | Default: 0x0000 | ||
2219 | ignore_ctl_error | ||
2220 | Ignore any USB-controller regarding mixer interface (default: no) | ||
2221 | autoclock | ||
2222 | Enable auto-clock selection for UAC2 devices (default: yes) | ||
2223 | quirk_alias | ||
2224 | Quirk alias list, pass strings like ``0123abcd:5678beef``, which | ||
2225 | applies the existing quirk for the device 5678:beef to a new | ||
2226 | device 0123:abcd. | ||
2227 | |||
2228 | This module supports multiple devices, autoprobe and hotplugging. | ||
2229 | |||
2230 | NB: ``nrpacks`` parameter can be modified dynamically via sysfs. | ||
2231 | Don't put the value over 20. Changing via sysfs has no sanity | ||
2232 | check. | ||
2233 | |||
2234 | NB: ``ignore_ctl_error=1`` may help when you get an error at accessing | ||
2235 | the mixer element such as URB error -22. This happens on some | ||
2236 | buggy USB device or the controller. | ||
2237 | |||
2238 | NB: quirk_alias option is provided only for testing / development. | ||
2239 | If you want to have a proper support, contact to upstream for | ||
2240 | adding the matching quirk in the driver code statically. | ||
2241 | |||
2242 | Module snd-usb-caiaq | ||
2243 | -------------------- | ||
2244 | |||
2245 | Module for caiaq UB audio interfaces, | ||
2246 | |||
2247 | * Native Instruments RigKontrol2 | ||
2248 | * Native Instruments Kore Controller | ||
2249 | * Native Instruments Audio Kontrol 1 | ||
2250 | * Native Instruments Audio 8 DJ | ||
2251 | |||
2252 | This module supports multiple devices, autoprobe and hotplugging. | ||
2253 | |||
2254 | Module snd-usb-usx2y | ||
2255 | -------------------- | ||
2256 | |||
2257 | Module for Tascam USB US-122, US-224 and US-428 devices. | ||
2258 | |||
2259 | This module supports multiple devices, autoprobe and hotplugging. | ||
2260 | |||
2261 | Note: you need to load the firmware via ``usx2yloader`` utility included | ||
2262 | in alsa-tools and alsa-firmware packages. | ||
2263 | |||
2264 | Module snd-via82xx | ||
2265 | ------------------ | ||
2266 | |||
2267 | Module for AC'97 motherboards based on VIA 82C686A/686B, 8233, 8233A, | ||
2268 | 8233C, 8235, 8237 (south) bridge. | ||
2269 | |||
2270 | mpu_port | ||
2271 | 0x300,0x310,0x320,0x330, otherwise obtain BIOS setup | ||
2272 | [VIA686A/686B only] | ||
2273 | joystick | ||
2274 | Enable joystick (default off) [VIA686A/686B only] | ||
2275 | ac97_clock | ||
2276 | AC'97 codec clock base (default 48000Hz) | ||
2277 | dxs_support | ||
2278 | support DXS channels, 0 = auto (default), 1 = enable, 2 = disable, | ||
2279 | 3 = 48k only, 4 = no VRA, 5 = enable any sample rate and different | ||
2280 | sample rates on different channels [VIA8233/C, 8235, 8237 only] | ||
2281 | ac97_quirk | ||
2282 | AC'97 workaround for strange hardware; | ||
2283 | See `AC97 Quirk Option`_ section below. | ||
2284 | |||
2285 | This module supports one chip and autoprobe. | ||
2286 | |||
2287 | Note: on some SMP motherboards like MSI 694D the interrupts might | ||
2288 | not be generated properly. In such a case, please try to | ||
2289 | set the SMP (or MPS) version on BIOS to 1.1 instead of | ||
2290 | default value 1.4. Then the interrupt number will be | ||
2291 | assigned under 15. You might also upgrade your BIOS. | ||
2292 | |||
2293 | Note: VIA8233/5/7 (not VIA8233A) can support DXS (direct sound) | ||
2294 | channels as the first PCM. On these channels, up to 4 | ||
2295 | streams can be played at the same time, and the controller | ||
2296 | can perform sample rate conversion with separate rates for | ||
2297 | each channel. | ||
2298 | As default (``dxs_support = 0``), 48k fixed rate is chosen | ||
2299 | except for the known devices since the output is often | ||
2300 | noisy except for 48k on some mother boards due to the | ||
2301 | bug of BIOS. | ||
2302 | Please try once ``dxs_support=5`` and if it works on other | ||
2303 | sample rates (e.g. 44.1kHz of mp3 playback), please let us | ||
2304 | know the PCI subsystem vendor/device id's (output of | ||
2305 | ``lspci -nv``). | ||
2306 | If ``dxs_support=5`` does not work, try ``dxs_support=4``; if it | ||
2307 | doesn't work too, try dxs_support=1. (dxs_support=1 is | ||
2308 | usually for old motherboards. The correct implemented | ||
2309 | board should work with 4 or 5.) If it still doesn't | ||
2310 | work and the default setting is ok, ``dxs_support=3`` is the | ||
2311 | right choice. If the default setting doesn't work at all, | ||
2312 | try ``dxs_support=2`` to disable the DXS channels. | ||
2313 | In any cases, please let us know the result and the | ||
2314 | subsystem vendor/device ids. See `Links and Addresses`_ | ||
2315 | below. | ||
2316 | |||
2317 | Note: for the MPU401 on VIA823x, use snd-mpu401 driver | ||
2318 | additionally. The mpu_port option is for VIA686 chips only. | ||
2319 | |||
2320 | The power-management is supported. | ||
2321 | |||
2322 | Module snd-via82xx-modem | ||
2323 | ------------------------ | ||
2324 | |||
2325 | Module for VIA82xx AC97 modem | ||
2326 | |||
2327 | ac97_clock | ||
2328 | AC'97 codec clock base (default 48000Hz) | ||
2329 | |||
2330 | This module supports one card and autoprobe. | ||
2331 | |||
2332 | Note: The default index value of this module is -2, i.e. the first | ||
2333 | slot is excluded. | ||
2334 | |||
2335 | The power-management is supported. | ||
2336 | |||
2337 | Module snd-virmidi | ||
2338 | ------------------ | ||
2339 | |||
2340 | Module for virtual rawmidi devices. | ||
2341 | This module creates virtual rawmidi devices which communicate | ||
2342 | to the corresponding ALSA sequencer ports. | ||
2343 | |||
2344 | midi_devs | ||
2345 | MIDI devices # (1-4, default=4) | ||
2346 | |||
2347 | This module supports multiple cards. | ||
2348 | |||
2349 | Module snd-virtuoso | ||
2350 | ------------------- | ||
2351 | |||
2352 | Module for sound cards based on the Asus AV66/AV100/AV200 chips, | ||
2353 | i.e., Xonar D1, DX, D2, D2X, DS, DSX, Essence ST (Deluxe), | ||
2354 | Essence STX (II), HDAV1.3 (Deluxe), and HDAV1.3 Slim. | ||
2355 | |||
2356 | This module supports autoprobe and multiple cards. | ||
2357 | |||
2358 | Module snd-vx222 | ||
2359 | ---------------- | ||
2360 | |||
2361 | Module for Digigram VX-Pocket VX222, V222 v2 and Mic cards. | ||
2362 | |||
2363 | mic | ||
2364 | Enable Microphone on V222 Mic (NYI) | ||
2365 | ibl | ||
2366 | Capture IBL size. (default = 0, minimum size) | ||
2367 | |||
2368 | This module supports multiple cards. | ||
2369 | |||
2370 | When the driver is compiled as a module and the hotplug firmware | ||
2371 | is supported, the firmware data is loaded via hotplug automatically. | ||
2372 | Install the necessary firmware files in alsa-firmware package. | ||
2373 | When no hotplug fw loader is available, you need to load the | ||
2374 | firmware via vxloader utility in alsa-tools package. To invoke | ||
2375 | vxloader automatically, add the following to /etc/modprobe.d/alsa.conf | ||
2376 | |||
2377 | :: | ||
2378 | |||
2379 | install snd-vx222 /sbin/modprobe --first-time -i snd-vx222\ | ||
2380 | && /usr/bin/vxloader | ||
2381 | |||
2382 | (for 2.2/2.4 kernels, add ``post-install /usr/bin/vxloader`` to | ||
2383 | /etc/modules.conf, instead.) | ||
2384 | IBL size defines the interrupts period for PCM. The smaller size | ||
2385 | gives smaller latency but leads to more CPU consumption, too. | ||
2386 | The size is usually aligned to 126. As default (=0), the smallest | ||
2387 | size is chosen. The possible IBL values can be found in | ||
2388 | /proc/asound/cardX/vx-status proc file. | ||
2389 | |||
2390 | The power-management is supported. | ||
2391 | |||
2392 | Module snd-vxpocket | ||
2393 | ------------------- | ||
2394 | |||
2395 | Module for Digigram VX-Pocket VX2 and 440 PCMCIA cards. | ||
2396 | |||
2397 | ibl | ||
2398 | Capture IBL size. (default = 0, minimum size) | ||
2399 | |||
2400 | This module supports multiple cards. The module is compiled only when | ||
2401 | PCMCIA is supported on kernel. | ||
2402 | |||
2403 | With the older 2.6.x kernel, to activate the driver via the card | ||
2404 | manager, you'll need to set up /etc/pcmcia/vxpocket.conf. See the | ||
2405 | sound/pcmcia/vx/vxpocket.c. 2.6.13 or later kernel requires no | ||
2406 | longer require a config file. | ||
2407 | |||
2408 | When the driver is compiled as a module and the hotplug firmware | ||
2409 | is supported, the firmware data is loaded via hotplug automatically. | ||
2410 | Install the necessary firmware files in alsa-firmware package. | ||
2411 | When no hotplug fw loader is available, you need to load the | ||
2412 | firmware via vxloader utility in alsa-tools package. | ||
2413 | |||
2414 | About capture IBL, see the description of snd-vx222 module. | ||
2415 | |||
2416 | Note: snd-vxp440 driver is merged to snd-vxpocket driver since | ||
2417 | ALSA 1.0.10. | ||
2418 | |||
2419 | The power-management is supported. | ||
2420 | |||
2421 | Module snd-ymfpci | ||
2422 | ----------------- | ||
2423 | |||
2424 | Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x). | ||
2425 | |||
2426 | mpu_port | ||
2427 | 0x300,0x330,0x332,0x334, 0 (disable) by default, | ||
2428 | 1 (auto-detect for YMF744/754 only) | ||
2429 | fm_port | ||
2430 | 0x388,0x398,0x3a0,0x3a8, 0 (disable) by default | ||
2431 | 1 (auto-detect for YMF744/754 only) | ||
2432 | joystick_port | ||
2433 | 0x201,0x202,0x204,0x205, 0 (disable) by default, | ||
2434 | 1 (auto-detect) | ||
2435 | rear_switch | ||
2436 | enable shared rear/line-in switch (bool) | ||
2437 | |||
2438 | This module supports autoprobe and multiple chips. | ||
2439 | |||
2440 | The power-management is supported. | ||
2441 | |||
2442 | Module snd-pdaudiocf | ||
2443 | -------------------- | ||
2444 | |||
2445 | Module for Sound Core PDAudioCF sound card. | ||
2446 | |||
2447 | The power-management is supported. | ||
2448 | |||
2449 | |||
2450 | AC97 Quirk Option | ||
2451 | ================= | ||
2452 | |||
2453 | The ac97_quirk option is used to enable/override the workaround for | ||
2454 | specific devices on drivers for on-board AC'97 controllers like | ||
2455 | snd-intel8x0. Some hardware have swapped output pins between Master | ||
2456 | and Headphone, or Surround (thanks to confusion of AC'97 | ||
2457 | specifications from version to version :-) | ||
2458 | |||
2459 | The driver provides the auto-detection of known problematic devices, | ||
2460 | but some might be unknown or wrongly detected. In such a case, pass | ||
2461 | the proper value with this option. | ||
2462 | |||
2463 | The following strings are accepted: | ||
2464 | |||
2465 | default | ||
2466 | Don't override the default setting | ||
2467 | none | ||
2468 | Disable the quirk | ||
2469 | hp_only | ||
2470 | Bind Master and Headphone controls as a single control | ||
2471 | swap_hp | ||
2472 | Swap headphone and master controls | ||
2473 | swap_surround | ||
2474 | Swap master and surround controls | ||
2475 | ad_sharing | ||
2476 | For AD1985, turn on OMS bit and use headphone | ||
2477 | alc_jack | ||
2478 | For ALC65x, turn on the jack sense mode | ||
2479 | inv_eapd | ||
2480 | Inverted EAPD implementation | ||
2481 | mute_led | ||
2482 | Bind EAPD bit for turning on/off mute LED | ||
2483 | |||
2484 | For backward compatibility, the corresponding integer value -1, 0, ... | ||
2485 | are accepted, too. | ||
2486 | |||
2487 | For example, if ``Master`` volume control has no effect on your device | ||
2488 | but only ``Headphone`` does, pass ac97_quirk=hp_only module option. | ||
2489 | |||
2490 | |||
2491 | Configuring Non-ISAPNP Cards | ||
2492 | ============================ | ||
2493 | |||
2494 | When the kernel is configured with ISA-PnP support, the modules | ||
2495 | supporting the isapnp cards will have module options ``isapnp``. | ||
2496 | If this option is set, *only* the ISA-PnP devices will be probed. | ||
2497 | For probing the non ISA-PnP cards, you have to pass ``isapnp=0`` option | ||
2498 | together with the proper i/o and irq configuration. | ||
2499 | |||
2500 | When the kernel is configured without ISA-PnP support, isapnp option | ||
2501 | will be not built in. | ||
2502 | |||
2503 | |||
2504 | Module Autoloading Support | ||
2505 | ========================== | ||
2506 | |||
2507 | The ALSA drivers can be loaded automatically on demand by defining | ||
2508 | module aliases. The string ``snd-card-%1`` is requested for ALSA native | ||
2509 | devices where ``%i`` is sound card number from zero to seven. | ||
2510 | |||
2511 | To auto-load an ALSA driver for OSS services, define the string | ||
2512 | ``sound-slot-%i`` where ``%i`` means the slot number for OSS, which | ||
2513 | corresponds to the card index of ALSA. Usually, define this | ||
2514 | as the same card module. | ||
2515 | |||
2516 | An example configuration for a single emu10k1 card is like below: | ||
2517 | :: | ||
2518 | |||
2519 | ----- /etc/modprobe.d/alsa.conf | ||
2520 | alias snd-card-0 snd-emu10k1 | ||
2521 | alias sound-slot-0 snd-emu10k1 | ||
2522 | ----- /etc/modprobe.d/alsa.conf | ||
2523 | |||
2524 | The available number of auto-loaded sound cards depends on the module | ||
2525 | option ``cards_limit`` of snd module. As default it's set to 1. | ||
2526 | To enable the auto-loading of multiple cards, specify the number of | ||
2527 | sound cards in that option. | ||
2528 | |||
2529 | When multiple cards are available, it'd better to specify the index | ||
2530 | number for each card via module option, too, so that the order of | ||
2531 | cards is kept consistent. | ||
2532 | |||
2533 | An example configuration for two sound cards is like below: | ||
2534 | :: | ||
2535 | |||
2536 | ----- /etc/modprobe.d/alsa.conf | ||
2537 | # ALSA portion | ||
2538 | options snd cards_limit=2 | ||
2539 | alias snd-card-0 snd-interwave | ||
2540 | alias snd-card-1 snd-ens1371 | ||
2541 | options snd-interwave index=0 | ||
2542 | options snd-ens1371 index=1 | ||
2543 | # OSS/Free portion | ||
2544 | alias sound-slot-0 snd-interwave | ||
2545 | alias sound-slot-1 snd-ens1371 | ||
2546 | ----- /etc/modprobe.d/alsa.conf | ||
2547 | |||
2548 | In this example, the interwave card is always loaded as the first card | ||
2549 | (index 0) and ens1371 as the second (index 1). | ||
2550 | |||
2551 | Alternative (and new) way to fixate the slot assignment is to use | ||
2552 | ``slots`` option of snd module. In the case above, specify like the | ||
2553 | following: | ||
2554 | :: | ||
2555 | |||
2556 | options snd slots=snd-interwave,snd-ens1371 | ||
2557 | |||
2558 | Then, the first slot (#0) is reserved for snd-interwave driver, and | ||
2559 | the second (#1) for snd-ens1371. You can omit index option in each | ||
2560 | driver if slots option is used (although you can still have them at | ||
2561 | the same time as long as they don't conflict). | ||
2562 | |||
2563 | The slots option is especially useful for avoiding the possible | ||
2564 | hot-plugging and the resultant slot conflict. For example, in the | ||
2565 | case above again, the first two slots are already reserved. If any | ||
2566 | other driver (e.g. snd-usb-audio) is loaded before snd-interwave or | ||
2567 | snd-ens1371, it will be assigned to the third or later slot. | ||
2568 | |||
2569 | When a module name is given with '!', the slot will be given for any | ||
2570 | modules but that name. For example, ``slots=!snd-pcsp`` will reserve | ||
2571 | the first slot for any modules but snd-pcsp. | ||
2572 | |||
2573 | |||
2574 | ALSA PCM devices to OSS devices mapping | ||
2575 | ======================================= | ||
2576 | :: | ||
2577 | |||
2578 | /dev/snd/pcmC0D0[c|p] -> /dev/audio0 (/dev/audio) -> minor 4 | ||
2579 | /dev/snd/pcmC0D0[c|p] -> /dev/dsp0 (/dev/dsp) -> minor 3 | ||
2580 | /dev/snd/pcmC0D1[c|p] -> /dev/adsp0 (/dev/adsp) -> minor 12 | ||
2581 | /dev/snd/pcmC1D0[c|p] -> /dev/audio1 -> minor 4+16 = 20 | ||
2582 | /dev/snd/pcmC1D0[c|p] -> /dev/dsp1 -> minor 3+16 = 19 | ||
2583 | /dev/snd/pcmC1D1[c|p] -> /dev/adsp1 -> minor 12+16 = 28 | ||
2584 | /dev/snd/pcmC2D0[c|p] -> /dev/audio2 -> minor 4+32 = 36 | ||
2585 | /dev/snd/pcmC2D0[c|p] -> /dev/dsp2 -> minor 3+32 = 39 | ||
2586 | /dev/snd/pcmC2D1[c|p] -> /dev/adsp2 -> minor 12+32 = 44 | ||
2587 | |||
2588 | The first number from ``/dev/snd/pcmC{X}D{Y}[c|p]`` expression means | ||
2589 | sound card number and second means device number. The ALSA devices | ||
2590 | have either ``c`` or ``p`` suffix indicating the direction, capture and | ||
2591 | playback, respectively. | ||
2592 | |||
2593 | Please note that the device mapping above may be varied via the module | ||
2594 | options of snd-pcm-oss module. | ||
2595 | |||
2596 | |||
2597 | Proc interfaces (/proc/asound) | ||
2598 | ============================== | ||
2599 | |||
2600 | /proc/asound/card#/pcm#[cp]/oss | ||
2601 | ------------------------------- | ||
2602 | erase | ||
2603 | erase all additional information about OSS applications | ||
2604 | |||
2605 | <app_name> <fragments> <fragment_size> [<options>] | ||
2606 | <app_name> | ||
2607 | name of application with (higher priority) or without path | ||
2608 | <fragments> | ||
2609 | number of fragments or zero if auto | ||
2610 | <fragment_size> | ||
2611 | size of fragment in bytes or zero if auto | ||
2612 | <options> | ||
2613 | optional parameters | ||
2614 | |||
2615 | disable | ||
2616 | the application tries to open a pcm device for | ||
2617 | this channel but does not want to use it. | ||
2618 | (Cause a bug or mmap needs) | ||
2619 | It's good for Quake etc... | ||
2620 | direct | ||
2621 | don't use plugins | ||
2622 | block | ||
2623 | force block mode (rvplayer) | ||
2624 | non-block | ||
2625 | force non-block mode | ||
2626 | whole-frag | ||
2627 | write only whole fragments (optimization affecting | ||
2628 | playback only) | ||
2629 | no-silence | ||
2630 | do not fill silence ahead to avoid clicks | ||
2631 | buggy-ptr | ||
2632 | Returns the whitespace blocks in GETOPTR ioctl | ||
2633 | instead of filled blocks | ||
2634 | |||
2635 | Example: | ||
2636 | :: | ||
2637 | |||
2638 | echo "x11amp 128 16384" > /proc/asound/card0/pcm0p/oss | ||
2639 | echo "squake 0 0 disable" > /proc/asound/card0/pcm0c/oss | ||
2640 | echo "rvplayer 0 0 block" > /proc/asound/card0/pcm0p/oss | ||
2641 | |||
2642 | |||
2643 | Early Buffer Allocation | ||
2644 | ======================= | ||
2645 | |||
2646 | Some drivers (e.g. hdsp) require the large contiguous buffers, and | ||
2647 | sometimes it's too late to find such spaces when the driver module is | ||
2648 | actually loaded due to memory fragmentation. You can pre-allocate the | ||
2649 | PCM buffers by loading snd-page-alloc module and write commands to its | ||
2650 | proc file in prior, for example, in the early boot stage like | ||
2651 | ``/etc/init.d/*.local`` scripts. | ||
2652 | |||
2653 | Reading the proc file /proc/drivers/snd-page-alloc shows the current | ||
2654 | usage of page allocation. In writing, you can send the following | ||
2655 | commands to the snd-page-alloc driver: | ||
2656 | |||
2657 | * add VENDOR DEVICE MASK SIZE BUFFERS | ||
2658 | |||
2659 | VENDOR and DEVICE are PCI vendor and device IDs. They take | ||
2660 | integer numbers (0x prefix is needed for the hex). | ||
2661 | MASK is the PCI DMA mask. Pass 0 if not restricted. | ||
2662 | SIZE is the size of each buffer to allocate. You can pass | ||
2663 | k and m suffix for KB and MB. The max number is 16MB. | ||
2664 | BUFFERS is the number of buffers to allocate. It must be greater | ||
2665 | than 0. The max number is 4. | ||
2666 | |||
2667 | * erase | ||
2668 | |||
2669 | This will erase the all pre-allocated buffers which are not in | ||
2670 | use. | ||
2671 | |||
2672 | |||
2673 | Links and Addresses | ||
2674 | =================== | ||
2675 | |||
2676 | ALSA project homepage | ||
2677 | http://www.alsa-project.org | ||
2678 | Kernel Bugzilla | ||
2679 | http://bugzilla.kernel.org/ | ||
2680 | ALSA Developers ML | ||
2681 | mailto:alsa-devel@alsa-project.org | ||
2682 | alsa-info.sh script | ||
2683 | http://www.alsa-project.org/alsa-info.sh | ||
diff --git a/Documentation/sound/alsa/ALSA-Configuration.txt b/Documentation/sound/alsa/ALSA-Configuration.txt deleted file mode 100644 index fc53ccd9a629..000000000000 --- a/Documentation/sound/alsa/ALSA-Configuration.txt +++ /dev/null | |||
@@ -1,2330 +0,0 @@ | |||
1 | |||
2 | Advanced Linux Sound Architecture - Driver | ||
3 | ========================================== | ||
4 | Configuration guide | ||
5 | |||
6 | |||
7 | Kernel Configuration | ||
8 | ==================== | ||
9 | |||
10 | To enable ALSA support you need at least to build the kernel with | ||
11 | primary sound card support (CONFIG_SOUND). Since ALSA can emulate OSS, | ||
12 | you don't have to choose any of the OSS modules. | ||
13 | |||
14 | Enable "OSS API emulation" (CONFIG_SND_OSSEMUL) and both OSS mixer and | ||
15 | PCM supports if you want to run OSS applications with ALSA. | ||
16 | |||
17 | If you want to support the WaveTable functionality on cards such as | ||
18 | SB Live! then you need to enable "Sequencer support" | ||
19 | (CONFIG_SND_SEQUENCER). | ||
20 | |||
21 | To make ALSA debug messages more verbose, enable the "Verbose printk" | ||
22 | and "Debug" options. To check for memory leaks, turn on "Debug memory" | ||
23 | too. "Debug detection" will add checks for the detection of cards. | ||
24 | |||
25 | Please note that all the ALSA ISA drivers support the Linux isapnp API | ||
26 | (if the card supports ISA PnP). You don't need to configure the cards | ||
27 | using isapnptools. | ||
28 | |||
29 | |||
30 | Creating ALSA devices | ||
31 | ===================== | ||
32 | |||
33 | This depends on your distribution, but normally you use the /dev/MAKEDEV | ||
34 | script to create the necessary device nodes. On some systems you use a | ||
35 | script named 'snddevices'. | ||
36 | |||
37 | |||
38 | Module parameters | ||
39 | ================= | ||
40 | |||
41 | The user can load modules with options. If the module supports more than | ||
42 | one card and you have more than one card of the same type then you can | ||
43 | specify multiple values for the option separated by commas. | ||
44 | |||
45 | Prior to version 0.9.0rc4 options had a 'snd_' prefix. This was removed. | ||
46 | |||
47 | Module snd | ||
48 | ---------- | ||
49 | |||
50 | The core ALSA module. It is used by all ALSA card drivers. | ||
51 | It takes the following options which have global effects. | ||
52 | |||
53 | major - major number for sound driver | ||
54 | - Default: 116 | ||
55 | cards_limit | ||
56 | - limiting card index for auto-loading (1-8) | ||
57 | - Default: 1 | ||
58 | - For auto-loading more than one card, specify this | ||
59 | option together with snd-card-X aliases. | ||
60 | slots - Reserve the slot index for the given driver. | ||
61 | This option takes multiple strings. | ||
62 | See "Module Autoloading Support" section for details. | ||
63 | debug - Specifies the debug message level | ||
64 | (0 = disable debug prints, 1 = normal debug messages, | ||
65 | 2 = verbose debug messages) | ||
66 | This option appears only when CONFIG_SND_DEBUG=y. | ||
67 | This option can be dynamically changed via sysfs | ||
68 | /sys/modules/snd/parameters/debug file. | ||
69 | |||
70 | Module snd-pcm-oss | ||
71 | ------------------ | ||
72 | |||
73 | The PCM OSS emulation module. | ||
74 | This module takes options which change the mapping of devices. | ||
75 | |||
76 | dsp_map - PCM device number maps assigned to the 1st OSS device. | ||
77 | - Default: 0 | ||
78 | adsp_map - PCM device number maps assigned to the 2st OSS device. | ||
79 | - Default: 1 | ||
80 | nonblock_open | ||
81 | - Don't block opening busy PCM devices. Default: 1 | ||
82 | |||
83 | For example, when dsp_map=2, /dev/dsp will be mapped to PCM #2 of | ||
84 | the card #0. Similarly, when adsp_map=0, /dev/adsp will be mapped | ||
85 | to PCM #0 of the card #0. | ||
86 | For changing the second or later card, specify the option with | ||
87 | commas, such like "dsp_map=0,1". | ||
88 | |||
89 | nonblock_open option is used to change the behavior of the PCM | ||
90 | regarding opening the device. When this option is non-zero, | ||
91 | opening a busy OSS PCM device won't be blocked but return | ||
92 | immediately with EAGAIN (just like O_NONBLOCK flag). | ||
93 | |||
94 | Module snd-rawmidi | ||
95 | ------------------ | ||
96 | |||
97 | This module takes options which change the mapping of devices. | ||
98 | similar to those of the snd-pcm-oss module. | ||
99 | |||
100 | midi_map - MIDI device number maps assigned to the 1st OSS device. | ||
101 | - Default: 0 | ||
102 | amidi_map - MIDI device number maps assigned to the 2st OSS device. | ||
103 | - Default: 1 | ||
104 | |||
105 | Common parameters for top sound card modules | ||
106 | -------------------------------------------- | ||
107 | |||
108 | Each of top level sound card module takes the following options. | ||
109 | |||
110 | index - index (slot #) of sound card | ||
111 | - Values: 0 through 31 or negative | ||
112 | - If nonnegative, assign that index number | ||
113 | - if negative, interpret as a bitmask of permissible | ||
114 | indices; the first free permitted index is assigned | ||
115 | - Default: -1 | ||
116 | id - card ID (identifier or name) | ||
117 | - Can be up to 15 characters long | ||
118 | - Default: the card type | ||
119 | - A directory by this name is created under /proc/asound/ | ||
120 | containing information about the card | ||
121 | - This ID can be used instead of the index number in | ||
122 | identifying the card | ||
123 | enable - enable card | ||
124 | - Default: enabled, for PCI and ISA PnP cards | ||
125 | |||
126 | Module snd-adlib | ||
127 | ---------------- | ||
128 | |||
129 | Module for AdLib FM cards. | ||
130 | |||
131 | port - port # for OPL chip | ||
132 | |||
133 | This module supports multiple cards. It does not support autoprobe, so | ||
134 | the port must be specified. For actual AdLib FM cards it will be 0x388. | ||
135 | Note that this card does not have PCM support and no mixer; only FM | ||
136 | synthesis. | ||
137 | |||
138 | Make sure you have "sbiload" from the alsa-tools package available and, | ||
139 | after loading the module, find out the assigned ALSA sequencer port | ||
140 | number through "sbiload -l". Example output: | ||
141 | |||
142 | Port Client name Port name | ||
143 | 64:0 OPL2 FM synth OPL2 FM Port | ||
144 | |||
145 | Load the std.sb and drums.sb patches also supplied by sbiload: | ||
146 | |||
147 | sbiload -p 64:0 std.sb drums.sb | ||
148 | |||
149 | If you use this driver to drive an OPL3, you can use std.o3 and drums.o3 | ||
150 | instead. To have the card produce sound, use aplaymidi from alsa-utils: | ||
151 | |||
152 | aplaymidi -p 64:0 foo.mid | ||
153 | |||
154 | Module snd-ad1816a | ||
155 | ------------------ | ||
156 | |||
157 | Module for sound cards based on Analog Devices AD1816A/AD1815 ISA chips. | ||
158 | |||
159 | clockfreq - Clock frequency for AD1816A chip (default = 0, 33000Hz) | ||
160 | |||
161 | This module supports multiple cards, autoprobe and PnP. | ||
162 | |||
163 | Module snd-ad1848 | ||
164 | ----------------- | ||
165 | |||
166 | Module for sound cards based on AD1848/AD1847/CS4248 ISA chips. | ||
167 | |||
168 | port - port # for AD1848 chip | ||
169 | irq - IRQ # for AD1848 chip | ||
170 | dma1 - DMA # for AD1848 chip (0,1,3) | ||
171 | |||
172 | This module supports multiple cards. It does not support autoprobe | ||
173 | thus main port must be specified!!! Other ports are optional. | ||
174 | |||
175 | The power-management is supported. | ||
176 | |||
177 | Module snd-ad1889 | ||
178 | ----------------- | ||
179 | |||
180 | Module for Analog Devices AD1889 chips. | ||
181 | |||
182 | ac97_quirk - AC'97 workaround for strange hardware | ||
183 | See the description of intel8x0 module for details. | ||
184 | |||
185 | This module supports multiple cards. | ||
186 | |||
187 | Module snd-ali5451 | ||
188 | ------------------ | ||
189 | |||
190 | Module for ALi M5451 PCI chip. | ||
191 | |||
192 | pcm_channels - Number of hardware channels assigned for PCM | ||
193 | spdif - Support SPDIF I/O | ||
194 | - Default: disabled | ||
195 | |||
196 | This module supports one chip and autoprobe. | ||
197 | |||
198 | The power-management is supported. | ||
199 | |||
200 | Module snd-als100 | ||
201 | ----------------- | ||
202 | |||
203 | Module for sound cards based on Avance Logic ALS100/ALS120 ISA chips. | ||
204 | |||
205 | This module supports multiple cards, autoprobe and PnP. | ||
206 | |||
207 | The power-management is supported. | ||
208 | |||
209 | Module snd-als300 | ||
210 | ----------------- | ||
211 | |||
212 | Module for Avance Logic ALS300 and ALS300+ | ||
213 | |||
214 | This module supports multiple cards. | ||
215 | |||
216 | The power-management is supported. | ||
217 | |||
218 | Module snd-als4000 | ||
219 | ------------------ | ||
220 | |||
221 | Module for sound cards based on Avance Logic ALS4000 PCI chip. | ||
222 | |||
223 | joystick_port - port # for legacy joystick support. | ||
224 | 0 = disabled (default), 1 = auto-detect | ||
225 | |||
226 | This module supports multiple cards, autoprobe and PnP. | ||
227 | |||
228 | The power-management is supported. | ||
229 | |||
230 | Module snd-asihpi | ||
231 | ----------------- | ||
232 | |||
233 | Module for AudioScience ASI soundcards | ||
234 | |||
235 | enable_hpi_hwdep - enable HPI hwdep for AudioScience soundcard | ||
236 | |||
237 | This module supports multiple cards. | ||
238 | The driver requires the firmware loader support on kernel. | ||
239 | |||
240 | Module snd-atiixp | ||
241 | ----------------- | ||
242 | |||
243 | Module for ATI IXP 150/200/250/400 AC97 controllers. | ||
244 | |||
245 | ac97_clock - AC'97 clock (default = 48000) | ||
246 | ac97_quirk - AC'97 workaround for strange hardware | ||
247 | See "AC97 Quirk Option" section below. | ||
248 | ac97_codec - Workaround to specify which AC'97 codec | ||
249 | instead of probing. If this works for you | ||
250 | file a bug with your `lspci -vn` output. | ||
251 | -2 -- Force probing. | ||
252 | -1 -- Default behavior. | ||
253 | 0-2 -- Use the specified codec. | ||
254 | spdif_aclink - S/PDIF transfer over AC-link (default = 1) | ||
255 | |||
256 | This module supports one card and autoprobe. | ||
257 | |||
258 | ATI IXP has two different methods to control SPDIF output. One is | ||
259 | over AC-link and another is over the "direct" SPDIF output. The | ||
260 | implementation depends on the motherboard, and you'll need to | ||
261 | choose the correct one via spdif_aclink module option. | ||
262 | |||
263 | The power-management is supported. | ||
264 | |||
265 | Module snd-atiixp-modem | ||
266 | ----------------------- | ||
267 | |||
268 | Module for ATI IXP 150/200/250 AC97 modem controllers. | ||
269 | |||
270 | This module supports one card and autoprobe. | ||
271 | |||
272 | Note: The default index value of this module is -2, i.e. the first | ||
273 | slot is excluded. | ||
274 | |||
275 | The power-management is supported. | ||
276 | |||
277 | Module snd-au8810, snd-au8820, snd-au8830 | ||
278 | ----------------------------------------- | ||
279 | |||
280 | Module for Aureal Vortex, Vortex2 and Advantage device. | ||
281 | |||
282 | pcifix - Control PCI workarounds | ||
283 | 0 = Disable all workarounds | ||
284 | 1 = Force the PCI latency of the Aureal card to 0xff | ||
285 | 2 = Force the Extend PCI#2 Internal Master for Efficient | ||
286 | Handling of Dummy Requests on the VIA KT133 AGP Bridge | ||
287 | 3 = Force both settings | ||
288 | 255 = Autodetect what is required (default) | ||
289 | |||
290 | This module supports all ADB PCM channels, ac97 mixer, SPDIF, hardware | ||
291 | EQ, mpu401, gameport. A3D and wavetable support are still in development. | ||
292 | Development and reverse engineering work is being coordinated at | ||
293 | http://savannah.nongnu.org/projects/openvortex/ | ||
294 | SPDIF output has a copy of the AC97 codec output, unless you use the | ||
295 | "spdif" pcm device, which allows raw data passthru. | ||
296 | The hardware EQ hardware and SPDIF is only present in the Vortex2 and | ||
297 | Advantage. | ||
298 | |||
299 | Note: Some ALSA mixer applications don't handle the SPDIF sample rate | ||
300 | control correctly. If you have problems regarding this, try | ||
301 | another ALSA compliant mixer (alsamixer works). | ||
302 | |||
303 | Module snd-azt1605 | ||
304 | ------------------ | ||
305 | |||
306 | Module for Aztech Sound Galaxy soundcards based on the Aztech AZT1605 | ||
307 | chipset. | ||
308 | |||
309 | port - port # for BASE (0x220,0x240,0x260,0x280) | ||
310 | wss_port - port # for WSS (0x530,0x604,0xe80,0xf40) | ||
311 | irq - IRQ # for WSS (7,9,10,11) | ||
312 | dma1 - DMA # for WSS playback (0,1,3) | ||
313 | dma2 - DMA # for WSS capture (0,1), -1 = disabled (default) | ||
314 | mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disabled (default) | ||
315 | mpu_irq - IRQ # for MPU-401 UART (3,5,7,9), -1 = disabled (default) | ||
316 | fm_port - port # for OPL3 (0x388), -1 = disabled (default) | ||
317 | |||
318 | This module supports multiple cards. It does not support autoprobe: port, | ||
319 | wss_port, irq and dma1 have to be specified. The other values are | ||
320 | optional. | ||
321 | |||
322 | "port" needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240) | ||
323 | or the value stored in the card's EEPROM for cards that have an EEPROM and | ||
324 | their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can | ||
325 | be chosen freely from the options enumerated above. | ||
326 | |||
327 | If dma2 is specified and different from dma1, the card will operate in | ||
328 | full-duplex mode. When dma1=3, only dma2=0 is valid and the only way to | ||
329 | enable capture since only channels 0 and 1 are available for capture. | ||
330 | |||
331 | Generic settings are "port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0 | ||
332 | mpu_port=0x330 mpu_irq=9 fm_port=0x388". | ||
333 | |||
334 | Whatever IRQ and DMA channels you pick, be sure to reserve them for | ||
335 | legacy ISA in your BIOS. | ||
336 | |||
337 | Module snd-azt2316 | ||
338 | ------------------ | ||
339 | |||
340 | Module for Aztech Sound Galaxy soundcards based on the Aztech AZT2316 | ||
341 | chipset. | ||
342 | |||
343 | port - port # for BASE (0x220,0x240,0x260,0x280) | ||
344 | wss_port - port # for WSS (0x530,0x604,0xe80,0xf40) | ||
345 | irq - IRQ # for WSS (7,9,10,11) | ||
346 | dma1 - DMA # for WSS playback (0,1,3) | ||
347 | dma2 - DMA # for WSS capture (0,1), -1 = disabled (default) | ||
348 | mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disabled (default) | ||
349 | mpu_irq - IRQ # for MPU-401 UART (5,7,9,10), -1 = disabled (default) | ||
350 | fm_port - port # for OPL3 (0x388), -1 = disabled (default) | ||
351 | |||
352 | This module supports multiple cards. It does not support autoprobe: port, | ||
353 | wss_port, irq and dma1 have to be specified. The other values are | ||
354 | optional. | ||
355 | |||
356 | "port" needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240) | ||
357 | or the value stored in the card's EEPROM for cards that have an EEPROM and | ||
358 | their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can | ||
359 | be chosen freely from the options enumerated above. | ||
360 | |||
361 | If dma2 is specified and different from dma1, the card will operate in | ||
362 | full-duplex mode. When dma1=3, only dma2=0 is valid and the only way to | ||
363 | enable capture since only channels 0 and 1 are available for capture. | ||
364 | |||
365 | Generic settings are "port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0 | ||
366 | mpu_port=0x330 mpu_irq=9 fm_port=0x388". | ||
367 | |||
368 | Whatever IRQ and DMA channels you pick, be sure to reserve them for | ||
369 | legacy ISA in your BIOS. | ||
370 | |||
371 | Module snd-aw2 | ||
372 | -------------- | ||
373 | |||
374 | Module for Audiowerk2 sound card | ||
375 | |||
376 | This module supports multiple cards. | ||
377 | |||
378 | Module snd-azt2320 | ||
379 | ------------------ | ||
380 | |||
381 | Module for sound cards based on Aztech System AZT2320 ISA chip (PnP only). | ||
382 | |||
383 | This module supports multiple cards, PnP and autoprobe. | ||
384 | |||
385 | The power-management is supported. | ||
386 | |||
387 | Module snd-azt3328 | ||
388 | ------------------ | ||
389 | |||
390 | Module for sound cards based on Aztech AZF3328 PCI chip. | ||
391 | |||
392 | joystick - Enable joystick (default off) | ||
393 | |||
394 | This module supports multiple cards. | ||
395 | |||
396 | Module snd-bt87x | ||
397 | ---------------- | ||
398 | |||
399 | Module for video cards based on Bt87x chips. | ||
400 | |||
401 | digital_rate - Override the default digital rate (Hz) | ||
402 | load_all - Load the driver even if the card model isn't known | ||
403 | |||
404 | This module supports multiple cards. | ||
405 | |||
406 | Note: The default index value of this module is -2, i.e. the first | ||
407 | slot is excluded. | ||
408 | |||
409 | Module snd-ca0106 | ||
410 | ----------------- | ||
411 | |||
412 | Module for Creative Audigy LS and SB Live 24bit | ||
413 | |||
414 | This module supports multiple cards. | ||
415 | |||
416 | |||
417 | Module snd-cmi8330 | ||
418 | ------------------ | ||
419 | |||
420 | Module for sound cards based on C-Media CMI8330 ISA chips. | ||
421 | |||
422 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
423 | |||
424 | with isapnp=0, the following options are available: | ||
425 | |||
426 | wssport - port # for CMI8330 chip (WSS) | ||
427 | wssirq - IRQ # for CMI8330 chip (WSS) | ||
428 | wssdma - first DMA # for CMI8330 chip (WSS) | ||
429 | sbport - port # for CMI8330 chip (SB16) | ||
430 | sbirq - IRQ # for CMI8330 chip (SB16) | ||
431 | sbdma8 - 8bit DMA # for CMI8330 chip (SB16) | ||
432 | sbdma16 - 16bit DMA # for CMI8330 chip (SB16) | ||
433 | fmport - (optional) OPL3 I/O port | ||
434 | mpuport - (optional) MPU401 I/O port | ||
435 | mpuirq - (optional) MPU401 irq # | ||
436 | |||
437 | This module supports multiple cards and autoprobe. | ||
438 | |||
439 | The power-management is supported. | ||
440 | |||
441 | Module snd-cmipci | ||
442 | ----------------- | ||
443 | |||
444 | Module for C-Media CMI8338/8738/8768/8770 PCI sound cards. | ||
445 | |||
446 | mpu_port - port address of MIDI interface (8338 only): | ||
447 | 0x300,0x310,0x320,0x330 = legacy port, | ||
448 | 0 = disable (default) | ||
449 | fm_port - port address of OPL-3 FM synthesizer (8x38 only): | ||
450 | 0x388 = legacy port, | ||
451 | 1 = integrated PCI port (default on 8738), | ||
452 | 0 = disable | ||
453 | soft_ac3 - Software-conversion of raw SPDIF packets (model 033 only) | ||
454 | (default = 1) | ||
455 | joystick_port - Joystick port address (0 = disable, 1 = auto-detect) | ||
456 | |||
457 | This module supports autoprobe and multiple cards. | ||
458 | |||
459 | The power-management is supported. | ||
460 | |||
461 | Module snd-cs4231 | ||
462 | ----------------- | ||
463 | |||
464 | Module for sound cards based on CS4231 ISA chips. | ||
465 | |||
466 | port - port # for CS4231 chip | ||
467 | mpu_port - port # for MPU-401 UART (optional), -1 = disable | ||
468 | irq - IRQ # for CS4231 chip | ||
469 | mpu_irq - IRQ # for MPU-401 UART | ||
470 | dma1 - first DMA # for CS4231 chip | ||
471 | dma2 - second DMA # for CS4231 chip | ||
472 | |||
473 | This module supports multiple cards. This module does not support autoprobe | ||
474 | thus main port must be specified!!! Other ports are optional. | ||
475 | |||
476 | The power-management is supported. | ||
477 | |||
478 | Module snd-cs4236 | ||
479 | ----------------- | ||
480 | |||
481 | Module for sound cards based on CS4232/CS4232A, | ||
482 | CS4235/CS4236/CS4236B/CS4237B/ | ||
483 | CS4238B/CS4239 ISA chips. | ||
484 | |||
485 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
486 | |||
487 | with isapnp=0, the following options are available: | ||
488 | |||
489 | port - port # for CS4236 chip (PnP setup - 0x534) | ||
490 | cport - control port # for CS4236 chip (PnP setup - 0x120,0x210,0xf00) | ||
491 | mpu_port - port # for MPU-401 UART (PnP setup - 0x300), -1 = disable | ||
492 | fm_port - FM port # for CS4236 chip (PnP setup - 0x388), -1 = disable | ||
493 | irq - IRQ # for CS4236 chip (5,7,9,11,12,15) | ||
494 | mpu_irq - IRQ # for MPU-401 UART (9,11,12,15) | ||
495 | dma1 - first DMA # for CS4236 chip (0,1,3) | ||
496 | dma2 - second DMA # for CS4236 chip (0,1,3), -1 = disable | ||
497 | |||
498 | This module supports multiple cards. This module does not support autoprobe | ||
499 | (if ISA PnP is not used) thus main port and control port must be | ||
500 | specified!!! Other ports are optional. | ||
501 | |||
502 | The power-management is supported. | ||
503 | |||
504 | This module is aliased as snd-cs4232 since it provides the old | ||
505 | snd-cs4232 functionality, too. | ||
506 | |||
507 | Module snd-cs4281 | ||
508 | ----------------- | ||
509 | |||
510 | Module for Cirrus Logic CS4281 soundchip. | ||
511 | |||
512 | dual_codec - Secondary codec ID (0 = disable, default) | ||
513 | |||
514 | This module supports multiple cards. | ||
515 | |||
516 | The power-management is supported. | ||
517 | |||
518 | Module snd-cs46xx | ||
519 | ----------------- | ||
520 | |||
521 | Module for PCI sound cards based on CS4610/CS4612/CS4614/CS4615/CS4622/ | ||
522 | CS4624/CS4630/CS4280 PCI chips. | ||
523 | |||
524 | external_amp - Force to enable external amplifier. | ||
525 | thinkpad - Force to enable Thinkpad's CLKRUN control. | ||
526 | mmap_valid - Support OSS mmap mode (default = 0). | ||
527 | |||
528 | This module supports multiple cards and autoprobe. | ||
529 | Usually external amp and CLKRUN controls are detected automatically | ||
530 | from PCI sub vendor/device ids. If they don't work, give the options | ||
531 | above explicitly. | ||
532 | |||
533 | The power-management is supported. | ||
534 | |||
535 | Module snd-cs5530 | ||
536 | _________________ | ||
537 | |||
538 | Module for Cyrix/NatSemi Geode 5530 chip. | ||
539 | |||
540 | Module snd-cs5535audio | ||
541 | ---------------------- | ||
542 | |||
543 | Module for multifunction CS5535 companion PCI device | ||
544 | |||
545 | The power-management is supported. | ||
546 | |||
547 | Module snd-ctxfi | ||
548 | ---------------- | ||
549 | |||
550 | Module for Creative Sound Blaster X-Fi boards (20k1 / 20k2 chips) | ||
551 | * Creative Sound Blaster X-Fi Titanium Fatal1ty Champion Series | ||
552 | * Creative Sound Blaster X-Fi Titanium Fatal1ty Professional Series | ||
553 | * Creative Sound Blaster X-Fi Titanium Professional Audio | ||
554 | * Creative Sound Blaster X-Fi Titanium | ||
555 | * Creative Sound Blaster X-Fi Elite Pro | ||
556 | * Creative Sound Blaster X-Fi Platinum | ||
557 | * Creative Sound Blaster X-Fi Fatal1ty | ||
558 | * Creative Sound Blaster X-Fi XtremeGamer | ||
559 | * Creative Sound Blaster X-Fi XtremeMusic | ||
560 | |||
561 | reference_rate - reference sample rate, 44100 or 48000 (default) | ||
562 | multiple - multiple to ref. sample rate, 1 or 2 (default) | ||
563 | subsystem - override the PCI SSID for probing; the value | ||
564 | consists of SSVID << 16 | SSDID. The default is | ||
565 | zero, which means no override. | ||
566 | |||
567 | This module supports multiple cards. | ||
568 | |||
569 | Module snd-darla20 | ||
570 | ------------------ | ||
571 | |||
572 | Module for Echoaudio Darla20 | ||
573 | |||
574 | This module supports multiple cards. | ||
575 | The driver requires the firmware loader support on kernel. | ||
576 | |||
577 | Module snd-darla24 | ||
578 | ------------------ | ||
579 | |||
580 | Module for Echoaudio Darla24 | ||
581 | |||
582 | This module supports multiple cards. | ||
583 | The driver requires the firmware loader support on kernel. | ||
584 | |||
585 | Module snd-dt019x | ||
586 | ----------------- | ||
587 | |||
588 | Module for Diamond Technologies DT-019X / Avance Logic ALS-007 (PnP | ||
589 | only) | ||
590 | |||
591 | This module supports multiple cards. This module is enabled only with | ||
592 | ISA PnP support. | ||
593 | |||
594 | The power-management is supported. | ||
595 | |||
596 | Module snd-dummy | ||
597 | ---------------- | ||
598 | |||
599 | Module for the dummy sound card. This "card" doesn't do any output | ||
600 | or input, but you may use this module for any application which | ||
601 | requires a sound card (like RealPlayer). | ||
602 | |||
603 | pcm_devs - Number of PCM devices assigned to each card | ||
604 | (default = 1, up to 4) | ||
605 | pcm_substreams - Number of PCM substreams assigned to each PCM | ||
606 | (default = 8, up to 128) | ||
607 | hrtimer - Use hrtimer (=1, default) or system timer (=0) | ||
608 | fake_buffer - Fake buffer allocations (default = 1) | ||
609 | |||
610 | When multiple PCM devices are created, snd-dummy gives different | ||
611 | behavior to each PCM device: | ||
612 | 0 = interleaved with mmap support | ||
613 | 1 = non-interleaved with mmap support | ||
614 | 2 = interleaved without mmap | ||
615 | 3 = non-interleaved without mmap | ||
616 | |||
617 | As default, snd-dummy drivers doesn't allocate the real buffers | ||
618 | but either ignores read/write or mmap a single dummy page to all | ||
619 | buffer pages, in order to save the resources. If your apps need | ||
620 | the read/ written buffer data to be consistent, pass fake_buffer=0 | ||
621 | option. | ||
622 | |||
623 | The power-management is supported. | ||
624 | |||
625 | Module snd-echo3g | ||
626 | ----------------- | ||
627 | |||
628 | Module for Echoaudio 3G cards (Gina3G/Layla3G) | ||
629 | |||
630 | This module supports multiple cards. | ||
631 | The driver requires the firmware loader support on kernel. | ||
632 | |||
633 | Module snd-emu10k1 | ||
634 | ------------------ | ||
635 | |||
636 | Module for EMU10K1/EMU10k2 based PCI sound cards. | ||
637 | * Sound Blaster Live! | ||
638 | * Sound Blaster PCI 512 | ||
639 | * Emu APS (partially supported) | ||
640 | * Sound Blaster Audigy | ||
641 | |||
642 | extin - bitmap of available external inputs for FX8010 (see bellow) | ||
643 | extout - bitmap of available external outputs for FX8010 (see bellow) | ||
644 | seq_ports - allocated sequencer ports (4 by default) | ||
645 | max_synth_voices - limit of voices used for wavetable (64 by default) | ||
646 | max_buffer_size - specifies the maximum size of wavetable/pcm buffers | ||
647 | given in MB unit. Default value is 128. | ||
648 | enable_ir - enable IR | ||
649 | |||
650 | This module supports multiple cards and autoprobe. | ||
651 | |||
652 | Input & Output configurations [extin/extout] | ||
653 | * Creative Card wo/Digital out [0x0003/0x1f03] | ||
654 | * Creative Card w/Digital out [0x0003/0x1f0f] | ||
655 | * Creative Card w/Digital CD in [0x000f/0x1f0f] | ||
656 | * Creative Card wo/Digital out + LiveDrive [0x3fc3/0x1fc3] | ||
657 | * Creative Card w/Digital out + LiveDrive [0x3fc3/0x1fcf] | ||
658 | * Creative Card w/Digital CD in + LiveDrive [0x3fcf/0x1fcf] | ||
659 | * Creative Card wo/Digital out + Digital I/O 2 [0x0fc3/0x1f0f] | ||
660 | * Creative Card w/Digital out + Digital I/O 2 [0x0fc3/0x1f0f] | ||
661 | * Creative Card w/Digital CD in + Digital I/O 2 [0x0fcf/0x1f0f] | ||
662 | * Creative Card 5.1/w Digital out + LiveDrive [0x3fc3/0x1fff] | ||
663 | * Creative Card 5.1 (c) 2003 [0x3fc3/0x7cff] | ||
664 | * Creative Card all ins and outs [0x3fff/0x7fff] | ||
665 | |||
666 | The power-management is supported. | ||
667 | |||
668 | Module snd-emu10k1x | ||
669 | ------------------- | ||
670 | |||
671 | Module for Creative Emu10k1X (SB Live Dell OEM version) | ||
672 | |||
673 | This module supports multiple cards. | ||
674 | |||
675 | Module snd-ens1370 | ||
676 | ------------------ | ||
677 | |||
678 | Module for Ensoniq AudioPCI ES1370 PCI sound cards. | ||
679 | * SoundBlaster PCI 64 | ||
680 | * SoundBlaster PCI 128 | ||
681 | |||
682 | joystick - Enable joystick (default off) | ||
683 | |||
684 | This module supports multiple cards and autoprobe. | ||
685 | |||
686 | The power-management is supported. | ||
687 | |||
688 | Module snd-ens1371 | ||
689 | ------------------ | ||
690 | |||
691 | Module for Ensoniq AudioPCI ES1371 PCI sound cards. | ||
692 | * SoundBlaster PCI 64 | ||
693 | * SoundBlaster PCI 128 | ||
694 | * SoundBlaster Vibra PCI | ||
695 | |||
696 | joystick_port - port # for joystick (0x200,0x208,0x210,0x218), | ||
697 | 0 = disable (default), 1 = auto-detect | ||
698 | |||
699 | This module supports multiple cards and autoprobe. | ||
700 | |||
701 | The power-management is supported. | ||
702 | |||
703 | Module snd-es1688 | ||
704 | ----------------- | ||
705 | |||
706 | Module for ESS AudioDrive ES-1688 and ES-688 sound cards. | ||
707 | |||
708 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
709 | mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default) | ||
710 | mpu_irq - IRQ # for MPU-401 port (5,7,9,10) | ||
711 | fm_port - port # for OPL3 (option; share the same port as default) | ||
712 | |||
713 | with isapnp=0, the following additional options are available: | ||
714 | port - port # for ES-1688 chip (0x220,0x240,0x260) | ||
715 | irq - IRQ # for ES-1688 chip (5,7,9,10) | ||
716 | dma8 - DMA # for ES-1688 chip (0,1,3) | ||
717 | |||
718 | This module supports multiple cards and autoprobe (without MPU-401 port) | ||
719 | and PnP with the ES968 chip. | ||
720 | |||
721 | Module snd-es18xx | ||
722 | ----------------- | ||
723 | |||
724 | Module for ESS AudioDrive ES-18xx sound cards. | ||
725 | |||
726 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
727 | |||
728 | with isapnp=0, the following options are available: | ||
729 | |||
730 | port - port # for ES-18xx chip (0x220,0x240,0x260) | ||
731 | mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default) | ||
732 | fm_port - port # for FM (optional, not used) | ||
733 | irq - IRQ # for ES-18xx chip (5,7,9,10) | ||
734 | dma1 - first DMA # for ES-18xx chip (0,1,3) | ||
735 | dma2 - first DMA # for ES-18xx chip (0,1,3) | ||
736 | |||
737 | This module supports multiple cards, ISA PnP and autoprobe (without MPU-401 | ||
738 | port if native ISA PnP routines are not used). | ||
739 | When dma2 is equal with dma1, the driver works as half-duplex. | ||
740 | |||
741 | The power-management is supported. | ||
742 | |||
743 | Module snd-es1938 | ||
744 | ----------------- | ||
745 | |||
746 | Module for sound cards based on ESS Solo-1 (ES1938,ES1946) chips. | ||
747 | |||
748 | This module supports multiple cards and autoprobe. | ||
749 | |||
750 | The power-management is supported. | ||
751 | |||
752 | Module snd-es1968 | ||
753 | ----------------- | ||
754 | |||
755 | Module for sound cards based on ESS Maestro-1/2/2E (ES1968/ES1978) chips. | ||
756 | |||
757 | total_bufsize - total buffer size in kB (1-4096kB) | ||
758 | pcm_substreams_p - playback channels (1-8, default=2) | ||
759 | pcm_substreams_c - capture channels (1-8, default=0) | ||
760 | clock - clock (0 = auto-detection) | ||
761 | use_pm - support the power-management (0 = off, 1 = on, | ||
762 | 2 = auto (default)) | ||
763 | enable_mpu - enable MPU401 (0 = off, 1 = on, 2 = auto (default)) | ||
764 | joystick - enable joystick (default off) | ||
765 | |||
766 | This module supports multiple cards and autoprobe. | ||
767 | |||
768 | The power-management is supported. | ||
769 | |||
770 | Module snd-fm801 | ||
771 | ---------------- | ||
772 | |||
773 | Module for ForteMedia FM801 based PCI sound cards. | ||
774 | |||
775 | tea575x_tuner - Enable TEA575x tuner | ||
776 | - 1 = MediaForte 256-PCS | ||
777 | - 2 = MediaForte 256-PCPR | ||
778 | - 3 = MediaForte 64-PCR | ||
779 | - High 16-bits are video (radio) device number + 1 | ||
780 | - example: 0x10002 (MediaForte 256-PCPR, device 1) | ||
781 | |||
782 | This module supports multiple cards and autoprobe. | ||
783 | |||
784 | The power-management is supported. | ||
785 | |||
786 | Module snd-gina20 | ||
787 | ----------------- | ||
788 | |||
789 | Module for Echoaudio Gina20 | ||
790 | |||
791 | This module supports multiple cards. | ||
792 | The driver requires the firmware loader support on kernel. | ||
793 | |||
794 | Module snd-gina24 | ||
795 | ----------------- | ||
796 | |||
797 | Module for Echoaudio Gina24 | ||
798 | |||
799 | This module supports multiple cards. | ||
800 | The driver requires the firmware loader support on kernel. | ||
801 | |||
802 | Module snd-gusclassic | ||
803 | --------------------- | ||
804 | |||
805 | Module for Gravis UltraSound Classic sound card. | ||
806 | |||
807 | port - port # for GF1 chip (0x220,0x230,0x240,0x250,0x260) | ||
808 | irq - IRQ # for GF1 chip (3,5,9,11,12,15) | ||
809 | dma1 - DMA # for GF1 chip (1,3,5,6,7) | ||
810 | dma2 - DMA # for GF1 chip (1,3,5,6,7,-1=disable) | ||
811 | joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
812 | voices - GF1 voices limit (14-32) | ||
813 | pcm_voices - reserved PCM voices | ||
814 | |||
815 | This module supports multiple cards and autoprobe. | ||
816 | |||
817 | Module snd-gusextreme | ||
818 | --------------------- | ||
819 | |||
820 | Module for Gravis UltraSound Extreme (Synergy ViperMax) sound card. | ||
821 | |||
822 | port - port # for ES-1688 chip (0x220,0x230,0x240,0x250,0x260) | ||
823 | gf1_port - port # for GF1 chip (0x210,0x220,0x230,0x240,0x250,0x260,0x270) | ||
824 | mpu_port - port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable | ||
825 | irq - IRQ # for ES-1688 chip (5,7,9,10) | ||
826 | gf1_irq - IRQ # for GF1 chip (3,5,9,11,12,15) | ||
827 | mpu_irq - IRQ # for MPU-401 port (5,7,9,10) | ||
828 | dma8 - DMA # for ES-1688 chip (0,1,3) | ||
829 | dma1 - DMA # for GF1 chip (1,3,5,6,7) | ||
830 | joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
831 | voices - GF1 voices limit (14-32) | ||
832 | pcm_voices - reserved PCM voices | ||
833 | |||
834 | This module supports multiple cards and autoprobe (without MPU-401 port). | ||
835 | |||
836 | Module snd-gusmax | ||
837 | ----------------- | ||
838 | |||
839 | Module for Gravis UltraSound MAX sound card. | ||
840 | |||
841 | port - port # for GF1 chip (0x220,0x230,0x240,0x250,0x260) | ||
842 | irq - IRQ # for GF1 chip (3,5,9,11,12,15) | ||
843 | dma1 - DMA # for GF1 chip (1,3,5,6,7) | ||
844 | dma2 - DMA # for GF1 chip (1,3,5,6,7,-1=disable) | ||
845 | joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
846 | voices - GF1 voices limit (14-32) | ||
847 | pcm_voices - reserved PCM voices | ||
848 | |||
849 | This module supports multiple cards and autoprobe. | ||
850 | |||
851 | Module snd-hda-intel | ||
852 | -------------------- | ||
853 | |||
854 | Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8, ICH9, ICH10, | ||
855 | PCH, SCH), | ||
856 | ATI SB450, SB600, R600, RS600, RS690, RS780, RV610, RV620, | ||
857 | RV630, RV635, RV670, RV770, | ||
858 | VIA VT8251/VT8237A, | ||
859 | SIS966, ULI M5461 | ||
860 | |||
861 | [Multiple options for each card instance] | ||
862 | model - force the model name | ||
863 | position_fix - Fix DMA pointer | ||
864 | -1 = system default: choose appropriate one per controller | ||
865 | hardware | ||
866 | 0 = auto: falls back to LPIB when POSBUF doesn't work | ||
867 | 1 = use LPIB | ||
868 | 2 = POSBUF: use position buffer | ||
869 | 3 = VIACOMBO: VIA-specific workaround for capture | ||
870 | 4 = COMBO: use LPIB for playback, auto for capture stream | ||
871 | probe_mask - Bitmask to probe codecs (default = -1, meaning all slots) | ||
872 | When the bit 8 (0x100) is set, the lower 8 bits are used | ||
873 | as the "fixed" codec slots; i.e. the driver probes the | ||
874 | slots regardless what hardware reports back | ||
875 | probe_only - Only probing and no codec initialization (default=off); | ||
876 | Useful to check the initial codec status for debugging | ||
877 | bdl_pos_adj - Specifies the DMA IRQ timing delay in samples. | ||
878 | Passing -1 will make the driver to choose the appropriate | ||
879 | value based on the controller chip. | ||
880 | patch - Specifies the early "patch" files to modify the HD-audio | ||
881 | setup before initializing the codecs. This option is | ||
882 | available only when CONFIG_SND_HDA_PATCH_LOADER=y is set. | ||
883 | See HD-Audio.txt for details. | ||
884 | beep_mode - Selects the beep registration mode (0=off, 1=on); default | ||
885 | value is set via CONFIG_SND_HDA_INPUT_BEEP_MODE kconfig. | ||
886 | |||
887 | [Single (global) options] | ||
888 | single_cmd - Use single immediate commands to communicate with | ||
889 | codecs (for debugging only) | ||
890 | enable_msi - Enable Message Signaled Interrupt (MSI) (default = off) | ||
891 | power_save - Automatic power-saving timeout (in second, 0 = | ||
892 | disable) | ||
893 | power_save_controller - Reset HD-audio controller in power-saving mode | ||
894 | (default = on) | ||
895 | align_buffer_size - Force rounding of buffer/period sizes to multiples | ||
896 | of 128 bytes. This is more efficient in terms of memory | ||
897 | access but isn't required by the HDA spec and prevents | ||
898 | users from specifying exact period/buffer sizes. | ||
899 | (default = on) | ||
900 | snoop - Enable/disable snooping (default = on) | ||
901 | |||
902 | This module supports multiple cards and autoprobe. | ||
903 | |||
904 | See Documentation/sound/alsa/HD-Audio.txt for more details about | ||
905 | HD-audio driver. | ||
906 | |||
907 | Each codec may have a model table for different configurations. | ||
908 | If your machine isn't listed there, the default (usually minimal) | ||
909 | configuration is set up. You can pass "model=<name>" option to | ||
910 | specify a certain model in such a case. There are different | ||
911 | models depending on the codec chip. The list of available models | ||
912 | is found in HD-Audio-Models.txt | ||
913 | |||
914 | The model name "generic" is treated as a special case. When this | ||
915 | model is given, the driver uses the generic codec parser without | ||
916 | "codec-patch". It's sometimes good for testing and debugging. | ||
917 | |||
918 | If the default configuration doesn't work and one of the above | ||
919 | matches with your device, report it together with alsa-info.sh | ||
920 | output (with --no-upload option) to kernel bugzilla or alsa-devel | ||
921 | ML (see the section "Links and Addresses"). | ||
922 | |||
923 | power_save and power_save_controller options are for power-saving | ||
924 | mode. See powersave.txt for details. | ||
925 | |||
926 | Note 2: If you get click noises on output, try the module option | ||
927 | position_fix=1 or 2. position_fix=1 will use the SD_LPIB | ||
928 | register value without FIFO size correction as the current | ||
929 | DMA pointer. position_fix=2 will make the driver to use | ||
930 | the position buffer instead of reading SD_LPIB register. | ||
931 | (Usually SD_LPIB register is more accurate than the | ||
932 | position buffer.) | ||
933 | |||
934 | position_fix=3 is specific to VIA devices. The position | ||
935 | of the capture stream is checked from both LPIB and POSBUF | ||
936 | values. position_fix=4 is a combination mode, using LPIB | ||
937 | for playback and POSBUF for capture. | ||
938 | |||
939 | NB: If you get many "azx_get_response timeout" messages at | ||
940 | loading, it's likely a problem of interrupts (e.g. ACPI irq | ||
941 | routing). Try to boot with options like "pci=noacpi". Also, you | ||
942 | can try "single_cmd=1" module option. This will switch the | ||
943 | communication method between HDA controller and codecs to the | ||
944 | single immediate commands instead of CORB/RIRB. Basically, the | ||
945 | single command mode is provided only for BIOS, and you won't get | ||
946 | unsolicited events, too. But, at least, this works independently | ||
947 | from the irq. Remember this is a last resort, and should be | ||
948 | avoided as much as possible... | ||
949 | |||
950 | MORE NOTES ON "azx_get_response timeout" PROBLEMS: | ||
951 | On some hardware, you may need to add a proper probe_mask option | ||
952 | to avoid the "azx_get_response timeout" problem above, instead. | ||
953 | This occurs when the access to non-existing or non-working codec slot | ||
954 | (likely a modem one) causes a stall of the communication via HD-audio | ||
955 | bus. You can see which codec slots are probed by enabling | ||
956 | CONFIG_SND_DEBUG_VERBOSE, or simply from the file name of the codec | ||
957 | proc files. Then limit the slots to probe by probe_mask option. | ||
958 | For example, probe_mask=1 means to probe only the first slot, and | ||
959 | probe_mask=4 means only the third slot. | ||
960 | |||
961 | The power-management is supported. | ||
962 | |||
963 | Module snd-hdsp | ||
964 | --------------- | ||
965 | |||
966 | Module for RME Hammerfall DSP audio interface(s) | ||
967 | |||
968 | This module supports multiple cards. | ||
969 | |||
970 | Note: The firmware data can be automatically loaded via hotplug | ||
971 | when CONFIG_FW_LOADER is set. Otherwise, you need to load | ||
972 | the firmware via hdsploader utility included in alsa-tools | ||
973 | package. | ||
974 | The firmware data is found in alsa-firmware package. | ||
975 | |||
976 | Note: snd-page-alloc module does the job which snd-hammerfall-mem | ||
977 | module did formerly. It will allocate the buffers in advance | ||
978 | when any HDSP cards are found. To make the buffer | ||
979 | allocation sure, load snd-page-alloc module in the early | ||
980 | stage of boot sequence. See "Early Buffer Allocation" | ||
981 | section. | ||
982 | |||
983 | Module snd-hdspm | ||
984 | ---------------- | ||
985 | |||
986 | Module for RME HDSP MADI board. | ||
987 | |||
988 | precise_ptr - Enable precise pointer, or disable. | ||
989 | line_outs_monitor - Send playback streams to analog outs by default. | ||
990 | enable_monitor - Enable Analog Out on Channel 63/64 by default. | ||
991 | |||
992 | See hdspm.txt for details. | ||
993 | |||
994 | Module snd-ice1712 | ||
995 | ------------------ | ||
996 | |||
997 | Module for Envy24 (ICE1712) based PCI sound cards. | ||
998 | * MidiMan M Audio Delta 1010 | ||
999 | * MidiMan M Audio Delta 1010LT | ||
1000 | * MidiMan M Audio Delta DiO 2496 | ||
1001 | * MidiMan M Audio Delta 66 | ||
1002 | * MidiMan M Audio Delta 44 | ||
1003 | * MidiMan M Audio Delta 410 | ||
1004 | * MidiMan M Audio Audiophile 2496 | ||
1005 | * TerraTec EWS 88MT | ||
1006 | * TerraTec EWS 88D | ||
1007 | * TerraTec EWX 24/96 | ||
1008 | * TerraTec DMX 6Fire | ||
1009 | * TerraTec Phase 88 | ||
1010 | * Hoontech SoundTrack DSP 24 | ||
1011 | * Hoontech SoundTrack DSP 24 Value | ||
1012 | * Hoontech SoundTrack DSP 24 Media 7.1 | ||
1013 | * Event Electronics, EZ8 | ||
1014 | * Digigram VX442 | ||
1015 | * Lionstracs, Mediastaton | ||
1016 | * Terrasoniq TS 88 | ||
1017 | |||
1018 | model - Use the given board model, one of the following: | ||
1019 | delta1010, dio2496, delta66, delta44, audiophile, delta410, | ||
1020 | delta1010lt, vx442, ewx2496, ews88mt, ews88mt_new, ews88d, | ||
1021 | dmx6fire, dsp24, dsp24_value, dsp24_71, ez8, | ||
1022 | phase88, mediastation | ||
1023 | omni - Omni I/O support for MidiMan M-Audio Delta44/66 | ||
1024 | cs8427_timeout - reset timeout for the CS8427 chip (S/PDIF transceiver) | ||
1025 | in msec resolution, default value is 500 (0.5 sec) | ||
1026 | |||
1027 | This module supports multiple cards and autoprobe. Note: The consumer part | ||
1028 | is not used with all Envy24 based cards (for example in the MidiMan Delta | ||
1029 | serie). | ||
1030 | |||
1031 | Note: The supported board is detected by reading EEPROM or PCI | ||
1032 | SSID (if EEPROM isn't available). You can override the | ||
1033 | model by passing "model" module option in case that the | ||
1034 | driver isn't configured properly or you want to try another | ||
1035 | type for testing. | ||
1036 | |||
1037 | Module snd-ice1724 | ||
1038 | ------------------ | ||
1039 | |||
1040 | Module for Envy24HT (VT/ICE1724), Envy24PT (VT1720) based PCI sound cards. | ||
1041 | * MidiMan M Audio Revolution 5.1 | ||
1042 | * MidiMan M Audio Revolution 7.1 | ||
1043 | * MidiMan M Audio Audiophile 192 | ||
1044 | * AMP Ltd AUDIO2000 | ||
1045 | * TerraTec Aureon 5.1 Sky | ||
1046 | * TerraTec Aureon 7.1 Space | ||
1047 | * TerraTec Aureon 7.1 Universe | ||
1048 | * TerraTec Phase 22 | ||
1049 | * TerraTec Phase 28 | ||
1050 | * AudioTrak Prodigy 7.1 | ||
1051 | * AudioTrak Prodigy 7.1 LT | ||
1052 | * AudioTrak Prodigy 7.1 XT | ||
1053 | * AudioTrak Prodigy 7.1 HIFI | ||
1054 | * AudioTrak Prodigy 7.1 HD2 | ||
1055 | * AudioTrak Prodigy 192 | ||
1056 | * Pontis MS300 | ||
1057 | * Albatron K8X800 Pro II | ||
1058 | * Chaintech ZNF3-150 | ||
1059 | * Chaintech ZNF3-250 | ||
1060 | * Chaintech 9CJS | ||
1061 | * Chaintech AV-710 | ||
1062 | * Shuttle SN25P | ||
1063 | * Onkyo SE-90PCI | ||
1064 | * Onkyo SE-200PCI | ||
1065 | * ESI Juli@ | ||
1066 | * ESI Maya44 | ||
1067 | * Hercules Fortissimo IV | ||
1068 | * EGO-SYS WaveTerminal 192M | ||
1069 | |||
1070 | model - Use the given board model, one of the following: | ||
1071 | revo51, revo71, amp2000, prodigy71, prodigy71lt, | ||
1072 | prodigy71xt, prodigy71hifi, prodigyhd2, prodigy192, | ||
1073 | juli, aureon51, aureon71, universe, ap192, k8x800, | ||
1074 | phase22, phase28, ms300, av710, se200pci, se90pci, | ||
1075 | fortissimo4, sn25p, WT192M, maya44 | ||
1076 | |||
1077 | This module supports multiple cards and autoprobe. | ||
1078 | |||
1079 | Note: The supported board is detected by reading EEPROM or PCI | ||
1080 | SSID (if EEPROM isn't available). You can override the | ||
1081 | model by passing "model" module option in case that the | ||
1082 | driver isn't configured properly or you want to try another | ||
1083 | type for testing. | ||
1084 | |||
1085 | Module snd-indigo | ||
1086 | ----------------- | ||
1087 | |||
1088 | Module for Echoaudio Indigo | ||
1089 | |||
1090 | This module supports multiple cards. | ||
1091 | The driver requires the firmware loader support on kernel. | ||
1092 | |||
1093 | Module snd-indigodj | ||
1094 | ------------------- | ||
1095 | |||
1096 | Module for Echoaudio Indigo DJ | ||
1097 | |||
1098 | This module supports multiple cards. | ||
1099 | The driver requires the firmware loader support on kernel. | ||
1100 | |||
1101 | Module snd-indigoio | ||
1102 | ------------------- | ||
1103 | |||
1104 | Module for Echoaudio Indigo IO | ||
1105 | |||
1106 | This module supports multiple cards. | ||
1107 | The driver requires the firmware loader support on kernel. | ||
1108 | |||
1109 | Module snd-intel8x0 | ||
1110 | ------------------- | ||
1111 | |||
1112 | Module for AC'97 motherboards from Intel and compatibles. | ||
1113 | * Intel i810/810E, i815, i820, i830, i84x, MX440 | ||
1114 | ICH5, ICH6, ICH7, 6300ESB, ESB2 | ||
1115 | * SiS 7012 (SiS 735) | ||
1116 | * NVidia NForce, NForce2, NForce3, MCP04, CK804 | ||
1117 | CK8, CK8S, MCP501 | ||
1118 | * AMD AMD768, AMD8111 | ||
1119 | * ALi m5455 | ||
1120 | |||
1121 | ac97_clock - AC'97 codec clock base (0 = auto-detect) | ||
1122 | ac97_quirk - AC'97 workaround for strange hardware | ||
1123 | See "AC97 Quirk Option" section below. | ||
1124 | buggy_irq - Enable workaround for buggy interrupts on some | ||
1125 | motherboards (default yes on nForce chips, | ||
1126 | otherwise off) | ||
1127 | buggy_semaphore - Enable workaround for hardware with buggy | ||
1128 | semaphores (e.g. on some ASUS laptops) | ||
1129 | (default off) | ||
1130 | spdif_aclink - Use S/PDIF over AC-link instead of direct connection | ||
1131 | from the controller chip | ||
1132 | (0 = off, 1 = on, -1 = default) | ||
1133 | |||
1134 | This module supports one chip and autoprobe. | ||
1135 | |||
1136 | Note: the latest driver supports auto-detection of chip clock. | ||
1137 | if you still encounter too fast playback, specify the clock | ||
1138 | explicitly via the module option "ac97_clock=41194". | ||
1139 | |||
1140 | Joystick/MIDI ports are not supported by this driver. If your | ||
1141 | motherboard has these devices, use the ns558 or snd-mpu401 | ||
1142 | modules, respectively. | ||
1143 | |||
1144 | The power-management is supported. | ||
1145 | |||
1146 | Module snd-intel8x0m | ||
1147 | -------------------- | ||
1148 | |||
1149 | Module for Intel ICH (i8x0) chipset MC97 modems. | ||
1150 | * Intel i810/810E, i815, i820, i830, i84x, MX440 | ||
1151 | ICH5, ICH6, ICH7 | ||
1152 | * SiS 7013 (SiS 735) | ||
1153 | * NVidia NForce, NForce2, NForce2s, NForce3 | ||
1154 | * AMD AMD8111 | ||
1155 | * ALi m5455 | ||
1156 | |||
1157 | ac97_clock - AC'97 codec clock base (0 = auto-detect) | ||
1158 | |||
1159 | This module supports one card and autoprobe. | ||
1160 | |||
1161 | Note: The default index value of this module is -2, i.e. the first | ||
1162 | slot is excluded. | ||
1163 | |||
1164 | The power-management is supported. | ||
1165 | |||
1166 | Module snd-interwave | ||
1167 | -------------------- | ||
1168 | |||
1169 | Module for Gravis UltraSound PnP, Dynasonic 3-D/Pro, STB Sound Rage 32 | ||
1170 | and other sound cards based on AMD InterWave (tm) chip. | ||
1171 | |||
1172 | joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
1173 | midi - 1 = MIDI UART enable, 0 = MIDI UART disable (default) | ||
1174 | pcm_voices - reserved PCM voices for the synthesizer (default 2) | ||
1175 | effect - 1 = InterWave effects enable (default 0); | ||
1176 | requires 8 voices | ||
1177 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1178 | |||
1179 | with isapnp=0, the following options are available: | ||
1180 | |||
1181 | port - port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260) | ||
1182 | irq - IRQ # for InterWave chip (3,5,9,11,12,15) | ||
1183 | dma1 - DMA # for InterWave chip (0,1,3,5,6,7) | ||
1184 | dma2 - DMA # for InterWave chip (0,1,3,5,6,7,-1=disable) | ||
1185 | |||
1186 | This module supports multiple cards, autoprobe and ISA PnP. | ||
1187 | |||
1188 | Module snd-interwave-stb | ||
1189 | ------------------------ | ||
1190 | |||
1191 | Module for UltraSound 32-Pro (sound card from STB used by Compaq) | ||
1192 | and other sound cards based on AMD InterWave (tm) chip with TEA6330T | ||
1193 | circuit for extended control of bass, treble and master volume. | ||
1194 | |||
1195 | joystick_dac - 0 to 31, (0.59V-4.52V or 0.389V-2.98V) | ||
1196 | midi - 1 = MIDI UART enable, 0 = MIDI UART disable (default) | ||
1197 | pcm_voices - reserved PCM voices for the synthesizer (default 2) | ||
1198 | effect - 1 = InterWave effects enable (default 0); | ||
1199 | requires 8 voices | ||
1200 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1201 | |||
1202 | with isapnp=0, the following options are available: | ||
1203 | |||
1204 | port - port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260) | ||
1205 | port_tc - tone control (i2c bus) port # for TEA6330T chip (0x350,0x360,0x370,0x380) | ||
1206 | irq - IRQ # for InterWave chip (3,5,9,11,12,15) | ||
1207 | dma1 - DMA # for InterWave chip (0,1,3,5,6,7) | ||
1208 | dma2 - DMA # for InterWave chip (0,1,3,5,6,7,-1=disable) | ||
1209 | |||
1210 | This module supports multiple cards, autoprobe and ISA PnP. | ||
1211 | |||
1212 | Module snd-jazz16 | ||
1213 | ------------------- | ||
1214 | |||
1215 | Module for Media Vision Jazz16 chipset. The chipset consists of 3 chips: | ||
1216 | MVD1216 + MVA416 + MVA514. | ||
1217 | |||
1218 | port - port # for SB DSP chip (0x210,0x220,0x230,0x240,0x250,0x260) | ||
1219 | irq - IRQ # for SB DSP chip (3,5,7,9,10,15) | ||
1220 | dma8 - DMA # for SB DSP chip (1,3) | ||
1221 | dma16 - DMA # for SB DSP chip (5,7) | ||
1222 | mpu_port - MPU-401 port # (0x300,0x310,0x320,0x330) | ||
1223 | mpu_irq - MPU-401 irq # (2,3,5,7) | ||
1224 | |||
1225 | This module supports multiple cards. | ||
1226 | |||
1227 | Module snd-korg1212 | ||
1228 | ------------------- | ||
1229 | |||
1230 | Module for Korg 1212 IO PCI card | ||
1231 | |||
1232 | This module supports multiple cards. | ||
1233 | |||
1234 | Module snd-layla20 | ||
1235 | ------------------ | ||
1236 | |||
1237 | Module for Echoaudio Layla20 | ||
1238 | |||
1239 | This module supports multiple cards. | ||
1240 | The driver requires the firmware loader support on kernel. | ||
1241 | |||
1242 | Module snd-layla24 | ||
1243 | ------------------ | ||
1244 | |||
1245 | Module for Echoaudio Layla24 | ||
1246 | |||
1247 | This module supports multiple cards. | ||
1248 | The driver requires the firmware loader support on kernel. | ||
1249 | |||
1250 | Module snd-lola | ||
1251 | --------------- | ||
1252 | |||
1253 | Module for Digigram Lola PCI-e boards | ||
1254 | |||
1255 | This module supports multiple cards. | ||
1256 | |||
1257 | Module snd-lx6464es | ||
1258 | ------------------- | ||
1259 | |||
1260 | Module for Digigram LX6464ES boards | ||
1261 | |||
1262 | This module supports multiple cards. | ||
1263 | |||
1264 | Module snd-maestro3 | ||
1265 | ------------------- | ||
1266 | |||
1267 | Module for Allegro/Maestro3 chips | ||
1268 | |||
1269 | external_amp - enable external amp (enabled by default) | ||
1270 | amp_gpio - GPIO pin number for external amp (0-15) or | ||
1271 | -1 for default pin (8 for allegro, 1 for | ||
1272 | others) | ||
1273 | |||
1274 | This module supports autoprobe and multiple chips. | ||
1275 | |||
1276 | Note: the binding of amplifier is dependent on hardware. | ||
1277 | If there is no sound even though all channels are unmuted, try to | ||
1278 | specify other gpio connection via amp_gpio option. | ||
1279 | For example, a Panasonic notebook might need "amp_gpio=0x0d" | ||
1280 | option. | ||
1281 | |||
1282 | The power-management is supported. | ||
1283 | |||
1284 | Module snd-mia | ||
1285 | --------------- | ||
1286 | |||
1287 | Module for Echoaudio Mia | ||
1288 | |||
1289 | This module supports multiple cards. | ||
1290 | The driver requires the firmware loader support on kernel. | ||
1291 | |||
1292 | Module snd-miro | ||
1293 | --------------- | ||
1294 | |||
1295 | Module for Miro soundcards: miroSOUND PCM 1 pro, | ||
1296 | miroSOUND PCM 12, | ||
1297 | miroSOUND PCM 20 Radio. | ||
1298 | |||
1299 | port - Port # (0x530,0x604,0xe80,0xf40) | ||
1300 | irq - IRQ # (5,7,9,10,11) | ||
1301 | dma1 - 1st dma # (0,1,3) | ||
1302 | dma2 - 2nd dma # (0,1) | ||
1303 | mpu_port - MPU-401 port # (0x300,0x310,0x320,0x330) | ||
1304 | mpu_irq - MPU-401 irq # (5,7,9,10) | ||
1305 | fm_port - FM Port # (0x388) | ||
1306 | wss - enable WSS mode | ||
1307 | ide - enable onboard ide support | ||
1308 | |||
1309 | Module snd-mixart | ||
1310 | ----------------- | ||
1311 | |||
1312 | Module for Digigram miXart8 sound cards. | ||
1313 | |||
1314 | This module supports multiple cards. | ||
1315 | Note: One miXart8 board will be represented as 4 alsa cards. | ||
1316 | See MIXART.txt for details. | ||
1317 | |||
1318 | When the driver is compiled as a module and the hotplug firmware | ||
1319 | is supported, the firmware data is loaded via hotplug automatically. | ||
1320 | Install the necessary firmware files in alsa-firmware package. | ||
1321 | When no hotplug fw loader is available, you need to load the | ||
1322 | firmware via mixartloader utility in alsa-tools package. | ||
1323 | |||
1324 | Module snd-mona | ||
1325 | --------------- | ||
1326 | |||
1327 | Module for Echoaudio Mona | ||
1328 | |||
1329 | This module supports multiple cards. | ||
1330 | The driver requires the firmware loader support on kernel. | ||
1331 | |||
1332 | Module snd-mpu401 | ||
1333 | ----------------- | ||
1334 | |||
1335 | Module for MPU-401 UART devices. | ||
1336 | |||
1337 | port - port number or -1 (disable) | ||
1338 | irq - IRQ number or -1 (disable) | ||
1339 | pnp - PnP detection - 0 = disable, 1 = enable (default) | ||
1340 | |||
1341 | This module supports multiple devices and PnP. | ||
1342 | |||
1343 | Module snd-msnd-classic | ||
1344 | ----------------------- | ||
1345 | |||
1346 | Module for Turtle Beach MultiSound Classic, Tahiti or Monterey | ||
1347 | soundcards. | ||
1348 | |||
1349 | io - Port # for msnd-classic card | ||
1350 | irq - IRQ # for msnd-classic card | ||
1351 | mem - Memory address (0xb0000, 0xc8000, 0xd0000, 0xd8000, | ||
1352 | 0xe0000 or 0xe8000) | ||
1353 | write_ndelay - enable write ndelay (default = 1) | ||
1354 | calibrate_signal - calibrate signal (default = 0) | ||
1355 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1356 | digital - Digital daughterboard present (default = 0) | ||
1357 | cfg - Config port (0x250, 0x260 or 0x270) default = PnP | ||
1358 | reset - Reset all devices | ||
1359 | mpu_io - MPU401 I/O port | ||
1360 | mpu_irq - MPU401 irq# | ||
1361 | ide_io0 - IDE port #0 | ||
1362 | ide_io1 - IDE port #1 | ||
1363 | ide_irq - IDE irq# | ||
1364 | joystick_io - Joystick I/O port | ||
1365 | |||
1366 | The driver requires firmware files "turtlebeach/msndinit.bin" and | ||
1367 | "turtlebeach/msndperm.bin" in the proper firmware directory. | ||
1368 | |||
1369 | See Documentation/sound/oss/MultiSound for important information | ||
1370 | about this driver. Note that it has been discontinued, but the | ||
1371 | Voyetra Turtle Beach knowledge base entry for it is still available | ||
1372 | at | ||
1373 | http://www.turtlebeach.com | ||
1374 | |||
1375 | Module snd-msnd-pinnacle | ||
1376 | ------------------------ | ||
1377 | |||
1378 | Module for Turtle Beach MultiSound Pinnacle/Fiji soundcards. | ||
1379 | |||
1380 | io - Port # for pinnacle/fiji card | ||
1381 | irq - IRQ # for pinnalce/fiji card | ||
1382 | mem - Memory address (0xb0000, 0xc8000, 0xd0000, 0xd8000, | ||
1383 | 0xe0000 or 0xe8000) | ||
1384 | write_ndelay - enable write ndelay (default = 1) | ||
1385 | calibrate_signal - calibrate signal (default = 0) | ||
1386 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1387 | |||
1388 | The driver requires firmware files "turtlebeach/pndspini.bin" and | ||
1389 | "turtlebeach/pndsperm.bin" in the proper firmware directory. | ||
1390 | |||
1391 | Module snd-mtpav | ||
1392 | ---------------- | ||
1393 | |||
1394 | Module for MOTU MidiTimePiece AV multiport MIDI (on the parallel | ||
1395 | port). | ||
1396 | |||
1397 | port - I/O port # for MTPAV (0x378,0x278, default=0x378) | ||
1398 | irq - IRQ # for MTPAV (7,5, default=7) | ||
1399 | hwports - number of supported hardware ports, default=8. | ||
1400 | |||
1401 | Module supports only 1 card. This module has no enable option. | ||
1402 | |||
1403 | Module snd-mts64 | ||
1404 | ---------------- | ||
1405 | |||
1406 | Module for Ego Systems (ESI) Miditerminal 4140 | ||
1407 | |||
1408 | This module supports multiple devices. | ||
1409 | Requires parport (CONFIG_PARPORT). | ||
1410 | |||
1411 | Module snd-nm256 | ||
1412 | ---------------- | ||
1413 | |||
1414 | Module for NeoMagic NM256AV/ZX chips | ||
1415 | |||
1416 | playback_bufsize - max playback frame size in kB (4-128kB) | ||
1417 | capture_bufsize - max capture frame size in kB (4-128kB) | ||
1418 | force_ac97 - 0 or 1 (disabled by default) | ||
1419 | buffer_top - specify buffer top address | ||
1420 | use_cache - 0 or 1 (disabled by default) | ||
1421 | vaio_hack - alias buffer_top=0x25a800 | ||
1422 | reset_workaround - enable AC97 RESET workaround for some laptops | ||
1423 | reset_workaround2 - enable extended AC97 RESET workaround for some | ||
1424 | other laptops | ||
1425 | |||
1426 | This module supports one chip and autoprobe. | ||
1427 | |||
1428 | The power-management is supported. | ||
1429 | |||
1430 | Note: on some notebooks the buffer address cannot be detected | ||
1431 | automatically, or causes hang-up during initialization. | ||
1432 | In such a case, specify the buffer top address explicitly via | ||
1433 | the buffer_top option. | ||
1434 | For example, | ||
1435 | Sony F250: buffer_top=0x25a800 | ||
1436 | Sony F270: buffer_top=0x272800 | ||
1437 | The driver supports only ac97 codec. It's possible to force | ||
1438 | to initialize/use ac97 although it's not detected. In such a | ||
1439 | case, use force_ac97=1 option - but *NO* guarantee whether it | ||
1440 | works! | ||
1441 | |||
1442 | Note: The NM256 chip can be linked internally with non-AC97 | ||
1443 | codecs. This driver supports only the AC97 codec, and won't work | ||
1444 | with machines with other (most likely CS423x or OPL3SAx) chips, | ||
1445 | even though the device is detected in lspci. In such a case, try | ||
1446 | other drivers, e.g. snd-cs4232 or snd-opl3sa2. Some has ISA-PnP | ||
1447 | but some doesn't have ISA PnP. You'll need to specify isapnp=0 | ||
1448 | and proper hardware parameters in the case without ISA PnP. | ||
1449 | |||
1450 | Note: some laptops need a workaround for AC97 RESET. For the | ||
1451 | known hardware like Dell Latitude LS and Sony PCG-F305, this | ||
1452 | workaround is enabled automatically. For other laptops with a | ||
1453 | hard freeze, you can try reset_workaround=1 option. | ||
1454 | |||
1455 | Note: Dell Latitude CSx laptops have another problem regarding | ||
1456 | AC97 RESET. On these laptops, reset_workaround2 option is | ||
1457 | turned on as default. This option is worth to try if the | ||
1458 | previous reset_workaround option doesn't help. | ||
1459 | |||
1460 | Note: This driver is really crappy. It's a porting from the | ||
1461 | OSS driver, which is a result of black-magic reverse engineering. | ||
1462 | The detection of codec will fail if the driver is loaded *after* | ||
1463 | X-server as described above. You might be able to force to load | ||
1464 | the module, but it may result in hang-up. Hence, make sure that | ||
1465 | you load this module *before* X if you encounter this kind of | ||
1466 | problem. | ||
1467 | |||
1468 | Module snd-opl3sa2 | ||
1469 | ------------------ | ||
1470 | |||
1471 | Module for Yamaha OPL3-SA2/SA3 sound cards. | ||
1472 | |||
1473 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1474 | |||
1475 | with isapnp=0, the following options are available: | ||
1476 | |||
1477 | port - control port # for OPL3-SA chip (0x370) | ||
1478 | sb_port - SB port # for OPL3-SA chip (0x220,0x240) | ||
1479 | wss_port - WSS port # for OPL3-SA chip (0x530,0xe80,0xf40,0x604) | ||
1480 | midi_port - port # for MPU-401 UART (0x300,0x330), -1 = disable | ||
1481 | fm_port - FM port # for OPL3-SA chip (0x388), -1 = disable | ||
1482 | irq - IRQ # for OPL3-SA chip (5,7,9,10) | ||
1483 | dma1 - first DMA # for Yamaha OPL3-SA chip (0,1,3) | ||
1484 | dma2 - second DMA # for Yamaha OPL3-SA chip (0,1,3), -1 = disable | ||
1485 | |||
1486 | This module supports multiple cards and ISA PnP. It does not support | ||
1487 | autoprobe (if ISA PnP is not used) thus all ports must be specified!!! | ||
1488 | |||
1489 | The power-management is supported. | ||
1490 | |||
1491 | Module snd-opti92x-ad1848 | ||
1492 | ------------------------- | ||
1493 | |||
1494 | Module for sound cards based on OPTi 82c92x and Analog Devices AD1848 chips. | ||
1495 | Module works with OAK Mozart cards as well. | ||
1496 | |||
1497 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1498 | |||
1499 | with isapnp=0, the following options are available: | ||
1500 | |||
1501 | port - port # for WSS chip (0x530,0xe80,0xf40,0x604) | ||
1502 | mpu_port - port # for MPU-401 UART (0x300,0x310,0x320,0x330) | ||
1503 | fm_port - port # for OPL3 device (0x388) | ||
1504 | irq - IRQ # for WSS chip (5,7,9,10,11) | ||
1505 | mpu_irq - IRQ # for MPU-401 UART (5,7,9,10) | ||
1506 | dma1 - first DMA # for WSS chip (0,1,3) | ||
1507 | |||
1508 | This module supports only one card, autoprobe and PnP. | ||
1509 | |||
1510 | Module snd-opti92x-cs4231 | ||
1511 | ------------------------- | ||
1512 | |||
1513 | Module for sound cards based on OPTi 82c92x and Crystal CS4231 chips. | ||
1514 | |||
1515 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1516 | |||
1517 | with isapnp=0, the following options are available: | ||
1518 | |||
1519 | port - port # for WSS chip (0x530,0xe80,0xf40,0x604) | ||
1520 | mpu_port - port # for MPU-401 UART (0x300,0x310,0x320,0x330) | ||
1521 | fm_port - port # for OPL3 device (0x388) | ||
1522 | irq - IRQ # for WSS chip (5,7,9,10,11) | ||
1523 | mpu_irq - IRQ # for MPU-401 UART (5,7,9,10) | ||
1524 | dma1 - first DMA # for WSS chip (0,1,3) | ||
1525 | dma2 - second DMA # for WSS chip (0,1,3) | ||
1526 | |||
1527 | This module supports only one card, autoprobe and PnP. | ||
1528 | |||
1529 | Module snd-opti93x | ||
1530 | ------------------ | ||
1531 | |||
1532 | Module for sound cards based on OPTi 82c93x chips. | ||
1533 | |||
1534 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1535 | |||
1536 | with isapnp=0, the following options are available: | ||
1537 | |||
1538 | port - port # for WSS chip (0x530,0xe80,0xf40,0x604) | ||
1539 | mpu_port - port # for MPU-401 UART (0x300,0x310,0x320,0x330) | ||
1540 | fm_port - port # for OPL3 device (0x388) | ||
1541 | irq - IRQ # for WSS chip (5,7,9,10,11) | ||
1542 | mpu_irq - IRQ # for MPU-401 UART (5,7,9,10) | ||
1543 | dma1 - first DMA # for WSS chip (0,1,3) | ||
1544 | dma2 - second DMA # for WSS chip (0,1,3) | ||
1545 | |||
1546 | This module supports only one card, autoprobe and PnP. | ||
1547 | |||
1548 | Module snd-oxygen | ||
1549 | ----------------- | ||
1550 | |||
1551 | Module for sound cards based on the C-Media CMI8786/8787/8788 chip: | ||
1552 | * Asound A-8788 | ||
1553 | * Asus Xonar DG/DGX | ||
1554 | * AuzenTech X-Meridian | ||
1555 | * AuzenTech X-Meridian 2G | ||
1556 | * Bgears b-Enspirer | ||
1557 | * Club3D Theatron DTS | ||
1558 | * HT-Omega Claro (plus) | ||
1559 | * HT-Omega Claro halo (XT) | ||
1560 | * Kuroutoshikou CMI8787-HG2PCI | ||
1561 | * Razer Barracuda AC-1 | ||
1562 | * Sondigo Inferno | ||
1563 | * TempoTec HiFier Fantasia | ||
1564 | * TempoTec HiFier Serenade | ||
1565 | |||
1566 | This module supports autoprobe and multiple cards. | ||
1567 | |||
1568 | Module snd-pcsp | ||
1569 | ----------------- | ||
1570 | |||
1571 | Module for internal PC-Speaker. | ||
1572 | |||
1573 | nopcm - Disable PC-Speaker PCM sound. Only beeps remain. | ||
1574 | nforce_wa - enable NForce chipset workaround. Expect bad sound. | ||
1575 | |||
1576 | This module supports system beeps, some kind of PCM playback and | ||
1577 | even a few mixer controls. | ||
1578 | |||
1579 | Module snd-pcxhr | ||
1580 | ---------------- | ||
1581 | |||
1582 | Module for Digigram PCXHR boards | ||
1583 | |||
1584 | This module supports multiple cards. | ||
1585 | |||
1586 | Module snd-portman2x4 | ||
1587 | --------------------- | ||
1588 | |||
1589 | Module for Midiman Portman 2x4 parallel port MIDI interface | ||
1590 | |||
1591 | This module supports multiple cards. | ||
1592 | |||
1593 | Module snd-powermac (on ppc only) | ||
1594 | --------------------------------- | ||
1595 | |||
1596 | Module for PowerMac, iMac and iBook on-board soundchips | ||
1597 | |||
1598 | enable_beep - enable beep using PCM (enabled as default) | ||
1599 | |||
1600 | Module supports autoprobe a chip. | ||
1601 | |||
1602 | Note: the driver may have problems regarding endianness. | ||
1603 | |||
1604 | The power-management is supported. | ||
1605 | |||
1606 | Module snd-pxa2xx-ac97 (on arm only) | ||
1607 | ------------------------------------ | ||
1608 | |||
1609 | Module for AC97 driver for the Intel PXA2xx chip | ||
1610 | |||
1611 | For ARM architecture only. | ||
1612 | |||
1613 | The power-management is supported. | ||
1614 | |||
1615 | Module snd-riptide | ||
1616 | ------------------ | ||
1617 | |||
1618 | Module for Conexant Riptide chip | ||
1619 | |||
1620 | joystick_port - Joystick port # (default: 0x200) | ||
1621 | mpu_port - MPU401 port # (default: 0x330) | ||
1622 | opl3_port - OPL3 port # (default: 0x388) | ||
1623 | |||
1624 | This module supports multiple cards. | ||
1625 | The driver requires the firmware loader support on kernel. | ||
1626 | You need to install the firmware file "riptide.hex" to the standard | ||
1627 | firmware path (e.g. /lib/firmware). | ||
1628 | |||
1629 | Module snd-rme32 | ||
1630 | ---------------- | ||
1631 | |||
1632 | Module for RME Digi32, Digi32 Pro and Digi32/8 (Sek'd Prodif32, | ||
1633 | Prodif96 and Prodif Gold) sound cards. | ||
1634 | |||
1635 | This module supports multiple cards. | ||
1636 | |||
1637 | Module snd-rme96 | ||
1638 | ---------------- | ||
1639 | |||
1640 | Module for RME Digi96, Digi96/8 and Digi96/8 PRO/PAD/PST sound cards. | ||
1641 | |||
1642 | This module supports multiple cards. | ||
1643 | |||
1644 | Module snd-rme9652 | ||
1645 | ------------------ | ||
1646 | |||
1647 | Module for RME Digi9652 (Hammerfall, Hammerfall-Light) sound cards. | ||
1648 | |||
1649 | precise_ptr - Enable precise pointer (doesn't work reliably). | ||
1650 | (default = 0) | ||
1651 | |||
1652 | This module supports multiple cards. | ||
1653 | |||
1654 | Note: snd-page-alloc module does the job which snd-hammerfall-mem | ||
1655 | module did formerly. It will allocate the buffers in advance | ||
1656 | when any RME9652 cards are found. To make the buffer | ||
1657 | allocation sure, load snd-page-alloc module in the early | ||
1658 | stage of boot sequence. See "Early Buffer Allocation" | ||
1659 | section. | ||
1660 | |||
1661 | Module snd-sa11xx-uda1341 (on arm only) | ||
1662 | --------------------------------------- | ||
1663 | |||
1664 | Module for Philips UDA1341TS on Compaq iPAQ H3600 sound card. | ||
1665 | |||
1666 | Module supports only one card. | ||
1667 | Module has no enable and index options. | ||
1668 | |||
1669 | The power-management is supported. | ||
1670 | |||
1671 | Module snd-sb8 | ||
1672 | -------------- | ||
1673 | |||
1674 | Module for 8-bit SoundBlaster cards: SoundBlaster 1.0, | ||
1675 | SoundBlaster 2.0, | ||
1676 | SoundBlaster Pro | ||
1677 | |||
1678 | port - port # for SB DSP chip (0x220,0x240,0x260) | ||
1679 | irq - IRQ # for SB DSP chip (5,7,9,10) | ||
1680 | dma8 - DMA # for SB DSP chip (1,3) | ||
1681 | |||
1682 | This module supports multiple cards and autoprobe. | ||
1683 | |||
1684 | The power-management is supported. | ||
1685 | |||
1686 | Module snd-sb16 and snd-sbawe | ||
1687 | ----------------------------- | ||
1688 | |||
1689 | Module for 16-bit SoundBlaster cards: SoundBlaster 16 (PnP), | ||
1690 | SoundBlaster AWE 32 (PnP), | ||
1691 | SoundBlaster AWE 64 PnP | ||
1692 | |||
1693 | mic_agc - Mic Auto-Gain-Control - 0 = disable, 1 = enable (default) | ||
1694 | csp - ASP/CSP chip support - 0 = disable (default), 1 = enable | ||
1695 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1696 | |||
1697 | with isapnp=0, the following options are available: | ||
1698 | |||
1699 | port - port # for SB DSP 4.x chip (0x220,0x240,0x260) | ||
1700 | mpu_port - port # for MPU-401 UART (0x300,0x330), -1 = disable | ||
1701 | awe_port - base port # for EMU8000 synthesizer (0x620,0x640,0x660) | ||
1702 | (snd-sbawe module only) | ||
1703 | irq - IRQ # for SB DSP 4.x chip (5,7,9,10) | ||
1704 | dma8 - 8-bit DMA # for SB DSP 4.x chip (0,1,3) | ||
1705 | dma16 - 16-bit DMA # for SB DSP 4.x chip (5,6,7) | ||
1706 | |||
1707 | This module supports multiple cards, autoprobe and ISA PnP. | ||
1708 | |||
1709 | Note: To use Vibra16X cards in 16-bit half duplex mode, you must | ||
1710 | disable 16bit DMA with dma16 = -1 module parameter. | ||
1711 | Also, all Sound Blaster 16 type cards can operate in 16-bit | ||
1712 | half duplex mode through 8-bit DMA channel by disabling their | ||
1713 | 16-bit DMA channel. | ||
1714 | |||
1715 | The power-management is supported. | ||
1716 | |||
1717 | Module snd-sc6000 | ||
1718 | ----------------- | ||
1719 | |||
1720 | Module for Gallant SC-6000 soundcard and later models: SC-6600 | ||
1721 | and SC-7000. | ||
1722 | |||
1723 | port - Port # (0x220 or 0x240) | ||
1724 | mss_port - MSS Port # (0x530 or 0xe80) | ||
1725 | irq - IRQ # (5,7,9,10,11) | ||
1726 | mpu_irq - MPU-401 IRQ # (5,7,9,10) ,0 - no MPU-401 irq | ||
1727 | dma - DMA # (1,3,0) | ||
1728 | joystick - Enable gameport - 0 = disable (default), 1 = enable | ||
1729 | |||
1730 | This module supports multiple cards. | ||
1731 | |||
1732 | This card is also known as Audio Excel DSP 16 or Zoltrix AV302. | ||
1733 | |||
1734 | Module snd-sscape | ||
1735 | ----------------- | ||
1736 | |||
1737 | Module for ENSONIQ SoundScape cards. | ||
1738 | |||
1739 | port - Port # (PnP setup) | ||
1740 | wss_port - WSS Port # (PnP setup) | ||
1741 | irq - IRQ # (PnP setup) | ||
1742 | mpu_irq - MPU-401 IRQ # (PnP setup) | ||
1743 | dma - DMA # (PnP setup) | ||
1744 | dma2 - 2nd DMA # (PnP setup, -1 to disable) | ||
1745 | joystick - Enable gameport - 0 = disable (default), 1 = enable | ||
1746 | |||
1747 | This module supports multiple cards. | ||
1748 | |||
1749 | The driver requires the firmware loader support on kernel. | ||
1750 | |||
1751 | Module snd-sun-amd7930 (on sparc only) | ||
1752 | -------------------------------------- | ||
1753 | |||
1754 | Module for AMD7930 sound chips found on Sparcs. | ||
1755 | |||
1756 | This module supports multiple cards. | ||
1757 | |||
1758 | Module snd-sun-cs4231 (on sparc only) | ||
1759 | ------------------------------------- | ||
1760 | |||
1761 | Module for CS4231 sound chips found on Sparcs. | ||
1762 | |||
1763 | This module supports multiple cards. | ||
1764 | |||
1765 | Module snd-sun-dbri (on sparc only) | ||
1766 | ----------------------------------- | ||
1767 | |||
1768 | Module for DBRI sound chips found on Sparcs. | ||
1769 | |||
1770 | This module supports multiple cards. | ||
1771 | |||
1772 | Module snd-wavefront | ||
1773 | -------------------- | ||
1774 | |||
1775 | Module for Turtle Beach Maui, Tropez and Tropez+ sound cards. | ||
1776 | |||
1777 | use_cs4232_midi - Use CS4232 MPU-401 interface | ||
1778 | (inaccessibly located inside your computer) | ||
1779 | isapnp - ISA PnP detection - 0 = disable, 1 = enable (default) | ||
1780 | |||
1781 | with isapnp=0, the following options are available: | ||
1782 | |||
1783 | cs4232_pcm_port - Port # for CS4232 PCM interface. | ||
1784 | cs4232_pcm_irq - IRQ # for CS4232 PCM interface (5,7,9,11,12,15). | ||
1785 | cs4232_mpu_port - Port # for CS4232 MPU-401 interface. | ||
1786 | cs4232_mpu_irq - IRQ # for CS4232 MPU-401 interface (9,11,12,15). | ||
1787 | ics2115_port - Port # for ICS2115 | ||
1788 | ics2115_irq - IRQ # for ICS2115 | ||
1789 | fm_port - FM OPL-3 Port # | ||
1790 | dma1 - DMA1 # for CS4232 PCM interface. | ||
1791 | dma2 - DMA2 # for CS4232 PCM interface. | ||
1792 | |||
1793 | The below are options for wavefront_synth features: | ||
1794 | wf_raw - Assume that we need to boot the OS (default:no) | ||
1795 | If yes, then during driver loading, the state of the board is | ||
1796 | ignored, and we reset the board and load the firmware anyway. | ||
1797 | fx_raw - Assume that the FX process needs help (default:yes) | ||
1798 | If false, we'll leave the FX processor in whatever state it is | ||
1799 | when the driver is loaded. The default is to download the | ||
1800 | microprogram and associated coefficients to set it up for | ||
1801 | "default" operation, whatever that means. | ||
1802 | debug_default - Debug parameters for card initialization | ||
1803 | wait_usecs - How long to wait without sleeping, usecs | ||
1804 | (default:150) | ||
1805 | This magic number seems to give pretty optimal throughput | ||
1806 | based on my limited experimentation. | ||
1807 | If you want to play around with it and find a better value, be | ||
1808 | my guest. Remember, the idea is to get a number that causes us | ||
1809 | to just busy wait for as many WaveFront commands as possible, | ||
1810 | without coming up with a number so large that we hog the whole | ||
1811 | CPU. | ||
1812 | Specifically, with this number, out of about 134,000 status | ||
1813 | waits, only about 250 result in a sleep. | ||
1814 | sleep_interval - How long to sleep when waiting for reply | ||
1815 | (default: 100) | ||
1816 | sleep_tries - How many times to try sleeping during a wait | ||
1817 | (default: 50) | ||
1818 | ospath - Pathname to processed ICS2115 OS firmware | ||
1819 | (default:wavefront.os) | ||
1820 | The path name of the ISC2115 OS firmware. In the recent | ||
1821 | version, it's handled via firmware loader framework, so it | ||
1822 | must be installed in the proper path, typically, | ||
1823 | /lib/firmware. | ||
1824 | reset_time - How long to wait for a reset to take effect | ||
1825 | (default:2) | ||
1826 | ramcheck_time - How many seconds to wait for the RAM test | ||
1827 | (default:20) | ||
1828 | osrun_time - How many seconds to wait for the ICS2115 OS | ||
1829 | (default:10) | ||
1830 | |||
1831 | This module supports multiple cards and ISA PnP. | ||
1832 | |||
1833 | Note: the firmware file "wavefront.os" was located in the earlier | ||
1834 | version in /etc. Now it's loaded via firmware loader, and | ||
1835 | must be in the proper firmware path, such as /lib/firmware. | ||
1836 | Copy (or symlink) the file appropriately if you get an error | ||
1837 | regarding firmware downloading after upgrading the kernel. | ||
1838 | |||
1839 | Module snd-sonicvibes | ||
1840 | --------------------- | ||
1841 | |||
1842 | Module for S3 SonicVibes PCI sound cards. | ||
1843 | * PINE Schubert 32 PCI | ||
1844 | |||
1845 | reverb - Reverb Enable - 1 = enable, 0 = disable (default) | ||
1846 | - SoundCard must have onboard SRAM for this. | ||
1847 | mge - Mic Gain Enable - 1 = enable, 0 = disable (default) | ||
1848 | |||
1849 | This module supports multiple cards and autoprobe. | ||
1850 | |||
1851 | Module snd-serial-u16550 | ||
1852 | ------------------------ | ||
1853 | |||
1854 | Module for UART16550A serial MIDI ports. | ||
1855 | |||
1856 | port - port # for UART16550A chip | ||
1857 | irq - IRQ # for UART16550A chip, -1 = poll mode | ||
1858 | speed - speed in bauds (9600,19200,38400,57600,115200) | ||
1859 | 38400 = default | ||
1860 | base - base for divisor in bauds (57600,115200,230400,460800) | ||
1861 | 115200 = default | ||
1862 | outs - number of MIDI ports in a serial port (1-4) | ||
1863 | 1 = default | ||
1864 | adaptor - Type of adaptor. | ||
1865 | 0 = Soundcanvas, 1 = MS-124T, 2 = MS-124W S/A, | ||
1866 | 3 = MS-124W M/B, 4 = Generic | ||
1867 | |||
1868 | This module supports multiple cards. This module does not support autoprobe | ||
1869 | thus the main port must be specified!!! Other options are optional. | ||
1870 | |||
1871 | Module snd-trident | ||
1872 | ------------------ | ||
1873 | |||
1874 | Module for Trident 4DWave DX/NX sound cards. | ||
1875 | * Best Union Miss Melody 4DWave PCI | ||
1876 | * HIS 4DWave PCI | ||
1877 | * Warpspeed ONSpeed 4DWave PCI | ||
1878 | * AzTech PCI 64-Q3D | ||
1879 | * Addonics SV 750 | ||
1880 | * CHIC True Sound 4Dwave | ||
1881 | * Shark Predator4D-PCI | ||
1882 | * Jaton SonicWave 4D | ||
1883 | * SiS SI7018 PCI Audio | ||
1884 | * Hoontech SoundTrack Digital 4DWave NX | ||
1885 | |||
1886 | pcm_channels - max channels (voices) reserved for PCM | ||
1887 | wavetable_size - max wavetable size in kB (4-?kb) | ||
1888 | |||
1889 | This module supports multiple cards and autoprobe. | ||
1890 | |||
1891 | The power-management is supported. | ||
1892 | |||
1893 | Module snd-ua101 | ||
1894 | ---------------- | ||
1895 | |||
1896 | Module for the Edirol UA-101/UA-1000 audio/MIDI interfaces. | ||
1897 | |||
1898 | This module supports multiple devices, autoprobe and hotplugging. | ||
1899 | |||
1900 | Module snd-usb-audio | ||
1901 | -------------------- | ||
1902 | |||
1903 | Module for USB audio and USB MIDI devices. | ||
1904 | |||
1905 | vid - Vendor ID for the device (optional) | ||
1906 | pid - Product ID for the device (optional) | ||
1907 | nrpacks - Max. number of packets per URB (default: 8) | ||
1908 | device_setup - Device specific magic number (optional) | ||
1909 | - Influence depends on the device | ||
1910 | - Default: 0x0000 | ||
1911 | ignore_ctl_error - Ignore any USB-controller regarding mixer | ||
1912 | interface (default: no) | ||
1913 | autoclock - Enable auto-clock selection for UAC2 devices | ||
1914 | (default: yes) | ||
1915 | quirk_alias - Quirk alias list, pass strings like | ||
1916 | "0123abcd:5678beef", which applies the existing | ||
1917 | quirk for the device 5678:beef to a new device | ||
1918 | 0123:abcd. | ||
1919 | |||
1920 | This module supports multiple devices, autoprobe and hotplugging. | ||
1921 | |||
1922 | NB: nrpacks parameter can be modified dynamically via sysfs. | ||
1923 | Don't put the value over 20. Changing via sysfs has no sanity | ||
1924 | check. | ||
1925 | NB: ignore_ctl_error=1 may help when you get an error at accessing | ||
1926 | the mixer element such as URB error -22. This happens on some | ||
1927 | buggy USB device or the controller. | ||
1928 | NB: quirk_alias option is provided only for testing / development. | ||
1929 | If you want to have a proper support, contact to upstream for | ||
1930 | adding the matching quirk in the driver code statically. | ||
1931 | |||
1932 | Module snd-usb-caiaq | ||
1933 | -------------------- | ||
1934 | |||
1935 | Module for caiaq UB audio interfaces, | ||
1936 | * Native Instruments RigKontrol2 | ||
1937 | * Native Instruments Kore Controller | ||
1938 | * Native Instruments Audio Kontrol 1 | ||
1939 | * Native Instruments Audio 8 DJ | ||
1940 | |||
1941 | This module supports multiple devices, autoprobe and hotplugging. | ||
1942 | |||
1943 | Module snd-usb-usx2y | ||
1944 | -------------------- | ||
1945 | |||
1946 | Module for Tascam USB US-122, US-224 and US-428 devices. | ||
1947 | |||
1948 | This module supports multiple devices, autoprobe and hotplugging. | ||
1949 | |||
1950 | Note: you need to load the firmware via usx2yloader utility included | ||
1951 | in alsa-tools and alsa-firmware packages. | ||
1952 | |||
1953 | Module snd-via82xx | ||
1954 | ------------------ | ||
1955 | |||
1956 | Module for AC'97 motherboards based on VIA 82C686A/686B, 8233, | ||
1957 | 8233A, 8233C, 8235, 8237 (south) bridge. | ||
1958 | |||
1959 | mpu_port - 0x300,0x310,0x320,0x330, otherwise obtain BIOS setup | ||
1960 | [VIA686A/686B only] | ||
1961 | joystick - Enable joystick (default off) [VIA686A/686B only] | ||
1962 | ac97_clock - AC'97 codec clock base (default 48000Hz) | ||
1963 | dxs_support - support DXS channels, | ||
1964 | 0 = auto (default), 1 = enable, 2 = disable, | ||
1965 | 3 = 48k only, 4 = no VRA, 5 = enable any sample | ||
1966 | rate and different sample rates on different | ||
1967 | channels | ||
1968 | [VIA8233/C, 8235, 8237 only] | ||
1969 | ac97_quirk - AC'97 workaround for strange hardware | ||
1970 | See "AC97 Quirk Option" section below. | ||
1971 | |||
1972 | This module supports one chip and autoprobe. | ||
1973 | |||
1974 | Note: on some SMP motherboards like MSI 694D the interrupts might | ||
1975 | not be generated properly. In such a case, please try to | ||
1976 | set the SMP (or MPS) version on BIOS to 1.1 instead of | ||
1977 | default value 1.4. Then the interrupt number will be | ||
1978 | assigned under 15. You might also upgrade your BIOS. | ||
1979 | |||
1980 | Note: VIA8233/5/7 (not VIA8233A) can support DXS (direct sound) | ||
1981 | channels as the first PCM. On these channels, up to 4 | ||
1982 | streams can be played at the same time, and the controller | ||
1983 | can perform sample rate conversion with separate rates for | ||
1984 | each channel. | ||
1985 | As default (dxs_support = 0), 48k fixed rate is chosen | ||
1986 | except for the known devices since the output is often | ||
1987 | noisy except for 48k on some mother boards due to the | ||
1988 | bug of BIOS. | ||
1989 | Please try once dxs_support=5 and if it works on other | ||
1990 | sample rates (e.g. 44.1kHz of mp3 playback), please let us | ||
1991 | know the PCI subsystem vendor/device id's (output of | ||
1992 | "lspci -nv"). | ||
1993 | If dxs_support=5 does not work, try dxs_support=4; if it | ||
1994 | doesn't work too, try dxs_support=1. (dxs_support=1 is | ||
1995 | usually for old motherboards. The correct implemented | ||
1996 | board should work with 4 or 5.) If it still doesn't | ||
1997 | work and the default setting is ok, dxs_support=3 is the | ||
1998 | right choice. If the default setting doesn't work at all, | ||
1999 | try dxs_support=2 to disable the DXS channels. | ||
2000 | In any cases, please let us know the result and the | ||
2001 | subsystem vendor/device ids. See "Links and Addresses" | ||
2002 | below. | ||
2003 | |||
2004 | Note: for the MPU401 on VIA823x, use snd-mpu401 driver | ||
2005 | additionally. The mpu_port option is for VIA686 chips only. | ||
2006 | |||
2007 | The power-management is supported. | ||
2008 | |||
2009 | Module snd-via82xx-modem | ||
2010 | ------------------------ | ||
2011 | |||
2012 | Module for VIA82xx AC97 modem | ||
2013 | |||
2014 | ac97_clock - AC'97 codec clock base (default 48000Hz) | ||
2015 | |||
2016 | This module supports one card and autoprobe. | ||
2017 | |||
2018 | Note: The default index value of this module is -2, i.e. the first | ||
2019 | slot is excluded. | ||
2020 | |||
2021 | The power-management is supported. | ||
2022 | |||
2023 | Module snd-virmidi | ||
2024 | ------------------ | ||
2025 | |||
2026 | Module for virtual rawmidi devices. | ||
2027 | This module creates virtual rawmidi devices which communicate | ||
2028 | to the corresponding ALSA sequencer ports. | ||
2029 | |||
2030 | midi_devs - MIDI devices # (1-4, default=4) | ||
2031 | |||
2032 | This module supports multiple cards. | ||
2033 | |||
2034 | Module snd-virtuoso | ||
2035 | ------------------- | ||
2036 | |||
2037 | Module for sound cards based on the Asus AV66/AV100/AV200 chips, | ||
2038 | i.e., Xonar D1, DX, D2, D2X, DS, DSX, Essence ST (Deluxe), | ||
2039 | Essence STX (II), HDAV1.3 (Deluxe), and HDAV1.3 Slim. | ||
2040 | |||
2041 | This module supports autoprobe and multiple cards. | ||
2042 | |||
2043 | Module snd-vx222 | ||
2044 | ---------------- | ||
2045 | |||
2046 | Module for Digigram VX-Pocket VX222, V222 v2 and Mic cards. | ||
2047 | |||
2048 | mic - Enable Microphone on V222 Mic (NYI) | ||
2049 | ibl - Capture IBL size. (default = 0, minimum size) | ||
2050 | |||
2051 | This module supports multiple cards. | ||
2052 | |||
2053 | When the driver is compiled as a module and the hotplug firmware | ||
2054 | is supported, the firmware data is loaded via hotplug automatically. | ||
2055 | Install the necessary firmware files in alsa-firmware package. | ||
2056 | When no hotplug fw loader is available, you need to load the | ||
2057 | firmware via vxloader utility in alsa-tools package. To invoke | ||
2058 | vxloader automatically, add the following to /etc/modprobe.d/alsa.conf | ||
2059 | |||
2060 | install snd-vx222 /sbin/modprobe --first-time -i snd-vx222 && /usr/bin/vxloader | ||
2061 | |||
2062 | (for 2.2/2.4 kernels, add "post-install /usr/bin/vxloader" to | ||
2063 | /etc/modules.conf, instead.) | ||
2064 | IBL size defines the interrupts period for PCM. The smaller size | ||
2065 | gives smaller latency but leads to more CPU consumption, too. | ||
2066 | The size is usually aligned to 126. As default (=0), the smallest | ||
2067 | size is chosen. The possible IBL values can be found in | ||
2068 | /proc/asound/cardX/vx-status proc file. | ||
2069 | |||
2070 | The power-management is supported. | ||
2071 | |||
2072 | Module snd-vxpocket | ||
2073 | ------------------- | ||
2074 | |||
2075 | Module for Digigram VX-Pocket VX2 and 440 PCMCIA cards. | ||
2076 | |||
2077 | ibl - Capture IBL size. (default = 0, minimum size) | ||
2078 | |||
2079 | This module supports multiple cards. The module is compiled only when | ||
2080 | PCMCIA is supported on kernel. | ||
2081 | |||
2082 | With the older 2.6.x kernel, to activate the driver via the card | ||
2083 | manager, you'll need to set up /etc/pcmcia/vxpocket.conf. See the | ||
2084 | sound/pcmcia/vx/vxpocket.c. 2.6.13 or later kernel requires no | ||
2085 | longer require a config file. | ||
2086 | |||
2087 | When the driver is compiled as a module and the hotplug firmware | ||
2088 | is supported, the firmware data is loaded via hotplug automatically. | ||
2089 | Install the necessary firmware files in alsa-firmware package. | ||
2090 | When no hotplug fw loader is available, you need to load the | ||
2091 | firmware via vxloader utility in alsa-tools package. | ||
2092 | |||
2093 | About capture IBL, see the description of snd-vx222 module. | ||
2094 | |||
2095 | Note: snd-vxp440 driver is merged to snd-vxpocket driver since | ||
2096 | ALSA 1.0.10. | ||
2097 | |||
2098 | The power-management is supported. | ||
2099 | |||
2100 | Module snd-ymfpci | ||
2101 | ----------------- | ||
2102 | |||
2103 | Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x). | ||
2104 | |||
2105 | mpu_port - 0x300,0x330,0x332,0x334, 0 (disable) by default, | ||
2106 | 1 (auto-detect for YMF744/754 only) | ||
2107 | fm_port - 0x388,0x398,0x3a0,0x3a8, 0 (disable) by default | ||
2108 | 1 (auto-detect for YMF744/754 only) | ||
2109 | joystick_port - 0x201,0x202,0x204,0x205, 0 (disable) by default, | ||
2110 | 1 (auto-detect) | ||
2111 | rear_switch - enable shared rear/line-in switch (bool) | ||
2112 | |||
2113 | This module supports autoprobe and multiple chips. | ||
2114 | |||
2115 | The power-management is supported. | ||
2116 | |||
2117 | Module snd-pdaudiocf | ||
2118 | -------------------- | ||
2119 | |||
2120 | Module for Sound Core PDAudioCF sound card. | ||
2121 | |||
2122 | The power-management is supported. | ||
2123 | |||
2124 | |||
2125 | AC97 Quirk Option | ||
2126 | ================= | ||
2127 | |||
2128 | The ac97_quirk option is used to enable/override the workaround for | ||
2129 | specific devices on drivers for on-board AC'97 controllers like | ||
2130 | snd-intel8x0. Some hardware have swapped output pins between Master | ||
2131 | and Headphone, or Surround (thanks to confusion of AC'97 | ||
2132 | specifications from version to version :-) | ||
2133 | |||
2134 | The driver provides the auto-detection of known problematic devices, | ||
2135 | but some might be unknown or wrongly detected. In such a case, pass | ||
2136 | the proper value with this option. | ||
2137 | |||
2138 | The following strings are accepted: | ||
2139 | - default Don't override the default setting | ||
2140 | - none Disable the quirk | ||
2141 | - hp_only Bind Master and Headphone controls as a single control | ||
2142 | - swap_hp Swap headphone and master controls | ||
2143 | - swap_surround Swap master and surround controls | ||
2144 | - ad_sharing For AD1985, turn on OMS bit and use headphone | ||
2145 | - alc_jack For ALC65x, turn on the jack sense mode | ||
2146 | - inv_eapd Inverted EAPD implementation | ||
2147 | - mute_led Bind EAPD bit for turning on/off mute LED | ||
2148 | |||
2149 | For backward compatibility, the corresponding integer value -1, 0, | ||
2150 | ... are accepted, too. | ||
2151 | |||
2152 | For example, if "Master" volume control has no effect on your device | ||
2153 | but only "Headphone" does, pass ac97_quirk=hp_only module option. | ||
2154 | |||
2155 | |||
2156 | Configuring Non-ISAPNP Cards | ||
2157 | ============================ | ||
2158 | |||
2159 | When the kernel is configured with ISA-PnP support, the modules | ||
2160 | supporting the isapnp cards will have module options "isapnp". | ||
2161 | If this option is set, *only* the ISA-PnP devices will be probed. | ||
2162 | For probing the non ISA-PnP cards, you have to pass "isapnp=0" option | ||
2163 | together with the proper i/o and irq configuration. | ||
2164 | |||
2165 | When the kernel is configured without ISA-PnP support, isapnp option | ||
2166 | will be not built in. | ||
2167 | |||
2168 | |||
2169 | Module Autoloading Support | ||
2170 | ========================== | ||
2171 | |||
2172 | The ALSA drivers can be loaded automatically on demand by defining | ||
2173 | module aliases. The string 'snd-card-%1' is requested for ALSA native | ||
2174 | devices where %i is sound card number from zero to seven. | ||
2175 | |||
2176 | To auto-load an ALSA driver for OSS services, define the string | ||
2177 | 'sound-slot-%i' where %i means the slot number for OSS, which | ||
2178 | corresponds to the card index of ALSA. Usually, define this | ||
2179 | as the same card module. | ||
2180 | |||
2181 | An example configuration for a single emu10k1 card is like below: | ||
2182 | ----- /etc/modprobe.d/alsa.conf | ||
2183 | alias snd-card-0 snd-emu10k1 | ||
2184 | alias sound-slot-0 snd-emu10k1 | ||
2185 | ----- /etc/modprobe.d/alsa.conf | ||
2186 | |||
2187 | The available number of auto-loaded sound cards depends on the module | ||
2188 | option "cards_limit" of snd module. As default it's set to 1. | ||
2189 | To enable the auto-loading of multiple cards, specify the number of | ||
2190 | sound cards in that option. | ||
2191 | |||
2192 | When multiple cards are available, it'd better to specify the index | ||
2193 | number for each card via module option, too, so that the order of | ||
2194 | cards is kept consistent. | ||
2195 | |||
2196 | An example configuration for two sound cards is like below: | ||
2197 | |||
2198 | ----- /etc/modprobe.d/alsa.conf | ||
2199 | # ALSA portion | ||
2200 | options snd cards_limit=2 | ||
2201 | alias snd-card-0 snd-interwave | ||
2202 | alias snd-card-1 snd-ens1371 | ||
2203 | options snd-interwave index=0 | ||
2204 | options snd-ens1371 index=1 | ||
2205 | # OSS/Free portion | ||
2206 | alias sound-slot-0 snd-interwave | ||
2207 | alias sound-slot-1 snd-ens1371 | ||
2208 | ----- /etc/modprobe.d/alsa.conf | ||
2209 | |||
2210 | In this example, the interwave card is always loaded as the first card | ||
2211 | (index 0) and ens1371 as the second (index 1). | ||
2212 | |||
2213 | Alternative (and new) way to fixate the slot assignment is to use | ||
2214 | "slots" option of snd module. In the case above, specify like the | ||
2215 | following: | ||
2216 | |||
2217 | options snd slots=snd-interwave,snd-ens1371 | ||
2218 | |||
2219 | Then, the first slot (#0) is reserved for snd-interwave driver, and | ||
2220 | the second (#1) for snd-ens1371. You can omit index option in each | ||
2221 | driver if slots option is used (although you can still have them at | ||
2222 | the same time as long as they don't conflict). | ||
2223 | |||
2224 | The slots option is especially useful for avoiding the possible | ||
2225 | hot-plugging and the resultant slot conflict. For example, in the | ||
2226 | case above again, the first two slots are already reserved. If any | ||
2227 | other driver (e.g. snd-usb-audio) is loaded before snd-interwave or | ||
2228 | snd-ens1371, it will be assigned to the third or later slot. | ||
2229 | |||
2230 | When a module name is given with '!', the slot will be given for any | ||
2231 | modules but that name. For example, "slots=!snd-pcsp" will reserve | ||
2232 | the first slot for any modules but snd-pcsp. | ||
2233 | |||
2234 | |||
2235 | ALSA PCM devices to OSS devices mapping | ||
2236 | ======================================= | ||
2237 | |||
2238 | /dev/snd/pcmC0D0[c|p] -> /dev/audio0 (/dev/audio) -> minor 4 | ||
2239 | /dev/snd/pcmC0D0[c|p] -> /dev/dsp0 (/dev/dsp) -> minor 3 | ||
2240 | /dev/snd/pcmC0D1[c|p] -> /dev/adsp0 (/dev/adsp) -> minor 12 | ||
2241 | /dev/snd/pcmC1D0[c|p] -> /dev/audio1 -> minor 4+16 = 20 | ||
2242 | /dev/snd/pcmC1D0[c|p] -> /dev/dsp1 -> minor 3+16 = 19 | ||
2243 | /dev/snd/pcmC1D1[c|p] -> /dev/adsp1 -> minor 12+16 = 28 | ||
2244 | /dev/snd/pcmC2D0[c|p] -> /dev/audio2 -> minor 4+32 = 36 | ||
2245 | /dev/snd/pcmC2D0[c|p] -> /dev/dsp2 -> minor 3+32 = 39 | ||
2246 | /dev/snd/pcmC2D1[c|p] -> /dev/adsp2 -> minor 12+32 = 44 | ||
2247 | |||
2248 | The first number from /dev/snd/pcmC{X}D{Y}[c|p] expression means | ||
2249 | sound card number and second means device number. The ALSA devices | ||
2250 | have either 'c' or 'p' suffix indicating the direction, capture and | ||
2251 | playback, respectively. | ||
2252 | |||
2253 | Please note that the device mapping above may be varied via the module | ||
2254 | options of snd-pcm-oss module. | ||
2255 | |||
2256 | |||
2257 | Proc interfaces (/proc/asound) | ||
2258 | ============================== | ||
2259 | |||
2260 | /proc/asound/card#/pcm#[cp]/oss | ||
2261 | ------------------------------- | ||
2262 | String "erase" - erase all additional information about OSS applications | ||
2263 | String "<app_name> <fragments> <fragment_size> [<options>]" | ||
2264 | |||
2265 | <app_name> - name of application with (higher priority) or without path | ||
2266 | <fragments> - number of fragments or zero if auto | ||
2267 | <fragment_size> - size of fragment in bytes or zero if auto | ||
2268 | <options> - optional parameters | ||
2269 | - disable the application tries to open a pcm device for | ||
2270 | this channel but does not want to use it. | ||
2271 | (Cause a bug or mmap needs) | ||
2272 | It's good for Quake etc... | ||
2273 | - direct don't use plugins | ||
2274 | - block force block mode (rvplayer) | ||
2275 | - non-block force non-block mode | ||
2276 | - whole-frag write only whole fragments (optimization affecting | ||
2277 | playback only) | ||
2278 | - no-silence do not fill silence ahead to avoid clicks | ||
2279 | - buggy-ptr Returns the whitespace blocks in GETOPTR ioctl | ||
2280 | instead of filled blocks | ||
2281 | |||
2282 | Example: echo "x11amp 128 16384" > /proc/asound/card0/pcm0p/oss | ||
2283 | echo "squake 0 0 disable" > /proc/asound/card0/pcm0c/oss | ||
2284 | echo "rvplayer 0 0 block" > /proc/asound/card0/pcm0p/oss | ||
2285 | |||
2286 | |||
2287 | Early Buffer Allocation | ||
2288 | ======================= | ||
2289 | |||
2290 | Some drivers (e.g. hdsp) require the large contiguous buffers, and | ||
2291 | sometimes it's too late to find such spaces when the driver module is | ||
2292 | actually loaded due to memory fragmentation. You can pre-allocate the | ||
2293 | PCM buffers by loading snd-page-alloc module and write commands to its | ||
2294 | proc file in prior, for example, in the early boot stage like | ||
2295 | /etc/init.d/*.local scripts. | ||
2296 | |||
2297 | Reading the proc file /proc/drivers/snd-page-alloc shows the current | ||
2298 | usage of page allocation. In writing, you can send the following | ||
2299 | commands to the snd-page-alloc driver: | ||
2300 | |||
2301 | - add VENDOR DEVICE MASK SIZE BUFFERS | ||
2302 | |||
2303 | VENDOR and DEVICE are PCI vendor and device IDs. They take | ||
2304 | integer numbers (0x prefix is needed for the hex). | ||
2305 | MASK is the PCI DMA mask. Pass 0 if not restricted. | ||
2306 | SIZE is the size of each buffer to allocate. You can pass | ||
2307 | k and m suffix for KB and MB. The max number is 16MB. | ||
2308 | BUFFERS is the number of buffers to allocate. It must be greater | ||
2309 | than 0. The max number is 4. | ||
2310 | |||
2311 | - erase | ||
2312 | |||
2313 | This will erase the all pre-allocated buffers which are not in | ||
2314 | use. | ||
2315 | |||
2316 | |||
2317 | Links and Addresses | ||
2318 | =================== | ||
2319 | |||
2320 | ALSA project homepage | ||
2321 | http://www.alsa-project.org | ||
2322 | |||
2323 | Kernel Bugzilla | ||
2324 | http://bugzilla.kernel.org/ | ||
2325 | |||
2326 | ALSA Developers ML | ||
2327 | mailto:alsa-devel@alsa-project.org | ||
2328 | |||
2329 | alsa-info.sh script | ||
2330 | http://www.alsa-project.org/alsa-info.sh | ||
diff --git a/Documentation/sound/alsa/ControlNames.txt b/Documentation/sound/alsa/ControlNames.txt deleted file mode 100644 index 3fc1cf50d28e..000000000000 --- a/Documentation/sound/alsa/ControlNames.txt +++ /dev/null | |||
@@ -1,107 +0,0 @@ | |||
1 | This document describes standard names of mixer controls. | ||
2 | |||
3 | Syntax: [LOCATION] SOURCE [CHANNEL] [DIRECTION] FUNCTION | ||
4 | |||
5 | DIRECTION: | ||
6 | <nothing> (both directions) | ||
7 | Playback | ||
8 | Capture | ||
9 | Bypass Playback | ||
10 | Bypass Capture | ||
11 | |||
12 | FUNCTION: | ||
13 | Switch (on/off switch) | ||
14 | Volume | ||
15 | Route (route control, hardware specific) | ||
16 | |||
17 | CHANNEL: | ||
18 | <nothing> (channel independent, or applies to all channels) | ||
19 | Front | ||
20 | Surround (rear left/right in 4.0/5.1 surround) | ||
21 | CLFE | ||
22 | Center | ||
23 | LFE | ||
24 | Side (side left/right for 7.1 surround) | ||
25 | |||
26 | LOCATION: (physical location of source) | ||
27 | Front | ||
28 | Rear | ||
29 | Dock (docking station) | ||
30 | Internal | ||
31 | |||
32 | SOURCE: | ||
33 | Master | ||
34 | Master Mono | ||
35 | Hardware Master | ||
36 | Speaker (internal speaker) | ||
37 | Bass Speaker (internal LFE speaker) | ||
38 | Headphone | ||
39 | Line Out | ||
40 | Beep (beep generator) | ||
41 | Phone | ||
42 | Phone Input | ||
43 | Phone Output | ||
44 | Synth | ||
45 | FM | ||
46 | Mic | ||
47 | Headset Mic (mic part of combined headset jack - 4-pin headphone + mic) | ||
48 | Headphone Mic (mic part of either/or - 3-pin headphone or mic) | ||
49 | Line (input only, use "Line Out" for output) | ||
50 | CD | ||
51 | Video | ||
52 | Zoom Video | ||
53 | Aux | ||
54 | PCM | ||
55 | PCM Pan | ||
56 | Loopback | ||
57 | Analog Loopback (D/A -> A/D loopback) | ||
58 | Digital Loopback (playback -> capture loopback - without analog path) | ||
59 | Mono | ||
60 | Mono Output | ||
61 | Multi | ||
62 | ADC | ||
63 | Wave | ||
64 | Music | ||
65 | I2S | ||
66 | IEC958 | ||
67 | HDMI | ||
68 | SPDIF (output only) | ||
69 | SPDIF In | ||
70 | Digital In | ||
71 | HDMI/DP (either HDMI or DisplayPort) | ||
72 | |||
73 | Exceptions (deprecated): | ||
74 | [Analogue|Digital] Capture Source | ||
75 | [Analogue|Digital] Capture Switch (aka input gain switch) | ||
76 | [Analogue|Digital] Capture Volume (aka input gain volume) | ||
77 | [Analogue|Digital] Playback Switch (aka output gain switch) | ||
78 | [Analogue|Digital] Playback Volume (aka output gain volume) | ||
79 | Tone Control - Switch | ||
80 | Tone Control - Bass | ||
81 | Tone Control - Treble | ||
82 | 3D Control - Switch | ||
83 | 3D Control - Center | ||
84 | 3D Control - Depth | ||
85 | 3D Control - Wide | ||
86 | 3D Control - Space | ||
87 | 3D Control - Level | ||
88 | Mic Boost [(?dB)] | ||
89 | |||
90 | PCM interface: | ||
91 | |||
92 | Sample Clock Source { "Word", "Internal", "AutoSync" } | ||
93 | Clock Sync Status { "Lock", "Sync", "No Lock" } | ||
94 | External Rate /* external capture rate */ | ||
95 | Capture Rate /* capture rate taken from external source */ | ||
96 | |||
97 | IEC958 (S/PDIF) interface: | ||
98 | |||
99 | IEC958 [...] [Playback|Capture] Switch /* turn on/off the IEC958 interface */ | ||
100 | IEC958 [...] [Playback|Capture] Volume /* digital volume control */ | ||
101 | IEC958 [...] [Playback|Capture] Default /* default or global value - read/write */ | ||
102 | IEC958 [...] [Playback|Capture] Mask /* consumer and professional mask */ | ||
103 | IEC958 [...] [Playback|Capture] Con Mask /* consumer mask */ | ||
104 | IEC958 [...] [Playback|Capture] Pro Mask /* professional mask */ | ||
105 | IEC958 [...] [Playback|Capture] PCM Stream /* the settings assigned to a PCM stream */ | ||
106 | IEC958 Q-subcode [Playback|Capture] Default /* Q-subcode bits */ | ||
107 | IEC958 Preamble [Playback|Capture] Default /* burst preamble words (4*16bits) */ | ||
diff --git a/Documentation/sound/alsa/HD-Audio-Models.txt b/Documentation/sound/alsa/HD-Audio-Models.txt deleted file mode 100644 index ec099d4343f2..000000000000 --- a/Documentation/sound/alsa/HD-Audio-Models.txt +++ /dev/null | |||
@@ -1,324 +0,0 @@ | |||
1 | Model name Description | ||
2 | ---------- ----------- | ||
3 | ALC880 | ||
4 | ====== | ||
5 | 3stack 3-jack in back and a headphone out | ||
6 | 3stack-digout 3-jack in back, a HP out and a SPDIF out | ||
7 | 5stack 5-jack in back, 2-jack in front | ||
8 | 5stack-digout 5-jack in back, 2-jack in front, a SPDIF out | ||
9 | 6stack 6-jack in back, 2-jack in front | ||
10 | 6stack-digout 6-jack with a SPDIF out | ||
11 | |||
12 | ALC260 | ||
13 | ====== | ||
14 | gpio1 Enable GPIO1 | ||
15 | coef Enable EAPD via COEF table | ||
16 | fujitsu Quirk for FSC S7020 | ||
17 | fujitsu-jwse Quirk for FSC S7020 with jack modes and HP mic support | ||
18 | |||
19 | ALC262 | ||
20 | ====== | ||
21 | inv-dmic Inverted internal mic workaround | ||
22 | |||
23 | ALC267/268 | ||
24 | ========== | ||
25 | inv-dmic Inverted internal mic workaround | ||
26 | hp-eapd Disable HP EAPD on NID 0x15 | ||
27 | |||
28 | ALC22x/23x/25x/269/27x/28x/29x (and vendor-specific ALC3xxx models) | ||
29 | ====== | ||
30 | laptop-amic Laptops with analog-mic input | ||
31 | laptop-dmic Laptops with digital-mic input | ||
32 | alc269-dmic Enable ALC269(VA) digital mic workaround | ||
33 | alc271-dmic Enable ALC271X digital mic workaround | ||
34 | inv-dmic Inverted internal mic workaround | ||
35 | headset-mic Indicates a combined headset (headphone+mic) jack | ||
36 | headset-mode More comprehensive headset support for ALC269 & co | ||
37 | headset-mode-no-hp-mic Headset mode support without headphone mic | ||
38 | lenovo-dock Enables docking station I/O for some Lenovos | ||
39 | hp-gpio-led GPIO LED support on HP laptops | ||
40 | dell-headset-multi Headset jack, which can also be used as mic-in | ||
41 | dell-headset-dock Headset jack (without mic-in), and also dock I/O | ||
42 | alc283-dac-wcaps Fixups for Chromebook with ALC283 | ||
43 | alc283-sense-combo Combo jack sensing on ALC283 | ||
44 | tpt440-dock Pin configs for Lenovo Thinkpad Dock support | ||
45 | |||
46 | ALC66x/67x/892 | ||
47 | ============== | ||
48 | mario Chromebook mario model fixup | ||
49 | asus-mode1 ASUS | ||
50 | asus-mode2 ASUS | ||
51 | asus-mode3 ASUS | ||
52 | asus-mode4 ASUS | ||
53 | asus-mode5 ASUS | ||
54 | asus-mode6 ASUS | ||
55 | asus-mode7 ASUS | ||
56 | asus-mode8 ASUS | ||
57 | inv-dmic Inverted internal mic workaround | ||
58 | dell-headset-multi Headset jack, which can also be used as mic-in | ||
59 | |||
60 | ALC680 | ||
61 | ====== | ||
62 | N/A | ||
63 | |||
64 | ALC88x/898/1150 | ||
65 | ====================== | ||
66 | acer-aspire-4930g Acer Aspire 4930G/5930G/6530G/6930G/7730G | ||
67 | acer-aspire-8930g Acer Aspire 8330G/6935G | ||
68 | acer-aspire Acer Aspire others | ||
69 | inv-dmic Inverted internal mic workaround | ||
70 | no-primary-hp VAIO Z/VGC-LN51JGB workaround (for fixed speaker DAC) | ||
71 | |||
72 | ALC861/660 | ||
73 | ========== | ||
74 | N/A | ||
75 | |||
76 | ALC861VD/660VD | ||
77 | ============== | ||
78 | N/A | ||
79 | |||
80 | CMI9880 | ||
81 | ======= | ||
82 | minimal 3-jack in back | ||
83 | min_fp 3-jack in back, 2-jack in front | ||
84 | full 6-jack in back, 2-jack in front | ||
85 | full_dig 6-jack in back, 2-jack in front, SPDIF I/O | ||
86 | allout 5-jack in back, 2-jack in front, SPDIF out | ||
87 | auto auto-config reading BIOS (default) | ||
88 | |||
89 | AD1882 / AD1882A | ||
90 | ================ | ||
91 | 3stack 3-stack mode | ||
92 | 3stack-automute 3-stack with automute front HP (default) | ||
93 | 6stack 6-stack mode | ||
94 | |||
95 | AD1884A / AD1883 / AD1984A / AD1984B | ||
96 | ==================================== | ||
97 | desktop 3-stack desktop (default) | ||
98 | laptop laptop with HP jack sensing | ||
99 | mobile mobile devices with HP jack sensing | ||
100 | thinkpad Lenovo Thinkpad X300 | ||
101 | touchsmart HP Touchsmart | ||
102 | |||
103 | AD1884 | ||
104 | ====== | ||
105 | N/A | ||
106 | |||
107 | AD1981 | ||
108 | ====== | ||
109 | basic 3-jack (default) | ||
110 | hp HP nx6320 | ||
111 | thinkpad Lenovo Thinkpad T60/X60/Z60 | ||
112 | toshiba Toshiba U205 | ||
113 | |||
114 | AD1983 | ||
115 | ====== | ||
116 | N/A | ||
117 | |||
118 | AD1984 | ||
119 | ====== | ||
120 | basic default configuration | ||
121 | thinkpad Lenovo Thinkpad T61/X61 | ||
122 | dell_desktop Dell T3400 | ||
123 | |||
124 | AD1986A | ||
125 | ======= | ||
126 | 3stack 3-stack, shared surrounds | ||
127 | laptop 2-channel only (FSC V2060, Samsung M50) | ||
128 | laptop-imic 2-channel with built-in mic | ||
129 | eapd Turn on EAPD constantly | ||
130 | |||
131 | AD1988/AD1988B/AD1989A/AD1989B | ||
132 | ============================== | ||
133 | 6stack 6-jack | ||
134 | 6stack-dig ditto with SPDIF | ||
135 | 3stack 3-jack | ||
136 | 3stack-dig ditto with SPDIF | ||
137 | laptop 3-jack with hp-jack automute | ||
138 | laptop-dig ditto with SPDIF | ||
139 | auto auto-config reading BIOS (default) | ||
140 | |||
141 | Conexant 5045 | ||
142 | ============= | ||
143 | laptop-hpsense Laptop with HP sense (old model laptop) | ||
144 | laptop-micsense Laptop with Mic sense (old model fujitsu) | ||
145 | laptop-hpmicsense Laptop with HP and Mic senses | ||
146 | benq Benq R55E | ||
147 | laptop-hp530 HP 530 laptop | ||
148 | test for testing/debugging purpose, almost all controls | ||
149 | can be adjusted. Appearing only when compiled with | ||
150 | $CONFIG_SND_DEBUG=y | ||
151 | |||
152 | Conexant 5047 | ||
153 | ============= | ||
154 | laptop Basic Laptop config | ||
155 | laptop-hp Laptop config for some HP models (subdevice 30A5) | ||
156 | laptop-eapd Laptop config with EAPD support | ||
157 | test for testing/debugging purpose, almost all controls | ||
158 | can be adjusted. Appearing only when compiled with | ||
159 | $CONFIG_SND_DEBUG=y | ||
160 | |||
161 | Conexant 5051 | ||
162 | ============= | ||
163 | laptop Basic Laptop config (default) | ||
164 | hp HP Spartan laptop | ||
165 | hp-dv6736 HP dv6736 | ||
166 | hp-f700 HP Compaq Presario F700 | ||
167 | ideapad Lenovo IdeaPad laptop | ||
168 | toshiba Toshiba Satellite M300 | ||
169 | |||
170 | Conexant 5066 | ||
171 | ============= | ||
172 | laptop Basic Laptop config (default) | ||
173 | hp-laptop HP laptops, e g G60 | ||
174 | asus Asus K52JU, Lenovo G560 | ||
175 | dell-laptop Dell laptops | ||
176 | dell-vostro Dell Vostro | ||
177 | olpc-xo-1_5 OLPC XO 1.5 | ||
178 | ideapad Lenovo IdeaPad U150 | ||
179 | thinkpad Lenovo Thinkpad | ||
180 | |||
181 | STAC9200 | ||
182 | ======== | ||
183 | ref Reference board | ||
184 | oqo OQO Model 2 | ||
185 | dell-d21 Dell (unknown) | ||
186 | dell-d22 Dell (unknown) | ||
187 | dell-d23 Dell (unknown) | ||
188 | dell-m21 Dell Inspiron 630m, Dell Inspiron 640m | ||
189 | dell-m22 Dell Latitude D620, Dell Latitude D820 | ||
190 | dell-m23 Dell XPS M1710, Dell Precision M90 | ||
191 | dell-m24 Dell Latitude 120L | ||
192 | dell-m25 Dell Inspiron E1505n | ||
193 | dell-m26 Dell Inspiron 1501 | ||
194 | dell-m27 Dell Inspiron E1705/9400 | ||
195 | gateway-m4 Gateway laptops with EAPD control | ||
196 | gateway-m4-2 Gateway laptops with EAPD control | ||
197 | panasonic Panasonic CF-74 | ||
198 | auto BIOS setup (default) | ||
199 | |||
200 | STAC9205/9254 | ||
201 | ============= | ||
202 | ref Reference board | ||
203 | dell-m42 Dell (unknown) | ||
204 | dell-m43 Dell Precision | ||
205 | dell-m44 Dell Inspiron | ||
206 | eapd Keep EAPD on (e.g. Gateway T1616) | ||
207 | auto BIOS setup (default) | ||
208 | |||
209 | STAC9220/9221 | ||
210 | ============= | ||
211 | ref Reference board | ||
212 | 3stack D945 3stack | ||
213 | 5stack D945 5stack + SPDIF | ||
214 | intel-mac-v1 Intel Mac Type 1 | ||
215 | intel-mac-v2 Intel Mac Type 2 | ||
216 | intel-mac-v3 Intel Mac Type 3 | ||
217 | intel-mac-v4 Intel Mac Type 4 | ||
218 | intel-mac-v5 Intel Mac Type 5 | ||
219 | intel-mac-auto Intel Mac (detect type according to subsystem id) | ||
220 | macmini Intel Mac Mini (equivalent with type 3) | ||
221 | macbook Intel Mac Book (eq. type 5) | ||
222 | macbook-pro-v1 Intel Mac Book Pro 1st generation (eq. type 3) | ||
223 | macbook-pro Intel Mac Book Pro 2nd generation (eq. type 3) | ||
224 | imac-intel Intel iMac (eq. type 2) | ||
225 | imac-intel-20 Intel iMac (newer version) (eq. type 3) | ||
226 | ecs202 ECS/PC chips | ||
227 | dell-d81 Dell (unknown) | ||
228 | dell-d82 Dell (unknown) | ||
229 | dell-m81 Dell (unknown) | ||
230 | dell-m82 Dell XPS M1210 | ||
231 | auto BIOS setup (default) | ||
232 | |||
233 | STAC9202/9250/9251 | ||
234 | ================== | ||
235 | ref Reference board, base config | ||
236 | m1 Some Gateway MX series laptops (NX560XL) | ||
237 | m1-2 Some Gateway MX series laptops (MX6453) | ||
238 | m2 Some Gateway MX series laptops (M255) | ||
239 | m2-2 Some Gateway MX series laptops | ||
240 | m3 Some Gateway MX series laptops | ||
241 | m5 Some Gateway MX series laptops (MP6954) | ||
242 | m6 Some Gateway NX series laptops | ||
243 | auto BIOS setup (default) | ||
244 | |||
245 | STAC9227/9228/9229/927x | ||
246 | ======================= | ||
247 | ref Reference board | ||
248 | ref-no-jd Reference board without HP/Mic jack detection | ||
249 | 3stack D965 3stack | ||
250 | 5stack D965 5stack + SPDIF | ||
251 | 5stack-no-fp D965 5stack without front panel | ||
252 | dell-3stack Dell Dimension E520 | ||
253 | dell-bios Fixes with Dell BIOS setup | ||
254 | dell-bios-amic Fixes with Dell BIOS setup including analog mic | ||
255 | volknob Fixes with volume-knob widget 0x24 | ||
256 | auto BIOS setup (default) | ||
257 | |||
258 | STAC92HD71B* | ||
259 | ============ | ||
260 | ref Reference board | ||
261 | dell-m4-1 Dell desktops | ||
262 | dell-m4-2 Dell desktops | ||
263 | dell-m4-3 Dell desktops | ||
264 | hp-m4 HP mini 1000 | ||
265 | hp-dv5 HP dv series | ||
266 | hp-hdx HP HDX series | ||
267 | hp-dv4-1222nr HP dv4-1222nr (with LED support) | ||
268 | auto BIOS setup (default) | ||
269 | |||
270 | STAC92HD73* | ||
271 | =========== | ||
272 | ref Reference board | ||
273 | no-jd BIOS setup but without jack-detection | ||
274 | intel Intel DG45* mobos | ||
275 | dell-m6-amic Dell desktops/laptops with analog mics | ||
276 | dell-m6-dmic Dell desktops/laptops with digital mics | ||
277 | dell-m6 Dell desktops/laptops with both type of mics | ||
278 | dell-eq Dell desktops/laptops | ||
279 | alienware Alienware M17x | ||
280 | auto BIOS setup (default) | ||
281 | |||
282 | STAC92HD83* | ||
283 | =========== | ||
284 | ref Reference board | ||
285 | mic-ref Reference board with power management for ports | ||
286 | dell-s14 Dell laptop | ||
287 | dell-vostro-3500 Dell Vostro 3500 laptop | ||
288 | hp-dv7-4000 HP dv-7 4000 | ||
289 | hp_cNB11_intquad HP CNB models with 4 speakers | ||
290 | hp-zephyr HP Zephyr | ||
291 | hp-led HP with broken BIOS for mute LED | ||
292 | hp-inv-led HP with broken BIOS for inverted mute LED | ||
293 | hp-mic-led HP with mic-mute LED | ||
294 | headset-jack Dell Latitude with a 4-pin headset jack | ||
295 | hp-envy-bass Pin fixup for HP Envy bass speaker (NID 0x0f) | ||
296 | hp-envy-ts-bass Pin fixup for HP Envy TS bass speaker (NID 0x10) | ||
297 | hp-bnb13-eq Hardware equalizer setup for HP laptops | ||
298 | auto BIOS setup (default) | ||
299 | |||
300 | STAC92HD95 | ||
301 | ========== | ||
302 | hp-led LED support for HP laptops | ||
303 | hp-bass Bass HPF setup for HP Spectre 13 | ||
304 | |||
305 | STAC9872 | ||
306 | ======== | ||
307 | vaio VAIO laptop without SPDIF | ||
308 | auto BIOS setup (default) | ||
309 | |||
310 | Cirrus Logic CS4206/4207 | ||
311 | ======================== | ||
312 | mbp55 MacBook Pro 5,5 | ||
313 | imac27 IMac 27 Inch | ||
314 | auto BIOS setup (default) | ||
315 | |||
316 | Cirrus Logic CS4208 | ||
317 | =================== | ||
318 | mba6 MacBook Air 6,1 and 6,2 | ||
319 | gpio0 Enable GPIO 0 amp | ||
320 | auto BIOS setup (default) | ||
321 | |||
322 | VIA VT17xx/VT18xx/VT20xx | ||
323 | ======================== | ||
324 | auto BIOS setup (default) | ||
diff --git a/Documentation/sound/alsa/VIA82xx-mixer.txt b/Documentation/sound/alsa/VIA82xx-mixer.txt deleted file mode 100644 index 1b0ac06ba95d..000000000000 --- a/Documentation/sound/alsa/VIA82xx-mixer.txt +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | |||
2 | VIA82xx mixer | ||
3 | ============= | ||
4 | |||
5 | On many VIA82xx boards, the 'Input Source Select' mixer control does not work. | ||
6 | Setting it to 'Input2' on such boards will cause recording to hang, or fail | ||
7 | with EIO (input/output error) via OSS emulation. This control should be left | ||
8 | at 'Input1' for such cards. | ||
diff --git a/Documentation/sound/alsa/alsa-parameters.txt b/Documentation/sound/alsa/alsa-parameters.txt deleted file mode 100644 index 72eced86f035..000000000000 --- a/Documentation/sound/alsa/alsa-parameters.txt +++ /dev/null | |||
@@ -1,135 +0,0 @@ | |||
1 | ALSA Kernel Parameters | ||
2 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
3 | |||
4 | See Documentation/admin-guide/kernel-parameters.rst for general information on | ||
5 | specifying module parameters. | ||
6 | |||
7 | This document may not be entirely up to date and comprehensive. The command | ||
8 | "modinfo -p ${modulename}" shows a current list of all parameters of a loadable | ||
9 | module. Loadable modules, after being loaded into the running kernel, also | ||
10 | reveal their parameters in /sys/module/${modulename}/parameters/. Some of these | ||
11 | parameters may be changed at runtime by the command | ||
12 | "echo -n ${value} > /sys/module/${modulename}/parameters/${parm}". | ||
13 | |||
14 | |||
15 | snd-ad1816a= [HW,ALSA] | ||
16 | |||
17 | snd-ad1848= [HW,ALSA] | ||
18 | |||
19 | snd-ali5451= [HW,ALSA] | ||
20 | |||
21 | snd-als100= [HW,ALSA] | ||
22 | |||
23 | snd-als4000= [HW,ALSA] | ||
24 | |||
25 | snd-azt2320= [HW,ALSA] | ||
26 | |||
27 | snd-cmi8330= [HW,ALSA] | ||
28 | |||
29 | snd-cmipci= [HW,ALSA] | ||
30 | |||
31 | snd-cs4231= [HW,ALSA] | ||
32 | |||
33 | snd-cs4232= [HW,ALSA] | ||
34 | |||
35 | snd-cs4236= [HW,ALSA] | ||
36 | |||
37 | snd-cs4281= [HW,ALSA] | ||
38 | |||
39 | snd-cs46xx= [HW,ALSA] | ||
40 | |||
41 | snd-dt019x= [HW,ALSA] | ||
42 | |||
43 | snd-dummy= [HW,ALSA] | ||
44 | |||
45 | snd-emu10k1= [HW,ALSA] | ||
46 | |||
47 | snd-ens1370= [HW,ALSA] | ||
48 | |||
49 | snd-ens1371= [HW,ALSA] | ||
50 | |||
51 | snd-es968= [HW,ALSA] | ||
52 | |||
53 | snd-es1688= [HW,ALSA] | ||
54 | |||
55 | snd-es18xx= [HW,ALSA] | ||
56 | |||
57 | snd-es1938= [HW,ALSA] | ||
58 | |||
59 | snd-es1968= [HW,ALSA] | ||
60 | |||
61 | snd-fm801= [HW,ALSA] | ||
62 | |||
63 | snd-gusclassic= [HW,ALSA] | ||
64 | |||
65 | snd-gusextreme= [HW,ALSA] | ||
66 | |||
67 | snd-gusmax= [HW,ALSA] | ||
68 | |||
69 | snd-hdsp= [HW,ALSA] | ||
70 | |||
71 | snd-ice1712= [HW,ALSA] | ||
72 | |||
73 | snd-intel8x0= [HW,ALSA] | ||
74 | |||
75 | snd-interwave= [HW,ALSA] | ||
76 | |||
77 | snd-interwave-stb= | ||
78 | [HW,ALSA] | ||
79 | |||
80 | snd-korg1212= [HW,ALSA] | ||
81 | |||
82 | snd-maestro3= [HW,ALSA] | ||
83 | |||
84 | snd-mpu401= [HW,ALSA] | ||
85 | |||
86 | snd-mtpav= [HW,ALSA] | ||
87 | |||
88 | snd-nm256= [HW,ALSA] | ||
89 | |||
90 | snd-opl3sa2= [HW,ALSA] | ||
91 | |||
92 | snd-opti92x-ad1848= | ||
93 | [HW,ALSA] | ||
94 | |||
95 | snd-opti92x-cs4231= | ||
96 | [HW,ALSA] | ||
97 | |||
98 | snd-opti93x= [HW,ALSA] | ||
99 | |||
100 | snd-pmac= [HW,ALSA] | ||
101 | |||
102 | snd-rme32= [HW,ALSA] | ||
103 | |||
104 | snd-rme96= [HW,ALSA] | ||
105 | |||
106 | snd-rme9652= [HW,ALSA] | ||
107 | |||
108 | snd-sb8= [HW,ALSA] | ||
109 | |||
110 | snd-sb16= [HW,ALSA] | ||
111 | |||
112 | snd-sbawe= [HW,ALSA] | ||
113 | |||
114 | snd-serial= [HW,ALSA] | ||
115 | |||
116 | snd-sgalaxy= [HW,ALSA] | ||
117 | |||
118 | snd-sonicvibes= [HW,ALSA] | ||
119 | |||
120 | snd-sun-amd7930= | ||
121 | [HW,ALSA] | ||
122 | |||
123 | snd-sun-cs4231= [HW,ALSA] | ||
124 | |||
125 | snd-trident= [HW,ALSA] | ||
126 | |||
127 | snd-usb-audio= [HW,ALSA,USB] | ||
128 | |||
129 | snd-via82xx= [HW,ALSA] | ||
130 | |||
131 | snd-virmidi= [HW,ALSA] | ||
132 | |||
133 | snd-wavefront= [HW,ALSA] | ||
134 | |||
135 | snd-ymfpci= [HW,ALSA] | ||
diff --git a/Documentation/sound/alsa/seq_oss.html b/Documentation/sound/alsa/seq_oss.html deleted file mode 100644 index 9663b45f6fde..000000000000 --- a/Documentation/sound/alsa/seq_oss.html +++ /dev/null | |||
@@ -1,409 +0,0 @@ | |||
1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> | ||
2 | <HTML> | ||
3 | <HEAD> | ||
4 | <TITLE>OSS Sequencer Emulation on ALSA</TITLE> | ||
5 | </HEAD> | ||
6 | <BODY> | ||
7 | |||
8 | <CENTER> | ||
9 | <H1> | ||
10 | |||
11 | <HR WIDTH="100%"></H1></CENTER> | ||
12 | |||
13 | <CENTER> | ||
14 | <H1> | ||
15 | OSS Sequencer Emulation on ALSA</H1></CENTER> | ||
16 | |||
17 | <HR WIDTH="100%"> | ||
18 | <P>Copyright (c) 1998,1999 by Takashi Iwai | ||
19 | <TT><A HREF="mailto:iwai@ww.uni-erlangen.de"><iwai@ww.uni-erlangen.de></A></TT> | ||
20 | <P>ver.0.1.8; Nov. 16, 1999 | ||
21 | <H2> | ||
22 | |||
23 | <HR WIDTH="100%"></H2> | ||
24 | |||
25 | <H2> | ||
26 | 1. Description</H2> | ||
27 | This directory contains the OSS sequencer emulation driver on ALSA. Note | ||
28 | that this program is still in the development state. | ||
29 | <P>What this does - it provides the emulation of the OSS sequencer, access | ||
30 | via | ||
31 | <TT>/dev/sequencer</TT> and <TT>/dev/music</TT> devices. | ||
32 | The most of applications using OSS can run if the appropriate ALSA | ||
33 | sequencer is prepared. | ||
34 | <P>The following features are emulated by this driver: | ||
35 | <UL> | ||
36 | <LI> | ||
37 | Normal sequencer and MIDI events:</LI> | ||
38 | |||
39 | <BR>They are converted to the ALSA sequencer events, and sent to the corresponding | ||
40 | port. | ||
41 | <LI> | ||
42 | Timer events:</LI> | ||
43 | |||
44 | <BR>The timer is not selectable by ioctl. The control rate is fixed to | ||
45 | 100 regardless of HZ. That is, even on Alpha system, a tick is always | ||
46 | 1/100 second. The base rate and tempo can be changed in <TT>/dev/music</TT>. | ||
47 | |||
48 | <LI> | ||
49 | Patch loading:</LI> | ||
50 | |||
51 | <BR>It purely depends on the synth drivers whether it's supported since | ||
52 | the patch loading is realized by callback to the synth driver. | ||
53 | <LI> | ||
54 | I/O controls:</LI> | ||
55 | |||
56 | <BR>Most of controls are accepted. Some controls | ||
57 | are dependent on the synth driver, as well as even on original OSS.</UL> | ||
58 | Furthermore, you can find the following advanced features: | ||
59 | <UL> | ||
60 | <LI> | ||
61 | Better queue mechanism:</LI> | ||
62 | |||
63 | <BR>The events are queued before processing them. | ||
64 | <LI> | ||
65 | Multiple applications:</LI> | ||
66 | |||
67 | <BR>You can run two or more applications simultaneously (even for OSS sequencer)! | ||
68 | However, each MIDI device is exclusive - that is, if a MIDI device is opened | ||
69 | once by some application, other applications can't use it. No such a restriction | ||
70 | in synth devices. | ||
71 | <LI> | ||
72 | Real-time event processing:</LI> | ||
73 | |||
74 | <BR>The events can be processed in real time without using out of bound | ||
75 | ioctl. To switch to real-time mode, send ABSTIME 0 event. The followed | ||
76 | events will be processed in real-time without queued. To switch off the | ||
77 | real-time mode, send RELTIME 0 event. | ||
78 | <LI> | ||
79 | <TT>/proc</TT> interface:</LI> | ||
80 | |||
81 | <BR>The status of applications and devices can be shown via <TT>/proc/asound/seq/oss</TT> | ||
82 | at any time. In the later version, configuration will be changed via <TT>/proc</TT> | ||
83 | interface, too.</UL> | ||
84 | |||
85 | <H2> | ||
86 | 2. Installation</H2> | ||
87 | Run configure script with both sequencer support (<TT>--with-sequencer=yes</TT>) | ||
88 | and OSS emulation (<TT>--with-oss=yes</TT>) options. A module <TT>snd-seq-oss.o</TT> | ||
89 | will be created. If the synth module of your sound card supports for OSS | ||
90 | emulation (so far, only Emu8000 driver), this module will be loaded automatically. | ||
91 | Otherwise, you need to load this module manually. | ||
92 | <P>At beginning, this module probes all the MIDI ports which have been | ||
93 | already connected to the sequencer. Once after that, the creation and deletion | ||
94 | of ports are watched by announcement mechanism of ALSA sequencer. | ||
95 | <P>The available synth and MIDI devices can be found in proc interface. | ||
96 | Run "<TT>cat /proc/asound/seq/oss</TT>", and check the devices. For example, | ||
97 | if you use an AWE64 card, you'll see like the following: | ||
98 | <PRE> OSS sequencer emulation version 0.1.8 | ||
99 | ALSA client number 63 | ||
100 | ALSA receiver port 0 | ||
101 | |||
102 | Number of applications: 0 | ||
103 | |||
104 | Number of synth devices: 1 | ||
105 | |||
106 | synth 0: [EMU8000] | ||
107 | type 0x1 : subtype 0x20 : voices 32 | ||
108 | capabilties : ioctl enabled / load_patch enabled | ||
109 | |||
110 | Number of MIDI devices: 3 | ||
111 | |||
112 | midi 0: [Emu8000 Port-0] ALSA port 65:0 | ||
113 | capability write / opened none | ||
114 | |||
115 | midi 1: [Emu8000 Port-1] ALSA port 65:1 | ||
116 | capability write / opened none | ||
117 | |||
118 | midi 2: [0: MPU-401 (UART)] ALSA port 64:0 | ||
119 | capability read/write / opened none</PRE> | ||
120 | Note that the device number may be different from the information of | ||
121 | <TT>/proc/asound/oss-devices</TT> | ||
122 | or ones of the original OSS driver. Use the device number listed in <TT>/proc/asound/seq/oss</TT> | ||
123 | to play via OSS sequencer emulation. | ||
124 | <H2> | ||
125 | 3. Using Synthesizer Devices</H2> | ||
126 | Run your favorite program. I've tested playmidi-2.4, awemidi-0.4.3, gmod-3.1 | ||
127 | and xmp-1.1.5. You can load samples via <TT>/dev/sequencer</TT> like sfxload, | ||
128 | too. | ||
129 | <P>If the lowlevel driver supports multiple access to synth devices (like | ||
130 | Emu8000 driver), two or more applications are allowed to run at the same | ||
131 | time. | ||
132 | <H2> | ||
133 | 4. Using MIDI Devices</H2> | ||
134 | So far, only MIDI output was tested. MIDI input was not checked at all, | ||
135 | but hopefully it will work. Use the device number listed in <TT>/proc/asound/seq/oss</TT>. | ||
136 | Be aware that these numbers are mostly different from the list in | ||
137 | <TT>/proc/asound/oss-devices</TT>. | ||
138 | <H2> | ||
139 | 5. Module Options</H2> | ||
140 | The following module options are available: | ||
141 | <UL> | ||
142 | <LI> | ||
143 | <TT>maxqlen</TT></LI> | ||
144 | |||
145 | <BR>specifies the maximum read/write queue length. This queue is private | ||
146 | for OSS sequencer, so that it is independent from the queue length of ALSA | ||
147 | sequencer. Default value is 1024. | ||
148 | <LI> | ||
149 | <TT>seq_oss_debug</TT></LI> | ||
150 | |||
151 | <BR>specifies the debug level and accepts zero (= no debug message) or | ||
152 | positive integer. Default value is 0.</UL> | ||
153 | |||
154 | <H2> | ||
155 | 6. Queue Mechanism</H2> | ||
156 | OSS sequencer emulation uses an ALSA priority queue. The | ||
157 | events from <TT>/dev/sequencer</TT> are processed and put onto the queue | ||
158 | specified by module option. | ||
159 | <P>All the events from <TT>/dev/sequencer</TT> are parsed at beginning. | ||
160 | The timing events are also parsed at this moment, so that the events may | ||
161 | be processed in real-time. Sending an event ABSTIME 0 switches the operation | ||
162 | mode to real-time mode, and sending an event RELTIME 0 switches it off. | ||
163 | In the real-time mode, all events are dispatched immediately. | ||
164 | <P>The queued events are dispatched to the corresponding ALSA sequencer | ||
165 | ports after scheduled time by ALSA sequencer dispatcher. | ||
166 | <P>If the write-queue is full, the application sleeps until a certain amount | ||
167 | (as default one half) becomes empty in blocking mode. The synchronization | ||
168 | to write timing was implemented, too. | ||
169 | <P>The input from MIDI devices or echo-back events are stored on read FIFO | ||
170 | queue. If application reads <TT>/dev/sequencer</TT> in blocking mode, the | ||
171 | process will be awaked. | ||
172 | |||
173 | <H2> | ||
174 | 7. Interface to Synthesizer Device</H2> | ||
175 | |||
176 | <H3> | ||
177 | 7.1. Registration</H3> | ||
178 | To register an OSS synthesizer device, use <TT>snd_seq_oss_synth_register</TT> | ||
179 | function. | ||
180 | <PRE>int snd_seq_oss_synth_register(char *name, int type, int subtype, int nvoices, | ||
181 | snd_seq_oss_callback_t *oper, void *private_data)</PRE> | ||
182 | The arguments <TT>name</TT>, <TT>type</TT>, <TT>subtype</TT> and | ||
183 | <TT>nvoices</TT> | ||
184 | are used for making the appropriate synth_info structure for ioctl. The | ||
185 | return value is an index number of this device. This index must be remembered | ||
186 | for unregister. If registration is failed, -errno will be returned. | ||
187 | <P>To release this device, call <TT>snd_seq_oss_synth_unregister function</TT>: | ||
188 | <PRE>int snd_seq_oss_synth_unregister(int index),</PRE> | ||
189 | where the <TT>index</TT> is the index number returned by register function. | ||
190 | <H3> | ||
191 | 7.2. Callbacks</H3> | ||
192 | OSS synthesizer devices have capability for sample downloading and ioctls | ||
193 | like sample reset. In OSS emulation, these special features are realized | ||
194 | by using callbacks. The registration argument oper is used to specify these | ||
195 | callbacks. The following callback functions must be defined: | ||
196 | <PRE>snd_seq_oss_callback_t: | ||
197 | int (*open)(snd_seq_oss_arg_t *p, void *closure); | ||
198 | int (*close)(snd_seq_oss_arg_t *p); | ||
199 | int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg); | ||
200 | int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char *buf, int offs, int count); | ||
201 | int (*reset)(snd_seq_oss_arg_t *p); | ||
202 | Except for <TT>open</TT> and <TT>close</TT> callbacks, they are allowed | ||
203 | to be NULL. | ||
204 | <P>Each callback function takes the argument type snd_seq_oss_arg_t as the | ||
205 | first argument. | ||
206 | <PRE>struct snd_seq_oss_arg_t { | ||
207 | int app_index; | ||
208 | int file_mode; | ||
209 | int seq_mode; | ||
210 | snd_seq_addr_t addr; | ||
211 | void *private_data; | ||
212 | int event_passing; | ||
213 | };</PRE> | ||
214 | The first three fields, <TT>app_index</TT>, <TT>file_mode</TT> and | ||
215 | <TT>seq_mode</TT> | ||
216 | are initialized by OSS sequencer. The <TT>app_index</TT> is the application | ||
217 | index which is unique to each application opening OSS sequencer. The | ||
218 | <TT>file_mode</TT> | ||
219 | is bit-flags indicating the file operation mode. See | ||
220 | <TT>seq_oss.h</TT> | ||
221 | for its meaning. The <TT>seq_mode</TT> is sequencer operation mode. In | ||
222 | the current version, only <TT>SND_OSSSEQ_MODE_SYNTH</TT> is used. | ||
223 | <P>The next two fields, <TT>addr</TT> and <TT>private_data</TT>, must be | ||
224 | filled by the synth driver at open callback. The <TT>addr</TT> contains | ||
225 | the address of ALSA sequencer port which is assigned to this device. If | ||
226 | the driver allocates memory for <TT>private_data</TT>, it must be released | ||
227 | in close callback by itself. | ||
228 | <P>The last field, <TT>event_passing</TT>, indicates how to translate note-on | ||
229 | / off events. In <TT>PROCESS_EVENTS</TT> mode, the note 255 is regarded | ||
230 | as velocity change, and key pressure event is passed to the port. In <TT>PASS_EVENTS</TT> | ||
231 | mode, all note on/off events are passed to the port without modified. <TT>PROCESS_KEYPRESS</TT> | ||
232 | mode checks the note above 128 and regards it as key pressure event (mainly | ||
233 | for Emu8000 driver). | ||
234 | <H4> | ||
235 | 7.2.1. Open Callback</H4> | ||
236 | The <TT>open</TT> is called at each time this device is opened by an application | ||
237 | using OSS sequencer. This must not be NULL. Typically, the open callback | ||
238 | does the following procedure: | ||
239 | <OL> | ||
240 | <LI> | ||
241 | Allocate private data record.</LI> | ||
242 | |||
243 | <LI> | ||
244 | Create an ALSA sequencer port.</LI> | ||
245 | |||
246 | <LI> | ||
247 | Set the new port address on arg->addr.</LI> | ||
248 | |||
249 | <LI> | ||
250 | Set the private data record pointer on arg->private_data.</LI> | ||
251 | </OL> | ||
252 | Note that the type bit-flags in port_info of this synth port must NOT contain | ||
253 | <TT>TYPE_MIDI_GENERIC</TT> | ||
254 | bit. Instead, <TT>TYPE_SPECIFIC</TT> should be used. Also, <TT>CAP_SUBSCRIPTION</TT> | ||
255 | bit should NOT be included, too. This is necessary to tell it from other | ||
256 | normal MIDI devices. If the open procedure succeeded, return zero. Otherwise, | ||
257 | return -errno. | ||
258 | <H4> | ||
259 | 7.2.2 Ioctl Callback</H4> | ||
260 | The <TT>ioctl</TT> callback is called when the sequencer receives device-specific | ||
261 | ioctls. The following two ioctls should be processed by this callback: | ||
262 | <UL> | ||
263 | <LI> | ||
264 | <TT>IOCTL_SEQ_RESET_SAMPLES</TT></LI> | ||
265 | |||
266 | <BR>reset all samples on memory -- return 0 | ||
267 | <LI> | ||
268 | <TT>IOCTL_SYNTH_MEMAVL</TT></LI> | ||
269 | |||
270 | <BR>return the available memory size | ||
271 | <LI> | ||
272 | <TT>FM_4OP_ENABLE</TT></LI> | ||
273 | |||
274 | <BR>can be ignored usually</UL> | ||
275 | The other ioctls are processed inside the sequencer without passing to | ||
276 | the lowlevel driver. | ||
277 | <H4> | ||
278 | 7.2.3 Load_Patch Callback</H4> | ||
279 | The <TT>load_patch</TT> callback is used for sample-downloading. This callback | ||
280 | must read the data on user-space and transfer to each device. Return 0 | ||
281 | if succeeded, and -errno if failed. The format argument is the patch key | ||
282 | in patch_info record. The buf is user-space pointer where patch_info record | ||
283 | is stored. The offs can be ignored. The count is total data size of this | ||
284 | sample data. | ||
285 | <H4> | ||
286 | 7.2.4 Close Callback</H4> | ||
287 | The <TT>close</TT> callback is called when this device is closed by the | ||
288 | application. If any private data was allocated in open callback, it must | ||
289 | be released in the close callback. The deletion of ALSA port should be | ||
290 | done here, too. This callback must not be NULL. | ||
291 | <H4> | ||
292 | 7.2.5 Reset Callback</H4> | ||
293 | The <TT>reset</TT> callback is called when sequencer device is reset or | ||
294 | closed by applications. The callback should turn off the sounds on the | ||
295 | relevant port immediately, and initialize the status of the port. If this | ||
296 | callback is undefined, OSS seq sends a <TT>HEARTBEAT</TT> event to the | ||
297 | port. | ||
298 | <H3> | ||
299 | 7.3 Events</H3> | ||
300 | Most of the events are processed by sequencer and translated to the adequate | ||
301 | ALSA sequencer events, so that each synth device can receive by input_event | ||
302 | callback of ALSA sequencer port. The following ALSA events should be implemented | ||
303 | by the driver: | ||
304 | <BR> | ||
305 | <TABLE BORDER WIDTH="75%" NOSAVE > | ||
306 | <TR NOSAVE> | ||
307 | <TD NOSAVE><B>ALSA event</B></TD> | ||
308 | |||
309 | <TD><B>Original OSS events</B></TD> | ||
310 | </TR> | ||
311 | |||
312 | <TR> | ||
313 | <TD>NOTEON</TD> | ||
314 | |||
315 | <TD>SEQ_NOTEON | ||
316 | <BR>MIDI_NOTEON</TD> | ||
317 | </TR> | ||
318 | |||
319 | <TR> | ||
320 | <TD>NOTE</TD> | ||
321 | |||
322 | <TD>SEQ_NOTEOFF | ||
323 | <BR>MIDI_NOTEOFF</TD> | ||
324 | </TR> | ||
325 | |||
326 | <TR NOSAVE> | ||
327 | <TD NOSAVE>KEYPRESS</TD> | ||
328 | |||
329 | <TD>MIDI_KEY_PRESSURE</TD> | ||
330 | </TR> | ||
331 | |||
332 | <TR NOSAVE> | ||
333 | <TD>CHANPRESS</TD> | ||
334 | |||
335 | <TD NOSAVE>SEQ_AFTERTOUCH | ||
336 | <BR>MIDI_CHN_PRESSURE</TD> | ||
337 | </TR> | ||
338 | |||
339 | <TR NOSAVE> | ||
340 | <TD NOSAVE>PGMCHANGE</TD> | ||
341 | |||
342 | <TD NOSAVE>SEQ_PGMCHANGE | ||
343 | <BR>MIDI_PGM_CHANGE</TD> | ||
344 | </TR> | ||
345 | |||
346 | <TR> | ||
347 | <TD>PITCHBEND</TD> | ||
348 | |||
349 | <TD>SEQ_CONTROLLER(CTRL_PITCH_BENDER) | ||
350 | <BR>MIDI_PITCH_BEND</TD> | ||
351 | </TR> | ||
352 | |||
353 | <TR> | ||
354 | <TD>CONTROLLER</TD> | ||
355 | |||
356 | <TD>MIDI_CTL_CHANGE | ||
357 | <BR>SEQ_BALANCE (with CTL_PAN)</TD> | ||
358 | </TR> | ||
359 | |||
360 | <TR> | ||
361 | <TD>CONTROL14</TD> | ||
362 | |||
363 | <TD>SEQ_CONTROLLER</TD> | ||
364 | </TR> | ||
365 | |||
366 | <TR> | ||
367 | <TD>REGPARAM</TD> | ||
368 | |||
369 | <TD>SEQ_CONTROLLER(CTRL_PITCH_BENDER_RANGE)</TD> | ||
370 | </TR> | ||
371 | |||
372 | <TR> | ||
373 | <TD>SYSEX</TD> | ||
374 | |||
375 | <TD>SEQ_SYSEX</TD> | ||
376 | </TR> | ||
377 | </TABLE> | ||
378 | |||
379 | <P>The most of these behavior can be realized by MIDI emulation driver | ||
380 | included in the Emu8000 lowlevel driver. In the future release, this module | ||
381 | will be independent. | ||
382 | <P>Some OSS events (<TT>SEQ_PRIVATE</TT> and <TT>SEQ_VOLUME</TT> events) are passed as event | ||
383 | type SND_SEQ_OSS_PRIVATE. The OSS sequencer passes these event 8 byte | ||
384 | packets without any modification. The lowlevel driver should process these | ||
385 | events appropriately. | ||
386 | <H2> | ||
387 | 8. Interface to MIDI Device</H2> | ||
388 | Since the OSS emulation probes the creation and deletion of ALSA MIDI sequencer | ||
389 | ports automatically by receiving announcement from ALSA sequencer, the | ||
390 | MIDI devices don't need to be registered explicitly like synth devices. | ||
391 | However, the MIDI port_info registered to ALSA sequencer must include a group | ||
392 | name <TT>SND_SEQ_GROUP_DEVICE</TT> and a capability-bit <TT>CAP_READ</TT> or | ||
393 | <TT>CAP_WRITE</TT>. Also, subscription capabilities, <TT>CAP_SUBS_READ</TT> or <TT>CAP_SUBS_WRITE</TT>, | ||
394 | must be defined, too. If these conditions are not satisfied, the port is not | ||
395 | registered as OSS sequencer MIDI device. | ||
396 | <P>The events via MIDI devices are parsed in OSS sequencer and converted | ||
397 | to the corresponding ALSA sequencer events. The input from MIDI sequencer | ||
398 | is also converted to MIDI byte events by OSS sequencer. This works just | ||
399 | a reverse way of seq_midi module. | ||
400 | <H2> | ||
401 | 9. Known Problems / TODO's</H2> | ||
402 | |||
403 | <UL> | ||
404 | <LI> | ||
405 | Patch loading via ALSA instrument layer is not implemented yet.</LI> | ||
406 | </UL> | ||
407 | |||
408 | </BODY> | ||
409 | </HTML> | ||
diff --git a/Documentation/sound/alsa/Audigy-mixer.txt b/Documentation/sound/cards/audigy-mixer.rst index 7f10dc6ff28c..86213234435f 100644 --- a/Documentation/sound/alsa/Audigy-mixer.txt +++ b/Documentation/sound/cards/audigy-mixer.rst | |||
@@ -1,8 +1,8 @@ | |||
1 | ============================================= | ||
2 | Sound Blaster Audigy mixer / default DSP code | ||
3 | ============================================= | ||
1 | 4 | ||
2 | Sound Blaster Audigy mixer / default DSP code | 5 | This is based on sb-live-mixer.rst. |
3 | =========================================== | ||
4 | |||
5 | This is based on SB-Live-mixer.txt. | ||
6 | 6 | ||
7 | The EMU10K2 chips have a DSP part which can be programmed to support | 7 | The EMU10K2 chips have a DSP part which can be programmed to support |
8 | various ways of sample processing, which is described here. | 8 | various ways of sample processing, which is described here. |
@@ -13,8 +13,8 @@ The ALSA driver programs this portion of chip by default code | |||
13 | (can be altered later) which offers the following functionality: | 13 | (can be altered later) which offers the following functionality: |
14 | 14 | ||
15 | 15 | ||
16 | 1) Digital mixer controls | 16 | Digital mixer controls |
17 | ------------------------- | 17 | ====================== |
18 | 18 | ||
19 | These controls are built using the DSP instructions. They offer extended | 19 | These controls are built using the DSP instructions. They offer extended |
20 | functionality. Only the default build-in code in the ALSA driver is described | 20 | functionality. Only the default build-in code in the ALSA driver is described |
@@ -26,320 +26,343 @@ is mentioned in multiple controls, the signal is accumulated and can be wrapped | |||
26 | 26 | ||
27 | Explanation of used abbreviations: | 27 | Explanation of used abbreviations: |
28 | 28 | ||
29 | DAC - digital to analog converter | 29 | DAC |
30 | ADC - analog to digital converter | 30 | digital to analog converter |
31 | I2S - one-way three wire serial bus for digital sound by Philips Semiconductors | 31 | ADC |
32 | (this standard is used for connecting standalone DAC and ADC converters) | 32 | analog to digital converter |
33 | LFE - low frequency effects (subwoofer signal) | 33 | I2S |
34 | AC97 - a chip containing an analog mixer, DAC and ADC converters | 34 | one-way three wire serial bus for digital sound by Philips Semiconductors |
35 | IEC958 - S/PDIF | 35 | (this standard is used for connecting standalone DAC and ADC converters) |
36 | FX-bus - the EMU10K2 chip has an effect bus containing 64 accumulators. | 36 | LFE |
37 | Each of the synthesizer voices can feed its output to these accumulators | 37 | low frequency effects (subwoofer signal) |
38 | and the DSP microcontroller can operate with the resulting sum. | 38 | AC97 |
39 | a chip containing an analog mixer, DAC and ADC converters | ||
40 | IEC958 | ||
41 | S/PDIF | ||
42 | FX-bus | ||
43 | the EMU10K2 chip has an effect bus containing 64 accumulators. | ||
44 | Each of the synthesizer voices can feed its output to these accumulators | ||
45 | and the DSP microcontroller can operate with the resulting sum. | ||
39 | 46 | ||
40 | name='PCM Front Playback Volume',index=0 | 47 | name='PCM Front Playback Volume',index=0 |
41 | 48 | ---------------------------------------- | |
42 | This control is used to attenuate samples for left and right front PCM FX-bus | 49 | This control is used to attenuate samples for left and right front PCM FX-bus |
43 | accumulators. ALSA uses accumulators 8 and 9 for left and right front PCM | 50 | accumulators. ALSA uses accumulators 8 and 9 for left and right front PCM |
44 | samples for 5.1 playback. The result samples are forwarded to the front DAC PCM | 51 | samples for 5.1 playback. The result samples are forwarded to the front DAC PCM |
45 | slots of the Philips DAC. | 52 | slots of the Philips DAC. |
46 | 53 | ||
47 | name='PCM Surround Playback Volume',index=0 | 54 | name='PCM Surround Playback Volume',index=0 |
48 | 55 | ------------------------------------------- | |
49 | This control is used to attenuate samples for left and right surround PCM FX-bus | 56 | This control is used to attenuate samples for left and right surround PCM FX-bus |
50 | accumulators. ALSA uses accumulators 2 and 3 for left and right surround PCM | 57 | accumulators. ALSA uses accumulators 2 and 3 for left and right surround PCM |
51 | samples for 5.1 playback. The result samples are forwarded to the surround DAC PCM | 58 | samples for 5.1 playback. The result samples are forwarded to the surround DAC PCM |
52 | slots of the Philips DAC. | 59 | slots of the Philips DAC. |
53 | 60 | ||
54 | name='PCM Center Playback Volume',index=0 | 61 | name='PCM Center Playback Volume',index=0 |
55 | 62 | ----------------------------------------- | |
56 | This control is used to attenuate samples for center PCM FX-bus accumulator. | 63 | This control is used to attenuate samples for center PCM FX-bus accumulator. |
57 | ALSA uses accumulator 6 for center PCM sample for 5.1 playback. The result sample | 64 | ALSA uses accumulator 6 for center PCM sample for 5.1 playback. The result sample |
58 | is forwarded to the center DAC PCM slot of the Philips DAC. | 65 | is forwarded to the center DAC PCM slot of the Philips DAC. |
59 | 66 | ||
60 | name='PCM LFE Playback Volume',index=0 | 67 | name='PCM LFE Playback Volume',index=0 |
61 | 68 | -------------------------------------- | |
62 | This control is used to attenuate sample for LFE PCM FX-bus accumulator. | 69 | This control is used to attenuate sample for LFE PCM FX-bus accumulator. |
63 | ALSA uses accumulator 7 for LFE PCM sample for 5.1 playback. The result sample | 70 | ALSA uses accumulator 7 for LFE PCM sample for 5.1 playback. The result sample |
64 | is forwarded to the LFE DAC PCM slot of the Philips DAC. | 71 | is forwarded to the LFE DAC PCM slot of the Philips DAC. |
65 | 72 | ||
66 | name='PCM Playback Volume',index=0 | 73 | name='PCM Playback Volume',index=0 |
67 | 74 | ---------------------------------- | |
68 | This control is used to attenuate samples for left and right PCM FX-bus | 75 | This control is used to attenuate samples for left and right PCM FX-bus |
69 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples for | 76 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples for |
70 | stereo playback. The result samples are forwarded to the front DAC PCM slots | 77 | stereo playback. The result samples are forwarded to the front DAC PCM slots |
71 | of the Philips DAC. | 78 | of the Philips DAC. |
72 | 79 | ||
73 | name='PCM Capture Volume',index=0 | 80 | name='PCM Capture Volume',index=0 |
74 | 81 | --------------------------------- | |
75 | This control is used to attenuate samples for left and right PCM FX-bus | 82 | This control is used to attenuate samples for left and right PCM FX-bus |
76 | accumulator. ALSA uses accumulators 0 and 1 for left and right PCM. | 83 | accumulator. ALSA uses accumulators 0 and 1 for left and right PCM. |
77 | The result is forwarded to the ADC capture FIFO (thus to the standard capture | 84 | The result is forwarded to the ADC capture FIFO (thus to the standard capture |
78 | PCM device). | 85 | PCM device). |
79 | 86 | ||
80 | name='Music Playback Volume',index=0 | 87 | name='Music Playback Volume',index=0 |
81 | 88 | ------------------------------------ | |
82 | This control is used to attenuate samples for left and right MIDI FX-bus | 89 | This control is used to attenuate samples for left and right MIDI FX-bus |
83 | accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples. | 90 | accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples. |
84 | The result samples are forwarded to the front DAC PCM slots of the AC97 codec. | 91 | The result samples are forwarded to the front DAC PCM slots of the AC97 codec. |
85 | 92 | ||
86 | name='Music Capture Volume',index=0 | 93 | name='Music Capture Volume',index=0 |
87 | 94 | ----------------------------------- | |
88 | These controls are used to attenuate samples for left and right MIDI FX-bus | 95 | These controls are used to attenuate samples for left and right MIDI FX-bus |
89 | accumulator. ALSA uses accumulators 4 and 5 for left and right PCM. | 96 | accumulator. ALSA uses accumulators 4 and 5 for left and right PCM. |
90 | The result is forwarded to the ADC capture FIFO (thus to the standard capture | 97 | The result is forwarded to the ADC capture FIFO (thus to the standard capture |
91 | PCM device). | 98 | PCM device). |
92 | 99 | ||
93 | name='Mic Playback Volume',index=0 | 100 | name='Mic Playback Volume',index=0 |
94 | 101 | ---------------------------------- | |
95 | This control is used to attenuate samples for left and right Mic input. | 102 | This control is used to attenuate samples for left and right Mic input. |
96 | For Mic input is used AC97 codec. The result samples are forwarded to | 103 | For Mic input is used AC97 codec. The result samples are forwarded to |
97 | the front DAC PCM slots of the Philips DAC. Samples are forwarded to Mic | 104 | the front DAC PCM slots of the Philips DAC. Samples are forwarded to Mic |
98 | capture FIFO (device 1 - 16bit/8KHz mono) too without volume control. | 105 | capture FIFO (device 1 - 16bit/8KHz mono) too without volume control. |
99 | 106 | ||
100 | name='Mic Capture Volume',index=0 | 107 | name='Mic Capture Volume',index=0 |
101 | 108 | --------------------------------- | |
102 | This control is used to attenuate samples for left and right Mic input. | 109 | This control is used to attenuate samples for left and right Mic input. |
103 | The result is forwarded to the ADC capture FIFO (thus to the standard capture | 110 | The result is forwarded to the ADC capture FIFO (thus to the standard capture |
104 | PCM device). | 111 | PCM device). |
105 | 112 | ||
106 | name='Audigy CD Playback Volume',index=0 | 113 | name='Audigy CD Playback Volume',index=0 |
107 | 114 | ---------------------------------------- | |
108 | This control is used to attenuate samples from left and right IEC958 TTL | 115 | This control is used to attenuate samples from left and right IEC958 TTL |
109 | digital inputs (usually used by a CDROM drive). The result samples are | 116 | digital inputs (usually used by a CDROM drive). The result samples are |
110 | forwarded to the front DAC PCM slots of the Philips DAC. | 117 | forwarded to the front DAC PCM slots of the Philips DAC. |
111 | 118 | ||
112 | name='Audigy CD Capture Volume',index=0 | 119 | name='Audigy CD Capture Volume',index=0 |
113 | 120 | --------------------------------------- | |
114 | This control is used to attenuate samples from left and right IEC958 TTL | 121 | This control is used to attenuate samples from left and right IEC958 TTL |
115 | digital inputs (usually used by a CDROM drive). The result samples are | 122 | digital inputs (usually used by a CDROM drive). The result samples are |
116 | forwarded to the ADC capture FIFO (thus to the standard capture PCM device). | 123 | forwarded to the ADC capture FIFO (thus to the standard capture PCM device). |
117 | 124 | ||
118 | name='IEC958 Optical Playback Volume',index=0 | 125 | name='IEC958 Optical Playback Volume',index=0 |
119 | 126 | --------------------------------------------- | |
120 | This control is used to attenuate samples from left and right IEC958 optical | 127 | This control is used to attenuate samples from left and right IEC958 optical |
121 | digital input. The result samples are forwarded to the front DAC PCM slots | 128 | digital input. The result samples are forwarded to the front DAC PCM slots |
122 | of the Philips DAC. | 129 | of the Philips DAC. |
123 | 130 | ||
124 | name='IEC958 Optical Capture Volume',index=0 | 131 | name='IEC958 Optical Capture Volume',index=0 |
125 | 132 | -------------------------------------------- | |
126 | This control is used to attenuate samples from left and right IEC958 optical | 133 | This control is used to attenuate samples from left and right IEC958 optical |
127 | digital inputs. The result samples are forwarded to the ADC capture FIFO | 134 | digital inputs. The result samples are forwarded to the ADC capture FIFO |
128 | (thus to the standard capture PCM device). | 135 | (thus to the standard capture PCM device). |
129 | 136 | ||
130 | name='Line2 Playback Volume',index=0 | 137 | name='Line2 Playback Volume',index=0 |
131 | 138 | ------------------------------------ | |
132 | This control is used to attenuate samples from left and right I2S ADC | 139 | This control is used to attenuate samples from left and right I2S ADC |
133 | inputs (on the AudigyDrive). The result samples are forwarded to the front | 140 | inputs (on the AudigyDrive). The result samples are forwarded to the front |
134 | DAC PCM slots of the Philips DAC. | 141 | DAC PCM slots of the Philips DAC. |
135 | 142 | ||
136 | name='Line2 Capture Volume',index=1 | 143 | name='Line2 Capture Volume',index=1 |
137 | 144 | ----------------------------------- | |
138 | This control is used to attenuate samples from left and right I2S ADC | 145 | This control is used to attenuate samples from left and right I2S ADC |
139 | inputs (on the AudigyDrive). The result samples are forwarded to the ADC | 146 | inputs (on the AudigyDrive). The result samples are forwarded to the ADC |
140 | capture FIFO (thus to the standard capture PCM device). | 147 | capture FIFO (thus to the standard capture PCM device). |
141 | 148 | ||
142 | name='Analog Mix Playback Volume',index=0 | 149 | name='Analog Mix Playback Volume',index=0 |
143 | 150 | ----------------------------------------- | |
144 | This control is used to attenuate samples from left and right I2S ADC | 151 | This control is used to attenuate samples from left and right I2S ADC |
145 | inputs from Philips ADC. The result samples are forwarded to the front | 152 | inputs from Philips ADC. The result samples are forwarded to the front |
146 | DAC PCM slots of the Philips DAC. This contains mix from analog sources | 153 | DAC PCM slots of the Philips DAC. This contains mix from analog sources |
147 | like CD, Line In, Aux, .... | 154 | like CD, Line In, Aux, .... |
148 | 155 | ||
149 | name='Analog Mix Capture Volume',index=1 | 156 | name='Analog Mix Capture Volume',index=1 |
150 | 157 | ---------------------------------------- | |
151 | This control is used to attenuate samples from left and right I2S ADC | 158 | This control is used to attenuate samples from left and right I2S ADC |
152 | inputs Philips ADC. The result samples are forwarded to the ADC | 159 | inputs Philips ADC. The result samples are forwarded to the ADC |
153 | capture FIFO (thus to the standard capture PCM device). | 160 | capture FIFO (thus to the standard capture PCM device). |
154 | 161 | ||
155 | name='Aux2 Playback Volume',index=0 | 162 | name='Aux2 Playback Volume',index=0 |
156 | 163 | ----------------------------------- | |
157 | This control is used to attenuate samples from left and right I2S ADC | 164 | This control is used to attenuate samples from left and right I2S ADC |
158 | inputs (on the AudigyDrive). The result samples are forwarded to the front | 165 | inputs (on the AudigyDrive). The result samples are forwarded to the front |
159 | DAC PCM slots of the Philips DAC. | 166 | DAC PCM slots of the Philips DAC. |
160 | 167 | ||
161 | name='Aux2 Capture Volume',index=1 | 168 | name='Aux2 Capture Volume',index=1 |
162 | 169 | ---------------------------------- | |
163 | This control is used to attenuate samples from left and right I2S ADC | 170 | This control is used to attenuate samples from left and right I2S ADC |
164 | inputs (on the AudigyDrive). The result samples are forwarded to the ADC | 171 | inputs (on the AudigyDrive). The result samples are forwarded to the ADC |
165 | capture FIFO (thus to the standard capture PCM device). | 172 | capture FIFO (thus to the standard capture PCM device). |
166 | 173 | ||
167 | name='Front Playback Volume',index=0 | 174 | name='Front Playback Volume',index=0 |
168 | 175 | ------------------------------------ | |
169 | All stereo signals are mixed together and mirrored to surround, center and LFE. | 176 | All stereo signals are mixed together and mirrored to surround, center and LFE. |
170 | This control is used to attenuate samples for left and right front speakers of | 177 | This control is used to attenuate samples for left and right front speakers of |
171 | this mix. | 178 | this mix. |
172 | 179 | ||
173 | name='Surround Playback Volume',index=0 | 180 | name='Surround Playback Volume',index=0 |
174 | 181 | --------------------------------------- | |
175 | All stereo signals are mixed together and mirrored to surround, center and LFE. | 182 | All stereo signals are mixed together and mirrored to surround, center and LFE. |
176 | This control is used to attenuate samples for left and right surround speakers of | 183 | This control is used to attenuate samples for left and right surround speakers of |
177 | this mix. | 184 | this mix. |
178 | 185 | ||
179 | name='Center Playback Volume',index=0 | 186 | name='Center Playback Volume',index=0 |
180 | 187 | ------------------------------------- | |
181 | All stereo signals are mixed together and mirrored to surround, center and LFE. | 188 | All stereo signals are mixed together and mirrored to surround, center and LFE. |
182 | This control is used to attenuate sample for center speaker of this mix. | 189 | This control is used to attenuate sample for center speaker of this mix. |
183 | 190 | ||
184 | name='LFE Playback Volume',index=0 | 191 | name='LFE Playback Volume',index=0 |
185 | 192 | ---------------------------------- | |
186 | All stereo signals are mixed together and mirrored to surround, center and LFE. | 193 | All stereo signals are mixed together and mirrored to surround, center and LFE. |
187 | This control is used to attenuate sample for LFE speaker of this mix. | 194 | This control is used to attenuate sample for LFE speaker of this mix. |
188 | 195 | ||
189 | name='Tone Control - Switch',index=0 | 196 | name='Tone Control - Switch',index=0 |
190 | 197 | ------------------------------------ | |
191 | This control turns the tone control on or off. The samples for front, rear | 198 | This control turns the tone control on or off. The samples for front, rear |
192 | and center / LFE outputs are affected. | 199 | and center / LFE outputs are affected. |
193 | 200 | ||
194 | name='Tone Control - Bass',index=0 | 201 | name='Tone Control - Bass',index=0 |
195 | 202 | ---------------------------------- | |
196 | This control sets the bass intensity. There is no neutral value!! | 203 | This control sets the bass intensity. There is no neutral value!! |
197 | When the tone control code is activated, the samples are always modified. | 204 | When the tone control code is activated, the samples are always modified. |
198 | The closest value to pure signal is 20. | 205 | The closest value to pure signal is 20. |
199 | 206 | ||
200 | name='Tone Control - Treble',index=0 | 207 | name='Tone Control - Treble',index=0 |
201 | 208 | ------------------------------------ | |
202 | This control sets the treble intensity. There is no neutral value!! | 209 | This control sets the treble intensity. There is no neutral value!! |
203 | When the tone control code is activated, the samples are always modified. | 210 | When the tone control code is activated, the samples are always modified. |
204 | The closest value to pure signal is 20. | 211 | The closest value to pure signal is 20. |
205 | 212 | ||
206 | name='Master Playback Volume',index=0 | 213 | name='Master Playback Volume',index=0 |
207 | 214 | ------------------------------------- | |
208 | This control is used to attenuate samples for front, surround, center and | 215 | This control is used to attenuate samples for front, surround, center and |
209 | LFE outputs. | 216 | LFE outputs. |
210 | 217 | ||
211 | name='IEC958 Optical Raw Playback Switch',index=0 | 218 | name='IEC958 Optical Raw Playback Switch',index=0 |
212 | 219 | ------------------------------------------------- | |
213 | If this switch is on, then the samples for the IEC958 (S/PDIF) digital | 220 | If this switch is on, then the samples for the IEC958 (S/PDIF) digital |
214 | output are taken only from the raw FX8010 PCM, otherwise standard front | 221 | output are taken only from the raw FX8010 PCM, otherwise standard front |
215 | PCM samples are taken. | 222 | PCM samples are taken. |
216 | 223 | ||
217 | 224 | ||
218 | 2) PCM stream related controls | 225 | PCM stream related controls |
219 | ------------------------------ | 226 | =========================== |
220 | 227 | ||
221 | name='EMU10K1 PCM Volume',index 0-31 | 228 | name='EMU10K1 PCM Volume',index 0-31 |
222 | 229 | ------------------------------------ | |
223 | Channel volume attenuation in range 0-0xffff. The maximum value (no | 230 | Channel volume attenuation in range 0-0xffff. The maximum value (no |
224 | attenuation) is default. The channel mapping for three values is | 231 | attenuation) is default. The channel mapping for three values is |
225 | as follows: | 232 | as follows: |
226 | 233 | ||
227 | 0 - mono, default 0xffff (no attenuation) | 234 | * 0 - mono, default 0xffff (no attenuation) |
228 | 1 - left, default 0xffff (no attenuation) | 235 | * 1 - left, default 0xffff (no attenuation) |
229 | 2 - right, default 0xffff (no attenuation) | 236 | * 2 - right, default 0xffff (no attenuation) |
230 | 237 | ||
231 | name='EMU10K1 PCM Send Routing',index 0-31 | 238 | name='EMU10K1 PCM Send Routing',index 0-31 |
232 | 239 | ------------------------------------------ | |
233 | This control specifies the destination - FX-bus accumulators. There 24 | 240 | This control specifies the destination - FX-bus accumulators. There 24 |
234 | values with this mapping: | 241 | values with this mapping: |
235 | 242 | ||
236 | 0 - mono, A destination (FX-bus 0-63), default 0 | 243 | * 0 - mono, A destination (FX-bus 0-63), default 0 |
237 | 1 - mono, B destination (FX-bus 0-63), default 1 | 244 | * 1 - mono, B destination (FX-bus 0-63), default 1 |
238 | 2 - mono, C destination (FX-bus 0-63), default 2 | 245 | * 2 - mono, C destination (FX-bus 0-63), default 2 |
239 | 3 - mono, D destination (FX-bus 0-63), default 3 | 246 | * 3 - mono, D destination (FX-bus 0-63), default 3 |
240 | 4 - mono, E destination (FX-bus 0-63), default 0 | 247 | * 4 - mono, E destination (FX-bus 0-63), default 0 |
241 | 5 - mono, F destination (FX-bus 0-63), default 0 | 248 | * 5 - mono, F destination (FX-bus 0-63), default 0 |
242 | 6 - mono, G destination (FX-bus 0-63), default 0 | 249 | * 6 - mono, G destination (FX-bus 0-63), default 0 |
243 | 7 - mono, H destination (FX-bus 0-63), default 0 | 250 | * 7 - mono, H destination (FX-bus 0-63), default 0 |
244 | 8 - left, A destination (FX-bus 0-63), default 0 | 251 | * 8 - left, A destination (FX-bus 0-63), default 0 |
245 | 9 - left, B destination (FX-bus 0-63), default 1 | 252 | * 9 - left, B destination (FX-bus 0-63), default 1 |
246 | 10 - left, C destination (FX-bus 0-63), default 2 | 253 | * 10 - left, C destination (FX-bus 0-63), default 2 |
247 | 11 - left, D destination (FX-bus 0-63), default 3 | 254 | * 11 - left, D destination (FX-bus 0-63), default 3 |
248 | 12 - left, E destination (FX-bus 0-63), default 0 | 255 | * 12 - left, E destination (FX-bus 0-63), default 0 |
249 | 13 - left, F destination (FX-bus 0-63), default 0 | 256 | * 13 - left, F destination (FX-bus 0-63), default 0 |
250 | 14 - left, G destination (FX-bus 0-63), default 0 | 257 | * 14 - left, G destination (FX-bus 0-63), default 0 |
251 | 15 - left, H destination (FX-bus 0-63), default 0 | 258 | * 15 - left, H destination (FX-bus 0-63), default 0 |
252 | 16 - right, A destination (FX-bus 0-63), default 0 | 259 | * 16 - right, A destination (FX-bus 0-63), default 0 |
253 | 17 - right, B destination (FX-bus 0-63), default 1 | 260 | * 17 - right, B destination (FX-bus 0-63), default 1 |
254 | 18 - right, C destination (FX-bus 0-63), default 2 | 261 | * 18 - right, C destination (FX-bus 0-63), default 2 |
255 | 19 - right, D destination (FX-bus 0-63), default 3 | 262 | * 19 - right, D destination (FX-bus 0-63), default 3 |
256 | 20 - right, E destination (FX-bus 0-63), default 0 | 263 | * 20 - right, E destination (FX-bus 0-63), default 0 |
257 | 21 - right, F destination (FX-bus 0-63), default 0 | 264 | * 21 - right, F destination (FX-bus 0-63), default 0 |
258 | 22 - right, G destination (FX-bus 0-63), default 0 | 265 | * 22 - right, G destination (FX-bus 0-63), default 0 |
259 | 23 - right, H destination (FX-bus 0-63), default 0 | 266 | * 23 - right, H destination (FX-bus 0-63), default 0 |
260 | 267 | ||
261 | Don't forget that it's illegal to assign a channel to the same FX-bus accumulator | 268 | Don't forget that it's illegal to assign a channel to the same FX-bus accumulator |
262 | more than once (it means 0=0 && 1=0 is an invalid combination). | 269 | more than once (it means 0=0 && 1=0 is an invalid combination). |
263 | 270 | ||
264 | name='EMU10K1 PCM Send Volume',index 0-31 | 271 | name='EMU10K1 PCM Send Volume',index 0-31 |
265 | 272 | ----------------------------------------- | |
266 | It specifies the attenuation (amount) for given destination in range 0-255. | 273 | It specifies the attenuation (amount) for given destination in range 0-255. |
267 | The channel mapping is following: | 274 | The channel mapping is following: |
268 | 275 | ||
269 | 0 - mono, A destination attn, default 255 (no attenuation) | 276 | * 0 - mono, A destination attn, default 255 (no attenuation) |
270 | 1 - mono, B destination attn, default 255 (no attenuation) | 277 | * 1 - mono, B destination attn, default 255 (no attenuation) |
271 | 2 - mono, C destination attn, default 0 (mute) | 278 | * 2 - mono, C destination attn, default 0 (mute) |
272 | 3 - mono, D destination attn, default 0 (mute) | 279 | * 3 - mono, D destination attn, default 0 (mute) |
273 | 4 - mono, E destination attn, default 0 (mute) | 280 | * 4 - mono, E destination attn, default 0 (mute) |
274 | 5 - mono, F destination attn, default 0 (mute) | 281 | * 5 - mono, F destination attn, default 0 (mute) |
275 | 6 - mono, G destination attn, default 0 (mute) | 282 | * 6 - mono, G destination attn, default 0 (mute) |
276 | 7 - mono, H destination attn, default 0 (mute) | 283 | * 7 - mono, H destination attn, default 0 (mute) |
277 | 8 - left, A destination attn, default 255 (no attenuation) | 284 | * 8 - left, A destination attn, default 255 (no attenuation) |
278 | 9 - left, B destination attn, default 0 (mute) | 285 | * 9 - left, B destination attn, default 0 (mute) |
279 | 10 - left, C destination attn, default 0 (mute) | 286 | * 10 - left, C destination attn, default 0 (mute) |
280 | 11 - left, D destination attn, default 0 (mute) | 287 | * 11 - left, D destination attn, default 0 (mute) |
281 | 12 - left, E destination attn, default 0 (mute) | 288 | * 12 - left, E destination attn, default 0 (mute) |
282 | 13 - left, F destination attn, default 0 (mute) | 289 | * 13 - left, F destination attn, default 0 (mute) |
283 | 14 - left, G destination attn, default 0 (mute) | 290 | * 14 - left, G destination attn, default 0 (mute) |
284 | 15 - left, H destination attn, default 0 (mute) | 291 | * 15 - left, H destination attn, default 0 (mute) |
285 | 16 - right, A destination attn, default 0 (mute) | 292 | * 16 - right, A destination attn, default 0 (mute) |
286 | 17 - right, B destination attn, default 255 (no attenuation) | 293 | * 17 - right, B destination attn, default 255 (no attenuation) |
287 | 18 - right, C destination attn, default 0 (mute) | 294 | * 18 - right, C destination attn, default 0 (mute) |
288 | 19 - right, D destination attn, default 0 (mute) | 295 | * 19 - right, D destination attn, default 0 (mute) |
289 | 20 - right, E destination attn, default 0 (mute) | 296 | * 20 - right, E destination attn, default 0 (mute) |
290 | 21 - right, F destination attn, default 0 (mute) | 297 | * 21 - right, F destination attn, default 0 (mute) |
291 | 22 - right, G destination attn, default 0 (mute) | 298 | * 22 - right, G destination attn, default 0 (mute) |
292 | 23 - right, H destination attn, default 0 (mute) | 299 | * 23 - right, H destination attn, default 0 (mute) |
293 | 300 | ||
294 | 301 | ||
295 | 302 | ||
296 | 4) MANUALS/PATENTS: | 303 | MANUALS/PATENTS |
297 | ------------------- | 304 | =============== |
298 | 305 | ||
299 | ftp://opensource.creative.com/pub/doc | 306 | ftp://opensource.creative.com/pub/doc |
300 | ------------------------------------- | 307 | ------------------------------------- |
301 | 308 | ||
302 | Files: | 309 | LM4545.pdf |
303 | LM4545.pdf AC97 Codec | 310 | AC97 Codec |
304 | 311 | ||
305 | m2049.pdf The EMU10K1 Digital Audio Processor | 312 | m2049.pdf |
313 | The EMU10K1 Digital Audio Processor | ||
306 | 314 | ||
307 | hog63.ps FX8010 - A DSP Chip Architecture for Audio Effects | 315 | hog63.ps |
316 | FX8010 - A DSP Chip Architecture for Audio Effects | ||
308 | 317 | ||
309 | 318 | ||
310 | WIPO Patents | 319 | WIPO Patents |
311 | ------------ | 320 | ------------ |
312 | Patent numbers: | ||
313 | WO 9901813 (A1) Audio Effects Processor with multiple asynchronous (Jan. 14, 1999) | ||
314 | streams | ||
315 | 321 | ||
316 | WO 9901814 (A1) Processor with Instruction Set for Audio Effects (Jan. 14, 1999) | 322 | WO 9901813 (A1) |
323 | Audio Effects Processor with multiple asynchronous streams | ||
324 | (Jan. 14, 1999) | ||
325 | |||
326 | WO 9901814 (A1) | ||
327 | Processor with Instruction Set for Audio Effects (Jan. 14, 1999) | ||
317 | 328 | ||
318 | WO 9901953 (A1) Audio Effects Processor having Decoupled Instruction | 329 | WO 9901953 (A1) |
319 | Execution and Audio Data Sequencing (Jan. 14, 1999) | 330 | Audio Effects Processor having Decoupled Instruction |
331 | Execution and Audio Data Sequencing (Jan. 14, 1999) | ||
320 | 332 | ||
321 | 333 | ||
322 | US Patents (http://www.uspto.gov/) | 334 | US Patents (http://www.uspto.gov/) |
323 | ---------------------------------- | 335 | ---------------------------------- |
324 | 336 | ||
325 | US 5925841 Digital Sampling Instrument employing cache memory (Jul. 20, 1999) | 337 | US 5925841 |
326 | 338 | Digital Sampling Instrument employing cache memory (Jul. 20, 1999) | |
327 | US 5928342 Audio Effects Processor integrated on a single chip (Jul. 27, 1999) | 339 | |
328 | with a multiport memory onto which multiple asynchronous | 340 | US 5928342 |
329 | digital sound samples can be concurrently loaded | 341 | Audio Effects Processor integrated on a single chip |
330 | 342 | with a multiport memory onto which multiple asynchronous | |
331 | US 5930158 Processor with Instruction Set for Audio Effects (Jul. 27, 1999) | 343 | digital sound samples can be concurrently loaded |
332 | 344 | (Jul. 27, 1999) | |
333 | US 6032235 Memory initialization circuit (Tram) (Feb. 29, 2000) | 345 | |
334 | 346 | US 5930158 | |
335 | US 6138207 Interpolation looping of audio samples in cache connected to (Oct. 24, 2000) | 347 | Processor with Instruction Set for Audio Effects (Jul. 27, 1999) |
336 | system bus with prioritization and modification of bus transfers | 348 | |
337 | in accordance with loop ends and minimum block sizes | 349 | US 6032235 |
338 | 350 | Memory initialization circuit (Tram) (Feb. 29, 2000) | |
339 | US 6151670 Method for conserving memory storage using a (Nov. 21, 2000) | 351 | |
340 | pool of short term memory registers | 352 | US 6138207 |
341 | 353 | Interpolation looping of audio samples in cache connected to | |
342 | US 6195715 Interrupt control for multiple programs communicating with (Feb. 27, 2001) | 354 | system bus with prioritization and modification of bus transfers |
343 | a common interrupt by associating programs to GP registers, | 355 | in accordance with loop ends and minimum block sizes |
344 | defining interrupt register, polling GP registers, and invoking | 356 | (Oct. 24, 2000) |
345 | callback routine associated with defined interrupt register | 357 | |
358 | US 6151670 | ||
359 | Method for conserving memory storage using a | ||
360 | pool of short term memory registers | ||
361 | (Nov. 21, 2000) | ||
362 | |||
363 | US 6195715 | ||
364 | Interrupt control for multiple programs communicating with | ||
365 | a common interrupt by associating programs to GP registers, | ||
366 | defining interrupt register, polling GP registers, and invoking | ||
367 | callback routine associated with defined interrupt register | ||
368 | (Feb. 27, 2001) | ||
diff --git a/Documentation/sound/alsa/Audiophile-Usb.txt b/Documentation/sound/cards/audiophile-usb.rst index e7a5ed4dcae8..a7bb5648331f 100644 --- a/Documentation/sound/alsa/Audiophile-Usb.txt +++ b/Documentation/sound/cards/audiophile-usb.rst | |||
@@ -1,32 +1,41 @@ | |||
1 | Guide to using M-Audio Audiophile USB with ALSA and Jack v1.5 | 1 | ======================================================== |
2 | ======================================================== | 2 | Guide to using M-Audio Audiophile USB with ALSA and Jack |
3 | ======================================================== | ||
3 | 4 | ||
4 | Thibault Le Meur <Thibault.LeMeur@supelec.fr> | 5 | v1.5 |
6 | |||
7 | Thibault Le Meur <Thibault.LeMeur@supelec.fr> | ||
5 | 8 | ||
6 | This document is a guide to using the M-Audio Audiophile USB (tm) device with | 9 | This document is a guide to using the M-Audio Audiophile USB (tm) device with |
7 | ALSA and JACK. | 10 | ALSA and JACK. |
8 | 11 | ||
9 | History | 12 | History |
10 | ======= | 13 | ======= |
14 | |||
11 | * v1.4 - Thibault Le Meur (2007-07-11) | 15 | * v1.4 - Thibault Le Meur (2007-07-11) |
12 | - Added Low Endianness nature of 16bits-modes | 16 | |
13 | found by Hakan Lennestal <Hakan.Lennestal@brfsodrahamn.se> | 17 | - Added Low Endianness nature of 16bits-modes |
14 | - Modifying document structure | 18 | found by Hakan Lennestal <Hakan.Lennestal@brfsodrahamn.se> |
19 | - Modifying document structure | ||
20 | |||
15 | * v1.5 - Thibault Le Meur (2007-07-12) | 21 | * v1.5 - Thibault Le Meur (2007-07-12) |
16 | - Added AC3/DTS passthru info | 22 | - Added AC3/DTS passthru info |
17 | 23 | ||
18 | 24 | ||
19 | 1 - Audiophile USB Specs and correct usage | 25 | Audiophile USB Specs and correct usage |
20 | ========================================== | 26 | ====================================== |
21 | 27 | ||
22 | This part is a reminder of important facts about the functions and limitations | 28 | This part is a reminder of important facts about the functions and limitations |
23 | of the device. | 29 | of the device. |
24 | 30 | ||
25 | The device has 4 audio interfaces, and 2 MIDI ports: | 31 | The device has 4 audio interfaces, and 2 MIDI ports: |
32 | |||
26 | * Analog Stereo Input (Ai) | 33 | * Analog Stereo Input (Ai) |
34 | |||
27 | - This port supports 2 pairs of line-level audio inputs (1/4" TS and RCA) | 35 | - This port supports 2 pairs of line-level audio inputs (1/4" TS and RCA) |
28 | - When the 1/4" TS (jack) connectors are connected, the RCA connectors | 36 | - When the 1/4" TS (jack) connectors are connected, the RCA connectors |
29 | are disabled | 37 | are disabled |
38 | |||
30 | * Analog Stereo Output (Ao) | 39 | * Analog Stereo Output (Ao) |
31 | * Digital Stereo Input (Di) | 40 | * Digital Stereo Input (Di) |
32 | * Digital Stereo Output (Do) | 41 | * Digital Stereo Output (Do) |
@@ -34,56 +43,69 @@ The device has 4 audio interfaces, and 2 MIDI ports: | |||
34 | * Midi Out (Mo) | 43 | * Midi Out (Mo) |
35 | 44 | ||
36 | The internal DAC/ADC has the following characteristics: | 45 | The internal DAC/ADC has the following characteristics: |
46 | |||
37 | * sample depth of 16 or 24 bits | 47 | * sample depth of 16 or 24 bits |
38 | * sample rate from 8kHz to 96kHz | 48 | * sample rate from 8kHz to 96kHz |
39 | * Two interfaces can't use different sample depths at the same time. | 49 | * Two interfaces can't use different sample depths at the same time. |
50 | |||
40 | Moreover, the Audiophile USB documentation gives the following Warning: | 51 | Moreover, the Audiophile USB documentation gives the following Warning: |
41 | "Please exit any audio application running before switching between bit depths" | 52 | Please exit any audio application running before switching between bit depths |
42 | 53 | ||
43 | Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be | 54 | Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be |
44 | activated at the same time depending on the audio mode selected: | 55 | activated at the same time depending on the audio mode selected: |
56 | |||
45 | * 16-bit/48kHz ==> 4 channels in + 4 channels out | 57 | * 16-bit/48kHz ==> 4 channels in + 4 channels out |
58 | |||
46 | - Ai+Ao+Di+Do | 59 | - Ai+Ao+Di+Do |
60 | |||
47 | * 24-bit/48kHz ==> 4 channels in + 2 channels out, | 61 | * 24-bit/48kHz ==> 4 channels in + 2 channels out, |
48 | or 2 channels in + 4 channels out | 62 | or 2 channels in + 4 channels out |
63 | |||
49 | - Ai+Ao+Do or Ai+Di+Ao or Ai+Di+Do or Di+Ao+Do | 64 | - Ai+Ao+Do or Ai+Di+Ao or Ai+Di+Do or Di+Ao+Do |
65 | |||
50 | * 24-bit/96kHz ==> 2 channels in _or_ 2 channels out (half duplex only) | 66 | * 24-bit/96kHz ==> 2 channels in _or_ 2 channels out (half duplex only) |
67 | |||
51 | - Ai or Ao or Di or Do | 68 | - Ai or Ao or Di or Do |
52 | 69 | ||
53 | Important facts about the Digital interface: | 70 | Important facts about the Digital interface: |
54 | -------------------------------------------- | 71 | -------------------------------------------- |
72 | |||
55 | * The Do port additionally supports surround-encoded AC-3 and DTS passthrough, | 73 | * The Do port additionally supports surround-encoded AC-3 and DTS passthrough, |
56 | though I haven't tested it under Linux | 74 | though I haven't tested it under Linux |
75 | |||
57 | - Note that in this setup only the Do interface can be enabled | 76 | - Note that in this setup only the Do interface can be enabled |
77 | |||
58 | * Apart from recording an audio digital stream, enabling the Di port is a way | 78 | * Apart from recording an audio digital stream, enabling the Di port is a way |
59 | to synchronize the device to an external sample clock | 79 | to synchronize the device to an external sample clock |
80 | |||
60 | - As a consequence, the Di port must be enable only if an active Digital | 81 | - As a consequence, the Di port must be enable only if an active Digital |
61 | source is connected | 82 | source is connected |
62 | - Enabling Di when no digital source is connected can result in a | 83 | - Enabling Di when no digital source is connected can result in a |
63 | synchronization error (for instance sound played at an odd sample rate) | 84 | synchronization error (for instance sound played at an odd sample rate) |
64 | 85 | ||
65 | 86 | ||
66 | 2 - Audiophile USB MIDI support in ALSA | 87 | Audiophile USB MIDI support in ALSA |
67 | ======================================= | 88 | =================================== |
68 | 89 | ||
69 | The Audiophile USB MIDI ports will be automatically supported once the | 90 | The Audiophile USB MIDI ports will be automatically supported once the |
70 | following modules have been loaded: | 91 | following modules have been loaded: |
92 | |||
71 | * snd-usb-audio | 93 | * snd-usb-audio |
72 | * snd-seq-midi | 94 | * snd-seq-midi |
73 | 95 | ||
74 | No additional setting is required. | 96 | No additional setting is required. |
75 | 97 | ||
76 | 98 | ||
77 | 3 - Audiophile USB Audio support in ALSA | 99 | Audiophile USB Audio support in ALSA |
78 | ======================================== | 100 | ==================================== |
79 | 101 | ||
80 | Audio functions of the Audiophile USB device are handled by the snd-usb-audio | 102 | Audio functions of the Audiophile USB device are handled by the snd-usb-audio |
81 | module. This module can work in a default mode (without any device-specific | 103 | module. This module can work in a default mode (without any device-specific |
82 | parameter), or in an "advanced" mode with the device-specific parameter called | 104 | parameter), or in an "advanced" mode with the device-specific parameter called |
83 | "device_setup". | 105 | ``device_setup``. |
84 | 106 | ||
85 | 3.1 - Default Alsa driver mode | 107 | Default Alsa driver mode |
86 | ------------------------------ | 108 | ------------------------ |
87 | 109 | ||
88 | The default behavior of the snd-usb-audio driver is to list the device | 110 | The default behavior of the snd-usb-audio driver is to list the device |
89 | capabilities at startup and activate the required mode when required | 111 | capabilities at startup and activate the required mode when required |
@@ -101,6 +123,7 @@ Default Alsa driver mode can lead to device misconfigurations. | |||
101 | Let's get back to the Default Alsa driver mode for now. In this case the | 123 | Let's get back to the Default Alsa driver mode for now. In this case the |
102 | Audiophile interfaces are mapped to alsa pcm devices in the following | 124 | Audiophile interfaces are mapped to alsa pcm devices in the following |
103 | way (I suppose the device's index is 1): | 125 | way (I suppose the device's index is 1): |
126 | |||
104 | * hw:1,0 is Ao in playback and Di in capture | 127 | * hw:1,0 is Ao in playback and Di in capture |
105 | * hw:1,1 is Do in playback and Ai in capture | 128 | * hw:1,1 is Do in playback and Ai in capture |
106 | * hw:1,2 is Do in AC3/DTS passthrough mode | 129 | * hw:1,2 is Do in AC3/DTS passthrough mode |
@@ -115,20 +138,28 @@ This has been fixed in kernel 2.6.23 and above and now the hw:1,2 interface | |||
115 | is reported to be big endian in this default driver mode. | 138 | is reported to be big endian in this default driver mode. |
116 | 139 | ||
117 | Examples: | 140 | Examples: |
118 | * playing a S24_3BE encoded raw file to the Ao port | 141 | |
142 | * playing a S24_3BE encoded raw file to the Ao port:: | ||
143 | |||
119 | % aplay -D hw:1,0 -c2 -t raw -r48000 -fS24_3BE test.raw | 144 | % aplay -D hw:1,0 -c2 -t raw -r48000 -fS24_3BE test.raw |
120 | * recording a S24_3BE encoded raw file from the Ai port | 145 | |
146 | * recording a S24_3BE encoded raw file from the Ai port:: | ||
147 | |||
121 | % arecord -D hw:1,1 -c2 -t raw -r48000 -fS24_3BE test.raw | 148 | % arecord -D hw:1,1 -c2 -t raw -r48000 -fS24_3BE test.raw |
122 | * playing a S16_BE encoded raw file to the Do port | 149 | |
150 | * playing a S16_BE encoded raw file to the Do port:: | ||
151 | |||
123 | % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test.raw | 152 | % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test.raw |
124 | * playing an ac3 sample file to the Do port | 153 | |
154 | * playing an ac3 sample file to the Do port:: | ||
155 | |||
125 | % aplay -D hw:1,2 --channels=6 ac3_S16_BE_encoded_file.raw | 156 | % aplay -D hw:1,2 --channels=6 ac3_S16_BE_encoded_file.raw |
126 | 157 | ||
127 | If you're happy with the default Alsa driver mode and don't experience any | 158 | If you're happy with the default Alsa driver mode and don't experience any |
128 | issue with this mode, then you can skip the following chapter. | 159 | issue with this mode, then you can skip the following chapter. |
129 | 160 | ||
130 | 3.2 - Advanced module setup | 161 | Advanced module setup |
131 | --------------------------- | 162 | --------------------- |
132 | 163 | ||
133 | Due to the hardware constraints described above, the device initialization made | 164 | Due to the hardware constraints described above, the device initialization made |
134 | by the Alsa driver in default mode may result in a corrupted state of the | 165 | by the Alsa driver in default mode may result in a corrupted state of the |
@@ -137,34 +168,39 @@ from the Ai interface sounds distorted (as if boosted with an excessive high | |||
137 | volume gain). | 168 | volume gain). |
138 | 169 | ||
139 | For people having this problem, the snd-usb-audio module has a new module | 170 | For people having this problem, the snd-usb-audio module has a new module |
140 | parameter called "device_setup" (this parameter was introduced in kernel | 171 | parameter called ``device_setup`` (this parameter was introduced in kernel |
141 | release 2.6.17) | 172 | release 2.6.17) |
142 | 173 | ||
143 | 3.2.1 - Initializing the working mode of the Audiophile USB | 174 | Initializing the working mode of the Audiophile USB |
175 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
144 | 176 | ||
145 | As far as the Audiophile USB device is concerned, this value let the user | 177 | As far as the Audiophile USB device is concerned, this value let the user |
146 | specify: | 178 | specify: |
179 | |||
147 | * the sample depth | 180 | * the sample depth |
148 | * the sample rate | 181 | * the sample rate |
149 | * whether the Di port is used or not | 182 | * whether the Di port is used or not |
150 | 183 | ||
151 | When initialized with "device_setup=0x00", the snd-usb-audio module has | 184 | When initialized with ``device_setup=0x00``, the snd-usb-audio module has |
152 | the same behaviour as when the parameter is omitted (see paragraph "Default | 185 | the same behaviour as when the parameter is omitted (see paragraph "Default |
153 | Alsa driver mode" above) | 186 | Alsa driver mode" above) |
154 | 187 | ||
155 | Others modes are described in the following subsections. | 188 | Others modes are described in the following subsections. |
156 | 189 | ||
157 | 3.2.1.1 - 16-bit modes | 190 | 16-bit modes |
191 | ~~~~~~~~~~~~ | ||
158 | 192 | ||
159 | The two supported modes are: | 193 | The two supported modes are: |
160 | 194 | ||
161 | * device_setup=0x01 | 195 | * ``device_setup=0x01`` |
196 | |||
162 | - 16bits 48kHz mode with Di disabled | 197 | - 16bits 48kHz mode with Di disabled |
163 | - Ai,Ao,Do can be used at the same time | 198 | - Ai,Ao,Do can be used at the same time |
164 | - hw:1,0 is not available in capture mode | 199 | - hw:1,0 is not available in capture mode |
165 | - hw:1,2 is not available | 200 | - hw:1,2 is not available |
166 | 201 | ||
167 | * device_setup=0x11 | 202 | * ``device_setup=0x11`` |
203 | |||
168 | - 16bits 48kHz mode with Di enabled | 204 | - 16bits 48kHz mode with Di enabled |
169 | - Ai,Ao,Di,Do can be used at the same time | 205 | - Ai,Ao,Di,Do can be used at the same time |
170 | - hw:1,0 is available in capture mode | 206 | - hw:1,0 is available in capture mode |
@@ -173,33 +209,43 @@ The two supported modes are: | |||
173 | In this modes the device operates only at 16bits-modes. Before kernel 2.6.23, | 209 | In this modes the device operates only at 16bits-modes. Before kernel 2.6.23, |
174 | the devices where reported to be Big-Endian when in fact they were Little-Endian | 210 | the devices where reported to be Big-Endian when in fact they were Little-Endian |
175 | so that playing a file was a matter of using: | 211 | so that playing a file was a matter of using: |
212 | :: | ||
213 | |||
176 | % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test_S16_LE.raw | 214 | % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_BE test_S16_LE.raw |
215 | |||
177 | where "test_S16_LE.raw" was in fact a little-endian sample file. | 216 | where "test_S16_LE.raw" was in fact a little-endian sample file. |
178 | 217 | ||
179 | Thanks to Hakan Lennestal (who discovered the Little-Endiannes of the device in | 218 | Thanks to Hakan Lennestal (who discovered the Little-Endiannes of the device in |
180 | these modes) a fix has been committed (expected in kernel 2.6.23) and | 219 | these modes) a fix has been committed (expected in kernel 2.6.23) and |
181 | Alsa now reports Little-Endian interfaces. Thus playing a file now is as simple as | 220 | Alsa now reports Little-Endian interfaces. Thus playing a file now is as simple as |
182 | using: | 221 | using: |
222 | :: | ||
223 | |||
183 | % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_LE test_S16_LE.raw | 224 | % aplay -D hw:1,1 -c2 -t raw -r48000 -fS16_LE test_S16_LE.raw |
184 | 225 | ||
185 | 3.2.1.2 - 24-bit modes | 226 | |
227 | 24-bit modes | ||
228 | ~~~~~~~~~~~~ | ||
186 | 229 | ||
187 | The three supported modes are: | 230 | The three supported modes are: |
188 | 231 | ||
189 | * device_setup=0x09 | 232 | * ``device_setup=0x09`` |
233 | |||
190 | - 24bits 48kHz mode with Di disabled | 234 | - 24bits 48kHz mode with Di disabled |
191 | - Ai,Ao,Do can be used at the same time | 235 | - Ai,Ao,Do can be used at the same time |
192 | - hw:1,0 is not available in capture mode | 236 | - hw:1,0 is not available in capture mode |
193 | - hw:1,2 is not available | 237 | - hw:1,2 is not available |
194 | 238 | ||
195 | * device_setup=0x19 | 239 | * ``device_setup=0x19`` |
240 | |||
196 | - 24bits 48kHz mode with Di enabled | 241 | - 24bits 48kHz mode with Di enabled |
197 | - 3 ports from {Ai,Ao,Di,Do} can be used at the same time | 242 | - 3 ports from {Ai,Ao,Di,Do} can be used at the same time |
198 | - hw:1,0 is available in capture mode and an active digital source must be | 243 | - hw:1,0 is available in capture mode and an active digital source must be |
199 | connected to Di | 244 | connected to Di |
200 | - hw:1,2 is not available | 245 | - hw:1,2 is not available |
201 | 246 | ||
202 | * device_setup=0x0D or 0x10 | 247 | * ``device_setup=0x0D`` or ``0x10`` |
248 | |||
203 | - 24bits 96kHz mode | 249 | - 24bits 96kHz mode |
204 | - Di is enabled by default for this mode but does not need to be connected | 250 | - Di is enabled by default for this mode but does not need to be connected |
205 | to an active source | 251 | to an active source |
@@ -210,29 +256,35 @@ The three supported modes are: | |||
210 | In these modes the device is only Big-Endian compliant (see "Default Alsa driver | 256 | In these modes the device is only Big-Endian compliant (see "Default Alsa driver |
211 | mode" above for an aplay command example) | 257 | mode" above for an aplay command example) |
212 | 258 | ||
213 | 3.2.1.3 - AC3 w/ DTS passthru mode | 259 | AC3 w/ DTS passthru mode |
260 | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
214 | 261 | ||
215 | Thanks to Hakan Lennestal, I now have a report saying that this mode works. | 262 | Thanks to Hakan Lennestal, I now have a report saying that this mode works. |
216 | 263 | ||
217 | * device_setup=0x03 | 264 | * ``device_setup=0x03`` |
265 | |||
218 | - 16bits 48kHz mode with only the Do port enabled | 266 | - 16bits 48kHz mode with only the Do port enabled |
219 | - AC3 with DTS passthru | 267 | - AC3 with DTS passthru |
220 | - Caution with this setup the Do port is mapped to the pcm device hw:1,0 | 268 | - Caution with this setup the Do port is mapped to the pcm device hw:1,0 |
221 | 269 | ||
222 | The command line used to playback the AC3/DTS encoded .wav-files in this mode: | 270 | The command line used to playback the AC3/DTS encoded .wav-files in this mode: |
271 | :: | ||
272 | |||
223 | % aplay -D hw:1,0 --channels=6 ac3_S16_LE_encoded_file.raw | 273 | % aplay -D hw:1,0 --channels=6 ac3_S16_LE_encoded_file.raw |
224 | 274 | ||
225 | 3.2.2 - How to use the device_setup parameter | 275 | How to use the ``device_setup`` parameter |
226 | ---------------------------------------------- | 276 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
227 | 277 | ||
228 | The parameter can be given: | 278 | The parameter can be given: |
229 | 279 | ||
230 | * By manually probing the device (as root): | 280 | * By manually probing the device (as root)::: |
281 | |||
231 | # modprobe -r snd-usb-audio | 282 | # modprobe -r snd-usb-audio |
232 | # modprobe snd-usb-audio index=1 device_setup=0x09 | 283 | # modprobe snd-usb-audio index=1 device_setup=0x09 |
233 | 284 | ||
234 | * Or while configuring the modules options in your modules configuration file | 285 | * Or while configuring the modules options in your modules configuration file |
235 | (typically a .conf file in /etc/modprobe.d/ directory: | 286 | (typically a .conf file in /etc/modprobe.d/ directory::: |
287 | |||
236 | alias snd-card-1 snd-usb-audio | 288 | alias snd-card-1 snd-usb-audio |
237 | options snd-usb-audio index=1 device_setup=0x09 | 289 | options snd-usb-audio index=1 device_setup=0x09 |
238 | 290 | ||
@@ -250,26 +302,31 @@ CAUTION when initializing the device | |||
250 | * If you've correctly initialized the device in a valid mode and then want to switch | 302 | * If you've correctly initialized the device in a valid mode and then want to switch |
251 | to another mode (possibly with another sample-depth), please use also the following | 303 | to another mode (possibly with another sample-depth), please use also the following |
252 | procedure: | 304 | procedure: |
305 | |||
253 | - first turn off the device | 306 | - first turn off the device |
254 | - de-register the snd-usb-audio module (modprobe -r) | 307 | - de-register the snd-usb-audio module (modprobe -r) |
255 | - change the device_setup parameter by changing the device_setup | 308 | - change the device_setup parameter by changing the device_setup |
256 | option in /etc/modprobe.d/*.conf | 309 | option in ``/etc/modprobe.d/*.conf`` |
257 | - turn on the device | 310 | - turn on the device |
311 | |||
258 | * A workaround for this last issue has been applied to kernel 2.6.23, but it may not | 312 | * A workaround for this last issue has been applied to kernel 2.6.23, but it may not |
259 | be enough to ensure the 'stability' of the device initialization. | 313 | be enough to ensure the 'stability' of the device initialization. |
260 | 314 | ||
261 | 3.2.3 - Technical details for hackers | 315 | Technical details for hackers |
262 | ------------------------------------- | 316 | ----------------------------- |
317 | |||
263 | This section is for hackers, wanting to understand details about the device | 318 | This section is for hackers, wanting to understand details about the device |
264 | internals and how Alsa supports it. | 319 | internals and how Alsa supports it. |
265 | 320 | ||
266 | 3.2.3.1 - Audiophile USB's device_setup structure | 321 | Audiophile USB's ``device_setup`` structure |
322 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
267 | 323 | ||
268 | If you want to understand the device_setup magic numbers for the Audiophile | 324 | If you want to understand the device_setup magic numbers for the Audiophile |
269 | USB, you need some very basic understanding of binary computation. However, | 325 | USB, you need some very basic understanding of binary computation. However, |
270 | this is not required to use the parameter and you may skip this section. | 326 | this is not required to use the parameter and you may skip this section. |
271 | 327 | ||
272 | The device_setup is one byte long and its structure is the following: | 328 | The device_setup is one byte long and its structure is the following: |
329 | :: | ||
273 | 330 | ||
274 | +---+---+---+---+---+---+---+---+ | 331 | +---+---+---+---+---+---+---+---+ |
275 | | b7| b6| b5| b4| b3| b2| b1| b0| | 332 | | b7| b6| b5| b4| b3| b2| b1| b0| |
@@ -278,38 +335,55 @@ The device_setup is one byte long and its structure is the following: | |||
278 | +---+---+---+---+---+---+---+---+ | 335 | +---+---+---+---+---+---+---+---+ |
279 | 336 | ||
280 | Where: | 337 | Where: |
281 | * b0 is the "SET" bit | 338 | |
339 | * b0 is the ``SET`` bit | ||
340 | |||
282 | - it MUST be set if device_setup is initialized | 341 | - it MUST be set if device_setup is initialized |
283 | * b1 is the "DTS" bit | 342 | |
343 | * b1 is the ``DTS`` bit | ||
344 | |||
284 | - it is set only for Digital output with DTS/AC3 | 345 | - it is set only for Digital output with DTS/AC3 |
285 | - this setup is not tested | 346 | - this setup is not tested |
347 | |||
286 | * b2 is the Rate selection flag | 348 | * b2 is the Rate selection flag |
287 | - When set to "1" the rate range is 48.1-96kHz | 349 | |
350 | - When set to ``1`` the rate range is 48.1-96kHz | ||
288 | - Otherwise the sample rate range is 8-48kHz | 351 | - Otherwise the sample rate range is 8-48kHz |
352 | |||
289 | * b3 is the bit depth selection flag | 353 | * b3 is the bit depth selection flag |
290 | - When set to "1" samples are 24bits long | 354 | |
355 | - When set to ``1`` samples are 24bits long | ||
291 | - Otherwise they are 16bits long | 356 | - Otherwise they are 16bits long |
292 | - Note that b2 implies b3 as the 96kHz mode is only supported for 24 bits | 357 | - Note that b2 implies b3 as the 96kHz mode is only supported for 24 bits |
293 | samples | 358 | samples |
359 | |||
294 | * b4 is the Digital input flag | 360 | * b4 is the Digital input flag |
295 | - When set to "1" the device assumes that an active digital source is | 361 | |
362 | - When set to ``1`` the device assumes that an active digital source is | ||
296 | connected | 363 | connected |
297 | - You shouldn't enable Di if no source is seen on the port (this leads to | 364 | - You shouldn't enable Di if no source is seen on the port (this leads to |
298 | synchronization issues) | 365 | synchronization issues) |
299 | - b4 is implied by b2 (since only one port is enabled at a time no synch | 366 | - b4 is implied by b2 (since only one port is enabled at a time no synch |
300 | error can occur) | 367 | error can occur) |
301 | * b5 to b7 are reserved for future uses, and must be set to "0" | 368 | |
369 | * b5 to b7 are reserved for future uses, and must be set to ``0`` | ||
370 | |||
302 | - might become Ao, Do, Ai, for b7, b6, b4 respectively | 371 | - might become Ao, Do, Ai, for b7, b6, b4 respectively |
303 | 372 | ||
304 | Caution: | 373 | Caution: |
374 | |||
305 | * there is no check on the value you will give to device_setup | 375 | * there is no check on the value you will give to device_setup |
376 | |||
306 | - for instance choosing 0x05 (16bits 96kHz) will fail back to 0x09 since | 377 | - for instance choosing 0x05 (16bits 96kHz) will fail back to 0x09 since |
307 | b2 implies b3. But _there_will_be_no_warning_ in /var/log/messages | 378 | b2 implies b3. But _there_will_be_no_warning_ in /var/log/messages |
379 | |||
308 | * Hardware constraints due to the USB bus limitation aren't checked | 380 | * Hardware constraints due to the USB bus limitation aren't checked |
381 | |||
309 | - choosing b2 will prepare all interfaces for 24bits/96kHz but you'll | 382 | - choosing b2 will prepare all interfaces for 24bits/96kHz but you'll |
310 | only be able to use one at the same time | 383 | only be able to use one at the same time |
311 | 384 | ||
312 | 3.2.3.2 - USB implementation details for this device | 385 | USB implementation details for this device |
386 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
313 | 387 | ||
314 | You may safely skip this section if you're not interested in driver | 388 | You may safely skip this section if you're not interested in driver |
315 | hacking. | 389 | hacking. |
@@ -319,46 +393,72 @@ data I got by usb-snooping the windows and Linux drivers. | |||
319 | 393 | ||
320 | The M-Audio Audiophile USB has 7 USB Interfaces: | 394 | The M-Audio Audiophile USB has 7 USB Interfaces: |
321 | a "USB interface": | 395 | a "USB interface": |
396 | |||
322 | * USB Interface nb.0 | 397 | * USB Interface nb.0 |
323 | * USB Interface nb.1 | 398 | * USB Interface nb.1 |
399 | |||
324 | - Audio Control function | 400 | - Audio Control function |
401 | |||
325 | * USB Interface nb.2 | 402 | * USB Interface nb.2 |
403 | |||
326 | - Analog Output | 404 | - Analog Output |
405 | |||
327 | * USB Interface nb.3 | 406 | * USB Interface nb.3 |
407 | |||
328 | - Digital Output | 408 | - Digital Output |
409 | |||
329 | * USB Interface nb.4 | 410 | * USB Interface nb.4 |
411 | |||
330 | - Analog Input | 412 | - Analog Input |
413 | |||
331 | * USB Interface nb.5 | 414 | * USB Interface nb.5 |
415 | |||
332 | - Digital Input | 416 | - Digital Input |
417 | |||
333 | * USB Interface nb.6 | 418 | * USB Interface nb.6 |
419 | |||
334 | - MIDI interface compliant with the MIDIMAN quirk | 420 | - MIDI interface compliant with the MIDIMAN quirk |
335 | 421 | ||
336 | Each interface has 5 altsettings (AltSet 1,2,3,4,5) except: | 422 | Each interface has 5 altsettings (AltSet 1,2,3,4,5) except: |
423 | |||
337 | * Interface 3 (Digital Out) has an extra Alset nb.6 | 424 | * Interface 3 (Digital Out) has an extra Alset nb.6 |
338 | * Interface 5 (Digital In) does not have Alset nb.3 and 5 | 425 | * Interface 5 (Digital In) does not have Alset nb.3 and 5 |
339 | 426 | ||
340 | Here is a short description of the AltSettings capabilities: | 427 | Here is a short description of the AltSettings capabilities: |
341 | * AltSettings 1 corresponds to | 428 | |
429 | * AltSettings 1 corresponds to | ||
430 | |||
342 | - 24-bit depth, 48.1-96kHz sample mode | 431 | - 24-bit depth, 48.1-96kHz sample mode |
343 | - Adaptive playback (Ao and Do), Synch capture (Ai), or Asynch capture (Di) | 432 | - Adaptive playback (Ao and Do), Synch capture (Ai), or Asynch capture (Di) |
344 | * AltSettings 2 corresponds to | 433 | |
434 | * AltSettings 2 corresponds to | ||
435 | |||
345 | - 24-bit depth, 8-48kHz sample mode | 436 | - 24-bit depth, 8-48kHz sample mode |
346 | - Asynch capture and playback (Ao,Ai,Do,Di) | 437 | - Asynch capture and playback (Ao,Ai,Do,Di) |
347 | * AltSettings 3 corresponds to | 438 | |
439 | * AltSettings 3 corresponds to | ||
440 | |||
348 | - 24-bit depth, 8-48kHz sample mode | 441 | - 24-bit depth, 8-48kHz sample mode |
349 | - Synch capture (Ai) and Adaptive playback (Ao,Do) | 442 | - Synch capture (Ai) and Adaptive playback (Ao,Do) |
350 | * AltSettings 4 corresponds to | 443 | |
444 | * AltSettings 4 corresponds to | ||
445 | |||
351 | - 16-bit depth, 8-48kHz sample mode | 446 | - 16-bit depth, 8-48kHz sample mode |
352 | - Asynch capture and playback (Ao,Ai,Do,Di) | 447 | - Asynch capture and playback (Ao,Ai,Do,Di) |
353 | * AltSettings 5 corresponds to | 448 | |
449 | * AltSettings 5 corresponds to | ||
450 | |||
354 | - 16-bit depth, 8-48kHz sample mode | 451 | - 16-bit depth, 8-48kHz sample mode |
355 | - Synch capture (Ai) and Adaptive playback (Ao,Do) | 452 | - Synch capture (Ai) and Adaptive playback (Ao,Do) |
356 | * AltSettings 6 corresponds to | 453 | |
454 | * AltSettings 6 corresponds to | ||
455 | |||
357 | - 16-bit depth, 8-48kHz sample mode | 456 | - 16-bit depth, 8-48kHz sample mode |
358 | - Synch playback (Do), audio format type III IEC1937_AC-3 | 457 | - Synch playback (Do), audio format type III IEC1937_AC-3 |
359 | 458 | ||
360 | In order to ensure a correct initialization of the device, the driver | 459 | In order to ensure a correct initialization of the device, the driver |
361 | _must_know_ how the device will be used: | 460 | *must* *know* how the device will be used: |
461 | |||
362 | * if DTS is chosen, only Interface 2 with AltSet nb.6 must be | 462 | * if DTS is chosen, only Interface 2 with AltSet nb.6 must be |
363 | registered | 463 | registered |
364 | * if 96KHz only AltSets nb.1 of each interface must be selected | 464 | * if 96KHz only AltSets nb.1 of each interface must be selected |
@@ -371,20 +471,21 @@ _must_know_ how the device will be used: | |||
371 | 471 | ||
372 | When device_setup is given as a parameter to the snd-usb-audio module, the | 472 | When device_setup is given as a parameter to the snd-usb-audio module, the |
373 | parse_audio_endpoints function uses a quirk called | 473 | parse_audio_endpoints function uses a quirk called |
374 | "audiophile_skip_setting_quirk" in order to prevent AltSettings not | 474 | ``audiophile_skip_setting_quirk`` in order to prevent AltSettings not |
375 | corresponding to device_setup from being registered in the driver. | 475 | corresponding to device_setup from being registered in the driver. |
376 | 476 | ||
377 | 4 - Audiophile USB and Jack support | 477 | Audiophile USB and Jack support |
378 | =================================== | 478 | =============================== |
379 | 479 | ||
380 | This section deals with support of the Audiophile USB device in Jack. | 480 | This section deals with support of the Audiophile USB device in Jack. |
381 | 481 | ||
382 | There are 2 main potential issues when using Jackd with the device: | 482 | There are 2 main potential issues when using Jackd with the device: |
483 | |||
383 | * support for Big-Endian devices in 24-bit modes | 484 | * support for Big-Endian devices in 24-bit modes |
384 | * support for 4-in / 4-out channels | 485 | * support for 4-in / 4-out channels |
385 | 486 | ||
386 | 4.1 - Direct support in Jackd | 487 | Direct support in Jackd |
387 | ----------------------------- | 488 | ----------------------- |
388 | 489 | ||
389 | Jack supports big endian devices only in recent versions (thanks to | 490 | Jack supports big endian devices only in recent versions (thanks to |
390 | Andreas Steinmetz for his first big-endian patch). I can't remember | 491 | Andreas Steinmetz for his first big-endian patch). I can't remember |
@@ -396,29 +497,35 @@ are now Little Endians ;-) ). | |||
396 | 497 | ||
397 | You can run jackd with the following command for playback with Ao and | 498 | You can run jackd with the following command for playback with Ao and |
398 | record with Ai: | 499 | record with Ai: |
500 | :: | ||
501 | |||
399 | % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1 | 502 | % jackd -R -dalsa -Phw:1,0 -r48000 -p128 -n2 -D -Chw:1,1 |
400 | 503 | ||
401 | 4.2 - Using Alsa plughw | 504 | Using Alsa plughw |
402 | ----------------------- | 505 | ----------------- |
506 | |||
403 | If you don't have a recent Jackd installed, you can downgrade to using | 507 | If you don't have a recent Jackd installed, you can downgrade to using |
404 | the Alsa "plug" converter. | 508 | the Alsa ``plug`` converter. |
405 | 509 | ||
406 | For instance here is one way to run Jack with 2 playback channels on Ao and 2 | 510 | For instance here is one way to run Jack with 2 playback channels on Ao and 2 |
407 | capture channels from Ai: | 511 | capture channels from Ai: |
512 | :: | ||
513 | |||
408 | % jackd -R -dalsa -dplughw:1 -r48000 -p256 -n2 -D -Cplughw:1,1 | 514 | % jackd -R -dalsa -dplughw:1 -r48000 -p256 -n2 -D -Cplughw:1,1 |
409 | 515 | ||
410 | However you may see the following warning message: | 516 | However you may see the following warning message: |
411 | "You appear to be using the ALSA software "plug" layer, probably a result of | 517 | You appear to be using the ALSA software "plug" layer, probably a result of |
412 | using the "default" ALSA device. This is less efficient than it could be. | 518 | using the "default" ALSA device. This is less efficient than it could be. |
413 | Consider using a hardware device instead rather than using the plug layer." | 519 | Consider using a hardware device instead rather than using the plug layer. |
414 | 520 | ||
415 | 4.3 - Getting 2 input and/or output interfaces in Jack | 521 | Getting 2 input and/or output interfaces in Jack |
416 | ------------------------------------------------------ | 522 | ------------------------------------------------ |
417 | 523 | ||
418 | As you can see, starting the Jack server this way will only enable 1 stereo | 524 | As you can see, starting the Jack server this way will only enable 1 stereo |
419 | input (Di or Ai) and 1 stereo output (Ao or Do). | 525 | input (Di or Ai) and 1 stereo output (Ao or Do). |
420 | 526 | ||
421 | This is due to the following restrictions: | 527 | This is due to the following restrictions: |
528 | |||
422 | * Jack can only open one capture device and one playback device at a time | 529 | * Jack can only open one capture device and one playback device at a time |
423 | * The Audiophile USB is seen as 2 (or three) Alsa devices: hw:1,0, hw:1,1 | 530 | * The Audiophile USB is seen as 2 (or three) Alsa devices: hw:1,0, hw:1,1 |
424 | (and optionally hw:1,2) | 531 | (and optionally hw:1,2) |
@@ -432,6 +539,7 @@ It is related to another device (ice1712) but can be adapted to suit | |||
432 | the Audiophile USB. | 539 | the Audiophile USB. |
433 | 540 | ||
434 | Enabling multiple Audiophile USB interfaces for Jackd will certainly require: | 541 | Enabling multiple Audiophile USB interfaces for Jackd will certainly require: |
542 | |||
435 | * Making sure your Jackd version has the MMAP_COMPLEX patch (see the ice1712 page) | 543 | * Making sure your Jackd version has the MMAP_COMPLEX patch (see the ice1712 page) |
436 | * (maybe) patching the alsa-lib/src/pcm/pcm_multi.c file (see the ice1712 page) | 544 | * (maybe) patching the alsa-lib/src/pcm/pcm_multi.c file (see the ice1712 page) |
437 | * define a multi device (combination of hw:1,0 and hw:1,1) in your .asoundrc | 545 | * define a multi device (combination of hw:1,0 and hw:1,1) in your .asoundrc |
diff --git a/Documentation/sound/alsa/Bt87x.txt b/Documentation/sound/cards/bt87x.rst index f158cde8b065..912732d3ef9e 100644 --- a/Documentation/sound/alsa/Bt87x.txt +++ b/Documentation/sound/cards/bt87x.rst | |||
@@ -1,18 +1,23 @@ | |||
1 | ================= | ||
2 | ALSA BT87x Driver | ||
3 | ================= | ||
4 | |||
1 | Intro | 5 | Intro |
2 | ===== | 6 | ===== |
3 | 7 | ||
4 | You might have noticed that the bt878 grabber cards have actually | 8 | You might have noticed that the bt878 grabber cards have actually |
5 | _two_ PCI functions: | 9 | *two* PCI functions: |
10 | :: | ||
6 | 11 | ||
7 | $ lspci | 12 | $ lspci |
8 | [ ... ] | 13 | [ ... ] |
9 | 00:0a.0 Multimedia video controller: Brooktree Corporation Bt878 (rev 02) | 14 | 00:0a.0 Multimedia video controller: Brooktree Corporation Bt878 (rev 02) |
10 | 00:0a.1 Multimedia controller: Brooktree Corporation Bt878 (rev 02) | 15 | 00:0a.1 Multimedia controller: Brooktree Corporation Bt878 (rev 02) |
11 | [ ... ] | 16 | [ ... ] |
12 | 17 | ||
13 | The first does video, it is backward compatible to the bt848. The second | 18 | The first does video, it is backward compatible to the bt848. The second |
14 | does audio. snd-bt87x is a driver for the second function. It's a sound | 19 | does audio. snd-bt87x is a driver for the second function. It's a sound |
15 | driver which can be used for recording sound (and _only_ recording, no | 20 | driver which can be used for recording sound (and *only* recording, no |
16 | playback). As most TV cards come with a short cable which can be plugged | 21 | playback). As most TV cards come with a short cable which can be plugged |
17 | into your sound card's line-in you probably don't need this driver if all | 22 | into your sound card's line-in you probably don't need this driver if all |
18 | you want to do is just watching TV... | 23 | you want to do is just watching TV... |
@@ -30,9 +35,9 @@ The driver is now stable. However, it doesn't know about many TV cards, | |||
30 | and it refuses to load for cards it doesn't know. | 35 | and it refuses to load for cards it doesn't know. |
31 | 36 | ||
32 | If the driver complains ("Unknown TV card found, the audio driver will | 37 | If the driver complains ("Unknown TV card found, the audio driver will |
33 | not load"), you can specify the load_all=1 option to force the driver to | 38 | not load"), you can specify the ``load_all=1`` option to force the driver to |
34 | try to use the audio capture function of your card. If the frequency of | 39 | try to use the audio capture function of your card. If the frequency of |
35 | recorded data is not right, try to specify the digital_rate option with | 40 | recorded data is not right, try to specify the ``digital_rate`` option with |
36 | other values than the default 32000 (often it's 44100 or 64000). | 41 | other values than the default 32000 (often it's 44100 or 64000). |
37 | 42 | ||
38 | If you have an unknown card, please mail the ID and board name to | 43 | If you have an unknown card, please mail the ID and board name to |
diff --git a/Documentation/sound/alsa/CMIPCI.txt b/Documentation/sound/cards/cmipci.rst index 4e36e6e809ca..9ea1de6ec4ce 100644 --- a/Documentation/sound/alsa/CMIPCI.txt +++ b/Documentation/sound/cards/cmipci.rst | |||
@@ -1,7 +1,8 @@ | |||
1 | Brief Notes on C-Media 8338/8738/8768/8770 Driver | 1 | ================================================= |
2 | ================================================= | 2 | Brief Notes on C-Media 8338/8738/8768/8770 Driver |
3 | ================================================= | ||
3 | 4 | ||
4 | Takashi Iwai <tiwai@suse.de> | 5 | Takashi Iwai <tiwai@suse.de> |
5 | 6 | ||
6 | 7 | ||
7 | Front/Rear Multi-channel Playback | 8 | Front/Rear Multi-channel Playback |
@@ -30,19 +31,20 @@ The rear output can be heard only when "Four Channel Mode" switch is | |||
30 | disabled. Otherwise no signal will be routed to the rear speakers. | 31 | disabled. Otherwise no signal will be routed to the rear speakers. |
31 | As default it's turned on. | 32 | As default it's turned on. |
32 | 33 | ||
33 | *** WARNING *** | 34 | .. WARNING:: |
34 | When "Four Channel Mode" switch is off, the output from rear speakers | 35 | When "Four Channel Mode" switch is off, the output from rear speakers |
35 | will be FULL VOLUME regardless of Master and PCM volumes. | 36 | will be FULL VOLUME regardless of Master and PCM volumes [#]_. |
36 | This might damage your audio equipment. Please disconnect speakers | 37 | This might damage your audio equipment. Please disconnect speakers |
37 | before your turn off this switch. | 38 | before your turn off this switch. |
38 | *** WARNING *** | ||
39 | 39 | ||
40 | [ Well.. I once got the output with correct volume (i.e. same with the | 40 | |
41 | .. [#] | ||
42 | Well.. I once got the output with correct volume (i.e. same with the | ||
41 | front one) and was so excited. It was even with "Four Channel" bit | 43 | front one) and was so excited. It was even with "Four Channel" bit |
42 | on and "double DAC" mode. Actually I could hear separate 4 channels | 44 | on and "double DAC" mode. Actually I could hear separate 4 channels |
43 | from front and rear speakers! But.. after reboot, all was gone. | 45 | from front and rear speakers! But.. after reboot, all was gone. |
44 | It's a very pity that I didn't save the register dump at that | 46 | It's a very pity that I didn't save the register dump at that |
45 | time.. Maybe there is an unknown register to achieve this... ] | 47 | time.. Maybe there is an unknown register to achieve this... |
46 | 48 | ||
47 | If your card has an extra output jack for the rear output, the rear | 49 | If your card has an extra output jack for the rear output, the rear |
48 | playback should be routed there as default. If not, there is a | 50 | playback should be routed there as default. If not, there is a |
@@ -73,12 +75,14 @@ cannot operate with full-duplex. | |||
73 | 75 | ||
74 | The 4.0 and 5.1 modes are defined as the pcm "surround40" and "surround51" | 76 | The 4.0 and 5.1 modes are defined as the pcm "surround40" and "surround51" |
75 | in alsa-lib. For example, you can play a WAV file with 6 channels like | 77 | in alsa-lib. For example, you can play a WAV file with 6 channels like |
78 | :: | ||
76 | 79 | ||
77 | % aplay -Dsurround51 sixchannels.wav | 80 | % aplay -Dsurround51 sixchannels.wav |
78 | 81 | ||
79 | For programming the 4/6 channel playback, you need to specify the PCM | 82 | For programming the 4/6 channel playback, you need to specify the PCM |
80 | channels as you like and set the format S16LE. For example, for playback | 83 | channels as you like and set the format S16LE. For example, for playback |
81 | with 4 channels, | 84 | with 4 channels, |
85 | :: | ||
82 | 86 | ||
83 | snd_pcm_hw_params_set_access(pcm, hw, SND_PCM_ACCESS_RW_INTERLEAVED); | 87 | snd_pcm_hw_params_set_access(pcm, hw, SND_PCM_ACCESS_RW_INTERLEAVED); |
84 | // or mmap if you like | 88 | // or mmap if you like |
@@ -89,13 +93,15 @@ and use the interleaved 4 channel data. | |||
89 | 93 | ||
90 | There are some control switches affecting to the speaker connections: | 94 | There are some control switches affecting to the speaker connections: |
91 | 95 | ||
92 | "Line-In Mode" - an enum control to change the behavior of line-in | 96 | Line-In Mode |
97 | an enum control to change the behavior of line-in | ||
93 | jack. Either "Line-In", "Rear Output" or "Bass Output" can | 98 | jack. Either "Line-In", "Rear Output" or "Bass Output" can |
94 | be selected. The last item is available only with model 039 | 99 | be selected. The last item is available only with model 039 |
95 | or newer. | 100 | or newer. |
96 | When "Rear Output" is chosen, the surround channels 3 and 4 | 101 | When "Rear Output" is chosen, the surround channels 3 and 4 |
97 | are output to line-in jack. | 102 | are output to line-in jack. |
98 | "Mic-In Mode" - an enum control to change the behavior of mic-in | 103 | Mic-In Mode |
104 | an enum control to change the behavior of mic-in | ||
99 | jack. Either "Mic-In" or "Center/LFE Output" can be | 105 | jack. Either "Mic-In" or "Center/LFE Output" can be |
100 | selected. | 106 | selected. |
101 | When "Center/LFE Output" is chosen, the center and bass | 107 | When "Center/LFE Output" is chosen, the center and bass |
@@ -111,11 +117,14 @@ The SPDIF playback and capture are done via the third PCM device | |||
111 | (hw:0,2). Usually this is assigned to the PCM device "spdif". | 117 | (hw:0,2). Usually this is assigned to the PCM device "spdif". |
112 | The available rates are 44100 and 48000 Hz. | 118 | The available rates are 44100 and 48000 Hz. |
113 | For playback with aplay, you can run like below: | 119 | For playback with aplay, you can run like below: |
120 | :: | ||
114 | 121 | ||
115 | % aplay -Dhw:0,2 foo.wav | 122 | % aplay -Dhw:0,2 foo.wav |
116 | 123 | ||
117 | or | 124 | or |
118 | 125 | ||
126 | :: | ||
127 | |||
119 | % aplay -Dspdif foo.wav | 128 | % aplay -Dspdif foo.wav |
120 | 129 | ||
121 | 24bit format is also supported experimentally. | 130 | 24bit format is also supported experimentally. |
@@ -140,31 +149,40 @@ off. (Also don't forget to turn on "IEC958 Output Switch", too.) | |||
140 | 149 | ||
141 | Additionally there are relevant control switches: | 150 | Additionally there are relevant control switches: |
142 | 151 | ||
143 | "IEC958 Mix Analog" - Mix analog PCM playback and FM-OPL/3 streams and | 152 | IEC958 Mix Analog |
153 | Mix analog PCM playback and FM-OPL/3 streams and | ||
144 | output through SPDIF. This switch appears only on old chip | 154 | output through SPDIF. This switch appears only on old chip |
145 | models (CM8738 033 and 037). | 155 | models (CM8738 033 and 037). |
156 | |||
146 | Note: without this control you can output PCM to SPDIF. | 157 | Note: without this control you can output PCM to SPDIF. |
147 | This is "mixing" of streams, so e.g. it's not for AC3 output | 158 | This is "mixing" of streams, so e.g. it's not for AC3 output |
148 | (see the next section). | 159 | (see the next section). |
149 | 160 | ||
150 | "IEC958 In Select" - Select SPDIF input, the internal CD-in (false) | 161 | IEC958 In Select |
162 | Select SPDIF input, the internal CD-in (false) | ||
151 | and the external input (true). | 163 | and the external input (true). |
152 | 164 | ||
153 | "IEC958 Loop" - SPDIF input data is loop back into SPDIF | 165 | IEC958 Loop |
166 | SPDIF input data is loop back into SPDIF | ||
154 | output (aka bypass) | 167 | output (aka bypass) |
155 | 168 | ||
156 | "IEC958 Copyright" - Set the copyright bit. | 169 | IEC958 Copyright |
170 | Set the copyright bit. | ||
157 | 171 | ||
158 | "IEC958 5V" - Select 0.5V (coax) or 5V (optical) interface. | 172 | IEC958 5V |
173 | Select 0.5V (coax) or 5V (optical) interface. | ||
159 | On some cards this doesn't work and you need to change the | 174 | On some cards this doesn't work and you need to change the |
160 | configuration with hardware dip-switch. | 175 | configuration with hardware dip-switch. |
161 | 176 | ||
162 | "IEC958 In Monitor" - SPDIF input is routed to DAC. | 177 | IEC958 In Monitor |
178 | SPDIF input is routed to DAC. | ||
163 | 179 | ||
164 | "IEC958 In Phase Inverse" - Set SPDIF input format as inverse. | 180 | IEC958 In Phase Inverse |
181 | Set SPDIF input format as inverse. | ||
165 | [FIXME: this doesn't work on all chips..] | 182 | [FIXME: this doesn't work on all chips..] |
166 | 183 | ||
167 | "IEC958 In Valid" - Set input validity flag detection. | 184 | IEC958 In Valid |
185 | Set input validity flag detection. | ||
168 | 186 | ||
169 | Note: When "PCM Playback Switch" is on, you'll hear the digital output | 187 | Note: When "PCM Playback Switch" is on, you'll hear the digital output |
170 | stream through analog line-out. | 188 | stream through analog line-out. |
@@ -217,7 +235,7 @@ to enable MIDI support. Valid I/O ports are 0x300, 0x310, 0x320 and | |||
217 | With CMI8738 and newer chips, the MIDI interface is enabled by default | 235 | With CMI8738 and newer chips, the MIDI interface is enabled by default |
218 | and the driver automatically chooses a port address. | 236 | and the driver automatically chooses a port address. |
219 | 237 | ||
220 | There is _no_ hardware wavetable function on this chip (except for | 238 | There is *no* hardware wavetable function on this chip (except for |
221 | OPL3 synth below). | 239 | OPL3 synth below). |
222 | What's said as MIDI synth on Windows is a software synthesizer | 240 | What's said as MIDI synth on Windows is a software synthesizer |
223 | emulation. On Linux use TiMidity or other softsynth program for | 241 | emulation. On Linux use TiMidity or other softsynth program for |
diff --git a/Documentation/sound/alsa/emu10k1-jack.txt b/Documentation/sound/cards/emu10k1-jack.rst index 751d45036a05..6597f1ea83f0 100644 --- a/Documentation/sound/alsa/emu10k1-jack.txt +++ b/Documentation/sound/cards/emu10k1-jack.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ================================================================= | ||
2 | Low latency, multichannel audio with JACK and the emu10k1/emu10k2 | ||
3 | ================================================================= | ||
4 | |||
1 | This document is a guide to using the emu10k1 based devices with JACK for low | 5 | This document is a guide to using the emu10k1 based devices with JACK for low |
2 | latency, multichannel recording functionality. All of my recent work to allow | 6 | latency, multichannel recording functionality. All of my recent work to allow |
3 | Linux users to use the full capabilities of their hardware has been inspired | 7 | Linux users to use the full capabilities of their hardware has been inspired |
@@ -7,8 +11,6 @@ power of this hardware. | |||
7 | http://www.kxproject.com | 11 | http://www.kxproject.com |
8 | - Lee Revell, 2005.03.30 | 12 | - Lee Revell, 2005.03.30 |
9 | 13 | ||
10 | Low latency, multichannel audio with JACK and the emu10k1/emu10k2 | ||
11 | ----------------------------------------------------------------- | ||
12 | 14 | ||
13 | Until recently, emu10k1 users on Linux did not have access to the same low | 15 | Until recently, emu10k1 users on Linux did not have access to the same low |
14 | latency, multichannel features offered by the "kX ASIO" feature of their | 16 | latency, multichannel features offered by the "kX ASIO" feature of their |
@@ -23,14 +25,15 @@ select the correct device for JACK to use. Actually, for qjackctl users it's | |||
23 | fairly self explanatory - select Duplex, then for capture and playback select | 25 | fairly self explanatory - select Duplex, then for capture and playback select |
24 | the multichannel devices, set the in and out channels to 16, and the sample | 26 | the multichannel devices, set the in and out channels to 16, and the sample |
25 | rate to 48000Hz. The command line looks like this: | 27 | rate to 48000Hz. The command line looks like this: |
28 | :: | ||
26 | 29 | ||
27 | /usr/local/bin/jackd -R -dalsa -r48000 -p64 -n2 -D -Chw:0,2 -Phw:0,3 -S | 30 | /usr/local/bin/jackd -R -dalsa -r48000 -p64 -n2 -D -Chw:0,2 -Phw:0,3 -S |
28 | 31 | ||
29 | This will give you 16 input ports and 16 output ports. | 32 | This will give you 16 input ports and 16 output ports. |
30 | 33 | ||
31 | The 16 output ports map onto the 16 FX buses (or the first 16 of 64, for the | 34 | The 16 output ports map onto the 16 FX buses (or the first 16 of 64, for the |
32 | Audigy). The mapping from FX bus to physical output is described in | 35 | Audigy). The mapping from FX bus to physical output is described in |
33 | SB-Live-mixer.txt (or Audigy-mixer.txt). | 36 | sb-live-mixer.rst (or audigy-mixer.rst). |
34 | 37 | ||
35 | The 16 input ports are connected to the 16 physical inputs. Contrary to | 38 | The 16 input ports are connected to the 16 physical inputs. Contrary to |
36 | popular belief, all emu10k1 cards are multichannel cards. Which of these | 39 | popular belief, all emu10k1 cards are multichannel cards. Which of these |
@@ -49,10 +52,11 @@ This chart, borrowed from kxfxlib/da_asio51.cpp, describes the mapping of JACK | |||
49 | ports to FXBUS2 (multitrack recording input) and EXTOUT (physical output) | 52 | ports to FXBUS2 (multitrack recording input) and EXTOUT (physical output) |
50 | channels. | 53 | channels. |
51 | 54 | ||
52 | /*JACK (& ASIO) mappings on 10k1 5.1 SBLive cards: | 55 | JACK (& ASIO) mappings on 10k1 5.1 SBLive cards: |
53 | -------------------------------------------- | 56 | |
57 | ============== ======== ============ | ||
54 | JACK Epilog FXBUS2(nr) | 58 | JACK Epilog FXBUS2(nr) |
55 | -------------------------------------------- | 59 | ============== ======== ============ |
56 | capture_1 asio14 FXBUS2(0xe) | 60 | capture_1 asio14 FXBUS2(0xe) |
57 | capture_2 asio15 FXBUS2(0xf) | 61 | capture_2 asio15 FXBUS2(0xf) |
58 | capture_3 asio0 FXBUS2(0x0) | 62 | capture_3 asio0 FXBUS2(0x0) |
@@ -69,6 +73,6 @@ capture_13 asio10 FXBUS2(0xa) | |||
69 | capture_14 asio11 FXBUS2(0xb) | 73 | capture_14 asio11 FXBUS2(0xb) |
70 | capture_15 asio12 FXBUS2(0xc) | 74 | capture_15 asio12 FXBUS2(0xc) |
71 | capture_16 asio13 FXBUS2(0xd) | 75 | capture_16 asio13 FXBUS2(0xd) |
72 | */ | 76 | ============== ======== ============ |
73 | 77 | ||
74 | TODO: describe use of ld10k1/qlo10k1 in conjunction with JACK | 78 | TODO: describe use of ld10k1/qlo10k1 in conjunction with JACK |
diff --git a/Documentation/sound/alsa/hdspm.txt b/Documentation/sound/cards/hdspm.rst index 7ba31948dea7..5373e51ed076 100644 --- a/Documentation/sound/alsa/hdspm.txt +++ b/Documentation/sound/cards/hdspm.rst | |||
@@ -1,21 +1,24 @@ | |||
1 | ======================================= | ||
1 | Software Interface ALSA-DSP MADI Driver | 2 | Software Interface ALSA-DSP MADI Driver |
3 | ======================================= | ||
2 | 4 | ||
3 | (translated from German, so no good English ;-), | 5 | (translated from German, so no good English ;-), |
4 | 2004 - winfried ritsch | ||
5 | |||
6 | 6 | ||
7 | 2004 - winfried ritsch | ||
7 | 8 | ||
8 | Full functionality has been added to the driver. Since some of | ||
9 | the Controls and startup-options are ALSA-Standard and only the | ||
10 | special Controls are described and discussed below. | ||
11 | 9 | ||
10 | Full functionality has been added to the driver. Since some of | ||
11 | the Controls and startup-options are ALSA-Standard and only the | ||
12 | special Controls are described and discussed below. | ||
12 | 13 | ||
13 | hardware functionality: | ||
14 | 14 | ||
15 | Hardware functionality | ||
16 | ====================== | ||
15 | 17 | ||
16 | Audio transmission: | 18 | Audio transmission |
19 | ------------------ | ||
17 | 20 | ||
18 | number of channels -- depends on transmission mode | 21 | * number of channels -- depends on transmission mode |
19 | 22 | ||
20 | The number of channels chosen is from 1..Nmax. The reason to | 23 | The number of channels chosen is from 1..Nmax. The reason to |
21 | use for a lower number of channels is only resource allocation, | 24 | use for a lower number of channels is only resource allocation, |
@@ -23,31 +26,34 @@ Software Interface ALSA-DSP MADI Driver | |||
23 | allocated. So also the throughput of the PCI system can be | 26 | allocated. So also the throughput of the PCI system can be |
24 | scaled. (Only important for low performance boards). | 27 | scaled. (Only important for low performance boards). |
25 | 28 | ||
26 | Single Speed -- 1..64 channels | 29 | * Single Speed -- 1..64 channels |
27 | 30 | ||
31 | .. note:: | ||
28 | (Note: Choosing the 56channel mode for transmission or as | 32 | (Note: Choosing the 56channel mode for transmission or as |
29 | receiver, only 56 are transmitted/received over the MADI, but | 33 | receiver, only 56 are transmitted/received over the MADI, but |
30 | all 64 channels are available for the mixer, so channel count | 34 | all 64 channels are available for the mixer, so channel count |
31 | for the driver) | 35 | for the driver) |
32 | 36 | ||
33 | Double Speed -- 1..32 channels | 37 | * Double Speed -- 1..32 channels |
34 | 38 | ||
39 | .. note:: | ||
35 | Note: Choosing the 56-channel mode for | 40 | Note: Choosing the 56-channel mode for |
36 | transmission/receive-mode , only 28 are transmitted/received | 41 | transmission/receive-mode , only 28 are transmitted/received |
37 | over the MADI, but all 32 channels are available for the mixer, | 42 | over the MADI, but all 32 channels are available for the mixer, |
38 | so channel count for the driver | 43 | so channel count for the driver |
39 | 44 | ||
40 | 45 | ||
41 | Quad Speed -- 1..16 channels | 46 | * Quad Speed -- 1..16 channels |
42 | 47 | ||
43 | Note: Choosing the 56-channel mode for | 48 | .. note:: |
49 | Choosing the 56-channel mode for | ||
44 | transmission/receive-mode , only 14 are transmitted/received | 50 | transmission/receive-mode , only 14 are transmitted/received |
45 | over the MADI, but all 16 channels are available for the mixer, | 51 | over the MADI, but all 16 channels are available for the mixer, |
46 | so channel count for the driver | 52 | so channel count for the driver |
47 | 53 | ||
48 | Format -- signed 32 Bit Little Endian (SNDRV_PCM_FMTBIT_S32_LE) | 54 | * Format -- signed 32 Bit Little Endian (SNDRV_PCM_FMTBIT_S32_LE) |
49 | 55 | ||
50 | Sample Rates -- | 56 | * Sample Rates -- |
51 | 57 | ||
52 | Single Speed -- 32000, 44100, 48000 | 58 | Single Speed -- 32000, 44100, 48000 |
53 | 59 | ||
@@ -55,14 +61,13 @@ Software Interface ALSA-DSP MADI Driver | |||
55 | 61 | ||
56 | Quad Speed -- 128000, 176400, 192000 (untested) | 62 | Quad Speed -- 128000, 176400, 192000 (untested) |
57 | 63 | ||
58 | access-mode -- MMAP (memory mapped), Not interleaved | 64 | * access-mode -- MMAP (memory mapped), Not interleaved (PCM_NON-INTERLEAVED) |
59 | (PCM_NON-INTERLEAVED) | ||
60 | 65 | ||
61 | buffer-sizes -- 64,128,256,512,1024,2048,8192 Samples | 66 | * buffer-sizes -- 64,128,256,512,1024,2048,8192 Samples |
62 | 67 | ||
63 | fragments -- 2 | 68 | * fragments -- 2 |
64 | 69 | ||
65 | Hardware-pointer -- 2 Modi | 70 | * Hardware-pointer -- 2 Modi |
66 | 71 | ||
67 | 72 | ||
68 | The Card supports the readout of the actual Buffer-pointer, | 73 | The Card supports the readout of the actual Buffer-pointer, |
@@ -74,53 +79,54 @@ Software Interface ALSA-DSP MADI Driver | |||
74 | precise-pointer. | 79 | precise-pointer. |
75 | 80 | ||
76 | 81 | ||
82 | .. hint:: | ||
77 | (Hint: Experimenting I found that the pointer is maximum 64 to | 83 | (Hint: Experimenting I found that the pointer is maximum 64 to |
78 | large never to small. So if you subtract 64 you always have a | 84 | large never to small. So if you subtract 64 you always have a |
79 | safe pointer for writing, which is used on this mode inside | 85 | safe pointer for writing, which is used on this mode inside |
80 | ALSA. In theory now you can get now a latency as low as 16 | 86 | ALSA. In theory now you can get now a latency as low as 16 |
81 | Samples, which is a quarter of the interrupt possibilities.) | 87 | Samples, which is a quarter of the interrupt possibilities.) |
82 | 88 | ||
83 | Precise Pointer -- off | 89 | * Precise Pointer -- off |
84 | interrupt used for pointer-calculation | 90 | interrupt used for pointer-calculation |
85 | 91 | ||
86 | Precise Pointer -- on | 92 | * Precise Pointer -- on |
87 | hardware pointer used. | 93 | hardware pointer used. |
88 | 94 | ||
89 | Controller: | 95 | Controller |
90 | 96 | ---------- | |
91 | 97 | ||
92 | Since DSP-MADI-Mixer has 8152 Fader, it does not make sense to | 98 | Since DSP-MADI-Mixer has 8152 Fader, it does not make sense to |
93 | use the standard mixer-controls, since this would break most of | 99 | use the standard mixer-controls, since this would break most of |
94 | (especially graphic) ALSA-Mixer GUIs. So Mixer control has be | 100 | (especially graphic) ALSA-Mixer GUIs. So Mixer control has be |
95 | provided by a 2-dimensional controller using the | 101 | provided by a 2-dimensional controller using the |
96 | hwdep-interface. | 102 | hwdep-interface. |
97 | 103 | ||
98 | Also all 128+256 Peak and RMS-Meter can be accessed via the | 104 | Also all 128+256 Peak and RMS-Meter can be accessed via the |
99 | hwdep-interface. Since it could be a performance problem always | 105 | hwdep-interface. Since it could be a performance problem always |
100 | copying and converting Peak and RMS-Levels even if you just need | 106 | copying and converting Peak and RMS-Levels even if you just need |
101 | one, I decided to export the hardware structure, so that of | 107 | one, I decided to export the hardware structure, so that of |
102 | needed some driver-guru can implement a memory-mapping of mixer | 108 | needed some driver-guru can implement a memory-mapping of mixer |
103 | or peak-meters over ioctl, or also to do only copying and no | 109 | or peak-meters over ioctl, or also to do only copying and no |
104 | conversion. A test-application shows the usage of the controller. | 110 | conversion. A test-application shows the usage of the controller. |
105 | |||
106 | Latency Controls --- not implemented !!! | ||
107 | 111 | ||
112 | * Latency Controls --- not implemented !!! | ||
108 | 113 | ||
114 | .. note:: | ||
109 | Note: Within the windows-driver the latency is accessible of a | 115 | Note: Within the windows-driver the latency is accessible of a |
110 | control-panel, but buffer-sizes are controlled with ALSA from | 116 | control-panel, but buffer-sizes are controlled with ALSA from |
111 | hwparams-calls and should not be changed in run-state, I did not | 117 | hwparams-calls and should not be changed in run-state, I did not |
112 | implement it here. | 118 | implement it here. |
113 | 119 | ||
114 | 120 | ||
115 | System Clock -- suspended !!!! | 121 | * System Clock -- suspended !!!! |
116 | |||
117 | Name -- "System Clock Mode" | ||
118 | 122 | ||
119 | Access -- Read Write | 123 | * Name -- "System Clock Mode" |
120 | |||
121 | Values -- "Master" "Slave" | ||
122 | 124 | ||
125 | * Access -- Read Write | ||
126 | |||
127 | * Values -- "Master" "Slave" | ||
123 | 128 | ||
129 | .. note:: | ||
124 | !!!! This is a hardware-function but is in conflict with the | 130 | !!!! This is a hardware-function but is in conflict with the |
125 | Clock-source controller, which is a kind of ALSA-standard. I | 131 | Clock-source controller, which is a kind of ALSA-standard. I |
126 | makes sense to set the card to a special mode (master at some | 132 | makes sense to set the card to a special mode (master at some |
@@ -128,106 +134,107 @@ Software Interface ALSA-DSP MADI Driver | |||
128 | a studio should have working synchronisations setup. So use | 134 | a studio should have working synchronisations setup. So use |
129 | Clock-source-controller instead !!!! | 135 | Clock-source-controller instead !!!! |
130 | 136 | ||
131 | Clock Source | 137 | * Clock Source |
132 | 138 | ||
133 | Name -- "Sample Clock Source" | 139 | * Name -- "Sample Clock Source" |
134 | 140 | ||
135 | Access -- Read Write | 141 | * Access -- Read Write |
136 | 142 | ||
137 | Values -- "AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", | 143 | * Values -- "AutoSync", "Internal 32.0 kHz", "Internal 44.1 kHz", |
138 | "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", | 144 | "Internal 48.0 kHz", "Internal 64.0 kHz", "Internal 88.2 kHz", |
139 | "Internal 96.0 kHz" | 145 | "Internal 96.0 kHz" |
140 | 146 | ||
141 | Choose between Master at a specific Frequency and so also the | 147 | Choose between Master at a specific Frequency and so also the |
142 | Speed-mode or Slave (Autosync). Also see "Preferred Sync Ref" | 148 | Speed-mode or Slave (Autosync). Also see "Preferred Sync Ref" |
143 | 149 | ||
144 | 150 | .. warning:: | |
145 | !!!! This is no pure hardware function but was implemented by | 151 | !!!! This is no pure hardware function but was implemented by |
146 | ALSA by some ALSA-drivers before, so I use it also. !!! | 152 | ALSA by some ALSA-drivers before, so I use it also. !!! |
147 | 153 | ||
148 | 154 | ||
149 | Preferred Sync Ref | 155 | * Preferred Sync Ref |
150 | 156 | ||
151 | Name -- "Preferred Sync Reference" | 157 | * Name -- "Preferred Sync Reference" |
152 | 158 | ||
153 | Access -- Read Write | 159 | * Access -- Read Write |
154 | 160 | ||
155 | Values -- "Word" "MADI" | 161 | * Values -- "Word" "MADI" |
156 | 162 | ||
157 | 163 | ||
158 | Within the Auto-sync-Mode the preferred Sync Source can be | 164 | Within the Auto-sync-Mode the preferred Sync Source can be |
159 | chosen. If it is not available another is used if possible. | 165 | chosen. If it is not available another is used if possible. |
160 | 166 | ||
167 | .. note:: | ||
161 | Note: Since MADI has a much higher bit-rate than word-clock, the | 168 | Note: Since MADI has a much higher bit-rate than word-clock, the |
162 | card should synchronise better in MADI Mode. But since the | 169 | card should synchronise better in MADI Mode. But since the |
163 | RME-PLL is very good, there are almost no problems with | 170 | RME-PLL is very good, there are almost no problems with |
164 | word-clock too. I never found a difference. | 171 | word-clock too. I never found a difference. |
165 | 172 | ||
166 | 173 | ||
167 | TX 64 channel --- | 174 | * TX 64 channel |
168 | 175 | ||
169 | Name -- "TX 64 channels mode" | 176 | * Name -- "TX 64 channels mode" |
170 | 177 | ||
171 | Access -- Read Write | 178 | * Access -- Read Write |
172 | 179 | ||
173 | Values -- 0 1 | 180 | * Values -- 0 1 |
174 | 181 | ||
175 | Using 64-channel-modus (1) or 56-channel-modus for | 182 | Using 64-channel-modus (1) or 56-channel-modus for |
176 | MADI-transmission (0). | 183 | MADI-transmission (0). |
177 | 184 | ||
178 | 185 | ||
186 | .. note:: | ||
179 | Note: This control is for output only. Input-mode is detected | 187 | Note: This control is for output only. Input-mode is detected |
180 | automatically from hardware sending MADI. | 188 | automatically from hardware sending MADI. |
181 | 189 | ||
182 | 190 | ||
183 | Clear TMS --- | 191 | * Clear TMS |
184 | 192 | ||
185 | Name -- "Clear Track Marker" | 193 | * Name -- "Clear Track Marker" |
186 | 194 | ||
187 | Access -- Read Write | 195 | * Access -- Read Write |
188 | 196 | ||
189 | Values -- 0 1 | 197 | * Values -- 0 1 |
190 | 198 | ||
191 | 199 | ||
192 | Don't use to lower 5 Audio-bits on AES as additional Bits. | 200 | Don't use to lower 5 Audio-bits on AES as additional Bits. |
193 | 201 | ||
194 | 202 | ||
195 | Safe Mode oder Auto Input --- | 203 | * Safe Mode oder Auto Input |
196 | 204 | ||
197 | Name -- "Safe Mode" | 205 | * Name -- "Safe Mode" |
198 | 206 | ||
199 | Access -- Read Write | 207 | * Access -- Read Write |
200 | 208 | ||
201 | Values -- 0 1 | 209 | * Values -- 0 1 (default on) |
202 | |||
203 | (default on) | ||
204 | 210 | ||
205 | If on (1), then if either the optical or coaxial connection | 211 | If on (1), then if either the optical or coaxial connection |
206 | has a failure, there is a takeover to the working one, with no | 212 | has a failure, there is a takeover to the working one, with no |
207 | sample failure. Its only useful if you use the second as a | 213 | sample failure. Its only useful if you use the second as a |
208 | backup connection. | 214 | backup connection. |
209 | 215 | ||
210 | Input --- | 216 | * Input |
211 | 217 | ||
212 | Name -- "Input Select" | 218 | * Name -- "Input Select" |
213 | 219 | ||
214 | Access -- Read Write | 220 | * Access -- Read Write |
215 | 221 | ||
216 | Values -- optical coaxial | 222 | * Values -- optical coaxial |
217 | 223 | ||
218 | 224 | ||
219 | Choosing the Input, optical or coaxial. If Safe-mode is active, | 225 | Choosing the Input, optical or coaxial. If Safe-mode is active, |
220 | this is the preferred Input. | 226 | this is the preferred Input. |
221 | 227 | ||
222 | -------------- Mixer ---------------------- | 228 | Mixer |
229 | ----- | ||
223 | 230 | ||
224 | Mixer | 231 | * Mixer |
225 | 232 | ||
226 | Name -- "Mixer" | 233 | * Name -- "Mixer" |
227 | 234 | ||
228 | Access -- Read Write | 235 | * Access -- Read Write |
229 | 236 | ||
230 | Values - <channel-number 0-127> <Value 0-65535> | 237 | * Values - <channel-number 0-127> <Value 0-65535> |
231 | 238 | ||
232 | 239 | ||
233 | Here as a first value the channel-index is taken to get/set the | 240 | Here as a first value the channel-index is taken to get/set the |
@@ -235,40 +242,41 @@ Software Interface ALSA-DSP MADI Driver | |||
235 | fader and 64-127 the playback to outputs fader. Value 0 | 242 | fader and 64-127 the playback to outputs fader. Value 0 |
236 | is channel muted 0 and 32768 an amplification of 1. | 243 | is channel muted 0 and 32768 an amplification of 1. |
237 | 244 | ||
238 | Chn 1-64 | 245 | * Chn 1-64 |
239 | 246 | ||
240 | fast mixer for the ALSA-mixer utils. The diagonal of the | 247 | fast mixer for the ALSA-mixer utils. The diagonal of the |
241 | mixer-matrix is implemented from playback to output. | 248 | mixer-matrix is implemented from playback to output. |
242 | 249 | ||
243 | 250 | ||
244 | Line Out | 251 | * Line Out |
245 | 252 | ||
246 | Name -- "Line Out" | 253 | * Name -- "Line Out" |
247 | 254 | ||
248 | Access -- Read Write | 255 | * Access -- Read Write |
249 | 256 | ||
250 | Values -- 0 1 | 257 | * Values -- 0 1 |
251 | 258 | ||
252 | Switching on and off the analog out, which has nothing to do | 259 | Switching on and off the analog out, which has nothing to do |
253 | with mixing or routing. the analog outs reflects channel 63,64. | 260 | with mixing or routing. the analog outs reflects channel 63,64. |
254 | 261 | ||
255 | 262 | ||
256 | --- information (only read access): | 263 | Information (only read access) |
264 | ------------------------------ | ||
257 | 265 | ||
258 | Sample Rate | 266 | * Sample Rate |
259 | 267 | ||
260 | Name -- "System Sample Rate" | 268 | * Name -- "System Sample Rate" |
261 | 269 | ||
262 | Access -- Read-only | 270 | * Access -- Read-only |
263 | 271 | ||
264 | getting the sample rate. | 272 | getting the sample rate. |
265 | 273 | ||
266 | 274 | ||
267 | External Rate measured | 275 | * External Rate measured |
268 | 276 | ||
269 | Name -- "External Rate" | 277 | * Name -- "External Rate" |
270 | 278 | ||
271 | Access -- Read only | 279 | * Access -- Read only |
272 | 280 | ||
273 | 281 | ||
274 | Should be "Autosync Rate", but Name used is | 282 | Should be "Autosync Rate", but Name used is |
@@ -276,79 +284,86 @@ Software Interface ALSA-DSP MADI Driver | |||
276 | reported. | 284 | reported. |
277 | 285 | ||
278 | 286 | ||
279 | MADI Sync Status | 287 | * MADI Sync Status |
280 | 288 | ||
281 | Name -- "MADI Sync Lock Status" | 289 | * Name -- "MADI Sync Lock Status" |
282 | 290 | ||
283 | Access -- Read | 291 | * Access -- Read |
284 | 292 | ||
285 | Values -- 0,1,2 | 293 | * Values -- 0,1,2 |
286 | 294 | ||
287 | MADI-Input is 0=Unlocked, 1=Locked, or 2=Synced. | 295 | MADI-Input is 0=Unlocked, 1=Locked, or 2=Synced. |
288 | 296 | ||
289 | 297 | ||
290 | Word Clock Sync Status | 298 | * Word Clock Sync Status |
291 | 299 | ||
292 | Name -- "Word Clock Lock Status" | 300 | * Name -- "Word Clock Lock Status" |
293 | 301 | ||
294 | Access -- Read | 302 | * Access -- Read |
295 | 303 | ||
296 | Values -- 0,1,2 | 304 | * Values -- 0,1,2 |
297 | 305 | ||
298 | Word Clock Input is 0=Unlocked, 1=Locked, or 2=Synced. | 306 | Word Clock Input is 0=Unlocked, 1=Locked, or 2=Synced. |
299 | 307 | ||
300 | AutoSync | 308 | * AutoSync |
301 | 309 | ||
302 | Name -- "AutoSync Reference" | 310 | * Name -- "AutoSync Reference" |
303 | 311 | ||
304 | Access -- Read | 312 | * Access -- Read |
305 | 313 | ||
306 | Values -- "WordClock", "MADI", "None" | 314 | * Values -- "WordClock", "MADI", "None" |
307 | 315 | ||
308 | Sync-Reference is either "WordClock", "MADI" or none. | 316 | Sync-Reference is either "WordClock", "MADI" or none. |
309 | 317 | ||
310 | RX 64ch --- noch nicht implementiert | 318 | * RX 64ch --- noch nicht implementiert |
311 | 319 | ||
312 | MADI-Receiver is in 64 channel mode oder 56 channel mode. | 320 | MADI-Receiver is in 64 channel mode oder 56 channel mode. |
313 | 321 | ||
314 | 322 | ||
315 | AB_inp --- not tested | 323 | * AB_inp --- not tested |
316 | 324 | ||
317 | Used input for Auto-Input. | 325 | Used input for Auto-Input. |
318 | 326 | ||
319 | 327 | ||
320 | actual Buffer Position --- not implemented | 328 | * actual Buffer Position --- not implemented |
321 | 329 | ||
322 | !!! this is a ALSA internal function, so no control is used !!! | 330 | !!! this is a ALSA internal function, so no control is used !!! |
323 | 331 | ||
324 | 332 | ||
325 | 333 | ||
326 | Calling Parameter: | 334 | Calling Parameter |
335 | ================= | ||
336 | |||
337 | * index int array (min = 1, max = 8) | ||
327 | 338 | ||
328 | index int array (min = 1, max = 8), | 339 | Index value for RME HDSPM interface. card-index within ALSA |
329 | "Index value for RME HDSPM interface." card-index within ALSA | ||
330 | 340 | ||
331 | note: ALSA-standard | 341 | note: ALSA-standard |
332 | 342 | ||
333 | id string array (min = 1, max = 8), | 343 | * id string array (min = 1, max = 8) |
334 | "ID string for RME HDSPM interface." | 344 | |
345 | ID string for RME HDSPM interface. | ||
335 | 346 | ||
336 | note: ALSA-standard | 347 | note: ALSA-standard |
337 | 348 | ||
338 | enable int array (min = 1, max = 8), | 349 | * enable int array (min = 1, max = 8) |
339 | "Enable/disable specific HDSPM sound-cards." | 350 | |
351 | Enable/disable specific HDSPM sound-cards. | ||
340 | 352 | ||
341 | note: ALSA-standard | 353 | note: ALSA-standard |
342 | 354 | ||
343 | precise_ptr int array (min = 1, max = 8), | 355 | * precise_ptr int array (min = 1, max = 8) |
344 | "Enable precise pointer, or disable." | ||
345 | 356 | ||
357 | Enable precise pointer, or disable. | ||
358 | |||
359 | .. note:: | ||
346 | note: Use only when the application supports this (which is a special case). | 360 | note: Use only when the application supports this (which is a special case). |
347 | 361 | ||
348 | line_outs_monitor int array (min = 1, max = 8), | 362 | * line_outs_monitor int array (min = 1, max = 8) |
349 | "Send playback streams to analog outs by default." | ||
350 | 363 | ||
364 | Send playback streams to analog outs by default. | ||
351 | 365 | ||
366 | .. note:: | ||
352 | note: each playback channel is mixed to the same numbered output | 367 | note: each playback channel is mixed to the same numbered output |
353 | channel (routed). This is against the ALSA-convention, where all | 368 | channel (routed). This is against the ALSA-convention, where all |
354 | channels have to be muted on after loading the driver, but was | 369 | channels have to be muted on after loading the driver, but was |
@@ -356,7 +371,9 @@ Calling Parameter: | |||
356 | 371 | ||
357 | 372 | ||
358 | 373 | ||
359 | enable_monitor int array (min = 1, max = 8), | 374 | * enable_monitor int array (min = 1, max = 8) |
360 | "Enable Analog Out on Channel 63/64 by default." | 375 | |
376 | Enable Analog Out on Channel 63/64 by default. | ||
361 | 377 | ||
378 | .. note :: | ||
362 | note: here the analog output is enabled (but not routed). | 379 | note: here the analog output is enabled (but not routed). |
diff --git a/Documentation/sound/alsa/img,spdif-in.txt b/Documentation/sound/cards/img-spdif-in.rst index 8b7505785fa6..7df9f5ae2609 100644 --- a/Documentation/sound/alsa/img,spdif-in.txt +++ b/Documentation/sound/cards/img-spdif-in.rst | |||
@@ -1,21 +1,25 @@ | |||
1 | ================================================ | ||
2 | Imagination Technologies SPDIF Input Controllers | ||
3 | ================================================ | ||
4 | |||
1 | The Imagination Technologies SPDIF Input controller contains the following | 5 | The Imagination Technologies SPDIF Input controller contains the following |
2 | controls: | 6 | controls: |
3 | 7 | ||
4 | name='IEC958 Capture Mask',index=0 | 8 | * name='IEC958 Capture Mask',index=0 |
5 | 9 | ||
6 | This control returns a mask that shows which of the IEC958 status bits | 10 | This control returns a mask that shows which of the IEC958 status bits |
7 | can be read using the 'IEC958 Capture Default' control. | 11 | can be read using the 'IEC958 Capture Default' control. |
8 | 12 | ||
9 | name='IEC958 Capture Default',index=0 | 13 | * name='IEC958 Capture Default',index=0 |
10 | 14 | ||
11 | This control returns the status bits contained within the SPDIF stream that | 15 | This control returns the status bits contained within the SPDIF stream that |
12 | is being received. The 'IEC958 Capture Mask' shows which bits can be read | 16 | is being received. The 'IEC958 Capture Mask' shows which bits can be read |
13 | from this control. | 17 | from this control. |
14 | 18 | ||
15 | name='SPDIF In Multi Frequency Acquire',index=0 | 19 | * name='SPDIF In Multi Frequency Acquire',index=0 |
16 | name='SPDIF In Multi Frequency Acquire',index=1 | 20 | * name='SPDIF In Multi Frequency Acquire',index=1 |
17 | name='SPDIF In Multi Frequency Acquire',index=2 | 21 | * name='SPDIF In Multi Frequency Acquire',index=2 |
18 | name='SPDIF In Multi Frequency Acquire',index=3 | 22 | * name='SPDIF In Multi Frequency Acquire',index=3 |
19 | 23 | ||
20 | This control is used to attempt acquisition of up to four different sample | 24 | This control is used to attempt acquisition of up to four different sample |
21 | rates. The active rate can be obtained by reading the 'SPDIF In Lock Frequency' | 25 | rates. The active rate can be obtained by reading the 'SPDIF In Lock Frequency' |
@@ -29,21 +33,21 @@ four sample rates set here. | |||
29 | If less than four rates are required, the same rate can be specified more than | 33 | If less than four rates are required, the same rate can be specified more than |
30 | once | 34 | once |
31 | 35 | ||
32 | name='SPDIF In Lock Frequency',index=0 | 36 | * name='SPDIF In Lock Frequency',index=0 |
33 | 37 | ||
34 | This control returns the active capture rate, or 0 if a lock has not been | 38 | This control returns the active capture rate, or 0 if a lock has not been |
35 | acquired | 39 | acquired |
36 | 40 | ||
37 | name='SPDIF In Lock TRK',index=0 | 41 | * name='SPDIF In Lock TRK',index=0 |
38 | 42 | ||
39 | This control is used to modify the locking/jitter rejection characteristics | 43 | This control is used to modify the locking/jitter rejection characteristics |
40 | of the block. Larger values increase the locking range, but reduce jitter | 44 | of the block. Larger values increase the locking range, but reduce jitter |
41 | rejection. | 45 | rejection. |
42 | 46 | ||
43 | name='SPDIF In Lock Acquire Threshold',index=0 | 47 | * name='SPDIF In Lock Acquire Threshold',index=0 |
44 | 48 | ||
45 | This control is used to change the threshold at which a lock is acquired. | 49 | This control is used to change the threshold at which a lock is acquired. |
46 | 50 | ||
47 | name='SPDIF In Lock Release Threshold',index=0 | 51 | * name='SPDIF In Lock Release Threshold',index=0 |
48 | 52 | ||
49 | This control is used to change the threshold at which a lock is released. | 53 | This control is used to change the threshold at which a lock is released. |
diff --git a/Documentation/sound/cards/index.rst b/Documentation/sound/cards/index.rst new file mode 100644 index 000000000000..c016f8c3b88b --- /dev/null +++ b/Documentation/sound/cards/index.rst | |||
@@ -0,0 +1,19 @@ | |||
1 | Card-Specific Information | ||
2 | ========================= | ||
3 | |||
4 | .. toctree:: | ||
5 | :maxdepth: 2 | ||
6 | |||
7 | joystick | ||
8 | cmipci | ||
9 | sb-live-mixer | ||
10 | audigy-mixer | ||
11 | emu10k1-jack | ||
12 | via82xx-mixer | ||
13 | audiophile-usb | ||
14 | mixart | ||
15 | bt87x | ||
16 | maya44 | ||
17 | hdspm | ||
18 | serial-u16550 | ||
19 | img-spdif-in | ||
diff --git a/Documentation/sound/alsa/Joystick.txt b/Documentation/sound/cards/joystick.rst index ccda41b10f8a..a6e468c81d02 100644 --- a/Documentation/sound/alsa/Joystick.txt +++ b/Documentation/sound/cards/joystick.rst | |||
@@ -1,7 +1,10 @@ | |||
1 | ======================================= | ||
1 | Analog Joystick Support on ALSA Drivers | 2 | Analog Joystick Support on ALSA Drivers |
2 | ======================================= | 3 | ======================================= |
3 | Oct. 14, 2003 | 4 | |
4 | Takashi Iwai <tiwai@suse.de> | 5 | Oct. 14, 2003 |
6 | |||
7 | Takashi Iwai <tiwai@suse.de> | ||
5 | 8 | ||
6 | General | 9 | General |
7 | ------- | 10 | ------- |
@@ -34,44 +37,46 @@ stability and the resource management. | |||
34 | 37 | ||
35 | The following PCI drivers support the joystick natively. | 38 | The following PCI drivers support the joystick natively. |
36 | 39 | ||
37 | Driver Module Option Available Values | 40 | ============== ============= ============================================ |
38 | --------------------------------------------------------------------------- | 41 | Driver Module Option Available Values |
39 | als4000 joystick_port 0 = disable (default), 1 = auto-detect, | 42 | ============== ============= ============================================ |
40 | manual: any address (e.g. 0x200) | 43 | als4000 joystick_port 0 = disable (default), 1 = auto-detect, |
41 | au88x0 N/A N/A | 44 | manual: any address (e.g. 0x200) |
42 | azf3328 joystick 0 = disable, 1 = enable, -1 = auto (default) | 45 | au88x0 N/A N/A |
43 | ens1370 joystick 0 = disable (default), 1 = enable | 46 | azf3328 joystick 0 = disable, 1 = enable, -1 = auto (default) |
44 | ens1371 joystick_port 0 = disable (default), 1 = auto-detect, | 47 | ens1370 joystick 0 = disable (default), 1 = enable |
45 | manual: 0x200, 0x208, 0x210, 0x218 | 48 | ens1371 joystick_port 0 = disable (default), 1 = auto-detect, |
46 | cmipci joystick_port 0 = disable (default), 1 = auto-detect, | 49 | manual: 0x200, 0x208, 0x210, 0x218 |
47 | manual: any address (e.g. 0x200) | 50 | cmipci joystick_port 0 = disable (default), 1 = auto-detect, |
48 | cs4281 N/A N/A | 51 | manual: any address (e.g. 0x200) |
49 | cs46xx N/A N/A | 52 | cs4281 N/A N/A |
50 | es1938 N/A N/A | 53 | cs46xx N/A N/A |
51 | es1968 joystick 0 = disable (default), 1 = enable | 54 | es1938 N/A N/A |
52 | sonicvibes N/A N/A | 55 | es1968 joystick 0 = disable (default), 1 = enable |
53 | trident N/A N/A | 56 | sonicvibes N/A N/A |
54 | via82xx(*1) joystick 0 = disable (default), 1 = enable | 57 | trident N/A N/A |
55 | ymfpci joystick_port 0 = disable (default), 1 = auto-detect, | 58 | via82xx [#f1]_ joystick 0 = disable (default), 1 = enable |
56 | manual: 0x201, 0x202, 0x204, 0x205(*2) | 59 | ymfpci joystick_port 0 = disable (default), 1 = auto-detect, |
57 | --------------------------------------------------------------------------- | 60 | manual: 0x201, 0x202, 0x204, 0x205 [#f2]_ |
58 | 61 | ============== ============= ============================================ | |
59 | *1) VIA686A/B only | 62 | |
60 | *2) With YMF744/754 chips, the port address can be chosen arbitrarily | 63 | .. [#f1] VIA686A/B only |
64 | .. [#f2] With YMF744/754 chips, the port address can be chosen arbitrarily | ||
61 | 65 | ||
62 | The following drivers don't support gameport natively, but there are | 66 | The following drivers don't support gameport natively, but there are |
63 | additional modules. Load the corresponding module to add the gameport | 67 | additional modules. Load the corresponding module to add the gameport |
64 | support. | 68 | support. |
65 | 69 | ||
66 | Driver Additional Module | 70 | ======= ================= |
67 | ----------------------------- | 71 | Driver Additional Module |
68 | emu10k1 emu10k1-gp | 72 | ======= ================= |
69 | fm801 fm801-gp | 73 | emu10k1 emu10k1-gp |
70 | ----------------------------- | 74 | fm801 fm801-gp |
75 | ======= ================= | ||
71 | 76 | ||
72 | Note: the "pcigame" and "cs461x" modules are for the OSS drivers only. | 77 | Note: the "pcigame" and "cs461x" modules are for the OSS drivers only. |
73 | These ALSA drivers (cs46xx, trident and au88x0) have the | 78 | These ALSA drivers (cs46xx, trident and au88x0) have the |
74 | built-in gameport support. | 79 | built-in gameport support. |
75 | 80 | ||
76 | As mentioned above, ALSA PCI drivers have the built-in gameport | 81 | As mentioned above, ALSA PCI drivers have the built-in gameport |
77 | support, so you don't have to load ns558 module. Just load "joydev" | 82 | support, so you don't have to load ns558 module. Just load "joydev" |
diff --git a/Documentation/sound/alsa/README.maya44 b/Documentation/sound/cards/maya44.rst index 67b2ea1cc31d..bf09a584b443 100644 --- a/Documentation/sound/alsa/README.maya44 +++ b/Documentation/sound/cards/maya44.rst | |||
@@ -1,10 +1,18 @@ | |||
1 | NOTE: The following is the original document of Rainer's patch that the | 1 | ================================= |
2 | current maya44 code based on. Some contents might be obsoleted, but I | 2 | Notes on Maya44 USB Audio Support |
3 | keep here as reference -- tiwai | 3 | ================================= |
4 | 4 | ||
5 | ---------------------------------------------------------------- | 5 | .. note:: |
6 | The following is the original document of Rainer's patch that the | ||
7 | current maya44 code based on. Some contents might be obsoleted, but I | ||
8 | keep here as reference -- tiwai | ||
9 | |||
10 | Feb 14, 2008 | ||
11 | |||
12 | Rainer Zimmermann <mail@lightshed.de> | ||
6 | 13 | ||
7 | STATE OF DEVELOPMENT: | 14 | STATE OF DEVELOPMENT |
15 | ==================== | ||
8 | 16 | ||
9 | This driver is being developed on the initiative of Piotr Makowski (oponek@gmail.com) and financed by Lars Bergmann. | 17 | This driver is being developed on the initiative of Piotr Makowski (oponek@gmail.com) and financed by Lars Bergmann. |
10 | Development is carried out by Rainer Zimmermann (mail@lightshed.de). | 18 | Development is carried out by Rainer Zimmermann (mail@lightshed.de). |
@@ -44,16 +52,17 @@ Things that do not seem to work: | |||
44 | - Ardour 2.1 seems to work only via JACK, not using ALSA directly or via OSS. This still needs to be tracked down. | 52 | - Ardour 2.1 seems to work only via JACK, not using ALSA directly or via OSS. This still needs to be tracked down. |
45 | 53 | ||
46 | 54 | ||
47 | DRIVER DETAILS: | 55 | DRIVER DETAILS |
56 | ============== | ||
48 | 57 | ||
49 | the following files were added: | 58 | the following files were added: |
50 | 59 | ||
51 | pci/ice1724/maya44.c - Maya44 specific code | 60 | * pci/ice1724/maya44.c - Maya44 specific code |
52 | pci/ice1724/maya44.h | 61 | * pci/ice1724/maya44.h |
53 | pci/ice1724/ice1724.patch | 62 | * pci/ice1724/ice1724.patch |
54 | pci/ice1724/ice1724.h.patch - PROPOSED patch to ice1724.h (see SAMPLING RATES) | 63 | * pci/ice1724/ice1724.h.patch - PROPOSED patch to ice1724.h (see SAMPLING RATES) |
55 | i2c/other/wm8776.c - low-level access routines for Wolfson WM8776 codecs | 64 | * i2c/other/wm8776.c - low-level access routines for Wolfson WM8776 codecs |
56 | include/wm8776.h | 65 | * include/wm8776.h |
57 | 66 | ||
58 | 67 | ||
59 | Note that the wm8776.c code is meant to be card-independent and does not actually register the codec with the ALSA infrastructure. | 68 | Note that the wm8776.c code is meant to be card-independent and does not actually register the codec with the ALSA infrastructure. |
@@ -62,25 +71,26 @@ This is done in maya44.c, mainly because some of the WM8776 controls are used in | |||
62 | 71 | ||
63 | the following files were created in pci/ice1724, simply #including the corresponding file from the alsa-kernel tree: | 72 | the following files were created in pci/ice1724, simply #including the corresponding file from the alsa-kernel tree: |
64 | 73 | ||
65 | wtm.h | 74 | * wtm.h |
66 | vt1720_mobo.h | 75 | * vt1720_mobo.h |
67 | revo.h | 76 | * revo.h |
68 | prodigy192.h | 77 | * prodigy192.h |
69 | pontis.h | 78 | * pontis.h |
70 | phase.h | 79 | * phase.h |
71 | maya44.h | 80 | * maya44.h |
72 | juli.h | 81 | * juli.h |
73 | aureon.h | 82 | * aureon.h |
74 | amp.h | 83 | * amp.h |
75 | envy24ht.h | 84 | * envy24ht.h |
76 | se.h | 85 | * se.h |
77 | prodigy_hifi.h | 86 | * prodigy_hifi.h |
78 | 87 | ||
79 | 88 | ||
80 | *I hope this is the correct way to do things.* | 89 | *I hope this is the correct way to do things.* |
81 | 90 | ||
82 | 91 | ||
83 | SAMPLING RATES: | 92 | SAMPLING RATES |
93 | ============== | ||
84 | 94 | ||
85 | The Maya44 card (or more exactly, the Wolfson WM8776 codecs) allow a maximum sampling rate of 192 kHz for playback and 92 kHz for capture. | 95 | The Maya44 card (or more exactly, the Wolfson WM8776 codecs) allow a maximum sampling rate of 192 kHz for playback and 92 kHz for capture. |
86 | 96 | ||
@@ -98,66 +108,79 @@ I propose some additional code for limiting the sampling rate when setting on a | |||
98 | The proposed code (currently deactivated) is in ice1712.h.patch, ice1724.c and maya44.c (in pci/ice1712). | 108 | The proposed code (currently deactivated) is in ice1712.h.patch, ice1724.c and maya44.c (in pci/ice1712). |
99 | 109 | ||
100 | 110 | ||
101 | SOUND DEVICES: | 111 | SOUND DEVICES |
112 | ============= | ||
102 | 113 | ||
103 | PCM devices correspond to inputs/outputs as follows (assuming Maya44 is card #0): | 114 | PCM devices correspond to inputs/outputs as follows (assuming Maya44 is card #0): |
104 | 115 | ||
105 | hw:0,0 input - stereo, analog input 1+2 | 116 | * hw:0,0 input - stereo, analog input 1+2 |
106 | hw:0,0 output - stereo, analog output 1+2 | 117 | * hw:0,0 output - stereo, analog output 1+2 |
107 | hw:0,1 input - stereo, analog input 3+4 OR S/PDIF input | 118 | * hw:0,1 input - stereo, analog input 3+4 OR S/PDIF input |
108 | hw:0,1 output - stereo, analog output 3+4 (and SPDIF out) | 119 | * hw:0,1 output - stereo, analog output 3+4 (and SPDIF out) |
109 | 120 | ||
110 | 121 | ||
111 | NAMING OF MIXER CONTROLS: | 122 | NAMING OF MIXER CONTROLS |
123 | ======================== | ||
112 | 124 | ||
113 | (for more information about the signal flow, please refer to the block diagram on p.24 of the ESI Maya44 manual, or in the ESI windows software). | 125 | (for more information about the signal flow, please refer to the block diagram on p.24 of the ESI Maya44 manual, or in the ESI windows software). |
114 | 126 | ||
115 | 127 | ||
116 | PCM: (digital) output level for channel 1+2 | 128 | PCM |
117 | PCM 1: same for channel 3+4 | 129 | (digital) output level for channel 1+2 |
130 | PCM 1 | ||
131 | same for channel 3+4 | ||
132 | |||
133 | Mic Phantom+48V | ||
134 | switch for +48V phantom power for electrostatic microphones on input 1/2. | ||
118 | 135 | ||
119 | Mic Phantom+48V: switch for +48V phantom power for electrostatic microphones on input 1/2. | ||
120 | Make sure this is not turned on while any other source is connected to input 1/2. | 136 | Make sure this is not turned on while any other source is connected to input 1/2. |
121 | It might damage the source and/or the maya44 card. | 137 | It might damage the source and/or the maya44 card. |
122 | 138 | ||
123 | Mic/Line input: if switch is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo). | 139 | Mic/Line input |
140 | if switch is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo). | ||
141 | |||
142 | Bypass | ||
143 | analogue bypass from ADC input to output for channel 1+2. Same as "Monitor" in the windows driver. | ||
144 | Bypass 1 | ||
145 | same for channel 3+4. | ||
124 | 146 | ||
125 | Bypass: analogue bypass from ADC input to output for channel 1+2. Same as "Monitor" in the windows driver. | 147 | Crossmix |
126 | Bypass 1: same for channel 3+4. | 148 | cross-mixer from channels 1+2 to channels 3+4 |
149 | Crossmix 1 | ||
150 | cross-mixer from channels 3+4 to channels 1+2 | ||
127 | 151 | ||
128 | Crossmix: cross-mixer from channels 1+2 to channels 3+4 | 152 | IEC958 Output |
129 | Crossmix 1: cross-mixer from channels 3+4 to channels 1+2 | 153 | switch for S/PDIF output. |
130 | 154 | ||
131 | IEC958 Output: switch for S/PDIF output. | ||
132 | This is not supported by the ESI windows driver. | 155 | This is not supported by the ESI windows driver. |
133 | S/PDIF should output the same signal as channel 3+4. [untested!] | 156 | S/PDIF should output the same signal as channel 3+4. [untested!] |
134 | 157 | ||
135 | 158 | ||
136 | Digitial output selectors: | 159 | Digitial output selectors |
137 | |||
138 | These switches allow a direct digital routing from the ADCs to the DACs. | 160 | These switches allow a direct digital routing from the ADCs to the DACs. |
139 | Each switch determines where the digital input data to one of the DACs comes from. | 161 | Each switch determines where the digital input data to one of the DACs comes from. |
140 | They are not supported by the ESI windows driver. | 162 | They are not supported by the ESI windows driver. |
141 | For normal operation, they should all be set to "PCM out". | 163 | For normal operation, they should all be set to "PCM out". |
142 | 164 | ||
143 | H/W: Output source channel 1 | 165 | H/W |
144 | H/W 1: Output source channel 2 | 166 | Output source channel 1 |
145 | H/W 2: Output source channel 3 | 167 | H/W 1 |
146 | H/W 3: Output source channel 4 | 168 | Output source channel 2 |
169 | H/W 2 | ||
170 | Output source channel 3 | ||
171 | H/W 3 | ||
172 | Output source channel 4 | ||
173 | |||
174 | H/W 4 ... H/W 9 | ||
175 | unknown function, left in to enable testing. | ||
147 | 176 | ||
148 | H/W 4 ... H/W 9: unknown function, left in to enable testing. | ||
149 | Possibly some of these control S/PDIF output(s). | 177 | Possibly some of these control S/PDIF output(s). |
150 | If these turn out to be unused, they will go away in later driver versions. | 178 | If these turn out to be unused, they will go away in later driver versions. |
151 | 179 | ||
152 | Selectable values for each of the digital output selectors are: | 180 | Selectable values for each of the digital output selectors are: |
153 | "PCM out" -> DAC output of the corresponding channel (default setting) | ||
154 | "Input 1"... | ||
155 | "Input 4" -> direct routing from ADC output of the selected input channel | ||
156 | |||
157 | 181 | ||
158 | -------- | 182 | PCM out |
159 | 183 | DAC output of the corresponding channel (default setting) | |
160 | Feb 14, 2008 | 184 | Input 1 ... Input 4 |
161 | Rainer Zimmermann | 185 | direct routing from ADC output of the selected input channel |
162 | mail@lightshed.de | ||
163 | 186 | ||
diff --git a/Documentation/sound/alsa/MIXART.txt b/Documentation/sound/cards/mixart.rst index 4ee35b4fbe4a..48aba98b088f 100644 --- a/Documentation/sound/alsa/MIXART.txt +++ b/Documentation/sound/cards/mixart.rst | |||
@@ -1,5 +1,8 @@ | |||
1 | Alsa driver for Digigram miXart8 and miXart8AES/EBU soundcards | 1 | ============================================================== |
2 | Digigram <alsa@digigram.com> | 2 | Alsa driver for Digigram miXart8 and miXart8AES/EBU soundcards |
3 | ============================================================== | ||
4 | |||
5 | Digigram <alsa@digigram.com> | ||
3 | 6 | ||
4 | 7 | ||
5 | GENERAL | 8 | GENERAL |
@@ -48,11 +51,15 @@ formats are supported. | |||
48 | 51 | ||
49 | Mixer | 52 | Mixer |
50 | ----- | 53 | ----- |
51 | <Master> and <Master Capture> : analog volume control of playback and capture PCM. | 54 | <Master> and <Master Capture> |
52 | <PCM 0-3> and <PCM Capture> : digital volume control of each analog substream. | 55 | analog volume control of playback and capture PCM. |
53 | <AES 0-3> and <AES Capture> : digital volume control of each AES/EBU substream. | 56 | <PCM 0-3> and <PCM Capture> |
54 | <Monitoring> : Loopback from 'pcm0c' to 'pcm0p' with digital volume | 57 | digital volume control of each analog substream. |
55 | and mute control. | 58 | <AES 0-3> and <AES Capture> |
59 | digital volume control of each AES/EBU substream. | ||
60 | <Monitoring> | ||
61 | Loopback from 'pcm0c' to 'pcm0p' with digital volume | ||
62 | and mute control. | ||
56 | 63 | ||
57 | Rem : for best audio quality try to keep a 0 attenuation on the PCM | 64 | Rem : for best audio quality try to keep a 0 attenuation on the PCM |
58 | and AES volume controls which is set by 219 in the range from 0 to 255 | 65 | and AES volume controls which is set by 219 in the range from 0 to 255 |
@@ -79,11 +86,14 @@ FIRMWARE | |||
79 | For loading the firmware automatically after the module is loaded, use a | 86 | For loading the firmware automatically after the module is loaded, use a |
80 | install command. For example, add the following entry to | 87 | install command. For example, add the following entry to |
81 | /etc/modprobe.d/mixart.conf for miXart driver: | 88 | /etc/modprobe.d/mixart.conf for miXart driver: |
89 | :: | ||
82 | 90 | ||
83 | install snd-mixart /sbin/modprobe --first-time -i snd-mixart && \ | 91 | install snd-mixart /sbin/modprobe --first-time -i snd-mixart && \ |
84 | /usr/bin/mixartloader | 92 | /usr/bin/mixartloader |
93 | |||
94 | |||
85 | (for 2.2/2.4 kernels, add "post-install snd-mixart /usr/bin/vxloader" to | 95 | (for 2.2/2.4 kernels, add "post-install snd-mixart /usr/bin/vxloader" to |
86 | /etc/modules.conf, instead.) | 96 | /etc/modules.conf, instead.) |
87 | 97 | ||
88 | The firmware binaries are installed on /usr/share/alsa/firmware | 98 | The firmware binaries are installed on /usr/share/alsa/firmware |
89 | (or /usr/local/share/alsa/firmware, depending to the prefix option of | 99 | (or /usr/local/share/alsa/firmware, depending to the prefix option of |
diff --git a/Documentation/sound/alsa/SB-Live-mixer.txt b/Documentation/sound/cards/sb-live-mixer.rst index f4b5988f450c..bcb62fc99bbb 100644 --- a/Documentation/sound/alsa/SB-Live-mixer.txt +++ b/Documentation/sound/cards/sb-live-mixer.rst | |||
@@ -1,6 +1,6 @@ | |||
1 | 1 | =========================================== | |
2 | Sound Blaster Live mixer / default DSP code | 2 | Sound Blaster Live mixer / default DSP code |
3 | =========================================== | 3 | =========================================== |
4 | 4 | ||
5 | 5 | ||
6 | The EMU10K1 chips have a DSP part which can be programmed to support | 6 | The EMU10K1 chips have a DSP part which can be programmed to support |
@@ -12,8 +12,8 @@ The ALSA driver programs this portion of chip by default code | |||
12 | (can be altered later) which offers the following functionality: | 12 | (can be altered later) which offers the following functionality: |
13 | 13 | ||
14 | 14 | ||
15 | 1) IEC958 (S/PDIF) raw PCM | 15 | IEC958 (S/PDIF) raw PCM |
16 | -------------------------- | 16 | ======================= |
17 | 17 | ||
18 | This PCM device (it's the 4th PCM device (index 3!) and first subdevice | 18 | This PCM device (it's the 4th PCM device (index 3!) and first subdevice |
19 | (index 0) for a given card) allows to forward 48kHz, stereo, 16-bit | 19 | (index 0) for a given card) allows to forward 48kHz, stereo, 16-bit |
@@ -27,8 +27,8 @@ at the time. | |||
27 | Look to tram_poke routines in lowlevel/emu10k1/emufx.c for more details. | 27 | Look to tram_poke routines in lowlevel/emu10k1/emufx.c for more details. |
28 | 28 | ||
29 | 29 | ||
30 | 2) Digital mixer controls | 30 | Digital mixer controls |
31 | ------------------------- | 31 | ====================== |
32 | 32 | ||
33 | These controls are built using the DSP instructions. They offer extended | 33 | These controls are built using the DSP instructions. They offer extended |
34 | functionality. Only the default build-in code in the ALSA driver is described | 34 | functionality. Only the default build-in code in the ALSA driver is described |
@@ -40,317 +40,334 @@ is mentioned in multiple controls, the signal is accumulated and can be wrapped | |||
40 | 40 | ||
41 | Explanation of used abbreviations: | 41 | Explanation of used abbreviations: |
42 | 42 | ||
43 | DAC - digital to analog converter | 43 | DAC |
44 | ADC - analog to digital converter | 44 | digital to analog converter |
45 | I2S - one-way three wire serial bus for digital sound by Philips Semiconductors | 45 | ADC |
46 | (this standard is used for connecting standalone DAC and ADC converters) | 46 | analog to digital converter |
47 | LFE - low frequency effects (subwoofer signal) | 47 | I2S |
48 | AC97 - a chip containing an analog mixer, DAC and ADC converters | 48 | one-way three wire serial bus for digital sound by Philips Semiconductors |
49 | IEC958 - S/PDIF | 49 | (this standard is used for connecting standalone DAC and ADC converters) |
50 | FX-bus - the EMU10K1 chip has an effect bus containing 16 accumulators. | 50 | LFE |
51 | Each of the synthesizer voices can feed its output to these accumulators | 51 | low frequency effects (subwoofer signal) |
52 | and the DSP microcontroller can operate with the resulting sum. | 52 | AC97 |
53 | 53 | a chip containing an analog mixer, DAC and ADC converters | |
54 | 54 | IEC958 | |
55 | name='Wave Playback Volume',index=0 | 55 | S/PDIF |
56 | 56 | FX-bus | |
57 | the EMU10K1 chip has an effect bus containing 16 accumulators. | ||
58 | Each of the synthesizer voices can feed its output to these accumulators | ||
59 | and the DSP microcontroller can operate with the resulting sum. | ||
60 | |||
61 | |||
62 | ``name='Wave Playback Volume',index=0`` | ||
63 | --------------------------------------- | ||
57 | This control is used to attenuate samples for left and right PCM FX-bus | 64 | This control is used to attenuate samples for left and right PCM FX-bus |
58 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. | 65 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. |
59 | The result samples are forwarded to the front DAC PCM slots of the AC97 codec. | 66 | The result samples are forwarded to the front DAC PCM slots of the AC97 codec. |
60 | 67 | ||
61 | name='Wave Surround Playback Volume',index=0 | 68 | ``name='Wave Surround Playback Volume',index=0`` |
62 | 69 | ------------------------------------------------ | |
63 | This control is used to attenuate samples for left and right PCM FX-bus | 70 | This control is used to attenuate samples for left and right PCM FX-bus |
64 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. | 71 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. |
65 | The result samples are forwarded to the rear I2S DACs. These DACs operates | 72 | The result samples are forwarded to the rear I2S DACs. These DACs operates |
66 | separately (they are not inside the AC97 codec). | 73 | separately (they are not inside the AC97 codec). |
67 | 74 | ||
68 | name='Wave Center Playback Volume',index=0 | 75 | ``name='Wave Center Playback Volume',index=0`` |
69 | 76 | ---------------------------------------------- | |
70 | This control is used to attenuate samples for left and right PCM FX-bus | 77 | This control is used to attenuate samples for left and right PCM FX-bus |
71 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. | 78 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. |
72 | The result is mixed to mono signal (single channel) and forwarded to | 79 | The result is mixed to mono signal (single channel) and forwarded to |
73 | the ??rear?? right DAC PCM slot of the AC97 codec. | 80 | the ??rear?? right DAC PCM slot of the AC97 codec. |
74 | 81 | ||
75 | name='Wave LFE Playback Volume',index=0 | 82 | ``name='Wave LFE Playback Volume',index=0`` |
76 | 83 | ------------------------------------------- | |
77 | This control is used to attenuate samples for left and right PCM FX-bus | 84 | This control is used to attenuate samples for left and right PCM FX-bus |
78 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM. | 85 | accumulators. ALSA uses accumulators 0 and 1 for left and right PCM. |
79 | The result is mixed to mono signal (single channel) and forwarded to | 86 | The result is mixed to mono signal (single channel) and forwarded to |
80 | the ??rear?? left DAC PCM slot of the AC97 codec. | 87 | the ??rear?? left DAC PCM slot of the AC97 codec. |
81 | 88 | ||
82 | name='Wave Capture Volume',index=0 | 89 | ``name='Wave Capture Volume',index=0``, ``name='Wave Capture Switch',index=0`` |
83 | name='Wave Capture Switch',index=0 | 90 | ------------------------------------------------------------------------------ |
84 | |||
85 | These controls are used to attenuate samples for left and right PCM FX-bus | 91 | These controls are used to attenuate samples for left and right PCM FX-bus |
86 | accumulator. ALSA uses accumulators 0 and 1 for left and right PCM. | 92 | accumulator. ALSA uses accumulators 0 and 1 for left and right PCM. |
87 | The result is forwarded to the ADC capture FIFO (thus to the standard capture | 93 | The result is forwarded to the ADC capture FIFO (thus to the standard capture |
88 | PCM device). | 94 | PCM device). |
89 | 95 | ||
90 | name='Synth Playback Volume',index=0 | 96 | ``name='Synth Playback Volume',index=0`` |
91 | 97 | ---------------------------------------- | |
92 | This control is used to attenuate samples for left and right MIDI FX-bus | 98 | This control is used to attenuate samples for left and right MIDI FX-bus |
93 | accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples. | 99 | accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples. |
94 | The result samples are forwarded to the front DAC PCM slots of the AC97 codec. | 100 | The result samples are forwarded to the front DAC PCM slots of the AC97 codec. |
95 | 101 | ||
96 | name='Synth Capture Volume',index=0 | 102 | ``name='Synth Capture Volume',index=0``, ``name='Synth Capture Switch',index=0`` |
97 | name='Synth Capture Switch',index=0 | 103 | -------------------------------------------------------------------------------- |
98 | |||
99 | These controls are used to attenuate samples for left and right MIDI FX-bus | 104 | These controls are used to attenuate samples for left and right MIDI FX-bus |
100 | accumulator. ALSA uses accumulators 4 and 5 for left and right PCM. | 105 | accumulator. ALSA uses accumulators 4 and 5 for left and right PCM. |
101 | The result is forwarded to the ADC capture FIFO (thus to the standard capture | 106 | The result is forwarded to the ADC capture FIFO (thus to the standard capture |
102 | PCM device). | 107 | PCM device). |
103 | 108 | ||
104 | name='Surround Playback Volume',index=0 | 109 | ``name='Surround Playback Volume',index=0`` |
105 | 110 | ------------------------------------------- | |
106 | This control is used to attenuate samples for left and right rear PCM FX-bus | 111 | This control is used to attenuate samples for left and right rear PCM FX-bus |
107 | accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples. | 112 | accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples. |
108 | The result samples are forwarded to the rear I2S DACs. These DACs operate | 113 | The result samples are forwarded to the rear I2S DACs. These DACs operate |
109 | separately (they are not inside the AC97 codec). | 114 | separately (they are not inside the AC97 codec). |
110 | 115 | ||
111 | name='Surround Capture Volume',index=0 | 116 | ``name='Surround Capture Volume',index=0``, ``name='Surround Capture Switch',index=0`` |
112 | name='Surround Capture Switch',index=0 | 117 | -------------------------------------------------------------------------------------- |
113 | |||
114 | These controls are used to attenuate samples for left and right rear PCM FX-bus | 118 | These controls are used to attenuate samples for left and right rear PCM FX-bus |
115 | accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples. | 119 | accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples. |
116 | The result is forwarded to the ADC capture FIFO (thus to the standard capture | 120 | The result is forwarded to the ADC capture FIFO (thus to the standard capture |
117 | PCM device). | 121 | PCM device). |
118 | 122 | ||
119 | name='Center Playback Volume',index=0 | 123 | ``name='Center Playback Volume',index=0`` |
120 | 124 | ----------------------------------------- | |
121 | This control is used to attenuate sample for center PCM FX-bus accumulator. | 125 | This control is used to attenuate sample for center PCM FX-bus accumulator. |
122 | ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded | 126 | ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded |
123 | to the ??rear?? right DAC PCM slot of the AC97 codec. | 127 | to the ??rear?? right DAC PCM slot of the AC97 codec. |
124 | 128 | ||
125 | name='LFE Playback Volume',index=0 | 129 | ``name='LFE Playback Volume',index=0`` |
126 | 130 | -------------------------------------- | |
127 | This control is used to attenuate sample for center PCM FX-bus accumulator. | 131 | This control is used to attenuate sample for center PCM FX-bus accumulator. |
128 | ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded | 132 | ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded |
129 | to the ??rear?? left DAC PCM slot of the AC97 codec. | 133 | to the ??rear?? left DAC PCM slot of the AC97 codec. |
130 | 134 | ||
131 | name='AC97 Playback Volume',index=0 | 135 | ``name='AC97 Playback Volume',index=0`` |
132 | 136 | --------------------------------------- | |
133 | This control is used to attenuate samples for left and right front ADC PCM slots | 137 | This control is used to attenuate samples for left and right front ADC PCM slots |
134 | of the AC97 codec. The result samples are forwarded to the front DAC PCM | 138 | of the AC97 codec. The result samples are forwarded to the front DAC PCM |
135 | slots of the AC97 codec. | 139 | slots of the AC97 codec. |
136 | ******************************************************************************** | ||
137 | *** Note: This control should be zero for the standard operations, otherwise *** | ||
138 | *** a digital loopback is activated. *** | ||
139 | ******************************************************************************** | ||
140 | 140 | ||
141 | name='AC97 Capture Volume',index=0 | 141 | .. note:: |
142 | This control should be zero for the standard operations, otherwise | ||
143 | a digital loopback is activated. | ||
144 | |||
142 | 145 | ||
146 | ``name='AC97 Capture Volume',index=0`` | ||
147 | -------------------------------------- | ||
143 | This control is used to attenuate samples for left and right front ADC PCM slots | 148 | This control is used to attenuate samples for left and right front ADC PCM slots |
144 | of the AC97 codec. The result is forwarded to the ADC capture FIFO (thus to | 149 | of the AC97 codec. The result is forwarded to the ADC capture FIFO (thus to |
145 | the standard capture PCM device). | 150 | the standard capture PCM device). |
146 | ******************************************************************************** | ||
147 | *** Note: This control should be 100 (maximal value), otherwise no analog *** | ||
148 | *** inputs of the AC97 codec can be captured (recorded). *** | ||
149 | ******************************************************************************** | ||
150 | 151 | ||
151 | name='IEC958 TTL Playback Volume',index=0 | 152 | .. note:: |
153 | This control should be 100 (maximal value), otherwise no analog | ||
154 | inputs of the AC97 codec can be captured (recorded). | ||
152 | 155 | ||
156 | ``name='IEC958 TTL Playback Volume',index=0`` | ||
157 | --------------------------------------------- | ||
153 | This control is used to attenuate samples from left and right IEC958 TTL | 158 | This control is used to attenuate samples from left and right IEC958 TTL |
154 | digital inputs (usually used by a CDROM drive). The result samples are | 159 | digital inputs (usually used by a CDROM drive). The result samples are |
155 | forwarded to the front DAC PCM slots of the AC97 codec. | 160 | forwarded to the front DAC PCM slots of the AC97 codec. |
156 | 161 | ||
157 | name='IEC958 TTL Capture Volume',index=0 | 162 | ``name='IEC958 TTL Capture Volume',index=0`` |
158 | 163 | -------------------------------------------- | |
159 | This control is used to attenuate samples from left and right IEC958 TTL | 164 | This control is used to attenuate samples from left and right IEC958 TTL |
160 | digital inputs (usually used by a CDROM drive). The result samples are | 165 | digital inputs (usually used by a CDROM drive). The result samples are |
161 | forwarded to the ADC capture FIFO (thus to the standard capture PCM device). | 166 | forwarded to the ADC capture FIFO (thus to the standard capture PCM device). |
162 | 167 | ||
163 | name='Zoom Video Playback Volume',index=0 | 168 | ``name='Zoom Video Playback Volume',index=0`` |
164 | 169 | --------------------------------------------- | |
165 | This control is used to attenuate samples from left and right zoom video | 170 | This control is used to attenuate samples from left and right zoom video |
166 | digital inputs (usually used by a CDROM drive). The result samples are | 171 | digital inputs (usually used by a CDROM drive). The result samples are |
167 | forwarded to the front DAC PCM slots of the AC97 codec. | 172 | forwarded to the front DAC PCM slots of the AC97 codec. |
168 | 173 | ||
169 | name='Zoom Video Capture Volume',index=0 | 174 | ``name='Zoom Video Capture Volume',index=0`` |
170 | 175 | -------------------------------------------- | |
171 | This control is used to attenuate samples from left and right zoom video | 176 | This control is used to attenuate samples from left and right zoom video |
172 | digital inputs (usually used by a CDROM drive). The result samples are | 177 | digital inputs (usually used by a CDROM drive). The result samples are |
173 | forwarded to the ADC capture FIFO (thus to the standard capture PCM device). | 178 | forwarded to the ADC capture FIFO (thus to the standard capture PCM device). |
174 | 179 | ||
175 | name='IEC958 LiveDrive Playback Volume',index=0 | 180 | ``name='IEC958 LiveDrive Playback Volume',index=0`` |
176 | 181 | --------------------------------------------------- | |
177 | This control is used to attenuate samples from left and right IEC958 optical | 182 | This control is used to attenuate samples from left and right IEC958 optical |
178 | digital input. The result samples are forwarded to the front DAC PCM slots | 183 | digital input. The result samples are forwarded to the front DAC PCM slots |
179 | of the AC97 codec. | 184 | of the AC97 codec. |
180 | 185 | ||
181 | name='IEC958 LiveDrive Capture Volume',index=0 | 186 | ``name='IEC958 LiveDrive Capture Volume',index=0`` |
182 | 187 | -------------------------------------------------- | |
183 | This control is used to attenuate samples from left and right IEC958 optical | 188 | This control is used to attenuate samples from left and right IEC958 optical |
184 | digital inputs. The result samples are forwarded to the ADC capture FIFO | 189 | digital inputs. The result samples are forwarded to the ADC capture FIFO |
185 | (thus to the standard capture PCM device). | 190 | (thus to the standard capture PCM device). |
186 | 191 | ||
187 | name='IEC958 Coaxial Playback Volume',index=0 | 192 | ``name='IEC958 Coaxial Playback Volume',index=0`` |
188 | 193 | ------------------------------------------------- | |
189 | This control is used to attenuate samples from left and right IEC958 coaxial | 194 | This control is used to attenuate samples from left and right IEC958 coaxial |
190 | digital inputs. The result samples are forwarded to the front DAC PCM slots | 195 | digital inputs. The result samples are forwarded to the front DAC PCM slots |
191 | of the AC97 codec. | 196 | of the AC97 codec. |
192 | 197 | ||
193 | name='IEC958 Coaxial Capture Volume',index=0 | 198 | ``name='IEC958 Coaxial Capture Volume',index=0`` |
194 | 199 | ------------------------------------------------ | |
195 | This control is used to attenuate samples from left and right IEC958 coaxial | 200 | This control is used to attenuate samples from left and right IEC958 coaxial |
196 | digital inputs. The result samples are forwarded to the ADC capture FIFO | 201 | digital inputs. The result samples are forwarded to the ADC capture FIFO |
197 | (thus to the standard capture PCM device). | 202 | (thus to the standard capture PCM device). |
198 | 203 | ||
199 | name='Line LiveDrive Playback Volume',index=0 | 204 | ``name='Line LiveDrive Playback Volume',index=0``, ``name='Line LiveDrive Playback Volume',index=1`` |
200 | name='Line LiveDrive Playback Volume',index=1 | 205 | ---------------------------------------------------------------------------------------------------- |
201 | |||
202 | This control is used to attenuate samples from left and right I2S ADC | 206 | This control is used to attenuate samples from left and right I2S ADC |
203 | inputs (on the LiveDrive). The result samples are forwarded to the front | 207 | inputs (on the LiveDrive). The result samples are forwarded to the front |
204 | DAC PCM slots of the AC97 codec. | 208 | DAC PCM slots of the AC97 codec. |
205 | 209 | ||
206 | name='Line LiveDrive Capture Volume',index=1 | 210 | ``name='Line LiveDrive Capture Volume',index=1``, ``name='Line LiveDrive Capture Volume',index=1`` |
207 | name='Line LiveDrive Capture Volume',index=1 | 211 | -------------------------------------------------------------------------------------------------- |
208 | |||
209 | This control is used to attenuate samples from left and right I2S ADC | 212 | This control is used to attenuate samples from left and right I2S ADC |
210 | inputs (on the LiveDrive). The result samples are forwarded to the ADC | 213 | inputs (on the LiveDrive). The result samples are forwarded to the ADC |
211 | capture FIFO (thus to the standard capture PCM device). | 214 | capture FIFO (thus to the standard capture PCM device). |
212 | 215 | ||
213 | name='Tone Control - Switch',index=0 | 216 | ``name='Tone Control - Switch',index=0`` |
214 | 217 | ---------------------------------------- | |
215 | This control turns the tone control on or off. The samples for front, rear | 218 | This control turns the tone control on or off. The samples for front, rear |
216 | and center / LFE outputs are affected. | 219 | and center / LFE outputs are affected. |
217 | 220 | ||
218 | name='Tone Control - Bass',index=0 | 221 | ``name='Tone Control - Bass',index=0`` |
219 | 222 | -------------------------------------- | |
220 | This control sets the bass intensity. There is no neutral value!! | 223 | This control sets the bass intensity. There is no neutral value!! |
221 | When the tone control code is activated, the samples are always modified. | 224 | When the tone control code is activated, the samples are always modified. |
222 | The closest value to pure signal is 20. | 225 | The closest value to pure signal is 20. |
223 | 226 | ||
224 | name='Tone Control - Treble',index=0 | 227 | ``name='Tone Control - Treble',index=0`` |
225 | 228 | ---------------------------------------- | |
226 | This control sets the treble intensity. There is no neutral value!! | 229 | This control sets the treble intensity. There is no neutral value!! |
227 | When the tone control code is activated, the samples are always modified. | 230 | When the tone control code is activated, the samples are always modified. |
228 | The closest value to pure signal is 20. | 231 | The closest value to pure signal is 20. |
229 | 232 | ||
230 | name='IEC958 Optical Raw Playback Switch',index=0 | 233 | ``name='IEC958 Optical Raw Playback Switch',index=0`` |
231 | 234 | ----------------------------------------------------- | |
232 | If this switch is on, then the samples for the IEC958 (S/PDIF) digital | 235 | If this switch is on, then the samples for the IEC958 (S/PDIF) digital |
233 | output are taken only from the raw FX8010 PCM, otherwise standard front | 236 | output are taken only from the raw FX8010 PCM, otherwise standard front |
234 | PCM samples are taken. | 237 | PCM samples are taken. |
235 | 238 | ||
236 | name='Headphone Playback Volume',index=1 | 239 | ``name='Headphone Playback Volume',index=1`` |
237 | 240 | -------------------------------------------- | |
238 | This control attenuates the samples for the headphone output. | 241 | This control attenuates the samples for the headphone output. |
239 | 242 | ||
240 | name='Headphone Center Playback Switch',index=1 | 243 | ``name='Headphone Center Playback Switch',index=1`` |
241 | 244 | --------------------------------------------------- | |
242 | If this switch is on, then the sample for the center PCM is put to the | 245 | If this switch is on, then the sample for the center PCM is put to the |
243 | left headphone output (useful for SB Live cards without separate center/LFE | 246 | left headphone output (useful for SB Live cards without separate center/LFE |
244 | output). | 247 | output). |
245 | 248 | ||
246 | name='Headphone LFE Playback Switch',index=1 | 249 | ``name='Headphone LFE Playback Switch',index=1`` |
247 | 250 | ------------------------------------------------ | |
248 | If this switch is on, then the sample for the center PCM is put to the | 251 | If this switch is on, then the sample for the center PCM is put to the |
249 | right headphone output (useful for SB Live cards without separate center/LFE | 252 | right headphone output (useful for SB Live cards without separate center/LFE |
250 | output). | 253 | output). |
251 | 254 | ||
252 | 255 | ||
253 | 3) PCM stream related controls | 256 | PCM stream related controls |
254 | ------------------------------ | 257 | =========================== |
255 | |||
256 | name='EMU10K1 PCM Volume',index 0-31 | ||
257 | 258 | ||
259 | ``name='EMU10K1 PCM Volume',index 0-31`` | ||
260 | ---------------------------------------- | ||
258 | Channel volume attenuation in range 0-0xffff. The maximum value (no | 261 | Channel volume attenuation in range 0-0xffff. The maximum value (no |
259 | attenuation) is default. The channel mapping for three values is | 262 | attenuation) is default. The channel mapping for three values is |
260 | as follows: | 263 | as follows: |
261 | 264 | ||
262 | 0 - mono, default 0xffff (no attenuation) | 265 | * 0 - mono, default 0xffff (no attenuation) |
263 | 1 - left, default 0xffff (no attenuation) | 266 | * 1 - left, default 0xffff (no attenuation) |
264 | 2 - right, default 0xffff (no attenuation) | 267 | * 2 - right, default 0xffff (no attenuation) |
265 | |||
266 | name='EMU10K1 PCM Send Routing',index 0-31 | ||
267 | 268 | ||
269 | ``name='EMU10K1 PCM Send Routing',index 0-31`` | ||
270 | ---------------------------------------------- | ||
268 | This control specifies the destination - FX-bus accumulators. There are | 271 | This control specifies the destination - FX-bus accumulators. There are |
269 | twelve values with this mapping: | 272 | twelve values with this mapping: |
270 | 273 | ||
271 | 0 - mono, A destination (FX-bus 0-15), default 0 | 274 | * 0 - mono, A destination (FX-bus 0-15), default 0 |
272 | 1 - mono, B destination (FX-bus 0-15), default 1 | 275 | * 1 - mono, B destination (FX-bus 0-15), default 1 |
273 | 2 - mono, C destination (FX-bus 0-15), default 2 | 276 | * 2 - mono, C destination (FX-bus 0-15), default 2 |
274 | 3 - mono, D destination (FX-bus 0-15), default 3 | 277 | * 3 - mono, D destination (FX-bus 0-15), default 3 |
275 | 4 - left, A destination (FX-bus 0-15), default 0 | 278 | * 4 - left, A destination (FX-bus 0-15), default 0 |
276 | 5 - left, B destination (FX-bus 0-15), default 1 | 279 | * 5 - left, B destination (FX-bus 0-15), default 1 |
277 | 6 - left, C destination (FX-bus 0-15), default 2 | 280 | * 6 - left, C destination (FX-bus 0-15), default 2 |
278 | 7 - left, D destination (FX-bus 0-15), default 3 | 281 | * 7 - left, D destination (FX-bus 0-15), default 3 |
279 | 8 - right, A destination (FX-bus 0-15), default 0 | 282 | * 8 - right, A destination (FX-bus 0-15), default 0 |
280 | 9 - right, B destination (FX-bus 0-15), default 1 | 283 | * 9 - right, B destination (FX-bus 0-15), default 1 |
281 | 10 - right, C destination (FX-bus 0-15), default 2 | 284 | * 10 - right, C destination (FX-bus 0-15), default 2 |
282 | 11 - right, D destination (FX-bus 0-15), default 3 | 285 | * 11 - right, D destination (FX-bus 0-15), default 3 |
283 | 286 | ||
284 | Don't forget that it's illegal to assign a channel to the same FX-bus accumulator | 287 | Don't forget that it's illegal to assign a channel to the same FX-bus accumulator |
285 | more than once (it means 0=0 && 1=0 is an invalid combination). | 288 | more than once (it means 0=0 && 1=0 is an invalid combination). |
286 | 289 | ||
287 | name='EMU10K1 PCM Send Volume',index 0-31 | 290 | ``name='EMU10K1 PCM Send Volume',index 0-31`` |
288 | 291 | --------------------------------------------- | |
289 | It specifies the attenuation (amount) for given destination in range 0-255. | 292 | It specifies the attenuation (amount) for given destination in range 0-255. |
290 | The channel mapping is following: | 293 | The channel mapping is following: |
291 | 294 | ||
292 | 0 - mono, A destination attn, default 255 (no attenuation) | 295 | * 0 - mono, A destination attn, default 255 (no attenuation) |
293 | 1 - mono, B destination attn, default 255 (no attenuation) | 296 | * 1 - mono, B destination attn, default 255 (no attenuation) |
294 | 2 - mono, C destination attn, default 0 (mute) | 297 | * 2 - mono, C destination attn, default 0 (mute) |
295 | 3 - mono, D destination attn, default 0 (mute) | 298 | * 3 - mono, D destination attn, default 0 (mute) |
296 | 4 - left, A destination attn, default 255 (no attenuation) | 299 | * 4 - left, A destination attn, default 255 (no attenuation) |
297 | 5 - left, B destination attn, default 0 (mute) | 300 | * 5 - left, B destination attn, default 0 (mute) |
298 | 6 - left, C destination attn, default 0 (mute) | 301 | * 6 - left, C destination attn, default 0 (mute) |
299 | 7 - left, D destination attn, default 0 (mute) | 302 | * 7 - left, D destination attn, default 0 (mute) |
300 | 8 - right, A destination attn, default 0 (mute) | 303 | * 8 - right, A destination attn, default 0 (mute) |
301 | 9 - right, B destination attn, default 255 (no attenuation) | 304 | * 9 - right, B destination attn, default 255 (no attenuation) |
302 | 10 - right, C destination attn, default 0 (mute) | 305 | * 10 - right, C destination attn, default 0 (mute) |
303 | 11 - right, D destination attn, default 0 (mute) | 306 | * 11 - right, D destination attn, default 0 (mute) |
304 | 307 | ||
305 | 308 | ||
306 | 309 | ||
307 | 4) MANUALS/PATENTS: | 310 | MANUALS/PATENTS |
308 | ------------------- | 311 | =============== |
309 | 312 | ||
310 | ftp://opensource.creative.com/pub/doc | 313 | ftp://opensource.creative.com/pub/doc |
311 | ------------------------------------- | 314 | ------------------------------------- |
312 | 315 | ||
313 | Files: | 316 | LM4545.pdf |
314 | LM4545.pdf AC97 Codec | 317 | AC97 Codec |
315 | 318 | m2049.pdf | |
316 | m2049.pdf The EMU10K1 Digital Audio Processor | 319 | The EMU10K1 Digital Audio Processor |
317 | 320 | hog63.ps | |
318 | hog63.ps FX8010 - A DSP Chip Architecture for Audio Effects | 321 | FX8010 - A DSP Chip Architecture for Audio Effects |
319 | 322 | ||
320 | 323 | ||
321 | WIPO Patents | 324 | WIPO Patents |
322 | ------------ | 325 | ------------ |
323 | Patent numbers: | ||
324 | WO 9901813 (A1) Audio Effects Processor with multiple asynchronous (Jan. 14, 1999) | ||
325 | streams | ||
326 | 326 | ||
327 | WO 9901814 (A1) Processor with Instruction Set for Audio Effects (Jan. 14, 1999) | 327 | WO 9901813 (A1) |
328 | Audio Effects Processor with multiple asynchronous streams | ||
329 | (Jan. 14, 1999) | ||
330 | |||
331 | WO 9901814 (A1) | ||
332 | Processor with Instruction Set for Audio Effects (Jan. 14, 1999) | ||
328 | 333 | ||
329 | WO 9901953 (A1) Audio Effects Processor having Decoupled Instruction | 334 | WO 9901953 (A1) |
330 | Execution and Audio Data Sequencing (Jan. 14, 1999) | 335 | Audio Effects Processor having Decoupled Instruction |
336 | Execution and Audio Data Sequencing (Jan. 14, 1999) | ||
331 | 337 | ||
332 | 338 | ||
333 | US Patents (http://www.uspto.gov/) | 339 | US Patents (http://www.uspto.gov/) |
334 | ---------------------------------- | 340 | ---------------------------------- |
335 | 341 | ||
336 | US 5925841 Digital Sampling Instrument employing cache memory (Jul. 20, 1999) | 342 | US 5925841 |
337 | 343 | Digital Sampling Instrument employing cache memory (Jul. 20, 1999) | |
338 | US 5928342 Audio Effects Processor integrated on a single chip (Jul. 27, 1999) | 344 | |
339 | with a multiport memory onto which multiple asynchronous | 345 | US 5928342 |
340 | digital sound samples can be concurrently loaded | 346 | Audio Effects Processor integrated on a single chip |
341 | 347 | with a multiport memory onto which multiple asynchronous | |
342 | US 5930158 Processor with Instruction Set for Audio Effects (Jul. 27, 1999) | 348 | digital sound samples can be concurrently loaded |
343 | 349 | (Jul. 27, 1999) | |
344 | US 6032235 Memory initialization circuit (Tram) (Feb. 29, 2000) | 350 | |
345 | 351 | US 5930158 | |
346 | US 6138207 Interpolation looping of audio samples in cache connected to (Oct. 24, 2000) | 352 | Processor with Instruction Set for Audio Effects (Jul. 27, 1999) |
347 | system bus with prioritization and modification of bus transfers | 353 | |
348 | in accordance with loop ends and minimum block sizes | 354 | US 6032235 |
349 | 355 | Memory initialization circuit (Tram) (Feb. 29, 2000) | |
350 | US 6151670 Method for conserving memory storage using a (Nov. 21, 2000) | 356 | |
351 | pool of short term memory registers | 357 | US 6138207 |
352 | 358 | Interpolation looping of audio samples in cache connected to | |
353 | US 6195715 Interrupt control for multiple programs communicating with (Feb. 27, 2001) | 359 | system bus with prioritization and modification of bus transfers |
354 | a common interrupt by associating programs to GP registers, | 360 | in accordance with loop ends and minimum block sizes |
355 | defining interrupt register, polling GP registers, and invoking | 361 | (Oct. 24, 2000) |
356 | callback routine associated with defined interrupt register | 362 | |
363 | US 6151670 | ||
364 | Method for conserving memory storage using a | ||
365 | pool of short term memory registers | ||
366 | (Nov. 21, 2000) | ||
367 | |||
368 | US 6195715 | ||
369 | Interrupt control for multiple programs communicating with | ||
370 | a common interrupt by associating programs to GP registers, | ||
371 | defining interrupt register, polling GP registers, and invoking | ||
372 | callback routine associated with defined interrupt register | ||
373 | (Feb. 27, 2001) | ||
diff --git a/Documentation/sound/alsa/serial-u16550.txt b/Documentation/sound/cards/serial-u16550.rst index c1919559d509..197aeacea3da 100644 --- a/Documentation/sound/alsa/serial-u16550.txt +++ b/Documentation/sound/cards/serial-u16550.rst | |||
@@ -1,14 +1,14 @@ | |||
1 | 1 | =================================== | |
2 | Serial UART 16450/16550 MIDI driver | 2 | Serial UART 16450/16550 MIDI driver |
3 | =================================== | 3 | =================================== |
4 | 4 | ||
5 | The adaptor module parameter allows you to select either: | 5 | The adaptor module parameter allows you to select either: |
6 | 6 | ||
7 | 0 - Roland Soundcanvas support (default) | 7 | * 0 - Roland Soundcanvas support (default) |
8 | 1 - Midiator MS-124T support (1) | 8 | * 1 - Midiator MS-124T support (1) |
9 | 2 - Midiator MS-124W S/A mode (2) | 9 | * 2 - Midiator MS-124W S/A mode (2) |
10 | 3 - MS-124W M/B mode support (3) | 10 | * 3 - MS-124W M/B mode support (3) |
11 | 4 - Generic device with multiple input support (4) | 11 | * 4 - Generic device with multiple input support (4) |
12 | 12 | ||
13 | For the Midiator MS-124W, you must set the physical M-S and A-B | 13 | For the Midiator MS-124W, you must set the physical M-S and A-B |
14 | switches on the Midiator to match the driver mode you select. | 14 | switches on the Midiator to match the driver mode you select. |
@@ -22,11 +22,13 @@ substream. The driver provides no way to send F5 00 (no selection) or to not | |||
22 | send the F5 NN command sequence at all; perhaps it ought to. | 22 | send the F5 NN command sequence at all; perhaps it ought to. |
23 | 23 | ||
24 | Usage example for simple serial converter: | 24 | Usage example for simple serial converter: |
25 | :: | ||
25 | 26 | ||
26 | /sbin/setserial /dev/ttyS0 uart none | 27 | /sbin/setserial /dev/ttyS0 uart none |
27 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 speed=115200 | 28 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 speed=115200 |
28 | 29 | ||
29 | Usage example for Roland SoundCanvas with 4 MIDI ports: | 30 | Usage example for Roland SoundCanvas with 4 MIDI ports: |
31 | :: | ||
30 | 32 | ||
31 | /sbin/setserial /dev/ttyS0 uart none | 33 | /sbin/setserial /dev/ttyS0 uart none |
32 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 outs=4 | 34 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 outs=4 |
@@ -37,6 +39,7 @@ all four MIDI Out connectors. Set the A-B switch and the speed module | |||
37 | parameter to match (A=19200, B=9600). | 39 | parameter to match (A=19200, B=9600). |
38 | 40 | ||
39 | Usage example for MS-124T, with A-B switch in A position: | 41 | Usage example for MS-124T, with A-B switch in A position: |
42 | :: | ||
40 | 43 | ||
41 | /sbin/setserial /dev/ttyS0 uart none | 44 | /sbin/setserial /dev/ttyS0 uart none |
42 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=1 \ | 45 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=1 \ |
@@ -47,6 +50,7 @@ the outs module parameter is automatically set to 1. The driver sends | |||
47 | the same data to all four MIDI Out connectors at full MIDI speed. | 50 | the same data to all four MIDI Out connectors at full MIDI speed. |
48 | 51 | ||
49 | Usage example for S/A mode: | 52 | Usage example for S/A mode: |
53 | :: | ||
50 | 54 | ||
51 | /sbin/setserial /dev/ttyS0 uart none | 55 | /sbin/setserial /dev/ttyS0 uart none |
52 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=2 | 56 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=2 |
@@ -63,6 +67,7 @@ at most one byte every 520 us, as compared with the full MIDI data rate of | |||
63 | one byte every 320 us per port. | 67 | one byte every 320 us per port. |
64 | 68 | ||
65 | Usage example for M/B mode: | 69 | Usage example for M/B mode: |
70 | :: | ||
66 | 71 | ||
67 | /sbin/setserial /dev/ttyS0 uart none | 72 | /sbin/setserial /dev/ttyS0 uart none |
68 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=3 | 73 | /sbin/modprobe snd-serial-u16550 port=0x3f8 irq=4 adaptor=3 |
diff --git a/Documentation/sound/cards/via82xx-mixer.rst b/Documentation/sound/cards/via82xx-mixer.rst new file mode 100644 index 000000000000..6ee993d4535b --- /dev/null +++ b/Documentation/sound/cards/via82xx-mixer.rst | |||
@@ -0,0 +1,8 @@ | |||
1 | ============= | ||
2 | VIA82xx mixer | ||
3 | ============= | ||
4 | |||
5 | On many VIA82xx boards, the ``Input Source Select`` mixer control does not work. | ||
6 | Setting it to ``Input2`` on such boards will cause recording to hang, or fail | ||
7 | with EIO (input/output error) via OSS emulation. This control should be left | ||
8 | at ``Input1`` for such cards. | ||
diff --git a/Documentation/sound/alsa/Channel-Mapping-API.txt b/Documentation/sound/designs/channel-mapping-api.rst index 3c43d1a4ca0e..58e6312a43c0 100644 --- a/Documentation/sound/alsa/Channel-Mapping-API.txt +++ b/Documentation/sound/designs/channel-mapping-api.rst | |||
@@ -1,9 +1,11 @@ | |||
1 | ============================ | ||
1 | ALSA PCM channel-mapping API | 2 | ALSA PCM channel-mapping API |
2 | ============================ | 3 | ============================ |
3 | Takashi Iwai <tiwai@suse.de> | ||
4 | 4 | ||
5 | GENERAL | 5 | Takashi Iwai <tiwai@suse.de> |
6 | ------- | 6 | |
7 | General | ||
8 | ======= | ||
7 | 9 | ||
8 | The channel mapping API allows user to query the possible channel maps | 10 | The channel mapping API allows user to query the possible channel maps |
9 | and the current channel map, also optionally to modify the channel map | 11 | and the current channel map, also optionally to modify the channel map |
@@ -11,9 +13,9 @@ of the current stream. | |||
11 | 13 | ||
12 | A channel map is an array of position for each PCM channel. | 14 | A channel map is an array of position for each PCM channel. |
13 | Typically, a stereo PCM stream has a channel map of | 15 | Typically, a stereo PCM stream has a channel map of |
14 | { front_left, front_right } | 16 | ``{ front_left, front_right }`` |
15 | while a 4.0 surround PCM stream has a channel map of | 17 | while a 4.0 surround PCM stream has a channel map of |
16 | { front left, front right, rear left, rear right }. | 18 | ``{ front left, front right, rear left, rear right }.`` |
17 | 19 | ||
18 | The problem, so far, was that we had no standard channel map | 20 | The problem, so far, was that we had no standard channel map |
19 | explicitly, and applications had no way to know which channel | 21 | explicitly, and applications had no way to know which channel |
@@ -29,8 +31,8 @@ specification. These are the main motivations for the new channel | |||
29 | mapping API. | 31 | mapping API. |
30 | 32 | ||
31 | 33 | ||
32 | DESIGN | 34 | Design |
33 | ------ | 35 | ====== |
34 | 36 | ||
35 | Actually, "the channel mapping API" doesn't introduce anything new in | 37 | Actually, "the channel mapping API" doesn't introduce anything new in |
36 | the kernel/user-space ABI perspective. It uses only the existing | 38 | the kernel/user-space ABI perspective. It uses only the existing |
@@ -39,10 +41,11 @@ control element features. | |||
39 | As a ground design, each PCM substream may contain a control element | 41 | As a ground design, each PCM substream may contain a control element |
40 | providing the channel mapping information and configuration. This | 42 | providing the channel mapping information and configuration. This |
41 | element is specified by: | 43 | element is specified by: |
42 | iface = SNDRV_CTL_ELEM_IFACE_PCM | 44 | |
43 | name = "Playback Channel Map" or "Capture Channel Map" | 45 | * iface = SNDRV_CTL_ELEM_IFACE_PCM |
44 | device = the same device number for the assigned PCM substream | 46 | * name = "Playback Channel Map" or "Capture Channel Map" |
45 | index = the same index number for the assigned PCM substream | 47 | * device = the same device number for the assigned PCM substream |
48 | * index = the same index number for the assigned PCM substream | ||
46 | 49 | ||
47 | Note the name is different depending on the PCM substream direction. | 50 | Note the name is different depending on the PCM substream direction. |
48 | 51 | ||
@@ -50,32 +53,35 @@ Each control element provides at least the TLV read operation and the | |||
50 | read operation. Optionally, the write operation can be provided to | 53 | read operation. Optionally, the write operation can be provided to |
51 | allow user to change the channel map dynamically. | 54 | allow user to change the channel map dynamically. |
52 | 55 | ||
53 | * TLV | 56 | TLV |
57 | --- | ||
54 | 58 | ||
55 | The TLV operation gives the list of available channel | 59 | The TLV operation gives the list of available channel |
56 | maps. A list item of a channel map is usually a TLV of | 60 | maps. A list item of a channel map is usually a TLV of |
57 | type data-bytes ch0 ch1 ch2... | 61 | ``type data-bytes ch0 ch1 ch2...`` |
58 | where type is the TLV type value, the second argument is the total | 62 | where type is the TLV type value, the second argument is the total |
59 | bytes (not the numbers) of channel values, and the rest are the | 63 | bytes (not the numbers) of channel values, and the rest are the |
60 | position value for each channel. | 64 | position value for each channel. |
61 | 65 | ||
62 | As a TLV type, either SNDRV_CTL_TLVT_CHMAP_FIXED, | 66 | As a TLV type, either ``SNDRV_CTL_TLVT_CHMAP_FIXED``, |
63 | SNDRV_CTL_TLV_CHMAP_VAR or SNDRV_CTL_TLVT_CHMAP_PAIRED can be used. | 67 | ``SNDRV_CTL_TLV_CHMAP_VAR`` or ``SNDRV_CTL_TLVT_CHMAP_PAIRED`` can be used. |
64 | The _FIXED type is for a channel map with the fixed channel position | 68 | The ``_FIXED`` type is for a channel map with the fixed channel position |
65 | while the latter two are for flexible channel positions. _VAR type is | 69 | while the latter two are for flexible channel positions. ``_VAR`` type is |
66 | for a channel map where all channels are freely swappable and _PAIRED | 70 | for a channel map where all channels are freely swappable and ``_PAIRED`` |
67 | type is where pair-wise channels are swappable. For example, when you | 71 | type is where pair-wise channels are swappable. For example, when you |
68 | have {FL/FR/RL/RR} channel map, _PAIRED type would allow you to swap | 72 | have {FL/FR/RL/RR} channel map, ``_PAIRED`` type would allow you to swap |
69 | only {RL/RR/FL/FR} while _VAR type would allow even swapping FL and | 73 | only {RL/RR/FL/FR} while ``_VAR`` type would allow even swapping FL and |
70 | RR. | 74 | RR. |
71 | 75 | ||
72 | These new TLV types are defined in sound/tlv.h. | 76 | These new TLV types are defined in ``sound/tlv.h``. |
73 | 77 | ||
74 | The available channel position values are defined in sound/asound.h, | 78 | The available channel position values are defined in ``sound/asound.h``, |
75 | here is a cut: | 79 | here is a cut: |
76 | 80 | ||
77 | /* channel positions */ | 81 | :: |
78 | enum { | 82 | |
83 | /* channel positions */ | ||
84 | enum { | ||
79 | SNDRV_CHMAP_UNKNOWN = 0, | 85 | SNDRV_CHMAP_UNKNOWN = 0, |
80 | SNDRV_CHMAP_NA, /* N/A, silent */ | 86 | SNDRV_CHMAP_NA, /* N/A, silent */ |
81 | SNDRV_CHMAP_MONO, /* mono stream */ | 87 | SNDRV_CHMAP_MONO, /* mono stream */ |
@@ -107,11 +113,13 @@ enum { | |||
107 | SNDRV_CHMAP_TRR, /* top rear right */ | 113 | SNDRV_CHMAP_TRR, /* top rear right */ |
108 | SNDRV_CHMAP_TRC, /* top rear center */ | 114 | SNDRV_CHMAP_TRC, /* top rear center */ |
109 | SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC, | 115 | SNDRV_CHMAP_LAST = SNDRV_CHMAP_TRC, |
110 | }; | 116 | }; |
111 | 117 | ||
112 | When a PCM stream can provide more than one channel map, you can | 118 | When a PCM stream can provide more than one channel map, you can |
113 | provide multiple channel maps in a TLV container type. The TLV data | 119 | provide multiple channel maps in a TLV container type. The TLV data |
114 | to be returned will contain such as: | 120 | to be returned will contain such as: |
121 | :: | ||
122 | |||
115 | SNDRV_CTL_TLVT_CONTAINER 96 | 123 | SNDRV_CTL_TLVT_CONTAINER 96 |
116 | SNDRV_CTL_TLVT_CHMAP_FIXED 4 SNDRV_CHMAP_FC | 124 | SNDRV_CTL_TLVT_CHMAP_FIXED 4 SNDRV_CHMAP_FC |
117 | SNDRV_CTL_TLVT_CHMAP_FIXED 8 SNDRV_CHMAP_FL SNDRV_CHMAP_FR | 125 | SNDRV_CTL_TLVT_CHMAP_FIXED 8 SNDRV_CHMAP_FL SNDRV_CHMAP_FR |
@@ -120,19 +128,21 @@ to be returned will contain such as: | |||
120 | 128 | ||
121 | The channel position is provided in LSB 16bits. The upper bits are | 129 | The channel position is provided in LSB 16bits. The upper bits are |
122 | used for bit flags. | 130 | used for bit flags. |
131 | :: | ||
123 | 132 | ||
124 | #define SNDRV_CHMAP_POSITION_MASK 0xffff | 133 | #define SNDRV_CHMAP_POSITION_MASK 0xffff |
125 | #define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16) | 134 | #define SNDRV_CHMAP_PHASE_INVERSE (0x01 << 16) |
126 | #define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16) | 135 | #define SNDRV_CHMAP_DRIVER_SPEC (0x02 << 16) |
127 | 136 | ||
128 | SNDRV_CHMAP_PHASE_INVERSE indicates the channel is phase inverted, | 137 | ``SNDRV_CHMAP_PHASE_INVERSE`` indicates the channel is phase inverted, |
129 | (thus summing left and right channels would result in almost silence). | 138 | (thus summing left and right channels would result in almost silence). |
130 | Some digital mic devices have this. | 139 | Some digital mic devices have this. |
131 | 140 | ||
132 | When SNDRV_CHMAP_DRIVER_SPEC is set, all the channel position values | 141 | When ``SNDRV_CHMAP_DRIVER_SPEC`` is set, all the channel position values |
133 | don't follow the standard definition above but driver-specific. | 142 | don't follow the standard definition above but driver-specific. |
134 | 143 | ||
135 | * READ OPERATION | 144 | Read Operation |
145 | -------------- | ||
136 | 146 | ||
137 | The control read operation is for providing the current channel map of | 147 | The control read operation is for providing the current channel map of |
138 | the given stream. The control element returns an integer array | 148 | the given stream. The control element returns an integer array |
@@ -140,9 +150,10 @@ containing the position of each channel. | |||
140 | 150 | ||
141 | When this is performed before the number of the channel is specified | 151 | When this is performed before the number of the channel is specified |
142 | (i.e. hw_params is set), it should return all channels set to | 152 | (i.e. hw_params is set), it should return all channels set to |
143 | UNKNOWN. | 153 | ``UNKNOWN``. |
144 | 154 | ||
145 | * WRITE OPERATION | 155 | Write Operation |
156 | --------------- | ||
146 | 157 | ||
147 | The control write operation is optional, and only for devices that can | 158 | The control write operation is optional, and only for devices that can |
148 | change the channel configuration on the fly, such as HDMI. User needs | 159 | change the channel configuration on the fly, such as HDMI. User needs |
diff --git a/Documentation/sound/alsa/compress_offload.txt b/Documentation/sound/designs/compress-offload.rst index 8ba556a131c3..ad4bfbdacc83 100644 --- a/Documentation/sound/alsa/compress_offload.txt +++ b/Documentation/sound/designs/compress-offload.rst | |||
@@ -1,10 +1,14 @@ | |||
1 | compress_offload.txt | 1 | ========================= |
2 | ===================== | 2 | ALSA Compress-Offload API |
3 | Pierre-Louis.Bossart <pierre-louis.bossart@linux.intel.com> | 3 | ========================= |
4 | Vinod Koul <vinod.koul@linux.intel.com> | 4 | |
5 | Pierre-Louis.Bossart <pierre-louis.bossart@linux.intel.com> | ||
6 | |||
7 | Vinod Koul <vinod.koul@linux.intel.com> | ||
5 | 8 | ||
6 | Overview | ||
7 | 9 | ||
10 | Overview | ||
11 | ======== | ||
8 | Since its early days, the ALSA API was defined with PCM support or | 12 | Since its early days, the ALSA API was defined with PCM support or |
9 | constant bitrates payloads such as IEC61937 in mind. Arguments and | 13 | constant bitrates payloads such as IEC61937 in mind. Arguments and |
10 | returned values in frames are the norm, making it a challenge to | 14 | returned values in frames are the norm, making it a challenge to |
@@ -27,8 +31,9 @@ Intel Moorestown SOC, with many corrections required to upstream the | |||
27 | API in the mainline kernel instead of the staging tree and make it | 31 | API in the mainline kernel instead of the staging tree and make it |
28 | usable by others. | 32 | usable by others. |
29 | 33 | ||
30 | Requirements | ||
31 | 34 | ||
35 | Requirements | ||
36 | ============ | ||
32 | The main requirements are: | 37 | The main requirements are: |
33 | 38 | ||
34 | - separation between byte counts and time. Compressed formats may have | 39 | - separation between byte counts and time. Compressed formats may have |
@@ -63,7 +68,7 @@ The main requirements are: | |||
63 | streaming compressed data to a DSP, with the assumption that the | 68 | streaming compressed data to a DSP, with the assumption that the |
64 | decoded samples are routed to a physical output or logical back-end. | 69 | decoded samples are routed to a physical output or logical back-end. |
65 | 70 | ||
66 | - Complexity hiding. Existing user-space multimedia frameworks all | 71 | - Complexity hiding. Existing user-space multimedia frameworks all |
67 | have existing enums/structures for each compressed format. This new | 72 | have existing enums/structures for each compressed format. This new |
68 | API assumes the existence of a platform-specific compatibility layer | 73 | API assumes the existence of a platform-specific compatibility layer |
69 | to expose, translate and make use of the capabilities of the audio | 74 | to expose, translate and make use of the capabilities of the audio |
@@ -72,7 +77,7 @@ The main requirements are: | |||
72 | 77 | ||
73 | 78 | ||
74 | Design | 79 | Design |
75 | 80 | ====== | |
76 | The new API shares a number of concepts with the PCM API for flow | 81 | The new API shares a number of concepts with the PCM API for flow |
77 | control. Start, pause, resume, drain and stop commands have the same | 82 | control. Start, pause, resume, drain and stop commands have the same |
78 | semantics no matter what the content is. | 83 | semantics no matter what the content is. |
@@ -95,43 +100,44 @@ mandatory routines and possibly make use of optional ones. | |||
95 | 100 | ||
96 | The main additions are | 101 | The main additions are |
97 | 102 | ||
98 | - get_caps | 103 | get_caps |
99 | This routine returns the list of audio formats supported. Querying the | 104 | This routine returns the list of audio formats supported. Querying the |
100 | codecs on a capture stream will return encoders, decoders will be | 105 | codecs on a capture stream will return encoders, decoders will be |
101 | listed for playback streams. | 106 | listed for playback streams. |
102 | 107 | ||
103 | - get_codec_caps For each codec, this routine returns a list of | 108 | get_codec_caps |
104 | capabilities. The intent is to make sure all the capabilities | 109 | For each codec, this routine returns a list of |
105 | correspond to valid settings, and to minimize the risks of | 110 | capabilities. The intent is to make sure all the capabilities |
106 | configuration failures. For example, for a complex codec such as AAC, | 111 | correspond to valid settings, and to minimize the risks of |
107 | the number of channels supported may depend on a specific profile. If | 112 | configuration failures. For example, for a complex codec such as AAC, |
108 | the capabilities were exposed with a single descriptor, it may happen | 113 | the number of channels supported may depend on a specific profile. If |
109 | that a specific combination of profiles/channels/formats may not be | 114 | the capabilities were exposed with a single descriptor, it may happen |
110 | supported. Likewise, embedded DSPs have limited memory and cpu cycles, | 115 | that a specific combination of profiles/channels/formats may not be |
111 | it is likely that some implementations make the list of capabilities | 116 | supported. Likewise, embedded DSPs have limited memory and cpu cycles, |
112 | dynamic and dependent on existing workloads. In addition to codec | 117 | it is likely that some implementations make the list of capabilities |
113 | settings, this routine returns the minimum buffer size handled by the | 118 | dynamic and dependent on existing workloads. In addition to codec |
114 | implementation. This information can be a function of the DMA buffer | 119 | settings, this routine returns the minimum buffer size handled by the |
115 | sizes, the number of bytes required to synchronize, etc, and can be | 120 | implementation. This information can be a function of the DMA buffer |
116 | used by userspace to define how much needs to be written in the ring | 121 | sizes, the number of bytes required to synchronize, etc, and can be |
117 | buffer before playback can start. | 122 | used by userspace to define how much needs to be written in the ring |
118 | 123 | buffer before playback can start. | |
119 | - set_params | 124 | |
120 | This routine sets the configuration chosen for a specific codec. The | 125 | set_params |
121 | most important field in the parameters is the codec type; in most | 126 | This routine sets the configuration chosen for a specific codec. The |
122 | cases decoders will ignore other fields, while encoders will strictly | 127 | most important field in the parameters is the codec type; in most |
123 | comply to the settings | 128 | cases decoders will ignore other fields, while encoders will strictly |
124 | 129 | comply to the settings | |
125 | - get_params | 130 | |
126 | This routines returns the actual settings used by the DSP. Changes to | 131 | get_params |
127 | the settings should remain the exception. | 132 | This routines returns the actual settings used by the DSP. Changes to |
128 | 133 | the settings should remain the exception. | |
129 | - get_timestamp | 134 | |
130 | The timestamp becomes a multiple field structure. It lists the number | 135 | get_timestamp |
131 | of bytes transferred, the number of samples processed and the number | 136 | The timestamp becomes a multiple field structure. It lists the number |
132 | of samples rendered/grabbed. All these values can be used to determine | 137 | of bytes transferred, the number of samples processed and the number |
133 | the average bitrate, figure out if the ring buffer needs to be | 138 | of samples rendered/grabbed. All these values can be used to determine |
134 | refilled or the delay due to decoding/encoding/io on the DSP. | 139 | the average bitrate, figure out if the ring buffer needs to be |
140 | refilled or the delay due to decoding/encoding/io on the DSP. | ||
135 | 141 | ||
136 | Note that the list of codecs/profiles/modes was derived from the | 142 | Note that the list of codecs/profiles/modes was derived from the |
137 | OpenMAX AL specification instead of reinventing the wheel. | 143 | OpenMAX AL specification instead of reinventing the wheel. |
@@ -145,6 +151,7 @@ Modifications include: | |||
145 | - Addition of encoding options when required (derived from OpenMAX IL) | 151 | - Addition of encoding options when required (derived from OpenMAX IL) |
146 | - Addition of rateControlSupported (missing in OpenMAX AL) | 152 | - Addition of rateControlSupported (missing in OpenMAX AL) |
147 | 153 | ||
154 | |||
148 | Gapless Playback | 155 | Gapless Playback |
149 | ================ | 156 | ================ |
150 | When playing thru an album, the decoders have the ability to skip the encoder | 157 | When playing thru an album, the decoders have the ability to skip the encoder |
@@ -162,19 +169,19 @@ switch from one track to another and start using data for second track. | |||
162 | 169 | ||
163 | The main additions are: | 170 | The main additions are: |
164 | 171 | ||
165 | - set_metadata | 172 | set_metadata |
166 | This routine sets the encoder delay and encoder padding. This can be used by | 173 | This routine sets the encoder delay and encoder padding. This can be used by |
167 | decoder to strip the silence. This needs to be set before the data in the track | 174 | decoder to strip the silence. This needs to be set before the data in the track |
168 | is written. | 175 | is written. |
169 | 176 | ||
170 | - set_next_track | 177 | set_next_track |
171 | This routine tells DSP that metadata and write operation sent after this would | 178 | This routine tells DSP that metadata and write operation sent after this would |
172 | correspond to subsequent track | 179 | correspond to subsequent track |
173 | 180 | ||
174 | - partial drain | 181 | partial drain |
175 | This is called when end of file is reached. The userspace can inform DSP that | 182 | This is called when end of file is reached. The userspace can inform DSP that |
176 | EOF is reached and now DSP can start skipping padding delay. Also next write | 183 | EOF is reached and now DSP can start skipping padding delay. Also next write |
177 | data would belong to next track | 184 | data would belong to next track |
178 | 185 | ||
179 | Sequence flow for gapless would be: | 186 | Sequence flow for gapless would be: |
180 | - Open | 187 | - Open |
@@ -189,10 +196,12 @@ Sequence flow for gapless would be: | |||
189 | - then call partial_drain to flush most of buffer in DSP | 196 | - then call partial_drain to flush most of buffer in DSP |
190 | - Fill data of the next track | 197 | - Fill data of the next track |
191 | - DSP switches to second track | 198 | - DSP switches to second track |
199 | |||
192 | (note: order for partial_drain and write for next track can be reversed as well) | 200 | (note: order for partial_drain and write for next track can be reversed as well) |
193 | 201 | ||
194 | Not supported: | ||
195 | 202 | ||
203 | Not supported | ||
204 | ============= | ||
196 | - Support for VoIP/circuit-switched calls is not the target of this | 205 | - Support for VoIP/circuit-switched calls is not the target of this |
197 | API. Support for dynamic bit-rate changes would require a tight | 206 | API. Support for dynamic bit-rate changes would require a tight |
198 | coupling between the DSP and the host stack, limiting power savings. | 207 | coupling between the DSP and the host stack, limiting power savings. |
@@ -225,7 +234,9 @@ Not supported: | |||
225 | rendered output in time, this does not deal with underrun/overrun and | 234 | rendered output in time, this does not deal with underrun/overrun and |
226 | maybe dealt in user-library | 235 | maybe dealt in user-library |
227 | 236 | ||
228 | Credits: | 237 | |
238 | Credits | ||
239 | ======= | ||
229 | - Mark Brown and Liam Girdwood for discussions on the need for this API | 240 | - Mark Brown and Liam Girdwood for discussions on the need for this API |
230 | - Harsha Priya for her work on intel_sst compressed API | 241 | - Harsha Priya for her work on intel_sst compressed API |
231 | - Rakesh Ughreja for valuable feedback | 242 | - Rakesh Ughreja for valuable feedback |
diff --git a/Documentation/sound/designs/control-names.rst b/Documentation/sound/designs/control-names.rst new file mode 100644 index 000000000000..7fedd0f33cd9 --- /dev/null +++ b/Documentation/sound/designs/control-names.rst | |||
@@ -0,0 +1,142 @@ | |||
1 | =========================== | ||
2 | Standard ALSA Control Names | ||
3 | =========================== | ||
4 | |||
5 | This document describes standard names of mixer controls. | ||
6 | |||
7 | Standard Syntax | ||
8 | --------------- | ||
9 | Syntax: [LOCATION] SOURCE [CHANNEL] [DIRECTION] FUNCTION | ||
10 | |||
11 | |||
12 | DIRECTION | ||
13 | ~~~~~~~~~ | ||
14 | ================ =============== | ||
15 | <nothing> both directions | ||
16 | Playback one direction | ||
17 | Capture one direction | ||
18 | Bypass Playback one direction | ||
19 | Bypass Capture one direction | ||
20 | ================ =============== | ||
21 | |||
22 | FUNCTION | ||
23 | ~~~~~~~~ | ||
24 | ======== ================================= | ||
25 | Switch on/off switch | ||
26 | Volume amplifier | ||
27 | Route route control, hardware specific | ||
28 | ======== ================================= | ||
29 | |||
30 | CHANNEL | ||
31 | ~~~~~~~ | ||
32 | ============ ================================================== | ||
33 | <nothing> channel independent, or applies to all channels | ||
34 | Front front left/right channels | ||
35 | Surround rear left/right in 4.0/5.1 surround | ||
36 | CLFE C/LFE channels | ||
37 | Center center cannel | ||
38 | LFE LFE channel | ||
39 | Side side left/right for 7.1 surround | ||
40 | ============ ================================================== | ||
41 | |||
42 | LOCATION (Physical location of source) | ||
43 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
44 | ============ ===================== | ||
45 | Front front position | ||
46 | Rear rear position | ||
47 | Dock on docking station | ||
48 | Internal internal | ||
49 | ============ ===================== | ||
50 | |||
51 | SOURCE | ||
52 | ~~~~~~ | ||
53 | =================== ================================================= | ||
54 | Master | ||
55 | Master Mono | ||
56 | Hardware Master | ||
57 | Speaker internal speaker | ||
58 | Bass Speaker internal LFE speaker | ||
59 | Headphone | ||
60 | Line Out | ||
61 | Beep beep generator | ||
62 | Phone | ||
63 | Phone Input | ||
64 | Phone Output | ||
65 | Synth | ||
66 | FM | ||
67 | Mic | ||
68 | Headset Mic mic part of combined headset jack - 4-pin | ||
69 | headphone + mic | ||
70 | Headphone Mic mic part of either/or - 3-pin headphone or mic | ||
71 | Line input only, use "Line Out" for output | ||
72 | CD | ||
73 | Video | ||
74 | Zoom Video | ||
75 | Aux | ||
76 | PCM | ||
77 | PCM Pan | ||
78 | Loopback | ||
79 | Analog Loopback D/A -> A/D loopback | ||
80 | Digital Loopback playback -> capture loopback - | ||
81 | without analog path | ||
82 | Mono | ||
83 | Mono Output | ||
84 | Multi | ||
85 | ADC | ||
86 | Wave | ||
87 | Music | ||
88 | I2S | ||
89 | IEC958 | ||
90 | HDMI | ||
91 | SPDIF output only | ||
92 | SPDIF In | ||
93 | Digital In | ||
94 | HDMI/DP either HDMI or DisplayPort | ||
95 | =================== ================================================= | ||
96 | |||
97 | Exceptions (deprecated) | ||
98 | ----------------------- | ||
99 | |||
100 | ===================================== ======================= | ||
101 | [Analogue|Digital] Capture Source | ||
102 | [Analogue|Digital] Capture Switch aka input gain switch | ||
103 | [Analogue|Digital] Capture Volume aka input gain volume | ||
104 | [Analogue|Digital] Playback Switch aka output gain switch | ||
105 | [Analogue|Digital] Playback Volume aka output gain volume | ||
106 | Tone Control - Switch | ||
107 | Tone Control - Bass | ||
108 | Tone Control - Treble | ||
109 | 3D Control - Switch | ||
110 | 3D Control - Center | ||
111 | 3D Control - Depth | ||
112 | 3D Control - Wide | ||
113 | 3D Control - Space | ||
114 | 3D Control - Level | ||
115 | Mic Boost [(?dB)] | ||
116 | ===================================== ======================= | ||
117 | |||
118 | PCM interface | ||
119 | ------------- | ||
120 | |||
121 | =================== ======================================== | ||
122 | Sample Clock Source { "Word", "Internal", "AutoSync" } | ||
123 | Clock Sync Status { "Lock", "Sync", "No Lock" } | ||
124 | External Rate external capture rate | ||
125 | Capture Rate capture rate taken from external source | ||
126 | =================== ======================================== | ||
127 | |||
128 | IEC958 (S/PDIF) interface | ||
129 | ------------------------- | ||
130 | |||
131 | ============================================ ====================================== | ||
132 | IEC958 [...] [Playback|Capture] Switch turn on/off the IEC958 interface | ||
133 | IEC958 [...] [Playback|Capture] Volume digital volume control | ||
134 | IEC958 [...] [Playback|Capture] Default default or global value - read/write | ||
135 | IEC958 [...] [Playback|Capture] Mask consumer and professional mask | ||
136 | IEC958 [...] [Playback|Capture] Con Mask consumer mask | ||
137 | IEC958 [...] [Playback|Capture] Pro Mask professional mask | ||
138 | IEC958 [...] [Playback|Capture] PCM Stream the settings assigned to a PCM stream | ||
139 | IEC958 Q-subcode [Playback|Capture] Default Q-subcode bits | ||
140 | |||
141 | IEC958 Preamble [Playback|Capture] Default burst preamble words (4*16bits) | ||
142 | ============================================ ====================================== | ||
diff --git a/Documentation/sound/designs/index.rst b/Documentation/sound/designs/index.rst new file mode 100644 index 000000000000..04dcdae3e4f2 --- /dev/null +++ b/Documentation/sound/designs/index.rst | |||
@@ -0,0 +1,15 @@ | |||
1 | Designs and Implementations | ||
2 | =========================== | ||
3 | |||
4 | .. toctree:: | ||
5 | :maxdepth: 2 | ||
6 | |||
7 | control-names | ||
8 | channel-mapping-api | ||
9 | compress-offload | ||
10 | timestamping | ||
11 | jack-controls | ||
12 | procfile | ||
13 | powersave | ||
14 | oss-emulation | ||
15 | seq-oss | ||
diff --git a/Documentation/sound/alsa/Jack-Controls.txt b/Documentation/sound/designs/jack-controls.rst index fe1c5e0c8555..ae25b1531bb0 100644 --- a/Documentation/sound/alsa/Jack-Controls.txt +++ b/Documentation/sound/designs/jack-controls.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ================== | ||
2 | ALSA Jack Controls | ||
3 | ================== | ||
4 | |||
1 | Why we need Jack kcontrols | 5 | Why we need Jack kcontrols |
2 | ========================== | 6 | ========================== |
3 | 7 | ||
@@ -29,11 +33,12 @@ How to use jack kcontrols | |||
29 | ========================= | 33 | ========================= |
30 | 34 | ||
31 | In order to keep compatibility, snd_jack_new() has been modified by | 35 | In order to keep compatibility, snd_jack_new() has been modified by |
32 | adding two params :- | 36 | adding two params: |
33 | 37 | ||
34 | - @initial_kctl: if true, create a kcontrol and add it to the jack | 38 | initial_kctl |
35 | list. | 39 | if true, create a kcontrol and add it to the jack list. |
36 | - @phantom_jack: Don't create a input device for phantom jacks. | 40 | phantom_jack |
41 | Don't create a input device for phantom jacks. | ||
37 | 42 | ||
38 | HDA jacks can set phantom_jack to true in order to create a phantom | 43 | HDA jacks can set phantom_jack to true in order to create a phantom |
39 | jack and set initial_kctl to true to create an initial kcontrol with | 44 | jack and set initial_kctl to true to create an initial kcontrol with |
diff --git a/Documentation/sound/alsa/OSS-Emulation.txt b/Documentation/sound/designs/oss-emulation.rst index 152ca2a3f1bd..e8dcb9633e7b 100644 --- a/Documentation/sound/alsa/OSS-Emulation.txt +++ b/Documentation/sound/designs/oss-emulation.rst | |||
@@ -1,7 +1,8 @@ | |||
1 | NOTES ON KERNEL OSS-EMULATION | 1 | ============================= |
2 | ============================= | 2 | Notes on Kernel OSS-Emulation |
3 | ============================= | ||
3 | 4 | ||
4 | Jan. 22, 2004 Takashi Iwai <tiwai@suse.de> | 5 | Jan. 22, 2004 Takashi Iwai <tiwai@suse.de> |
5 | 6 | ||
6 | 7 | ||
7 | Modules | 8 | Modules |
@@ -14,18 +15,18 @@ When you need to access the OSS PCM, mixer or sequencer devices, the | |||
14 | corresponding module has to be loaded. | 15 | corresponding module has to be loaded. |
15 | 16 | ||
16 | These modules are loaded automatically when the corresponding service | 17 | These modules are loaded automatically when the corresponding service |
17 | is called. The alias is defined sound-service-x-y, where x and y are | 18 | is called. The alias is defined ``sound-service-x-y``, where x and y are |
18 | the card number and the minor unit number. Usually you don't have to | 19 | the card number and the minor unit number. Usually you don't have to |
19 | define these aliases by yourself. | 20 | define these aliases by yourself. |
20 | 21 | ||
21 | Only necessary step for auto-loading of OSS modules is to define the | 22 | Only necessary step for auto-loading of OSS modules is to define the |
22 | card alias in /etc/modprobe.d/alsa.conf, such as | 23 | card alias in ``/etc/modprobe.d/alsa.conf``, such as:: |
23 | 24 | ||
24 | alias sound-slot-0 snd-emu10k1 | 25 | alias sound-slot-0 snd-emu10k1 |
25 | 26 | ||
26 | As the second card, define sound-slot-1 as well. | 27 | As the second card, define ``sound-slot-1`` as well. |
27 | Note that you can't use the aliased name as the target name (i.e. | 28 | Note that you can't use the aliased name as the target name (i.e. |
28 | "alias sound-slot-0 snd-card-0" doesn't work any more like the old | 29 | ``alias sound-slot-0 snd-card-0`` doesn't work any more like the old |
29 | modutils). | 30 | modutils). |
30 | 31 | ||
31 | The currently available OSS configuration is shown in | 32 | The currently available OSS configuration is shown in |
@@ -42,6 +43,7 @@ Device Mapping | |||
42 | ============== | 43 | ============== |
43 | 44 | ||
44 | ALSA supports the following OSS device files: | 45 | ALSA supports the following OSS device files: |
46 | :: | ||
45 | 47 | ||
46 | PCM: | 48 | PCM: |
47 | /dev/dspX | 49 | /dev/dspX |
@@ -61,48 +63,55 @@ ALSA supports the following OSS device files: | |||
61 | where X is the card number from 0 to 7. | 63 | where X is the card number from 0 to 7. |
62 | 64 | ||
63 | (NOTE: Some distributions have the device files like /dev/midi0 and | 65 | (NOTE: Some distributions have the device files like /dev/midi0 and |
64 | /dev/midi1. They are NOT for OSS but for tclmidi, which is | 66 | /dev/midi1. They are NOT for OSS but for tclmidi, which is |
65 | a totally different thing.) | 67 | a totally different thing.) |
66 | 68 | ||
67 | Unlike the real OSS, ALSA cannot use the device files more than the | 69 | Unlike the real OSS, ALSA cannot use the device files more than the |
68 | assigned ones. For example, the first card cannot use /dev/dsp1 or | 70 | assigned ones. For example, the first card cannot use /dev/dsp1 or |
69 | /dev/dsp2, but only /dev/dsp0 and /dev/adsp0. | 71 | /dev/dsp2, but only /dev/dsp0 and /dev/adsp0. |
70 | 72 | ||
71 | As seen above, PCM and MIDI may have two devices. Usually, the first | 73 | As seen above, PCM and MIDI may have two devices. Usually, the first |
72 | PCM device (hw:0,0 in ALSA) is mapped to /dev/dsp and the secondary | 74 | PCM device (``hw:0,0`` in ALSA) is mapped to /dev/dsp and the secondary |
73 | device (hw:0,1) to /dev/adsp (if available). For MIDI, /dev/midi and | 75 | device (``hw:0,1``) to /dev/adsp (if available). For MIDI, /dev/midi and |
74 | /dev/amidi, respectively. | 76 | /dev/amidi, respectively. |
75 | 77 | ||
76 | You can change this device mapping via the module options of | 78 | You can change this device mapping via the module options of |
77 | snd-pcm-oss and snd-rawmidi. In the case of PCM, the following | 79 | snd-pcm-oss and snd-rawmidi. In the case of PCM, the following |
78 | options are available for snd-pcm-oss: | 80 | options are available for snd-pcm-oss: |
79 | 81 | ||
80 | dsp_map PCM device number assigned to /dev/dspX | 82 | dsp_map |
81 | (default = 0) | 83 | PCM device number assigned to /dev/dspX |
82 | adsp_map PCM device number assigned to /dev/adspX | 84 | (default = 0) |
83 | (default = 1) | 85 | adsp_map |
86 | PCM device number assigned to /dev/adspX | ||
87 | (default = 1) | ||
84 | 88 | ||
85 | For example, to map the third PCM device (hw:0,2) to /dev/adsp0, | 89 | For example, to map the third PCM device (``hw:0,2``) to /dev/adsp0, |
86 | define like this: | 90 | define like this: |
91 | :: | ||
87 | 92 | ||
88 | options snd-pcm-oss adsp_map=2 | 93 | options snd-pcm-oss adsp_map=2 |
89 | 94 | ||
90 | The options take arrays. For configuring the second card, specify | 95 | The options take arrays. For configuring the second card, specify |
91 | two entries separated by comma. For example, to map the third PCM | 96 | two entries separated by comma. For example, to map the third PCM |
92 | device on the second card to /dev/adsp1, define like below: | 97 | device on the second card to /dev/adsp1, define like below: |
98 | :: | ||
93 | 99 | ||
94 | options snd-pcm-oss adsp_map=0,2 | 100 | options snd-pcm-oss adsp_map=0,2 |
95 | 101 | ||
96 | To change the mapping of MIDI devices, the following options are | 102 | To change the mapping of MIDI devices, the following options are |
97 | available for snd-rawmidi: | 103 | available for snd-rawmidi: |
98 | 104 | ||
99 | midi_map MIDI device number assigned to /dev/midi0X | 105 | midi_map |
100 | (default = 0) | 106 | MIDI device number assigned to /dev/midi0X |
101 | amidi_map MIDI device number assigned to /dev/amidi0X | 107 | (default = 0) |
102 | (default = 1) | 108 | amidi_map |
109 | MIDI device number assigned to /dev/amidi0X | ||
110 | (default = 1) | ||
103 | 111 | ||
104 | For example, to assign the third MIDI device on the first card to | 112 | For example, to assign the third MIDI device on the first card to |
105 | /dev/midi00, define as follows: | 113 | /dev/midi00, define as follows: |
114 | :: | ||
106 | 115 | ||
107 | options snd-rawmidi midi_map=2 | 116 | options snd-rawmidi midi_map=2 |
108 | 117 | ||
@@ -118,43 +127,52 @@ wine, especially if they use the card only in the MMAP mode. | |||
118 | 127 | ||
119 | In such a case, you can change the behavior of PCM per application by | 128 | In such a case, you can change the behavior of PCM per application by |
120 | writing a command to the proc file. There is a proc file for each PCM | 129 | writing a command to the proc file. There is a proc file for each PCM |
121 | stream, /proc/asound/cardX/pcmY[cp]/oss, where X is the card number | 130 | stream, ``/proc/asound/cardX/pcmY[cp]/oss``, where X is the card number |
122 | (zero-based), Y the PCM device number (zero-based), and 'p' is for | 131 | (zero-based), Y the PCM device number (zero-based), and ``p`` is for |
123 | playback and 'c' for capture, respectively. Note that this proc file | 132 | playback and ``c`` for capture, respectively. Note that this proc file |
124 | exists only after snd-pcm-oss module is loaded. | 133 | exists only after snd-pcm-oss module is loaded. |
125 | 134 | ||
126 | The command sequence has the following syntax: | 135 | The command sequence has the following syntax: |
136 | :: | ||
127 | 137 | ||
128 | app_name fragments fragment_size [options] | 138 | app_name fragments fragment_size [options] |
129 | 139 | ||
130 | app_name is the name of application with (higher priority) or without | 140 | ``app_name`` is the name of application with (higher priority) or without |
131 | path. | 141 | path. |
132 | fragments specifies the number of fragments or zero if no specific | 142 | ``fragments`` specifies the number of fragments or zero if no specific |
133 | number is given. | 143 | number is given. |
134 | fragment_size is the size of fragment in bytes or zero if not given. | 144 | ``fragment_size`` is the size of fragment in bytes or zero if not given. |
135 | options is the optional parameters. The following options are | 145 | ``options`` is the optional parameters. The following options are |
136 | available: | 146 | available: |
137 | 147 | ||
138 | disable the application tries to open a pcm device for | 148 | disable |
139 | this channel but does not want to use it. | 149 | the application tries to open a pcm device for |
140 | direct don't use plugins | 150 | this channel but does not want to use it. |
141 | block force block open mode | 151 | direct |
142 | non-block force non-block open mode | 152 | don't use plugins |
143 | partial-frag write also partial fragments (affects playback only) | 153 | block |
144 | no-silence do not fill silence ahead to avoid clicks | 154 | force block open mode |
145 | 155 | non-block | |
146 | The disable option is useful when one stream direction (playback or | 156 | force non-block open mode |
157 | partial-frag | ||
158 | write also partial fragments (affects playback only) | ||
159 | no-silence | ||
160 | do not fill silence ahead to avoid clicks | ||
161 | |||
162 | The ``disable`` option is useful when one stream direction (playback or | ||
147 | capture) is not handled correctly by the application although the | 163 | capture) is not handled correctly by the application although the |
148 | hardware itself does support both directions. | 164 | hardware itself does support both directions. |
149 | The direct option is used, as mentioned above, to bypass the automatic | 165 | The ``direct`` option is used, as mentioned above, to bypass the automatic |
150 | conversion and useful for MMAP-applications. | 166 | conversion and useful for MMAP-applications. |
151 | For example, to playback the first PCM device without plugins for | 167 | For example, to playback the first PCM device without plugins for |
152 | quake, send a command via echo like the following: | 168 | quake, send a command via echo like the following: |
169 | :: | ||
153 | 170 | ||
154 | % echo "quake 0 0 direct" > /proc/asound/card0/pcm0p/oss | 171 | % echo "quake 0 0 direct" > /proc/asound/card0/pcm0p/oss |
155 | 172 | ||
156 | While quake wants only playback, you may append the second command | 173 | While quake wants only playback, you may append the second command |
157 | to notify driver that only this direction is about to be allocated: | 174 | to notify driver that only this direction is about to be allocated: |
175 | :: | ||
158 | 176 | ||
159 | % echo "quake 0 0 disable" > /proc/asound/card0/pcm0c/oss | 177 | % echo "quake 0 0 disable" > /proc/asound/card0/pcm0c/oss |
160 | 178 | ||
@@ -171,10 +189,11 @@ the file when it's busy. The -EBUSY error is returned in this case. | |||
171 | This blocking behavior can be changed globally via nonblock_open | 189 | This blocking behavior can be changed globally via nonblock_open |
172 | module option of snd-pcm-oss. For using the blocking mode as default | 190 | module option of snd-pcm-oss. For using the blocking mode as default |
173 | for OSS devices, define like the following: | 191 | for OSS devices, define like the following: |
192 | :: | ||
174 | 193 | ||
175 | options snd-pcm-oss nonblock_open=0 | 194 | options snd-pcm-oss nonblock_open=0 |
176 | 195 | ||
177 | The partial-frag and no-silence commands have been added recently. | 196 | The ``partial-frag`` and ``no-silence`` commands have been added recently. |
178 | Both commands are for optimization use only. The former command | 197 | Both commands are for optimization use only. The former command |
179 | specifies to invoke the write transfer only when the whole fragment is | 198 | specifies to invoke the write transfer only when the whole fragment is |
180 | filled. The latter stops writing the silence data ahead | 199 | filled. The latter stops writing the silence data ahead |
@@ -183,15 +202,18 @@ automatically. Both are disabled as default. | |||
183 | You can check the currently defined configuration by reading the proc | 202 | You can check the currently defined configuration by reading the proc |
184 | file. The read image can be sent to the proc file again, hence you | 203 | file. The read image can be sent to the proc file again, hence you |
185 | can save the current configuration | 204 | can save the current configuration |
205 | :: | ||
186 | 206 | ||
187 | % cat /proc/asound/card0/pcm0p/oss > /somewhere/oss-cfg | 207 | % cat /proc/asound/card0/pcm0p/oss > /somewhere/oss-cfg |
188 | 208 | ||
189 | and restore it like | 209 | and restore it like |
210 | :: | ||
190 | 211 | ||
191 | % cat /somewhere/oss-cfg > /proc/asound/card0/pcm0p/oss | 212 | % cat /somewhere/oss-cfg > /proc/asound/card0/pcm0p/oss |
192 | 213 | ||
193 | Also, for clearing all the current configuration, send "erase" command | 214 | Also, for clearing all the current configuration, send ``erase`` command |
194 | as below: | 215 | as below: |
216 | :: | ||
195 | 217 | ||
196 | % echo "erase" > /proc/asound/card0/pcm0p/oss | 218 | % echo "erase" > /proc/asound/card0/pcm0p/oss |
197 | 219 | ||
@@ -211,40 +233,43 @@ automatically. | |||
211 | 233 | ||
212 | As default, ALSA uses the following control for OSS volumes: | 234 | As default, ALSA uses the following control for OSS volumes: |
213 | 235 | ||
214 | OSS volume ALSA control Index | 236 | ==================== ===================== ===== |
215 | ----------------------------------------------------- | 237 | OSS volume ALSA control Index |
216 | SOUND_MIXER_VOLUME Master 0 | 238 | ==================== ===================== ===== |
217 | SOUND_MIXER_BASS Tone Control - Bass 0 | 239 | SOUND_MIXER_VOLUME Master 0 |
218 | SOUND_MIXER_TREBLE Tone Control - Treble 0 | 240 | SOUND_MIXER_BASS Tone Control - Bass 0 |
219 | SOUND_MIXER_SYNTH Synth 0 | 241 | SOUND_MIXER_TREBLE Tone Control - Treble 0 |
220 | SOUND_MIXER_PCM PCM 0 | 242 | SOUND_MIXER_SYNTH Synth 0 |
221 | SOUND_MIXER_SPEAKER PC Speaker 0 | 243 | SOUND_MIXER_PCM PCM 0 |
222 | SOUND_MIXER_LINE Line 0 | 244 | SOUND_MIXER_SPEAKER PC Speaker 0 |
223 | SOUND_MIXER_MIC Mic 0 | 245 | SOUND_MIXER_LINE Line 0 |
224 | SOUND_MIXER_CD CD 0 | 246 | SOUND_MIXER_MIC Mic 0 |
225 | SOUND_MIXER_IMIX Monitor Mix 0 | 247 | SOUND_MIXER_CD CD 0 |
226 | SOUND_MIXER_ALTPCM PCM 1 | 248 | SOUND_MIXER_IMIX Monitor Mix 0 |
227 | SOUND_MIXER_RECLEV (not assigned) | 249 | SOUND_MIXER_ALTPCM PCM 1 |
228 | SOUND_MIXER_IGAIN Capture 0 | 250 | SOUND_MIXER_RECLEV (not assigned) |
229 | SOUND_MIXER_OGAIN Playback 0 | 251 | SOUND_MIXER_IGAIN Capture 0 |
230 | SOUND_MIXER_LINE1 Aux 0 | 252 | SOUND_MIXER_OGAIN Playback 0 |
231 | SOUND_MIXER_LINE2 Aux 1 | 253 | SOUND_MIXER_LINE1 Aux 0 |
232 | SOUND_MIXER_LINE3 Aux 2 | 254 | SOUND_MIXER_LINE2 Aux 1 |
233 | SOUND_MIXER_DIGITAL1 Digital 0 | 255 | SOUND_MIXER_LINE3 Aux 2 |
234 | SOUND_MIXER_DIGITAL2 Digital 1 | 256 | SOUND_MIXER_DIGITAL1 Digital 0 |
235 | SOUND_MIXER_DIGITAL3 Digital 2 | 257 | SOUND_MIXER_DIGITAL2 Digital 1 |
236 | SOUND_MIXER_PHONEIN Phone 0 | 258 | SOUND_MIXER_DIGITAL3 Digital 2 |
237 | SOUND_MIXER_PHONEOUT Phone 1 | 259 | SOUND_MIXER_PHONEIN Phone 0 |
238 | SOUND_MIXER_VIDEO Video 0 | 260 | SOUND_MIXER_PHONEOUT Phone 1 |
239 | SOUND_MIXER_RADIO Radio 0 | 261 | SOUND_MIXER_VIDEO Video 0 |
240 | SOUND_MIXER_MONITOR Monitor 0 | 262 | SOUND_MIXER_RADIO Radio 0 |
263 | SOUND_MIXER_MONITOR Monitor 0 | ||
264 | ==================== ===================== ===== | ||
241 | 265 | ||
242 | The second column is the base-string of the corresponding ALSA | 266 | The second column is the base-string of the corresponding ALSA |
243 | control. In fact, the controls with "XXX [Playback|Capture] | 267 | control. In fact, the controls with ``XXX [Playback|Capture] |
244 | [Volume|Switch]" will be checked in addition. | 268 | [Volume|Switch]`` will be checked in addition. |
245 | 269 | ||
246 | The current assignment of these mixer elements is listed in the proc | 270 | The current assignment of these mixer elements is listed in the proc |
247 | file, /proc/asound/cardX/oss_mixer, which will be like the following | 271 | file, /proc/asound/cardX/oss_mixer, which will be like the following |
272 | :: | ||
248 | 273 | ||
249 | VOLUME "Master" 0 | 274 | VOLUME "Master" 0 |
250 | BASS "" 0 | 275 | BASS "" 0 |
@@ -261,6 +286,7 @@ corresponding OSS control is not available. | |||
261 | For changing the assignment, you can write the configuration to this | 286 | For changing the assignment, you can write the configuration to this |
262 | proc file. For example, to map "Wave Playback" to the PCM volume, | 287 | proc file. For example, to map "Wave Playback" to the PCM volume, |
263 | send the command like the following: | 288 | send the command like the following: |
289 | :: | ||
264 | 290 | ||
265 | % echo 'VOLUME "Wave Playback" 0' > /proc/asound/card0/oss_mixer | 291 | % echo 'VOLUME "Wave Playback" 0' > /proc/asound/card0/oss_mixer |
266 | 292 | ||
@@ -284,12 +310,18 @@ Duplex Streams | |||
284 | Note that when attempting to use a single device file for playback and | 310 | Note that when attempting to use a single device file for playback and |
285 | capture, the OSS API provides no way to set the format, sample rate or | 311 | capture, the OSS API provides no way to set the format, sample rate or |
286 | number of channels different in each direction. Thus | 312 | number of channels different in each direction. Thus |
313 | :: | ||
314 | |||
287 | io_handle = open("device", O_RDWR) | 315 | io_handle = open("device", O_RDWR) |
316 | |||
288 | will only function correctly if the values are the same in each direction. | 317 | will only function correctly if the values are the same in each direction. |
289 | 318 | ||
290 | To use different values in the two directions, use both | 319 | To use different values in the two directions, use both |
320 | :: | ||
321 | |||
291 | input_handle = open("device", O_RDONLY) | 322 | input_handle = open("device", O_RDONLY) |
292 | output_handle = open("device", O_WRONLY) | 323 | output_handle = open("device", O_WRONLY) |
324 | |||
293 | and set the values for the corresponding handle. | 325 | and set the values for the corresponding handle. |
294 | 326 | ||
295 | 327 | ||
@@ -302,4 +334,3 @@ ICE1712 supports only the unconventional format, interleaved | |||
302 | 10-channels 24bit (packed in 32bit) format. Therefore you cannot mmap | 334 | 10-channels 24bit (packed in 32bit) format. Therefore you cannot mmap |
303 | the buffer as the conventional (mono or 2-channels, 8 or 16bit) format | 335 | the buffer as the conventional (mono or 2-channels, 8 or 16bit) format |
304 | on OSS. | 336 | on OSS. |
305 | |||
diff --git a/Documentation/sound/alsa/powersave.txt b/Documentation/sound/designs/powersave.rst index 9657e8099228..138157452eb9 100644 --- a/Documentation/sound/alsa/powersave.txt +++ b/Documentation/sound/designs/powersave.rst | |||
@@ -1,9 +1,10 @@ | |||
1 | ========================== | ||
1 | Notes on Power-Saving Mode | 2 | Notes on Power-Saving Mode |
2 | ========================== | 3 | ========================== |
3 | 4 | ||
4 | AC97 and HD-audio drivers have the automatic power-saving mode. | 5 | AC97 and HD-audio drivers have the automatic power-saving mode. |
5 | This feature is enabled via Kconfig CONFIG_SND_AC97_POWER_SAVE | 6 | This feature is enabled via Kconfig ``CONFIG_SND_AC97_POWER_SAVE`` |
6 | and CONFIG_SND_HDA_POWER_SAVE options, respectively. | 7 | and ``CONFIG_SND_HDA_POWER_SAVE`` options, respectively. |
7 | 8 | ||
8 | With the automatic power-saving, the driver turns off the codec power | 9 | With the automatic power-saving, the driver turns off the codec power |
9 | appropriately when no operation is required. When no applications use | 10 | appropriately when no operation is required. When no applications use |
@@ -11,20 +12,21 @@ the device and/or no analog loopback is set, the power disablement is | |||
11 | done fully or partially. It'll save a certain power consumption, thus | 12 | done fully or partially. It'll save a certain power consumption, thus |
12 | good for laptops (even for desktops). | 13 | good for laptops (even for desktops). |
13 | 14 | ||
14 | The time-out for automatic power-off can be specified via power_save | 15 | The time-out for automatic power-off can be specified via ``power_save`` |
15 | module option of snd-ac97-codec and snd-hda-intel modules. Specify | 16 | module option of snd-ac97-codec and snd-hda-intel modules. Specify |
16 | the time-out value in seconds. 0 means to disable the automatic | 17 | the time-out value in seconds. 0 means to disable the automatic |
17 | power-saving. The default value of timeout is given via | 18 | power-saving. The default value of timeout is given via |
18 | CONFIG_SND_AC97_POWER_SAVE_DEFAULT and | 19 | ``CONFIG_SND_AC97_POWER_SAVE_DEFAULT`` and |
19 | CONFIG_SND_HDA_POWER_SAVE_DEFAULT Kconfig options. Setting this to 1 | 20 | ``CONFIG_SND_HDA_POWER_SAVE_DEFAULT`` Kconfig options. Setting this to 1 |
20 | (the minimum value) isn't recommended because many applications try to | 21 | (the minimum value) isn't recommended because many applications try to |
21 | reopen the device frequently. 10 would be a good choice for normal | 22 | reopen the device frequently. 10 would be a good choice for normal |
22 | operations. | 23 | operations. |
23 | 24 | ||
24 | The power_save option is exported as writable. This means you can | 25 | The ``power_save`` option is exported as writable. This means you can |
25 | adjust the value via sysfs on the fly. For example, to turn on the | 26 | adjust the value via sysfs on the fly. For example, to turn on the |
26 | automatic power-save mode with 10 seconds, write to | 27 | automatic power-save mode with 10 seconds, write to |
27 | /sys/modules/snd_ac97_codec/parameters/power_save (usually as root): | 28 | ``/sys/modules/snd_ac97_codec/parameters/power_save`` (usually as root): |
29 | :: | ||
28 | 30 | ||
29 | # echo 10 > /sys/modules/snd_ac97_codec/parameters/power_save | 31 | # echo 10 > /sys/modules/snd_ac97_codec/parameters/power_save |
30 | 32 | ||
diff --git a/Documentation/sound/alsa/Procfile.txt b/Documentation/sound/designs/procfile.rst index 7f8a0d325905..29a466851fd2 100644 --- a/Documentation/sound/alsa/Procfile.txt +++ b/Documentation/sound/designs/procfile.rst | |||
@@ -1,20 +1,22 @@ | |||
1 | Proc Files of ALSA Drivers | 1 | ========================== |
2 | ========================== | 2 | Proc Files of ALSA Drivers |
3 | Takashi Iwai <tiwai@suse.de> | 3 | ========================== |
4 | |||
5 | Takashi Iwai <tiwai@suse.de> | ||
4 | 6 | ||
5 | General | 7 | General |
6 | ------- | 8 | ======= |
7 | 9 | ||
8 | ALSA has its own proc tree, /proc/asound. Many useful information are | 10 | ALSA has its own proc tree, /proc/asound. Many useful information are |
9 | found in this tree. When you encounter a problem and need debugging, | 11 | found in this tree. When you encounter a problem and need debugging, |
10 | check the files listed in the following sections. | 12 | check the files listed in the following sections. |
11 | 13 | ||
12 | Each card has its subtree cardX, where X is from 0 to 7. The | 14 | Each card has its subtree cardX, where X is from 0 to 7. The |
13 | card-specific files are stored in the card* subdirectories. | 15 | card-specific files are stored in the ``card*`` subdirectories. |
14 | 16 | ||
15 | 17 | ||
16 | Global Information | 18 | Global Information |
17 | ------------------ | 19 | ================== |
18 | 20 | ||
19 | cards | 21 | cards |
20 | Shows the list of currently configured ALSA drivers, | 22 | Shows the list of currently configured ALSA drivers, |
@@ -31,15 +33,15 @@ devices | |||
31 | 33 | ||
32 | meminfo | 34 | meminfo |
33 | Shows the status of allocated pages via ALSA drivers. | 35 | Shows the status of allocated pages via ALSA drivers. |
34 | Appears only when CONFIG_SND_DEBUG=y. | 36 | Appears only when ``CONFIG_SND_DEBUG=y``. |
35 | 37 | ||
36 | hwdep | 38 | hwdep |
37 | Lists the currently available hwdep devices in format of | 39 | Lists the currently available hwdep devices in format of |
38 | <card>-<device>: <name> | 40 | ``<card>-<device>: <name>`` |
39 | 41 | ||
40 | pcm | 42 | pcm |
41 | Lists the currently available PCM devices in format of | 43 | Lists the currently available PCM devices in format of |
42 | <card>-<device>: <id>: <name> : <sub-streams> | 44 | ``<card>-<device>: <id>: <name> : <sub-streams>`` |
43 | 45 | ||
44 | timer | 46 | timer |
45 | Lists the currently available timer devices | 47 | Lists the currently available timer devices |
@@ -54,23 +56,23 @@ oss/sndstat | |||
54 | 56 | ||
55 | 57 | ||
56 | Card Specific Files | 58 | Card Specific Files |
57 | ------------------- | 59 | =================== |
58 | 60 | ||
59 | The card-specific files are found in /proc/asound/card* directories. | 61 | The card-specific files are found in ``/proc/asound/card*`` directories. |
60 | Some drivers (e.g. cmipci) have their own proc entries for the | 62 | Some drivers (e.g. cmipci) have their own proc entries for the |
61 | register dump, etc (e.g. /proc/asound/card*/cmipci shows the register | 63 | register dump, etc (e.g. ``/proc/asound/card*/cmipci`` shows the register |
62 | dump). These files would be really helpful for debugging. | 64 | dump). These files would be really helpful for debugging. |
63 | 65 | ||
64 | When PCM devices are available on this card, you can see directories | 66 | When PCM devices are available on this card, you can see directories |
65 | like pcm0p or pcm1c. They hold the PCM information for each PCM | 67 | like pcm0p or pcm1c. They hold the PCM information for each PCM |
66 | stream. The number after 'pcm' is the PCM device number from 0, and | 68 | stream. The number after ``pcm`` is the PCM device number from 0, and |
67 | the last 'p' or 'c' means playback or capture direction. The files in | 69 | the last ``p`` or ``c`` means playback or capture direction. The files in |
68 | this subtree is described later. | 70 | this subtree is described later. |
69 | 71 | ||
70 | The status of MIDI I/O is found in midi* files. It shows the device | 72 | The status of MIDI I/O is found in ``midi*`` files. It shows the device |
71 | name and the received/transmitted bytes through the MIDI device. | 73 | name and the received/transmitted bytes through the MIDI device. |
72 | 74 | ||
73 | When the card is equipped with AC97 codecs, there are codec97#* | 75 | When the card is equipped with AC97 codecs, there are ``codec97#*`` |
74 | subdirectories (described later). | 76 | subdirectories (described later). |
75 | 77 | ||
76 | When the OSS mixer emulation is enabled (and the module is loaded), | 78 | When the OSS mixer emulation is enabled (and the module is loaded), |
@@ -81,26 +83,27 @@ details. | |||
81 | 83 | ||
82 | 84 | ||
83 | PCM Proc Files | 85 | PCM Proc Files |
84 | -------------- | 86 | ============== |
85 | 87 | ||
86 | card*/pcm*/info | 88 | ``card*/pcm*/info`` |
87 | The general information of this PCM device: card #, device #, | 89 | The general information of this PCM device: card #, device #, |
88 | substreams, etc. | 90 | substreams, etc. |
89 | 91 | ||
90 | card*/pcm*/xrun_debug | 92 | ``card*/pcm*/xrun_debug`` |
91 | This file appears when CONFIG_SND_DEBUG=y and | 93 | This file appears when ``CONFIG_SND_DEBUG=y`` and |
92 | CONFIG_PCM_XRUN_DEBUG=y. | 94 | ``CONFIG_PCM_XRUN_DEBUG=y``. |
93 | This shows the status of xrun (= buffer overrun/xrun) and | 95 | This shows the status of xrun (= buffer overrun/xrun) and |
94 | invalid PCM position debug/check of ALSA PCM middle layer. | 96 | invalid PCM position debug/check of ALSA PCM middle layer. |
95 | It takes an integer value, can be changed by writing to this | 97 | It takes an integer value, can be changed by writing to this |
96 | file, such as | 98 | file, such as:: |
97 | 99 | ||
98 | # echo 5 > /proc/asound/card0/pcm0p/xrun_debug | 100 | # echo 5 > /proc/asound/card0/pcm0p/xrun_debug |
99 | 101 | ||
100 | The value consists of the following bit flags: | 102 | The value consists of the following bit flags: |
101 | bit 0 = Enable XRUN/jiffies debug messages | 103 | |
102 | bit 1 = Show stack trace at XRUN / jiffies check | 104 | * bit 0 = Enable XRUN/jiffies debug messages |
103 | bit 2 = Enable additional jiffies check | 105 | * bit 1 = Show stack trace at XRUN / jiffies check |
106 | * bit 2 = Enable additional jiffies check | ||
104 | 107 | ||
105 | When the bit 0 is set, the driver will show the messages to | 108 | When the bit 0 is set, the driver will show the messages to |
106 | kernel log when an xrun is detected. The debug message is | 109 | kernel log when an xrun is detected. The debug message is |
@@ -117,72 +120,74 @@ card*/pcm*/xrun_debug | |||
117 | buggy) hardware that doesn't give smooth pointer updates. | 120 | buggy) hardware that doesn't give smooth pointer updates. |
118 | This feature is enabled via the bit 2. | 121 | This feature is enabled via the bit 2. |
119 | 122 | ||
120 | card*/pcm*/sub*/info | 123 | ``card*/pcm*/sub*/info`` |
121 | The general information of this PCM sub-stream. | 124 | The general information of this PCM sub-stream. |
122 | 125 | ||
123 | card*/pcm*/sub*/status | 126 | ``card*/pcm*/sub*/status`` |
124 | The current status of this PCM sub-stream, elapsed time, | 127 | The current status of this PCM sub-stream, elapsed time, |
125 | H/W position, etc. | 128 | H/W position, etc. |
126 | 129 | ||
127 | card*/pcm*/sub*/hw_params | 130 | ``card*/pcm*/sub*/hw_params`` |
128 | The hardware parameters set for this sub-stream. | 131 | The hardware parameters set for this sub-stream. |
129 | 132 | ||
130 | card*/pcm*/sub*/sw_params | 133 | ``card*/pcm*/sub*/sw_params`` |
131 | The soft parameters set for this sub-stream. | 134 | The soft parameters set for this sub-stream. |
132 | 135 | ||
133 | card*/pcm*/sub*/prealloc | 136 | ``card*/pcm*/sub*/prealloc`` |
134 | The buffer pre-allocation information. | 137 | The buffer pre-allocation information. |
135 | 138 | ||
136 | card*/pcm*/sub*/xrun_injection | 139 | ``card*/pcm*/sub*/xrun_injection`` |
137 | Triggers an XRUN to the running stream when any value is | 140 | Triggers an XRUN to the running stream when any value is |
138 | written to this proc file. Used for fault injection. | 141 | written to this proc file. Used for fault injection. |
139 | This entry is write-only. | 142 | This entry is write-only. |
140 | 143 | ||
141 | AC97 Codec Information | 144 | AC97 Codec Information |
142 | ---------------------- | 145 | ====================== |
143 | 146 | ||
144 | card*/codec97#*/ac97#?-? | 147 | ``card*/codec97#*/ac97#?-?`` |
145 | Shows the general information of this AC97 codec chip, such as | 148 | Shows the general information of this AC97 codec chip, such as |
146 | name, capabilities, set up. | 149 | name, capabilities, set up. |
147 | 150 | ||
148 | card*/codec97#0/ac97#?-?+regs | 151 | ``card*/codec97#0/ac97#?-?+regs`` |
149 | Shows the AC97 register dump. Useful for debugging. | 152 | Shows the AC97 register dump. Useful for debugging. |
150 | 153 | ||
151 | When CONFIG_SND_DEBUG is enabled, you can write to this file for | 154 | When CONFIG_SND_DEBUG is enabled, you can write to this file for |
152 | changing an AC97 register directly. Pass two hex numbers. | 155 | changing an AC97 register directly. Pass two hex numbers. |
153 | For example, | 156 | For example, |
154 | 157 | ||
158 | :: | ||
159 | |||
155 | # echo 02 9f1f > /proc/asound/card0/codec97#0/ac97#0-0+regs | 160 | # echo 02 9f1f > /proc/asound/card0/codec97#0/ac97#0-0+regs |
156 | 161 | ||
157 | 162 | ||
158 | USB Audio Streams | 163 | USB Audio Streams |
159 | ----------------- | 164 | ================= |
160 | 165 | ||
161 | card*/stream* | 166 | ``card*/stream*`` |
162 | Shows the assignment and the current status of each audio stream | 167 | Shows the assignment and the current status of each audio stream |
163 | of the given card. This information is very useful for debugging. | 168 | of the given card. This information is very useful for debugging. |
164 | 169 | ||
165 | 170 | ||
166 | HD-Audio Codecs | 171 | HD-Audio Codecs |
167 | --------------- | 172 | =============== |
168 | 173 | ||
169 | card*/codec#* | 174 | ``card*/codec#*`` |
170 | Shows the general codec information and the attribute of each | 175 | Shows the general codec information and the attribute of each |
171 | widget node. | 176 | widget node. |
172 | 177 | ||
173 | card*/eld#* | 178 | ``card*/eld#*`` |
174 | Available for HDMI or DisplayPort interfaces. | 179 | Available for HDMI or DisplayPort interfaces. |
175 | Shows ELD(EDID Like Data) info retrieved from the attached HDMI sink, | 180 | Shows ELD(EDID Like Data) info retrieved from the attached HDMI sink, |
176 | and describes its audio capabilities and configurations. | 181 | and describes its audio capabilities and configurations. |
177 | 182 | ||
178 | Some ELD fields may be modified by doing `echo name hex_value > eld#*`. | 183 | Some ELD fields may be modified by doing ``echo name hex_value > eld#*``. |
179 | Only do this if you are sure the HDMI sink provided value is wrong. | 184 | Only do this if you are sure the HDMI sink provided value is wrong. |
180 | And if that makes your HDMI audio work, please report to us so that we | 185 | And if that makes your HDMI audio work, please report to us so that we |
181 | can fix it in future kernel releases. | 186 | can fix it in future kernel releases. |
182 | 187 | ||
183 | 188 | ||
184 | Sequencer Information | 189 | Sequencer Information |
185 | --------------------- | 190 | ===================== |
186 | 191 | ||
187 | seq/drivers | 192 | seq/drivers |
188 | Lists the currently available ALSA sequencer drivers. | 193 | Lists the currently available ALSA sequencer drivers. |
@@ -203,7 +208,7 @@ seq/oss | |||
203 | 208 | ||
204 | 209 | ||
205 | Help For Debugging? | 210 | Help For Debugging? |
206 | ------------------- | 211 | =================== |
207 | 212 | ||
208 | When the problem is related with PCM, first try to turn on xrun_debug | 213 | When the problem is related with PCM, first try to turn on xrun_debug |
209 | mode. This will give you the kernel messages when and where xrun | 214 | mode. This will give you the kernel messages when and where xrun |
@@ -211,24 +216,23 @@ happened. | |||
211 | 216 | ||
212 | If it's really a bug, report it with the following information: | 217 | If it's really a bug, report it with the following information: |
213 | 218 | ||
214 | - the name of the driver/card, show in /proc/asound/cards | 219 | - the name of the driver/card, show in ``/proc/asound/cards`` |
215 | - the register dump, if available (e.g. card*/cmipci) | 220 | - the register dump, if available (e.g. ``card*/cmipci``) |
216 | 221 | ||
217 | when it's a PCM problem, | 222 | when it's a PCM problem, |
218 | 223 | ||
219 | - set-up of PCM, shown in hw_parms, sw_params, and status in the PCM | 224 | - set-up of PCM, shown in hw_parms, sw_params, and status in the PCM |
220 | sub-stream directory | 225 | sub-stream directory |
221 | 226 | ||
222 | when it's a mixer problem, | 227 | when it's a mixer problem, |
223 | 228 | ||
224 | - AC97 proc files, codec97#*/* files | 229 | - AC97 proc files, ``codec97#*/*`` files |
225 | 230 | ||
226 | for USB audio/midi, | 231 | for USB audio/midi, |
227 | 232 | ||
228 | - output of lsusb -v | 233 | - output of ``lsusb -v`` |
229 | - stream* files in card directory | 234 | - ``stream*`` files in card directory |
230 | 235 | ||
231 | 236 | ||
232 | The ALSA bug-tracking system is found at: | 237 | The ALSA bug-tracking system is found at: |
233 | 238 | https://bugtrack.alsa-project.org/alsa-bug/ | |
234 | https://bugtrack.alsa-project.org/alsa-bug/ | ||
diff --git a/Documentation/sound/designs/seq-oss.rst b/Documentation/sound/designs/seq-oss.rst new file mode 100644 index 000000000000..e82ffe0e7f43 --- /dev/null +++ b/Documentation/sound/designs/seq-oss.rst | |||
@@ -0,0 +1,371 @@ | |||
1 | =============================== | ||
2 | OSS Sequencer Emulation on ALSA | ||
3 | =============================== | ||
4 | |||
5 | Copyright (c) 1998,1999 by Takashi Iwai | ||
6 | |||
7 | ver.0.1.8; Nov. 16, 1999 | ||
8 | |||
9 | Description | ||
10 | =========== | ||
11 | |||
12 | This directory contains the OSS sequencer emulation driver on ALSA. Note | ||
13 | that this program is still in the development state. | ||
14 | |||
15 | What this does - it provides the emulation of the OSS sequencer, access | ||
16 | via ``/dev/sequencer`` and ``/dev/music`` devices. | ||
17 | The most of applications using OSS can run if the appropriate ALSA | ||
18 | sequencer is prepared. | ||
19 | |||
20 | The following features are emulated by this driver: | ||
21 | |||
22 | * Normal sequencer and MIDI events: | ||
23 | |||
24 | They are converted to the ALSA sequencer events, and sent to the | ||
25 | corresponding port. | ||
26 | |||
27 | * Timer events: | ||
28 | |||
29 | The timer is not selectable by ioctl. The control rate is fixed to | ||
30 | 100 regardless of HZ. That is, even on Alpha system, a tick is always | ||
31 | 1/100 second. The base rate and tempo can be changed in ``/dev/music``. | ||
32 | |||
33 | * Patch loading: | ||
34 | |||
35 | It purely depends on the synth drivers whether it's supported since | ||
36 | the patch loading is realized by callback to the synth driver. | ||
37 | |||
38 | * I/O controls: | ||
39 | |||
40 | Most of controls are accepted. Some controls | ||
41 | are dependent on the synth driver, as well as even on original OSS. | ||
42 | |||
43 | Furthermore, you can find the following advanced features: | ||
44 | |||
45 | * Better queue mechanism: | ||
46 | |||
47 | The events are queued before processing them. | ||
48 | |||
49 | * Multiple applications: | ||
50 | |||
51 | You can run two or more applications simultaneously (even for OSS | ||
52 | sequencer)! | ||
53 | However, each MIDI device is exclusive - that is, if a MIDI device | ||
54 | is opened once by some application, other applications can't use | ||
55 | it. No such a restriction in synth devices. | ||
56 | |||
57 | * Real-time event processing: | ||
58 | |||
59 | The events can be processed in real time without using out of bound | ||
60 | ioctl. To switch to real-time mode, send ABSTIME 0 event. The followed | ||
61 | events will be processed in real-time without queued. To switch off the | ||
62 | real-time mode, send RELTIME 0 event. | ||
63 | |||
64 | * ``/proc`` interface: | ||
65 | |||
66 | The status of applications and devices can be shown via | ||
67 | ``/proc/asound/seq/oss`` at any time. In the later version, | ||
68 | configuration will be changed via ``/proc`` interface, too. | ||
69 | |||
70 | |||
71 | Installation | ||
72 | ============ | ||
73 | |||
74 | Run configure script with both sequencer support (``--with-sequencer=yes``) | ||
75 | and OSS emulation (``--with-oss=yes``) options. A module ``snd-seq-oss.o`` | ||
76 | will be created. If the synth module of your sound card supports for OSS | ||
77 | emulation (so far, only Emu8000 driver), this module will be loaded | ||
78 | automatically. | ||
79 | Otherwise, you need to load this module manually. | ||
80 | |||
81 | At beginning, this module probes all the MIDI ports which have been | ||
82 | already connected to the sequencer. Once after that, the creation and deletion | ||
83 | of ports are watched by announcement mechanism of ALSA sequencer. | ||
84 | |||
85 | The available synth and MIDI devices can be found in proc interface. | ||
86 | Run ``cat /proc/asound/seq/oss``, and check the devices. For example, | ||
87 | if you use an AWE64 card, you'll see like the following: | ||
88 | :: | ||
89 | |||
90 | OSS sequencer emulation version 0.1.8 | ||
91 | ALSA client number 63 | ||
92 | ALSA receiver port 0 | ||
93 | |||
94 | Number of applications: 0 | ||
95 | |||
96 | Number of synth devices: 1 | ||
97 | synth 0: [EMU8000] | ||
98 | type 0x1 : subtype 0x20 : voices 32 | ||
99 | capabilties : ioctl enabled / load_patch enabled | ||
100 | |||
101 | Number of MIDI devices: 3 | ||
102 | midi 0: [Emu8000 Port-0] ALSA port 65:0 | ||
103 | capability write / opened none | ||
104 | |||
105 | midi 1: [Emu8000 Port-1] ALSA port 65:1 | ||
106 | capability write / opened none | ||
107 | |||
108 | midi 2: [0: MPU-401 (UART)] ALSA port 64:0 | ||
109 | capability read/write / opened none | ||
110 | |||
111 | Note that the device number may be different from the information of | ||
112 | ``/proc/asound/oss-devices`` or ones of the original OSS driver. | ||
113 | Use the device number listed in ``/proc/asound/seq/oss`` | ||
114 | to play via OSS sequencer emulation. | ||
115 | |||
116 | Using Synthesizer Devices | ||
117 | ========================= | ||
118 | |||
119 | Run your favorite program. I've tested playmidi-2.4, awemidi-0.4.3, gmod-3.1 | ||
120 | and xmp-1.1.5. You can load samples via ``/dev/sequencer`` like sfxload, | ||
121 | too. | ||
122 | |||
123 | If the lowlevel driver supports multiple access to synth devices (like | ||
124 | Emu8000 driver), two or more applications are allowed to run at the same | ||
125 | time. | ||
126 | |||
127 | Using MIDI Devices | ||
128 | ================== | ||
129 | |||
130 | So far, only MIDI output was tested. MIDI input was not checked at all, | ||
131 | but hopefully it will work. Use the device number listed in | ||
132 | ``/proc/asound/seq/oss``. | ||
133 | Be aware that these numbers are mostly different from the list in | ||
134 | ``/proc/asound/oss-devices``. | ||
135 | |||
136 | Module Options | ||
137 | ============== | ||
138 | |||
139 | The following module options are available: | ||
140 | |||
141 | maxqlen | ||
142 | specifies the maximum read/write queue length. This queue is private | ||
143 | for OSS sequencer, so that it is independent from the queue length of ALSA | ||
144 | sequencer. Default value is 1024. | ||
145 | |||
146 | seq_oss_debug | ||
147 | specifies the debug level and accepts zero (= no debug message) or | ||
148 | positive integer. Default value is 0. | ||
149 | |||
150 | Queue Mechanism | ||
151 | =============== | ||
152 | |||
153 | OSS sequencer emulation uses an ALSA priority queue. The | ||
154 | events from ``/dev/sequencer`` are processed and put onto the queue | ||
155 | specified by module option. | ||
156 | |||
157 | All the events from ``/dev/sequencer`` are parsed at beginning. | ||
158 | The timing events are also parsed at this moment, so that the events may | ||
159 | be processed in real-time. Sending an event ABSTIME 0 switches the operation | ||
160 | mode to real-time mode, and sending an event RELTIME 0 switches it off. | ||
161 | In the real-time mode, all events are dispatched immediately. | ||
162 | |||
163 | The queued events are dispatched to the corresponding ALSA sequencer | ||
164 | ports after scheduled time by ALSA sequencer dispatcher. | ||
165 | |||
166 | If the write-queue is full, the application sleeps until a certain amount | ||
167 | (as default one half) becomes empty in blocking mode. The synchronization | ||
168 | to write timing was implemented, too. | ||
169 | |||
170 | The input from MIDI devices or echo-back events are stored on read FIFO | ||
171 | queue. If application reads ``/dev/sequencer`` in blocking mode, the | ||
172 | process will be awaked. | ||
173 | |||
174 | Interface to Synthesizer Device | ||
175 | =============================== | ||
176 | |||
177 | Registration | ||
178 | ------------ | ||
179 | |||
180 | To register an OSS synthesizer device, use snd_seq_oss_synth_register() | ||
181 | function: | ||
182 | :: | ||
183 | |||
184 | int snd_seq_oss_synth_register(char *name, int type, int subtype, int nvoices, | ||
185 | snd_seq_oss_callback_t *oper, void *private_data) | ||
186 | |||
187 | The arguments ``name``, ``type``, ``subtype`` and ``nvoices`` | ||
188 | are used for making the appropriate synth_info structure for ioctl. The | ||
189 | return value is an index number of this device. This index must be remembered | ||
190 | for unregister. If registration is failed, -errno will be returned. | ||
191 | |||
192 | To release this device, call snd_seq_oss_synth_unregister() function: | ||
193 | :: | ||
194 | |||
195 | int snd_seq_oss_synth_unregister(int index) | ||
196 | |||
197 | where the ``index`` is the index number returned by register function. | ||
198 | |||
199 | Callbacks | ||
200 | --------- | ||
201 | |||
202 | OSS synthesizer devices have capability for sample downloading and ioctls | ||
203 | like sample reset. In OSS emulation, these special features are realized | ||
204 | by using callbacks. The registration argument oper is used to specify these | ||
205 | callbacks. The following callback functions must be defined: | ||
206 | :: | ||
207 | |||
208 | snd_seq_oss_callback_t: | ||
209 | int (*open)(snd_seq_oss_arg_t *p, void *closure); | ||
210 | int (*close)(snd_seq_oss_arg_t *p); | ||
211 | int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg); | ||
212 | int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char *buf, int offs, int count); | ||
213 | int (*reset)(snd_seq_oss_arg_t *p); | ||
214 | |||
215 | Except for ``open`` and ``close`` callbacks, they are allowed to be NULL. | ||
216 | |||
217 | Each callback function takes the argument type ``snd_seq_oss_arg_t`` as the | ||
218 | first argument. | ||
219 | :: | ||
220 | |||
221 | struct snd_seq_oss_arg_t { | ||
222 | int app_index; | ||
223 | int file_mode; | ||
224 | int seq_mode; | ||
225 | snd_seq_addr_t addr; | ||
226 | void *private_data; | ||
227 | int event_passing; | ||
228 | }; | ||
229 | |||
230 | The first three fields, ``app_index``, ``file_mode`` and ``seq_mode`` | ||
231 | are initialized by OSS sequencer. The ``app_index`` is the application | ||
232 | index which is unique to each application opening OSS sequencer. The | ||
233 | ``file_mode`` is bit-flags indicating the file operation mode. See | ||
234 | ``seq_oss.h`` for its meaning. The ``seq_mode`` is sequencer operation | ||
235 | mode. In the current version, only ``SND_OSSSEQ_MODE_SYNTH`` is used. | ||
236 | |||
237 | The next two fields, ``addr`` and ``private_data``, must be | ||
238 | filled by the synth driver at open callback. The ``addr`` contains | ||
239 | the address of ALSA sequencer port which is assigned to this device. If | ||
240 | the driver allocates memory for ``private_data``, it must be released | ||
241 | in close callback by itself. | ||
242 | |||
243 | The last field, ``event_passing``, indicates how to translate note-on | ||
244 | / off events. In ``PROCESS_EVENTS`` mode, the note 255 is regarded | ||
245 | as velocity change, and key pressure event is passed to the port. In | ||
246 | ``PASS_EVENTS`` mode, all note on/off events are passed to the port | ||
247 | without modified. ``PROCESS_KEYPRESS`` mode checks the note above 128 | ||
248 | and regards it as key pressure event (mainly for Emu8000 driver). | ||
249 | |||
250 | Open Callback | ||
251 | ------------- | ||
252 | |||
253 | The ``open`` is called at each time this device is opened by an application | ||
254 | using OSS sequencer. This must not be NULL. Typically, the open callback | ||
255 | does the following procedure: | ||
256 | |||
257 | #. Allocate private data record. | ||
258 | #. Create an ALSA sequencer port. | ||
259 | #. Set the new port address on ``arg->addr``. | ||
260 | #. Set the private data record pointer on ``arg->private_data``. | ||
261 | |||
262 | Note that the type bit-flags in port_info of this synth port must NOT contain | ||
263 | ``TYPE_MIDI_GENERIC`` | ||
264 | bit. Instead, ``TYPE_SPECIFIC`` should be used. Also, ``CAP_SUBSCRIPTION`` | ||
265 | bit should NOT be included, too. This is necessary to tell it from other | ||
266 | normal MIDI devices. If the open procedure succeeded, return zero. Otherwise, | ||
267 | return -errno. | ||
268 | |||
269 | Ioctl Callback | ||
270 | -------------- | ||
271 | |||
272 | The ``ioctl`` callback is called when the sequencer receives device-specific | ||
273 | ioctls. The following two ioctls should be processed by this callback: | ||
274 | |||
275 | IOCTL_SEQ_RESET_SAMPLES | ||
276 | reset all samples on memory -- return 0 | ||
277 | |||
278 | IOCTL_SYNTH_MEMAVL | ||
279 | return the available memory size | ||
280 | |||
281 | FM_4OP_ENABLE | ||
282 | can be ignored usually | ||
283 | |||
284 | The other ioctls are processed inside the sequencer without passing to | ||
285 | the lowlevel driver. | ||
286 | |||
287 | Load_Patch Callback | ||
288 | ------------------- | ||
289 | |||
290 | The ``load_patch`` callback is used for sample-downloading. This callback | ||
291 | must read the data on user-space and transfer to each device. Return 0 | ||
292 | if succeeded, and -errno if failed. The format argument is the patch key | ||
293 | in patch_info record. The buf is user-space pointer where patch_info record | ||
294 | is stored. The offs can be ignored. The count is total data size of this | ||
295 | sample data. | ||
296 | |||
297 | Close Callback | ||
298 | -------------- | ||
299 | |||
300 | The ``close`` callback is called when this device is closed by the | ||
301 | application. If any private data was allocated in open callback, it must | ||
302 | be released in the close callback. The deletion of ALSA port should be | ||
303 | done here, too. This callback must not be NULL. | ||
304 | |||
305 | Reset Callback | ||
306 | -------------- | ||
307 | |||
308 | The ``reset`` callback is called when sequencer device is reset or | ||
309 | closed by applications. The callback should turn off the sounds on the | ||
310 | relevant port immediately, and initialize the status of the port. If this | ||
311 | callback is undefined, OSS seq sends a ``HEARTBEAT`` event to the | ||
312 | port. | ||
313 | |||
314 | Events | ||
315 | ====== | ||
316 | |||
317 | Most of the events are processed by sequencer and translated to the adequate | ||
318 | ALSA sequencer events, so that each synth device can receive by input_event | ||
319 | callback of ALSA sequencer port. The following ALSA events should be | ||
320 | implemented by the driver: | ||
321 | |||
322 | ============= =================== | ||
323 | ALSA event Original OSS events | ||
324 | ============= =================== | ||
325 | NOTEON SEQ_NOTEON, MIDI_NOTEON | ||
326 | NOTE SEQ_NOTEOFF, MIDI_NOTEOFF | ||
327 | KEYPRESS MIDI_KEY_PRESSURE | ||
328 | CHANPRESS SEQ_AFTERTOUCH, MIDI_CHN_PRESSURE | ||
329 | PGMCHANGE SEQ_PGMCHANGE, MIDI_PGM_CHANGE | ||
330 | PITCHBEND SEQ_CONTROLLER(CTRL_PITCH_BENDER), | ||
331 | MIDI_PITCH_BEND | ||
332 | CONTROLLER MIDI_CTL_CHANGE, | ||
333 | SEQ_BALANCE (with CTL_PAN) | ||
334 | CONTROL14 SEQ_CONTROLLER | ||
335 | REGPARAM SEQ_CONTROLLER(CTRL_PITCH_BENDER_RANGE) | ||
336 | SYSEX SEQ_SYSEX | ||
337 | ============= =================== | ||
338 | |||
339 | The most of these behavior can be realized by MIDI emulation driver | ||
340 | included in the Emu8000 lowlevel driver. In the future release, this module | ||
341 | will be independent. | ||
342 | |||
343 | Some OSS events (``SEQ_PRIVATE`` and ``SEQ_VOLUME`` events) are passed as event | ||
344 | type SND_SEQ_OSS_PRIVATE. The OSS sequencer passes these event 8 byte | ||
345 | packets without any modification. The lowlevel driver should process these | ||
346 | events appropriately. | ||
347 | |||
348 | Interface to MIDI Device | ||
349 | ======================== | ||
350 | |||
351 | Since the OSS emulation probes the creation and deletion of ALSA MIDI | ||
352 | sequencer ports automatically by receiving announcement from ALSA | ||
353 | sequencer, the MIDI devices don't need to be registered explicitly | ||
354 | like synth devices. | ||
355 | However, the MIDI port_info registered to ALSA sequencer must include | ||
356 | a group name ``SND_SEQ_GROUP_DEVICE`` and a capability-bit | ||
357 | ``CAP_READ`` or ``CAP_WRITE``. Also, subscription capabilities, | ||
358 | ``CAP_SUBS_READ`` or ``CAP_SUBS_WRITE``, must be defined, too. If | ||
359 | these conditions are not satisfied, the port is not registered as OSS | ||
360 | sequencer MIDI device. | ||
361 | |||
362 | The events via MIDI devices are parsed in OSS sequencer and converted | ||
363 | to the corresponding ALSA sequencer events. The input from MIDI sequencer | ||
364 | is also converted to MIDI byte events by OSS sequencer. This works just | ||
365 | a reverse way of seq_midi module. | ||
366 | |||
367 | Known Problems / TODO's | ||
368 | ======================= | ||
369 | |||
370 | * Patch loading via ALSA instrument layer is not implemented yet. | ||
371 | |||
diff --git a/Documentation/sound/alsa/timestamping.txt b/Documentation/sound/designs/timestamping.rst index 9d579aefbffd..2b0fff503415 100644 --- a/Documentation/sound/alsa/timestamping.txt +++ b/Documentation/sound/designs/timestamping.rst | |||
@@ -1,18 +1,22 @@ | |||
1 | ===================== | ||
2 | ALSA PCM Timestamping | ||
3 | ===================== | ||
4 | |||
1 | The ALSA API can provide two different system timestamps: | 5 | The ALSA API can provide two different system timestamps: |
2 | 6 | ||
3 | - Trigger_tstamp is the system time snapshot taken when the .trigger | 7 | - Trigger_tstamp is the system time snapshot taken when the .trigger |
4 | callback is invoked. This snapshot is taken by the ALSA core in the | 8 | callback is invoked. This snapshot is taken by the ALSA core in the |
5 | general case, but specific hardware may have synchronization | 9 | general case, but specific hardware may have synchronization |
6 | capabilities or conversely may only be able to provide a correct | 10 | capabilities or conversely may only be able to provide a correct |
7 | estimate with a delay. In the latter two cases, the low-level driver | 11 | estimate with a delay. In the latter two cases, the low-level driver |
8 | is responsible for updating the trigger_tstamp at the most appropriate | 12 | is responsible for updating the trigger_tstamp at the most appropriate |
9 | and precise moment. Applications should not rely solely on the first | 13 | and precise moment. Applications should not rely solely on the first |
10 | trigger_tstamp but update their internal calculations if the driver | 14 | trigger_tstamp but update their internal calculations if the driver |
11 | provides a refined estimate with a delay. | 15 | provides a refined estimate with a delay. |
12 | 16 | ||
13 | - tstamp is the current system timestamp updated during the last | 17 | - tstamp is the current system timestamp updated during the last |
14 | event or application query. | 18 | event or application query. |
15 | The difference (tstamp - trigger_tstamp) defines the elapsed time. | 19 | The difference (tstamp - trigger_tstamp) defines the elapsed time. |
16 | 20 | ||
17 | The ALSA API provides two basic pieces of information, avail | 21 | The ALSA API provides two basic pieces of information, avail |
18 | and delay, which combined with the trigger and current system | 22 | and delay, which combined with the trigger and current system |
@@ -22,15 +26,15 @@ the ring buffer and the amount of queued samples. | |||
22 | The use of these different pointers and time information depends on | 26 | The use of these different pointers and time information depends on |
23 | the application needs: | 27 | the application needs: |
24 | 28 | ||
25 | - 'avail' reports how much can be written in the ring buffer | 29 | - ``avail`` reports how much can be written in the ring buffer |
26 | - 'delay' reports the time it will take to hear a new sample after all | 30 | - ``delay`` reports the time it will take to hear a new sample after all |
27 | queued samples have been played out. | 31 | queued samples have been played out. |
28 | 32 | ||
29 | When timestamps are enabled, the avail/delay information is reported | 33 | When timestamps are enabled, the avail/delay information is reported |
30 | along with a snapshot of system time. Applications can select from | 34 | along with a snapshot of system time. Applications can select from |
31 | CLOCK_REALTIME (NTP corrections including going backwards), | 35 | ``CLOCK_REALTIME`` (NTP corrections including going backwards), |
32 | CLOCK_MONOTONIC (NTP corrections but never going backwards), | 36 | ``CLOCK_MONOTONIC`` (NTP corrections but never going backwards), |
33 | CLOCK_MONOTIC_RAW (without NTP corrections) and change the mode | 37 | ``CLOCK_MONOTIC_RAW`` (without NTP corrections) and change the mode |
34 | dynamically with sw_params | 38 | dynamically with sw_params |
35 | 39 | ||
36 | 40 | ||
@@ -38,17 +42,18 @@ The ALSA API also provide an audio_tstamp which reflects the passage | |||
38 | of time as measured by different components of audio hardware. In | 42 | of time as measured by different components of audio hardware. In |
39 | ascii-art, this could be represented as follows (for the playback | 43 | ascii-art, this could be represented as follows (for the playback |
40 | case): | 44 | case): |
45 | :: | ||
41 | 46 | ||
47 | --------------------------------------------------------------> time | ||
48 | ^ ^ ^ ^ ^ | ||
49 | | | | | | | ||
50 | analog link dma app FullBuffer | ||
51 | time time time time time | ||
52 | | | | | | | ||
53 | |< codec delay >|<--hw delay-->|<queued samples>|<---avail->| | ||
54 | |<----------------- delay---------------------->| | | ||
55 | |<----ring buffer length---->| | ||
42 | 56 | ||
43 | --------------------------------------------------------------> time | ||
44 | ^ ^ ^ ^ ^ | ||
45 | | | | | | | ||
46 | analog link dma app FullBuffer | ||
47 | time time time time time | ||
48 | | | | | | | ||
49 | |< codec delay >|<--hw delay-->|<queued samples>|<---avail->| | ||
50 | |<----------------- delay---------------------->| | | ||
51 | |<----ring buffer length---->| | ||
52 | 57 | ||
53 | The analog time is taken at the last stage of the playback, as close | 58 | The analog time is taken at the last stage of the playback, as close |
54 | as possible to the actual transducer | 59 | as possible to the actual transducer |
@@ -113,11 +118,11 @@ audio applications... | |||
113 | 118 | ||
114 | Due to the varied nature of timestamping needs, even for a single | 119 | Due to the varied nature of timestamping needs, even for a single |
115 | application, the audio_tstamp_config can be changed dynamically. In | 120 | application, the audio_tstamp_config can be changed dynamically. In |
116 | the STATUS ioctl, the parameters are read-only and do not allow for | 121 | the ``STATUS`` ioctl, the parameters are read-only and do not allow for |
117 | any application selection. To work around this limitation without | 122 | any application selection. To work around this limitation without |
118 | impacting legacy applications, a new STATUS_EXT ioctl is introduced | 123 | impacting legacy applications, a new ``STATUS_EXT`` ioctl is introduced |
119 | with read/write parameters. ALSA-lib will be modified to make use of | 124 | with read/write parameters. ALSA-lib will be modified to make use of |
120 | STATUS_EXT and effectively deprecate STATUS. | 125 | ``STATUS_EXT`` and effectively deprecate ``STATUS``. |
121 | 126 | ||
122 | The ALSA API only allows for a single audio timestamp to be reported | 127 | The ALSA API only allows for a single audio timestamp to be reported |
123 | at a time. This is a conscious design decision, reading the audio | 128 | at a time. This is a conscious design decision, reading the audio |
@@ -135,36 +140,42 @@ the hardware, there is a risk of misalignment with the avail and delay | |||
135 | information. To make sure applications are not confused, a | 140 | information. To make sure applications are not confused, a |
136 | driver_timestamp field is added in the snd_pcm_status structure; this | 141 | driver_timestamp field is added in the snd_pcm_status structure; this |
137 | timestamp shows when the information is put together by the driver | 142 | timestamp shows when the information is put together by the driver |
138 | before returning from the STATUS and STATUS_EXT ioctl. in most cases | 143 | before returning from the ``STATUS`` and ``STATUS_EXT`` ioctl. in most cases |
139 | this driver_timestamp will be identical to the regular system tstamp. | 144 | this driver_timestamp will be identical to the regular system tstamp. |
140 | 145 | ||
141 | Examples of typestamping with HDaudio: | 146 | Examples of typestamping with HDaudio: |
142 | 147 | ||
143 | 1. DMA timestamp, no compensation for DMA+analog delay | 148 | 1. DMA timestamp, no compensation for DMA+analog delay |
144 | $ ./audio_time -p --ts_type=1 | 149 | :: |
145 | playback: systime: 341121338 nsec, audio time 342000000 nsec, systime delta -878662 | 150 | |
146 | playback: systime: 426236663 nsec, audio time 427187500 nsec, systime delta -950837 | 151 | $ ./audio_time -p --ts_type=1 |
147 | playback: systime: 597080580 nsec, audio time 598000000 nsec, systime delta -919420 | 152 | playback: systime: 341121338 nsec, audio time 342000000 nsec, systime delta -878662 |
148 | playback: systime: 682059782 nsec, audio time 683020833 nsec, systime delta -961051 | 153 | playback: systime: 426236663 nsec, audio time 427187500 nsec, systime delta -950837 |
149 | playback: systime: 852896415 nsec, audio time 853854166 nsec, systime delta -957751 | 154 | playback: systime: 597080580 nsec, audio time 598000000 nsec, systime delta -919420 |
150 | playback: systime: 937903344 nsec, audio time 938854166 nsec, systime delta -950822 | 155 | playback: systime: 682059782 nsec, audio time 683020833 nsec, systime delta -961051 |
156 | playback: systime: 852896415 nsec, audio time 853854166 nsec, systime delta -957751 | ||
157 | playback: systime: 937903344 nsec, audio time 938854166 nsec, systime delta -950822 | ||
151 | 158 | ||
152 | 2. DMA timestamp, compensation for DMA+analog delay | 159 | 2. DMA timestamp, compensation for DMA+analog delay |
153 | $ ./audio_time -p --ts_type=1 -d | 160 | :: |
154 | playback: systime: 341053347 nsec, audio time 341062500 nsec, systime delta -9153 | 161 | |
155 | playback: systime: 426072447 nsec, audio time 426062500 nsec, systime delta 9947 | 162 | $ ./audio_time -p --ts_type=1 -d |
156 | playback: systime: 596899518 nsec, audio time 596895833 nsec, systime delta 3685 | 163 | playback: systime: 341053347 nsec, audio time 341062500 nsec, systime delta -9153 |
157 | playback: systime: 681915317 nsec, audio time 681916666 nsec, systime delta -1349 | 164 | playback: systime: 426072447 nsec, audio time 426062500 nsec, systime delta 9947 |
158 | playback: systime: 852741306 nsec, audio time 852750000 nsec, systime delta -8694 | 165 | playback: systime: 596899518 nsec, audio time 596895833 nsec, systime delta 3685 |
166 | playback: systime: 681915317 nsec, audio time 681916666 nsec, systime delta -1349 | ||
167 | playback: systime: 852741306 nsec, audio time 852750000 nsec, systime delta -8694 | ||
159 | 168 | ||
160 | 3. link timestamp, compensation for DMA+analog delay | 169 | 3. link timestamp, compensation for DMA+analog delay |
161 | $ ./audio_time -p --ts_type=2 -d | 170 | :: |
162 | playback: systime: 341060004 nsec, audio time 341062791 nsec, systime delta -2787 | 171 | |
163 | playback: systime: 426242074 nsec, audio time 426244875 nsec, systime delta -2801 | 172 | $ ./audio_time -p --ts_type=2 -d |
164 | playback: systime: 597080992 nsec, audio time 597084583 nsec, systime delta -3591 | 173 | playback: systime: 341060004 nsec, audio time 341062791 nsec, systime delta -2787 |
165 | playback: systime: 682084512 nsec, audio time 682088291 nsec, systime delta -3779 | 174 | playback: systime: 426242074 nsec, audio time 426244875 nsec, systime delta -2801 |
166 | playback: systime: 852936229 nsec, audio time 852940916 nsec, systime delta -4687 | 175 | playback: systime: 597080992 nsec, audio time 597084583 nsec, systime delta -3591 |
167 | playback: systime: 938107562 nsec, audio time 938112708 nsec, systime delta -5146 | 176 | playback: systime: 682084512 nsec, audio time 682088291 nsec, systime delta -3779 |
177 | playback: systime: 852936229 nsec, audio time 852940916 nsec, systime delta -4687 | ||
178 | playback: systime: 938107562 nsec, audio time 938112708 nsec, systime delta -5146 | ||
168 | 179 | ||
169 | Example 1 shows that the timestamp at the DMA level is close to 1ms | 180 | Example 1 shows that the timestamp at the DMA level is close to 1ms |
170 | ahead of the actual playback time (as a side time this sort of | 181 | ahead of the actual playback time (as a side time this sort of |
@@ -181,20 +192,24 @@ shows how compensating for the delay exposes a 1ms accuracy (due to | |||
181 | the use of the frame counter by the driver) | 192 | the use of the frame counter by the driver) |
182 | 193 | ||
183 | Example 3: DMA timestamp, no compensation for delay, delta of ~5ms | 194 | Example 3: DMA timestamp, no compensation for delay, delta of ~5ms |
184 | $ ./audio_time -p -Dhw:1 -t1 | 195 | :: |
185 | playback: systime: 120174019 nsec, audio time 125000000 nsec, systime delta -4825981 | 196 | |
186 | playback: systime: 245041136 nsec, audio time 250000000 nsec, systime delta -4958864 | 197 | $ ./audio_time -p -Dhw:1 -t1 |
187 | playback: systime: 370106088 nsec, audio time 375000000 nsec, systime delta -4893912 | 198 | playback: systime: 120174019 nsec, audio time 125000000 nsec, systime delta -4825981 |
188 | playback: systime: 495040065 nsec, audio time 500000000 nsec, systime delta -4959935 | 199 | playback: systime: 245041136 nsec, audio time 250000000 nsec, systime delta -4958864 |
189 | playback: systime: 620038179 nsec, audio time 625000000 nsec, systime delta -4961821 | 200 | playback: systime: 370106088 nsec, audio time 375000000 nsec, systime delta -4893912 |
190 | playback: systime: 745087741 nsec, audio time 750000000 nsec, systime delta -4912259 | 201 | playback: systime: 495040065 nsec, audio time 500000000 nsec, systime delta -4959935 |
191 | playback: systime: 870037336 nsec, audio time 875000000 nsec, systime delta -4962664 | 202 | playback: systime: 620038179 nsec, audio time 625000000 nsec, systime delta -4961821 |
203 | playback: systime: 745087741 nsec, audio time 750000000 nsec, systime delta -4912259 | ||
204 | playback: systime: 870037336 nsec, audio time 875000000 nsec, systime delta -4962664 | ||
192 | 205 | ||
193 | Example 4: DMA timestamp, compensation for delay, delay of ~1ms | 206 | Example 4: DMA timestamp, compensation for delay, delay of ~1ms |
194 | $ ./audio_time -p -Dhw:1 -t1 -d | 207 | :: |
195 | playback: systime: 120190520 nsec, audio time 120000000 nsec, systime delta 190520 | 208 | |
196 | playback: systime: 245036740 nsec, audio time 244000000 nsec, systime delta 1036740 | 209 | $ ./audio_time -p -Dhw:1 -t1 -d |
197 | playback: systime: 370034081 nsec, audio time 369000000 nsec, systime delta 1034081 | 210 | playback: systime: 120190520 nsec, audio time 120000000 nsec, systime delta 190520 |
198 | playback: systime: 495159907 nsec, audio time 494000000 nsec, systime delta 1159907 | 211 | playback: systime: 245036740 nsec, audio time 244000000 nsec, systime delta 1036740 |
199 | playback: systime: 620098824 nsec, audio time 619000000 nsec, systime delta 1098824 | 212 | playback: systime: 370034081 nsec, audio time 369000000 nsec, systime delta 1034081 |
200 | playback: systime: 745031847 nsec, audio time 744000000 nsec, systime delta 1031847 | 213 | playback: systime: 495159907 nsec, audio time 494000000 nsec, systime delta 1159907 |
214 | playback: systime: 620098824 nsec, audio time 619000000 nsec, systime delta 1098824 | ||
215 | playback: systime: 745031847 nsec, audio time 744000000 nsec, systime delta 1031847 | ||
diff --git a/Documentation/sound/alsa/HD-Audio-Controls.txt b/Documentation/sound/hd-audio/controls.rst index e9621e349e17..f2ebc4f79b44 100644 --- a/Documentation/sound/alsa/HD-Audio-Controls.txt +++ b/Documentation/sound/hd-audio/controls.rst | |||
@@ -1,16 +1,21 @@ | |||
1 | ====================================== | ||
2 | HD-Audio Codec-Specific Mixer Controls | ||
3 | ====================================== | ||
4 | |||
5 | |||
1 | This file explains the codec-specific mixer controls. | 6 | This file explains the codec-specific mixer controls. |
2 | 7 | ||
3 | Realtek codecs | 8 | Realtek codecs |
4 | -------------- | 9 | -------------- |
5 | 10 | ||
6 | * Channel Mode | 11 | Channel Mode |
7 | This is an enum control to change the surround-channel setup, | 12 | This is an enum control to change the surround-channel setup, |
8 | appears only when the surround channels are available. | 13 | appears only when the surround channels are available. |
9 | It gives the number of channels to be used, "2ch", "4ch", "6ch", | 14 | It gives the number of channels to be used, "2ch", "4ch", "6ch", |
10 | and "8ch". According to the configuration, this also controls the | 15 | and "8ch". According to the configuration, this also controls the |
11 | jack-retasking of multi-I/O jacks. | 16 | jack-retasking of multi-I/O jacks. |
12 | 17 | ||
13 | * Auto-Mute Mode | 18 | Auto-Mute Mode |
14 | This is an enum control to change the auto-mute behavior of the | 19 | This is an enum control to change the auto-mute behavior of the |
15 | headphone and line-out jacks. If built-in speakers and headphone | 20 | headphone and line-out jacks. If built-in speakers and headphone |
16 | and/or line-out jacks are available on a machine, this controls | 21 | and/or line-out jacks are available on a machine, this controls |
@@ -30,24 +35,24 @@ Realtek codecs | |||
30 | IDT/Sigmatel codecs | 35 | IDT/Sigmatel codecs |
31 | ------------------- | 36 | ------------------- |
32 | 37 | ||
33 | * Analog Loopback | 38 | Analog Loopback |
34 | This control enables/disables the analog-loopback circuit. This | 39 | This control enables/disables the analog-loopback circuit. This |
35 | appears only when "loopback" is set to true in a codec hint | 40 | appears only when "loopback" is set to true in a codec hint |
36 | (see HD-Audio.txt). Note that on some codecs the analog-loopback | 41 | (see HD-Audio.txt). Note that on some codecs the analog-loopback |
37 | and the normal PCM playback are exclusive, i.e. when this is on, you | 42 | and the normal PCM playback are exclusive, i.e. when this is on, you |
38 | won't hear any PCM stream. | 43 | won't hear any PCM stream. |
39 | 44 | ||
40 | * Swap Center/LFE | 45 | Swap Center/LFE |
41 | Swaps the center and LFE channel order. Normally, the left | 46 | Swaps the center and LFE channel order. Normally, the left |
42 | corresponds to the center and the right to the LFE. When this is | 47 | corresponds to the center and the right to the LFE. When this is |
43 | ON, the left to the LFE and the right to the center. | 48 | ON, the left to the LFE and the right to the center. |
44 | 49 | ||
45 | * Headphone as Line Out | 50 | Headphone as Line Out |
46 | When this control is ON, treat the headphone jacks as line-out | 51 | When this control is ON, treat the headphone jacks as line-out |
47 | jacks. That is, the headphone won't auto-mute the other line-outs, | 52 | jacks. That is, the headphone won't auto-mute the other line-outs, |
48 | and no HP-amp is set to the pins. | 53 | and no HP-amp is set to the pins. |
49 | 54 | ||
50 | * Mic Jack Mode, Line Jack Mode, etc | 55 | Mic Jack Mode, Line Jack Mode, etc |
51 | These enum controls the direction and the bias of the input jack | 56 | These enum controls the direction and the bias of the input jack |
52 | pins. Depending on the jack type, it can set as "Mic In" and "Line | 57 | pins. Depending on the jack type, it can set as "Mic In" and "Line |
53 | In", for determining the input bias, or it can be set to "Line Out" | 58 | In", for determining the input bias, or it can be set to "Line Out" |
@@ -57,19 +62,19 @@ IDT/Sigmatel codecs | |||
57 | VIA codecs | 62 | VIA codecs |
58 | ---------- | 63 | ---------- |
59 | 64 | ||
60 | * Smart 5.1 | 65 | Smart 5.1 |
61 | An enum control to re-task the multi-I/O jacks for surround outputs. | 66 | An enum control to re-task the multi-I/O jacks for surround outputs. |
62 | When it's ON, the corresponding input jacks (usually a line-in and a | 67 | When it's ON, the corresponding input jacks (usually a line-in and a |
63 | mic-in) are switched as the surround and the CLFE output jacks. | 68 | mic-in) are switched as the surround and the CLFE output jacks. |
64 | 69 | ||
65 | * Independent HP | 70 | Independent HP |
66 | When this enum control is enabled, the headphone output is routed | 71 | When this enum control is enabled, the headphone output is routed |
67 | from an individual stream (the third PCM such as hw:0,2) instead of | 72 | from an individual stream (the third PCM such as hw:0,2) instead of |
68 | the primary stream. In the case the headphone DAC is shared with a | 73 | the primary stream. In the case the headphone DAC is shared with a |
69 | side or a CLFE-channel DAC, the DAC is switched to the headphone | 74 | side or a CLFE-channel DAC, the DAC is switched to the headphone |
70 | automatically. | 75 | automatically. |
71 | 76 | ||
72 | * Loopback Mixing | 77 | Loopback Mixing |
73 | An enum control to determine whether the analog-loopback route is | 78 | An enum control to determine whether the analog-loopback route is |
74 | enabled or not. When it's enabled, the analog-loopback is mixed to | 79 | enabled or not. When it's enabled, the analog-loopback is mixed to |
75 | the front-channel. Also, the same route is used for the headphone | 80 | the front-channel. Also, the same route is used for the headphone |
@@ -78,7 +83,7 @@ VIA codecs | |||
78 | headphones and speakers because there is only one DAC connected to a | 83 | headphones and speakers because there is only one DAC connected to a |
79 | mixer widget. | 84 | mixer widget. |
80 | 85 | ||
81 | * Dynamic Power-Control | 86 | Dynamic Power-Control |
82 | This control determines whether the dynamic power-control per jack | 87 | This control determines whether the dynamic power-control per jack |
83 | detection is enabled or not. When enabled, the widgets power state | 88 | detection is enabled or not. When enabled, the widgets power state |
84 | (D0/D3) are changed dynamically depending on the jack plugging | 89 | (D0/D3) are changed dynamically depending on the jack plugging |
@@ -86,7 +91,7 @@ VIA codecs | |||
86 | doesn't provide a proper jack-detection, this won't work; in such a | 91 | doesn't provide a proper jack-detection, this won't work; in such a |
87 | case, turn this control OFF. | 92 | case, turn this control OFF. |
88 | 93 | ||
89 | * Jack Detect | 94 | Jack Detect |
90 | This control is provided only for VT1708 codec which gives no proper | 95 | This control is provided only for VT1708 codec which gives no proper |
91 | unsolicited event per jack plug. When this is on, the driver polls | 96 | unsolicited event per jack plug. When this is on, the driver polls |
92 | the jack detection so that the headphone auto-mute can work, while | 97 | the jack detection so that the headphone auto-mute can work, while |
@@ -96,21 +101,21 @@ VIA codecs | |||
96 | Conexant codecs | 101 | Conexant codecs |
97 | --------------- | 102 | --------------- |
98 | 103 | ||
99 | * Auto-Mute Mode | 104 | Auto-Mute Mode |
100 | See Reatek codecs. | 105 | See Reatek codecs. |
101 | 106 | ||
102 | 107 | ||
103 | Analog codecs | 108 | Analog codecs |
104 | -------------- | 109 | -------------- |
105 | 110 | ||
106 | * Channel Mode | 111 | Channel Mode |
107 | This is an enum control to change the surround-channel setup, | 112 | This is an enum control to change the surround-channel setup, |
108 | appears only when the surround channels are available. | 113 | appears only when the surround channels are available. |
109 | It gives the number of channels to be used, "2ch", "4ch" and "6ch". | 114 | It gives the number of channels to be used, "2ch", "4ch" and "6ch". |
110 | According to the configuration, this also controls the | 115 | According to the configuration, this also controls the |
111 | jack-retasking of multi-I/O jacks. | 116 | jack-retasking of multi-I/O jacks. |
112 | 117 | ||
113 | * Independent HP | 118 | Independent HP |
114 | When this enum control is enabled, the headphone output is routed | 119 | When this enum control is enabled, the headphone output is routed |
115 | from an individual stream (the third PCM such as hw:0,2) instead of | 120 | from an individual stream (the third PCM such as hw:0,2) instead of |
116 | the primary stream. | 121 | the primary stream. |
diff --git a/Documentation/sound/alsa/HD-Audio-DP-MST-audio.txt b/Documentation/sound/hd-audio/dp-mst.rst index 82744ac3513d..58b72437e6c3 100644 --- a/Documentation/sound/alsa/HD-Audio-DP-MST-audio.txt +++ b/Documentation/sound/hd-audio/dp-mst.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ======================= | ||
2 | HD-Audio DP-MST Support | ||
3 | ======================= | ||
4 | |||
1 | To support DP MST audio, HD Audio hdmi codec driver introduces virtual pin | 5 | To support DP MST audio, HD Audio hdmi codec driver introduces virtual pin |
2 | and dynamic pcm assignment. | 6 | and dynamic pcm assignment. |
3 | 7 | ||
@@ -44,10 +48,12 @@ Build Jack | |||
44 | ---------- | 48 | ---------- |
45 | 49 | ||
46 | - dyn_pcm_assign | 50 | - dyn_pcm_assign |
47 | Will not use hda_jack but use snd_jack in spec->pcm_rec[pcm_idx].jack directly. | 51 | |
52 | Will not use hda_jack but use snd_jack in spec->pcm_rec[pcm_idx].jack directly. | ||
48 | 53 | ||
49 | - !dyn_pcm_assign | 54 | - !dyn_pcm_assign |
50 | Use hda_jack and assign spec->pcm_rec[pcm_idx].jack = jack->jack statically. | 55 | |
56 | Use hda_jack and assign spec->pcm_rec[pcm_idx].jack = jack->jack statically. | ||
51 | 57 | ||
52 | 58 | ||
53 | Unsolicited Event Enabling | 59 | Unsolicited Event Enabling |
@@ -58,16 +64,20 @@ Enable unsolicited event if !acomp. | |||
58 | Monitor Hotplug Event Handling | 64 | Monitor Hotplug Event Handling |
59 | ------------------------------ | 65 | ------------------------------ |
60 | - acomp | 66 | - acomp |
61 | pin_eld_notify() -> check_presence_and_report() -> hdmi_present_sense() -> | 67 | |
62 | sync_eld_via_acomp(). | 68 | pin_eld_notify() -> check_presence_and_report() -> hdmi_present_sense() -> |
63 | Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for | 69 | sync_eld_via_acomp(). |
64 | both dyn_pcm_assign and !dyn_pcm_assign | 70 | |
71 | Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for | ||
72 | both dyn_pcm_assign and !dyn_pcm_assign | ||
65 | 73 | ||
66 | - !acomp | 74 | - !acomp |
67 | Hdmi_unsol_event() -> hdmi_intrinsic_event() -> check_presence_and_report() -> | 75 | |
68 | hdmi_present_sense() -> hdmi_prepsent_sense_via_verbs() | 76 | hdmi_unsol_event() -> hdmi_intrinsic_event() -> check_presence_and_report() -> |
69 | Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for dyn_pcm_assign. | 77 | hdmi_present_sense() -> hdmi_prepsent_sense_via_verbs() |
70 | Use hda_jack mechanism to handle jack events. | 78 | |
79 | Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for dyn_pcm_assign. | ||
80 | Use hda_jack mechanism to handle jack events. | ||
71 | 81 | ||
72 | 82 | ||
73 | Others to be added later | 83 | Others to be added later |
diff --git a/Documentation/sound/hd-audio/index.rst b/Documentation/sound/hd-audio/index.rst new file mode 100644 index 000000000000..f8a72ffffe66 --- /dev/null +++ b/Documentation/sound/hd-audio/index.rst | |||
@@ -0,0 +1,10 @@ | |||
1 | HD-Audio | ||
2 | ======== | ||
3 | |||
4 | .. toctree:: | ||
5 | :maxdepth: 2 | ||
6 | |||
7 | notes | ||
8 | models | ||
9 | controls | ||
10 | dp-mst | ||
diff --git a/Documentation/sound/hd-audio/models.rst b/Documentation/sound/hd-audio/models.rst new file mode 100644 index 000000000000..5338673c88d9 --- /dev/null +++ b/Documentation/sound/hd-audio/models.rst | |||
@@ -0,0 +1,518 @@ | |||
1 | ============================== | ||
2 | HD-Audio Codec-Specific Models | ||
3 | ============================== | ||
4 | |||
5 | ALC880 | ||
6 | ====== | ||
7 | 3stack | ||
8 | 3-jack in back and a headphone out | ||
9 | 3stack-digout | ||
10 | 3-jack in back, a HP out and a SPDIF out | ||
11 | 5stack | ||
12 | 5-jack in back, 2-jack in front | ||
13 | 5stack-digout | ||
14 | 5-jack in back, 2-jack in front, a SPDIF out | ||
15 | 6stack | ||
16 | 6-jack in back, 2-jack in front | ||
17 | 6stack-digout | ||
18 | 6-jack with a SPDIF out | ||
19 | |||
20 | ALC260 | ||
21 | ====== | ||
22 | gpio1 | ||
23 | Enable GPIO1 | ||
24 | coef | ||
25 | Enable EAPD via COEF table | ||
26 | fujitsu | ||
27 | Quirk for FSC S7020 | ||
28 | fujitsu-jwse | ||
29 | Quirk for FSC S7020 with jack modes and HP mic support | ||
30 | |||
31 | ALC262 | ||
32 | ====== | ||
33 | inv-dmic | ||
34 | Inverted internal mic workaround | ||
35 | |||
36 | ALC267/268 | ||
37 | ========== | ||
38 | inv-dmic | ||
39 | Inverted internal mic workaround | ||
40 | hp-eapd | ||
41 | Disable HP EAPD on NID 0x15 | ||
42 | |||
43 | ALC22x/23x/25x/269/27x/28x/29x (and vendor-specific ALC3xxx models) | ||
44 | =================================================================== | ||
45 | laptop-amic | ||
46 | Laptops with analog-mic input | ||
47 | laptop-dmic | ||
48 | Laptops with digital-mic input | ||
49 | alc269-dmic | ||
50 | Enable ALC269(VA) digital mic workaround | ||
51 | alc271-dmic | ||
52 | Enable ALC271X digital mic workaround | ||
53 | inv-dmic | ||
54 | Inverted internal mic workaround | ||
55 | headset-mic | ||
56 | Indicates a combined headset (headphone+mic) jack | ||
57 | headset-mode | ||
58 | More comprehensive headset support for ALC269 & co | ||
59 | headset-mode-no-hp-mic | ||
60 | Headset mode support without headphone mic | ||
61 | lenovo-dock | ||
62 | Enables docking station I/O for some Lenovos | ||
63 | hp-gpio-led | ||
64 | GPIO LED support on HP laptops | ||
65 | dell-headset-multi | ||
66 | Headset jack, which can also be used as mic-in | ||
67 | dell-headset-dock | ||
68 | Headset jack (without mic-in), and also dock I/O | ||
69 | alc283-dac-wcaps | ||
70 | Fixups for Chromebook with ALC283 | ||
71 | alc283-sense-combo | ||
72 | Combo jack sensing on ALC283 | ||
73 | tpt440-dock | ||
74 | Pin configs for Lenovo Thinkpad Dock support | ||
75 | |||
76 | ALC66x/67x/892 | ||
77 | ============== | ||
78 | mario | ||
79 | Chromebook mario model fixup | ||
80 | asus-mode1 | ||
81 | ASUS | ||
82 | asus-mode2 | ||
83 | ASUS | ||
84 | asus-mode3 | ||
85 | ASUS | ||
86 | asus-mode4 | ||
87 | ASUS | ||
88 | asus-mode5 | ||
89 | ASUS | ||
90 | asus-mode6 | ||
91 | ASUS | ||
92 | asus-mode7 | ||
93 | ASUS | ||
94 | asus-mode8 | ||
95 | ASUS | ||
96 | inv-dmic | ||
97 | Inverted internal mic workaround | ||
98 | dell-headset-multi | ||
99 | Headset jack, which can also be used as mic-in | ||
100 | |||
101 | ALC680 | ||
102 | ====== | ||
103 | N/A | ||
104 | |||
105 | ALC88x/898/1150 | ||
106 | ====================== | ||
107 | acer-aspire-4930g | ||
108 | Acer Aspire 4930G/5930G/6530G/6930G/7730G | ||
109 | acer-aspire-8930g | ||
110 | Acer Aspire 8330G/6935G | ||
111 | acer-aspire | ||
112 | Acer Aspire others | ||
113 | inv-dmic | ||
114 | Inverted internal mic workaround | ||
115 | no-primary-hp | ||
116 | VAIO Z/VGC-LN51JGB workaround (for fixed speaker DAC) | ||
117 | |||
118 | ALC861/660 | ||
119 | ========== | ||
120 | N/A | ||
121 | |||
122 | ALC861VD/660VD | ||
123 | ============== | ||
124 | N/A | ||
125 | |||
126 | CMI9880 | ||
127 | ======= | ||
128 | minimal | ||
129 | 3-jack in back | ||
130 | min_fp | ||
131 | 3-jack in back, 2-jack in front | ||
132 | full | ||
133 | 6-jack in back, 2-jack in front | ||
134 | full_dig | ||
135 | 6-jack in back, 2-jack in front, SPDIF I/O | ||
136 | allout | ||
137 | 5-jack in back, 2-jack in front, SPDIF out | ||
138 | auto | ||
139 | auto-config reading BIOS (default) | ||
140 | |||
141 | AD1882 / AD1882A | ||
142 | ================ | ||
143 | 3stack | ||
144 | 3-stack mode | ||
145 | 3stack-automute | ||
146 | 3-stack with automute front HP (default) | ||
147 | 6stack | ||
148 | 6-stack mode | ||
149 | |||
150 | AD1884A / AD1883 / AD1984A / AD1984B | ||
151 | ==================================== | ||
152 | desktop 3-stack desktop (default) | ||
153 | laptop laptop with HP jack sensing | ||
154 | mobile mobile devices with HP jack sensing | ||
155 | thinkpad Lenovo Thinkpad X300 | ||
156 | touchsmart HP Touchsmart | ||
157 | |||
158 | AD1884 | ||
159 | ====== | ||
160 | N/A | ||
161 | |||
162 | AD1981 | ||
163 | ====== | ||
164 | basic 3-jack (default) | ||
165 | hp HP nx6320 | ||
166 | thinkpad Lenovo Thinkpad T60/X60/Z60 | ||
167 | toshiba Toshiba U205 | ||
168 | |||
169 | AD1983 | ||
170 | ====== | ||
171 | N/A | ||
172 | |||
173 | AD1984 | ||
174 | ====== | ||
175 | basic default configuration | ||
176 | thinkpad Lenovo Thinkpad T61/X61 | ||
177 | dell_desktop Dell T3400 | ||
178 | |||
179 | AD1986A | ||
180 | ======= | ||
181 | 3stack | ||
182 | 3-stack, shared surrounds | ||
183 | laptop | ||
184 | 2-channel only (FSC V2060, Samsung M50) | ||
185 | laptop-imic | ||
186 | 2-channel with built-in mic | ||
187 | eapd | ||
188 | Turn on EAPD constantly | ||
189 | |||
190 | AD1988/AD1988B/AD1989A/AD1989B | ||
191 | ============================== | ||
192 | 6stack | ||
193 | 6-jack | ||
194 | 6stack-dig | ||
195 | ditto with SPDIF | ||
196 | 3stack | ||
197 | 3-jack | ||
198 | 3stack-dig | ||
199 | ditto with SPDIF | ||
200 | laptop | ||
201 | 3-jack with hp-jack automute | ||
202 | laptop-dig | ||
203 | ditto with SPDIF | ||
204 | auto | ||
205 | auto-config reading BIOS (default) | ||
206 | |||
207 | Conexant 5045 | ||
208 | ============= | ||
209 | laptop-hpsense | ||
210 | Laptop with HP sense (old model laptop) | ||
211 | laptop-micsense | ||
212 | Laptop with Mic sense (old model fujitsu) | ||
213 | laptop-hpmicsense | ||
214 | Laptop with HP and Mic senses | ||
215 | benq | ||
216 | Benq R55E | ||
217 | laptop-hp530 | ||
218 | HP 530 laptop | ||
219 | test | ||
220 | for testing/debugging purpose, almost all controls can be | ||
221 | adjusted. Appearing only when compiled with $CONFIG_SND_DEBUG=y | ||
222 | |||
223 | Conexant 5047 | ||
224 | ============= | ||
225 | laptop | ||
226 | Basic Laptop config | ||
227 | laptop-hp | ||
228 | Laptop config for some HP models (subdevice 30A5) | ||
229 | laptop-eapd | ||
230 | Laptop config with EAPD support | ||
231 | test | ||
232 | for testing/debugging purpose, almost all controls can be | ||
233 | adjusted. Appearing only when compiled with $CONFIG_SND_DEBUG=y | ||
234 | |||
235 | Conexant 5051 | ||
236 | ============= | ||
237 | laptop | ||
238 | Basic Laptop config (default) | ||
239 | hp | ||
240 | HP Spartan laptop | ||
241 | hp-dv6736 | ||
242 | HP dv6736 | ||
243 | hp-f700 | ||
244 | HP Compaq Presario F700 | ||
245 | ideapad | ||
246 | Lenovo IdeaPad laptop | ||
247 | toshiba | ||
248 | Toshiba Satellite M300 | ||
249 | |||
250 | Conexant 5066 | ||
251 | ============= | ||
252 | laptop | ||
253 | Basic Laptop config (default) | ||
254 | hp-laptop | ||
255 | HP laptops, e g G60 | ||
256 | asus | ||
257 | Asus K52JU, Lenovo G560 | ||
258 | dell-laptop | ||
259 | Dell laptops | ||
260 | dell-vostro | ||
261 | Dell Vostro | ||
262 | olpc-xo-1_5 | ||
263 | OLPC XO 1.5 | ||
264 | ideapad | ||
265 | Lenovo IdeaPad U150 | ||
266 | thinkpad | ||
267 | Lenovo Thinkpad | ||
268 | |||
269 | STAC9200 | ||
270 | ======== | ||
271 | ref | ||
272 | Reference board | ||
273 | oqo | ||
274 | OQO Model 2 | ||
275 | dell-d21 | ||
276 | Dell (unknown) | ||
277 | dell-d22 | ||
278 | Dell (unknown) | ||
279 | dell-d23 | ||
280 | Dell (unknown) | ||
281 | dell-m21 | ||
282 | Dell Inspiron 630m, Dell Inspiron 640m | ||
283 | dell-m22 | ||
284 | Dell Latitude D620, Dell Latitude D820 | ||
285 | dell-m23 | ||
286 | Dell XPS M1710, Dell Precision M90 | ||
287 | dell-m24 | ||
288 | Dell Latitude 120L | ||
289 | dell-m25 | ||
290 | Dell Inspiron E1505n | ||
291 | dell-m26 | ||
292 | Dell Inspiron 1501 | ||
293 | dell-m27 | ||
294 | Dell Inspiron E1705/9400 | ||
295 | gateway-m4 | ||
296 | Gateway laptops with EAPD control | ||
297 | gateway-m4-2 | ||
298 | Gateway laptops with EAPD control | ||
299 | panasonic | ||
300 | Panasonic CF-74 | ||
301 | auto | ||
302 | BIOS setup (default) | ||
303 | |||
304 | STAC9205/9254 | ||
305 | ============= | ||
306 | ref | ||
307 | Reference board | ||
308 | dell-m42 | ||
309 | Dell (unknown) | ||
310 | dell-m43 | ||
311 | Dell Precision | ||
312 | dell-m44 | ||
313 | Dell Inspiron | ||
314 | eapd | ||
315 | Keep EAPD on (e.g. Gateway T1616) | ||
316 | auto | ||
317 | BIOS setup (default) | ||
318 | |||
319 | STAC9220/9221 | ||
320 | ============= | ||
321 | ref | ||
322 | Reference board | ||
323 | 3stack | ||
324 | D945 3stack | ||
325 | 5stack | ||
326 | D945 5stack + SPDIF | ||
327 | intel-mac-v1 | ||
328 | Intel Mac Type 1 | ||
329 | intel-mac-v2 | ||
330 | Intel Mac Type 2 | ||
331 | intel-mac-v3 | ||
332 | Intel Mac Type 3 | ||
333 | intel-mac-v4 | ||
334 | Intel Mac Type 4 | ||
335 | intel-mac-v5 | ||
336 | Intel Mac Type 5 | ||
337 | intel-mac-auto | ||
338 | Intel Mac (detect type according to subsystem id) | ||
339 | macmini | ||
340 | Intel Mac Mini (equivalent with type 3) | ||
341 | macbook | ||
342 | Intel Mac Book (eq. type 5) | ||
343 | macbook-pro-v1 | ||
344 | Intel Mac Book Pro 1st generation (eq. type 3) | ||
345 | macbook-pro | ||
346 | Intel Mac Book Pro 2nd generation (eq. type 3) | ||
347 | imac-intel | ||
348 | Intel iMac (eq. type 2) | ||
349 | imac-intel-20 | ||
350 | Intel iMac (newer version) (eq. type 3) | ||
351 | ecs202 | ||
352 | ECS/PC chips | ||
353 | dell-d81 | ||
354 | Dell (unknown) | ||
355 | dell-d82 | ||
356 | Dell (unknown) | ||
357 | dell-m81 | ||
358 | Dell (unknown) | ||
359 | dell-m82 | ||
360 | Dell XPS M1210 | ||
361 | auto | ||
362 | BIOS setup (default) | ||
363 | |||
364 | STAC9202/9250/9251 | ||
365 | ================== | ||
366 | ref | ||
367 | Reference board, base config | ||
368 | m1 | ||
369 | Some Gateway MX series laptops (NX560XL) | ||
370 | m1-2 | ||
371 | Some Gateway MX series laptops (MX6453) | ||
372 | m2 | ||
373 | Some Gateway MX series laptops (M255) | ||
374 | m2-2 | ||
375 | Some Gateway MX series laptops | ||
376 | m3 | ||
377 | Some Gateway MX series laptops | ||
378 | m5 | ||
379 | Some Gateway MX series laptops (MP6954) | ||
380 | m6 | ||
381 | Some Gateway NX series laptops | ||
382 | auto | ||
383 | BIOS setup (default) | ||
384 | |||
385 | STAC9227/9228/9229/927x | ||
386 | ======================= | ||
387 | ref | ||
388 | Reference board | ||
389 | ref-no-jd | ||
390 | Reference board without HP/Mic jack detection | ||
391 | 3stack | ||
392 | D965 3stack | ||
393 | 5stack | ||
394 | D965 5stack + SPDIF | ||
395 | 5stack-no-fp | ||
396 | D965 5stack without front panel | ||
397 | dell-3stack | ||
398 | Dell Dimension E520 | ||
399 | dell-bios | ||
400 | Fixes with Dell BIOS setup | ||
401 | dell-bios-amic | ||
402 | Fixes with Dell BIOS setup including analog mic | ||
403 | volknob | ||
404 | Fixes with volume-knob widget 0x24 | ||
405 | auto | ||
406 | BIOS setup (default) | ||
407 | |||
408 | STAC92HD71B* | ||
409 | ============ | ||
410 | ref | ||
411 | Reference board | ||
412 | dell-m4-1 | ||
413 | Dell desktops | ||
414 | dell-m4-2 | ||
415 | Dell desktops | ||
416 | dell-m4-3 | ||
417 | Dell desktops | ||
418 | hp-m4 | ||
419 | HP mini 1000 | ||
420 | hp-dv5 | ||
421 | HP dv series | ||
422 | hp-hdx | ||
423 | HP HDX series | ||
424 | hp-dv4-1222nr | ||
425 | HP dv4-1222nr (with LED support) | ||
426 | auto | ||
427 | BIOS setup (default) | ||
428 | |||
429 | STAC92HD73* | ||
430 | =========== | ||
431 | ref | ||
432 | Reference board | ||
433 | no-jd | ||
434 | BIOS setup but without jack-detection | ||
435 | intel | ||
436 | Intel DG45* mobos | ||
437 | dell-m6-amic | ||
438 | Dell desktops/laptops with analog mics | ||
439 | dell-m6-dmic | ||
440 | Dell desktops/laptops with digital mics | ||
441 | dell-m6 | ||
442 | Dell desktops/laptops with both type of mics | ||
443 | dell-eq | ||
444 | Dell desktops/laptops | ||
445 | alienware | ||
446 | Alienware M17x | ||
447 | auto | ||
448 | BIOS setup (default) | ||
449 | |||
450 | STAC92HD83* | ||
451 | =========== | ||
452 | ref | ||
453 | Reference board | ||
454 | mic-ref | ||
455 | Reference board with power management for ports | ||
456 | dell-s14 | ||
457 | Dell laptop | ||
458 | dell-vostro-3500 | ||
459 | Dell Vostro 3500 laptop | ||
460 | hp-dv7-4000 | ||
461 | HP dv-7 4000 | ||
462 | hp_cNB11_intquad | ||
463 | HP CNB models with 4 speakers | ||
464 | hp-zephyr | ||
465 | HP Zephyr | ||
466 | hp-led | ||
467 | HP with broken BIOS for mute LED | ||
468 | hp-inv-led | ||
469 | HP with broken BIOS for inverted mute LED | ||
470 | hp-mic-led | ||
471 | HP with mic-mute LED | ||
472 | headset-jack | ||
473 | Dell Latitude with a 4-pin headset jack | ||
474 | hp-envy-bass | ||
475 | Pin fixup for HP Envy bass speaker (NID 0x0f) | ||
476 | hp-envy-ts-bass | ||
477 | Pin fixup for HP Envy TS bass speaker (NID 0x10) | ||
478 | hp-bnb13-eq | ||
479 | Hardware equalizer setup for HP laptops | ||
480 | auto | ||
481 | BIOS setup (default) | ||
482 | |||
483 | STAC92HD95 | ||
484 | ========== | ||
485 | hp-led | ||
486 | LED support for HP laptops | ||
487 | hp-bass | ||
488 | Bass HPF setup for HP Spectre 13 | ||
489 | |||
490 | STAC9872 | ||
491 | ======== | ||
492 | vaio | ||
493 | VAIO laptop without SPDIF | ||
494 | auto | ||
495 | BIOS setup (default) | ||
496 | |||
497 | Cirrus Logic CS4206/4207 | ||
498 | ======================== | ||
499 | mbp55 | ||
500 | MacBook Pro 5,5 | ||
501 | imac27 | ||
502 | IMac 27 Inch | ||
503 | auto | ||
504 | BIOS setup (default) | ||
505 | |||
506 | Cirrus Logic CS4208 | ||
507 | =================== | ||
508 | mba6 | ||
509 | MacBook Air 6,1 and 6,2 | ||
510 | gpio0 | ||
511 | Enable GPIO 0 amp | ||
512 | auto | ||
513 | BIOS setup (default) | ||
514 | |||
515 | VIA VT17xx/VT18xx/VT20xx | ||
516 | ======================== | ||
517 | auto | ||
518 | BIOS setup (default) | ||
diff --git a/Documentation/sound/alsa/HD-Audio.txt b/Documentation/sound/hd-audio/notes.rst index d4510ebf2e8c..168d0cfab1ce 100644 --- a/Documentation/sound/alsa/HD-Audio.txt +++ b/Documentation/sound/hd-audio/notes.rst | |||
@@ -1,10 +1,12 @@ | |||
1 | MORE NOTES ON HD-AUDIO DRIVER | ||
2 | ============================= | 1 | ============================= |
3 | Takashi Iwai <tiwai@suse.de> | 2 | More Notes on HD-Audio Driver |
3 | ============================= | ||
4 | 4 | ||
5 | Takashi Iwai <tiwai@suse.de> | ||
5 | 6 | ||
6 | GENERAL | 7 | |
7 | ------- | 8 | General |
9 | ======= | ||
8 | 10 | ||
9 | HD-audio is the new standard on-board audio component on modern PCs | 11 | 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 | 12 | after AC97. Although Linux has been supporting HD-audio since long |
@@ -40,28 +42,28 @@ If you are interested in the deep debugging of HD-audio, read the | |||
40 | HD-audio specification at first. The specification is found on | 42 | HD-audio specification at first. The specification is found on |
41 | Intel's web page, for example: | 43 | Intel's web page, for example: |
42 | 44 | ||
43 | - http://www.intel.com/standards/hdaudio/ | 45 | * http://www.intel.com/standards/hdaudio/ |
44 | 46 | ||
45 | 47 | ||
46 | HD-AUDIO CONTROLLER | 48 | HD-Audio Controller |
47 | ------------------- | 49 | =================== |
48 | 50 | ||
49 | DMA-Position Problem | 51 | DMA-Position Problem |
50 | ~~~~~~~~~~~~~~~~~~~~ | 52 | -------------------- |
51 | The most common problem of the controller is the inaccurate DMA | 53 | The most common problem of the controller is the inaccurate DMA |
52 | pointer reporting. The DMA pointer for playback and capture can be | 54 | pointer reporting. The DMA pointer for playback and capture can be |
53 | read in two ways, either via a LPIB register or via a position-buffer | 55 | read in two ways, either via a LPIB register or via a position-buffer |
54 | map. As default the driver tries to read from the io-mapped | 56 | map. As default the driver tries to read from the io-mapped |
55 | position-buffer, and falls back to LPIB if the position-buffer appears | 57 | position-buffer, and falls back to LPIB if the position-buffer appears |
56 | dead. However, this detection isn't perfect on some devices. In such | 58 | dead. However, this detection isn't perfect on some devices. In such |
57 | a case, you can change the default method via `position_fix` option. | 59 | a case, you can change the default method via ``position_fix`` option. |
58 | 60 | ||
59 | `position_fix=1` means to use LPIB method explicitly. | 61 | ``position_fix=1`` means to use LPIB method explicitly. |
60 | `position_fix=2` means to use the position-buffer. | 62 | ``position_fix=2`` means to use the position-buffer. |
61 | `position_fix=3` means to use a combination of both methods, needed | 63 | ``position_fix=3`` means to use a combination of both methods, needed |
62 | for some VIA controllers. The capture stream position is corrected | 64 | for some VIA controllers. The capture stream position is corrected |
63 | by comparing both LPIB and position-buffer values. | 65 | by comparing both LPIB and position-buffer values. |
64 | `position_fix=4` is another combination available for all controllers, | 66 | ``position_fix=4`` is another combination available for all controllers, |
65 | and uses LPIB for the playback and the position-buffer for the capture | 67 | and uses LPIB for the playback and the position-buffer for the capture |
66 | streams. | 68 | streams. |
67 | 0 is the default value for all other | 69 | 0 is the default value for all other |
@@ -74,9 +76,9 @@ the wake-up timing. It wakes up a few samples before actually | |||
74 | processing the data on the buffer. This caused a lot of problems, for | 76 | processing the data on the buffer. This caused a lot of problems, for |
75 | example, with ALSA dmix or JACK. Since 2.6.27 kernel, the driver puts | 77 | example, with ALSA dmix or JACK. Since 2.6.27 kernel, the driver puts |
76 | an artificial delay to the wake up timing. This delay is controlled | 78 | an artificial delay to the wake up timing. This delay is controlled |
77 | via `bdl_pos_adj` option. | 79 | via ``bdl_pos_adj`` option. |
78 | 80 | ||
79 | When `bdl_pos_adj` is a negative value (as default), it's assigned to | 81 | When ``bdl_pos_adj`` is a negative value (as default), it's assigned to |
80 | an appropriate value depending on the controller chip. For Intel | 82 | an appropriate value depending on the controller chip. For Intel |
81 | chips, it'd be 1 while it'd be 32 for others. Usually this works. | 83 | chips, it'd be 1 while it'd be 32 for others. Usually this works. |
82 | Only in case it doesn't work and you get warning messages, you should | 84 | Only in case it doesn't work and you get warning messages, you should |
@@ -84,19 +86,19 @@ change this parameter to other values. | |||
84 | 86 | ||
85 | 87 | ||
86 | Codec-Probing Problem | 88 | Codec-Probing Problem |
87 | ~~~~~~~~~~~~~~~~~~~~~ | 89 | --------------------- |
88 | A less often but a more severe problem is the codec probing. When | 90 | A less often but a more severe problem is the codec probing. When |
89 | BIOS reports the available codec slots wrongly, the driver gets | 91 | BIOS reports the available codec slots wrongly, the driver gets |
90 | confused and tries to access the non-existing codec slot. This often | 92 | confused and tries to access the non-existing codec slot. This often |
91 | results in the total screw-up, and destructs the further communication | 93 | results in the total screw-up, and destructs the further communication |
92 | with the codec chips. The symptom appears usually as error messages | 94 | with the codec chips. The symptom appears usually as error messages |
93 | like: | 95 | like: |
94 | ------------------------------------------------------------------------ | 96 | :: |
95 | hda_intel: azx_get_response timeout, switching to polling mode: | 97 | |
96 | last cmd=0x12345678 | 98 | hda_intel: azx_get_response timeout, switching to polling mode: |
97 | hda_intel: azx_get_response timeout, switching to single_cmd mode: | 99 | last cmd=0x12345678 |
98 | last cmd=0x12345678 | 100 | hda_intel: azx_get_response timeout, switching to single_cmd mode: |
99 | ------------------------------------------------------------------------ | 101 | last cmd=0x12345678 |
100 | 102 | ||
101 | The first line is a warning, and this is usually relatively harmless. | 103 | The first line is a warning, and this is usually relatively harmless. |
102 | It means that the codec response isn't notified via an IRQ. The | 104 | It means that the codec response isn't notified via an IRQ. The |
@@ -108,24 +110,24 @@ it means that something is really wrong. Most likely you are | |||
108 | accessing a non-existing codec slot. | 110 | accessing a non-existing codec slot. |
109 | 111 | ||
110 | Thus, if the second error message appears, try to narrow the probed | 112 | Thus, if the second error message appears, try to narrow the probed |
111 | codec slots via `probe_mask` option. It's a bitmask, and each bit | 113 | codec slots via ``probe_mask`` option. It's a bitmask, and each bit |
112 | corresponds to the codec slot. For example, to probe only the first | 114 | corresponds to the codec slot. For example, to probe only the first |
113 | slot, pass `probe_mask=1`. For the first and the third slots, pass | 115 | slot, pass ``probe_mask=1``. For the first and the third slots, pass |
114 | `probe_mask=5` (where 5 = 1 | 4), and so on. | 116 | ``probe_mask=5`` (where 5 = 1 | 4), and so on. |
115 | 117 | ||
116 | Since 2.6.29 kernel, the driver has a more robust probing method, so | 118 | Since 2.6.29 kernel, the driver has a more robust probing method, so |
117 | this error might happen rarely, though. | 119 | this error might happen rarely, though. |
118 | 120 | ||
119 | On a machine with a broken BIOS, sometimes you need to force the | 121 | On a machine with a broken BIOS, sometimes you need to force the |
120 | driver to probe the codec slots the hardware doesn't report for use. | 122 | driver to probe the codec slots the hardware doesn't report for use. |
121 | In such a case, turn the bit 8 (0x100) of `probe_mask` option on. | 123 | In such a case, turn the bit 8 (0x100) of ``probe_mask`` option on. |
122 | Then the rest 8 bits are passed as the codec slots to probe | 124 | Then the rest 8 bits are passed as the codec slots to probe |
123 | unconditionally. For example, `probe_mask=0x103` will force to probe | 125 | unconditionally. For example, ``probe_mask=0x103`` will force to probe |
124 | the codec slots 0 and 1 no matter what the hardware reports. | 126 | the codec slots 0 and 1 no matter what the hardware reports. |
125 | 127 | ||
126 | 128 | ||
127 | Interrupt Handling | 129 | Interrupt Handling |
128 | ~~~~~~~~~~~~~~~~~~ | 130 | ------------------ |
129 | HD-audio driver uses MSI as default (if available) since 2.6.33 | 131 | HD-audio driver uses MSI as default (if available) since 2.6.33 |
130 | kernel as MSI works better on some machines, and in general, it's | 132 | kernel as MSI works better on some machines, and in general, it's |
131 | better for performance. However, Nvidia controllers showed bad | 133 | better for performance. However, Nvidia controllers showed bad |
@@ -134,17 +136,17 @@ thus we disabled MSI for them. | |||
134 | 136 | ||
135 | There seem also still other devices that don't work with MSI. If you | 137 | There seem also still other devices that don't work with MSI. If you |
136 | see a regression wrt the sound quality (stuttering, etc) or a lock-up | 138 | see a regression wrt the sound quality (stuttering, etc) or a lock-up |
137 | in the recent kernel, try to pass `enable_msi=0` option to disable | 139 | in the recent kernel, try to pass ``enable_msi=0`` option to disable |
138 | MSI. If it works, you can add the known bad device to the blacklist | 140 | MSI. If it works, you can add the known bad device to the blacklist |
139 | defined in hda_intel.c. In such a case, please report and give the | 141 | defined in hda_intel.c. In such a case, please report and give the |
140 | patch back to the upstream developer. | 142 | patch back to the upstream developer. |
141 | 143 | ||
142 | 144 | ||
143 | HD-AUDIO CODEC | 145 | HD-Audio Codec |
144 | -------------- | 146 | ============== |
145 | 147 | ||
146 | Model Option | 148 | Model Option |
147 | ~~~~~~~~~~~~ | 149 | ------------ |
148 | The most common problem regarding the HD-audio driver is the | 150 | The most common problem regarding the HD-audio driver is the |
149 | unsupported codec features or the mismatched device configuration. | 151 | unsupported codec features or the mismatched device configuration. |
150 | Most of codec-specific code has several preset models, either to | 152 | Most of codec-specific code has several preset models, either to |
@@ -153,13 +155,15 @@ override the BIOS setup or to provide more comprehensive features. | |||
153 | The driver checks PCI SSID and looks through the static configuration | 155 | The driver checks PCI SSID and looks through the static configuration |
154 | table until any matching entry is found. If you have a new machine, | 156 | table until any matching entry is found. If you have a new machine, |
155 | you may see a message like below: | 157 | you may see a message like below: |
156 | ------------------------------------------------------------------------ | 158 | :: |
159 | |||
157 | hda_codec: ALC880: BIOS auto-probing. | 160 | hda_codec: ALC880: BIOS auto-probing. |
158 | ------------------------------------------------------------------------ | 161 | |
159 | Meanwhile, in the earlier versions, you would see a message like: | 162 | Meanwhile, in the earlier versions, you would see a message like: |
160 | ------------------------------------------------------------------------ | 163 | :: |
164 | |||
161 | hda_codec: Unknown model for ALC880, trying auto-probe from BIOS... | 165 | hda_codec: Unknown model for ALC880, trying auto-probe from BIOS... |
162 | ------------------------------------------------------------------------ | 166 | |
163 | Even if you see such a message, DON'T PANIC. Take a deep breath and | 167 | Even if you see such a message, DON'T PANIC. Take a deep breath and |
164 | keep your towel. First of all, it's an informational message, no | 168 | keep your towel. First of all, it's an informational message, no |
165 | warning, no error. This means that the PCI SSID of your device isn't | 169 | warning, no error. This means that the PCI SSID of your device isn't |
@@ -182,32 +186,33 @@ model is found in the white-list, the driver assumes the static | |||
182 | configuration of that preset with the correct pin setup, etc. | 186 | configuration of that preset with the correct pin setup, etc. |
183 | Thus, if you have a newer machine with a slightly different PCI SSID | 187 | Thus, if you have a newer machine with a slightly different PCI SSID |
184 | (or codec SSID) from the existing one, you may have a good chance to | 188 | (or codec SSID) from the existing one, you may have a good chance to |
185 | re-use the same model. You can pass the `model` option to specify the | 189 | re-use the same model. You can pass the ``model`` option to specify the |
186 | preset model instead of PCI (and codec-) SSID look-up. | 190 | preset model instead of PCI (and codec-) SSID look-up. |
187 | 191 | ||
188 | What `model` option values are available depends on the codec chip. | 192 | What ``model`` option values are available depends on the codec chip. |
189 | Check your codec chip from the codec proc file (see "Codec Proc-File" | 193 | Check your codec chip from the codec proc file (see "Codec Proc-File" |
190 | section below). It will show the vendor/product name of your codec | 194 | section below). It will show the vendor/product name of your codec |
191 | chip. Then, see Documentation/sound/alsa/HD-Audio-Models.txt file, | 195 | chip. Then, see Documentation/sound/HD-Audio-Models.rst file, |
192 | the section of HD-audio driver. You can find a list of codecs | 196 | the section of HD-audio driver. You can find a list of codecs |
193 | and `model` options belonging to each codec. For example, for Realtek | 197 | and ``model`` options belonging to each codec. For example, for Realtek |
194 | ALC262 codec chip, pass `model=ultra` for devices that are compatible | 198 | ALC262 codec chip, pass ``model=ultra`` for devices that are compatible |
195 | with Samsung Q1 Ultra. | 199 | with Samsung Q1 Ultra. |
196 | 200 | ||
197 | Thus, the first thing you can do for any brand-new, unsupported and | 201 | Thus, the first thing you can do for any brand-new, unsupported and |
198 | non-working HD-audio hardware is to check HD-audio codec and several | 202 | non-working HD-audio hardware is to check HD-audio codec and several |
199 | different `model` option values. If you have any luck, some of them | 203 | different ``model`` option values. If you have any luck, some of them |
200 | might suit with your device well. | 204 | might suit with your device well. |
201 | 205 | ||
202 | There are a few special model option values: | 206 | There are a few special model option values: |
203 | - when 'nofixup' is passed, the device-specific fixups in the codec | 207 | |
208 | * when 'nofixup' is passed, the device-specific fixups in the codec | ||
204 | parser are skipped. | 209 | parser are skipped. |
205 | - when `generic` is passed, the codec-specific parser is skipped and | 210 | * when ``generic`` is passed, the codec-specific parser is skipped and |
206 | only the generic parser is used. | 211 | only the generic parser is used. |
207 | 212 | ||
208 | 213 | ||
209 | Speaker and Headphone Output | 214 | Speaker and Headphone Output |
210 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | 215 | ---------------------------- |
211 | One of the most frequent (and obvious) bugs with HD-audio is the | 216 | One of the most frequent (and obvious) bugs with HD-audio is the |
212 | silent output from either or both of a built-in speaker and a | 217 | silent output from either or both of a built-in speaker and a |
213 | headphone jack. In general, you should try a headphone output at | 218 | headphone jack. In general, you should try a headphone output at |
@@ -236,23 +241,23 @@ report. See the bug report section for details. | |||
236 | If you are masochistic enough to debug the driver problem, note the | 241 | If you are masochistic enough to debug the driver problem, note the |
237 | following: | 242 | following: |
238 | 243 | ||
239 | - The speaker (and the headphone, too) output often requires the | 244 | * The speaker (and the headphone, too) output often requires the |
240 | external amplifier. This can be set usually via EAPD verb or a | 245 | external amplifier. This can be set usually via EAPD verb or a |
241 | certain GPIO. If the codec pin supports EAPD, you have a better | 246 | certain GPIO. If the codec pin supports EAPD, you have a better |
242 | chance via SET_EAPD_BTL verb (0x70c). On others, GPIO pin (mostly | 247 | chance via SET_EAPD_BTL verb (0x70c). On others, GPIO pin (mostly |
243 | it's either GPIO0 or GPIO1) may turn on/off EAPD. | 248 | it's either GPIO0 or GPIO1) may turn on/off EAPD. |
244 | - Some Realtek codecs require special vendor-specific coefficients to | 249 | * Some Realtek codecs require special vendor-specific coefficients to |
245 | turn on the amplifier. See patch_realtek.c. | 250 | turn on the amplifier. See patch_realtek.c. |
246 | - IDT codecs may have extra power-enable/disable controls on each | 251 | * IDT codecs may have extra power-enable/disable controls on each |
247 | analog pin. See patch_sigmatel.c. | 252 | analog pin. See patch_sigmatel.c. |
248 | - Very rare but some devices don't accept the pin-detection verb until | 253 | * Very rare but some devices don't accept the pin-detection verb until |
249 | triggered. Issuing GET_PIN_SENSE verb (0xf09) may result in the | 254 | triggered. Issuing GET_PIN_SENSE verb (0xf09) may result in the |
250 | codec-communication stall. Some examples are found in | 255 | codec-communication stall. Some examples are found in |
251 | patch_realtek.c. | 256 | patch_realtek.c. |
252 | 257 | ||
253 | 258 | ||
254 | Capture Problems | 259 | Capture Problems |
255 | ~~~~~~~~~~~~~~~~ | 260 | ---------------- |
256 | The capture problems are often because of missing setups of mixers. | 261 | The capture problems are often because of missing setups of mixers. |
257 | Thus, before submitting a bug report, make sure that you set up the | 262 | Thus, before submitting a bug report, make sure that you set up the |
258 | mixer correctly. For example, both "Capture Volume" and "Capture | 263 | mixer correctly. For example, both "Capture Volume" and "Capture |
@@ -284,7 +289,7 @@ submit the improvement patch to the author. | |||
284 | 289 | ||
285 | 290 | ||
286 | Direct Debugging | 291 | Direct Debugging |
287 | ~~~~~~~~~~~~~~~~ | 292 | ---------------- |
288 | If no model option gives you a better result, and you are a tough guy | 293 | If no model option gives you a better result, and you are a tough guy |
289 | to fight against evil, try debugging via hitting the raw HD-audio | 294 | to fight against evil, try debugging via hitting the raw HD-audio |
290 | codec verbs to the device. Some tools are available: hda-emu and | 295 | codec verbs to the device. Some tools are available: hda-emu and |
@@ -293,45 +298,45 @@ below. You'd need to enable hwdep for using these tools. See "Kernel | |||
293 | Configuration" section. | 298 | Configuration" section. |
294 | 299 | ||
295 | 300 | ||
296 | OTHER ISSUES | 301 | Other Issues |
297 | ------------ | 302 | ============ |
298 | 303 | ||
299 | Kernel Configuration | 304 | Kernel Configuration |
300 | ~~~~~~~~~~~~~~~~~~~~ | 305 | -------------------- |
301 | In general, I recommend you to enable the sound debug option, | 306 | In general, I recommend you to enable the sound debug option, |
302 | `CONFIG_SND_DEBUG=y`, no matter whether you are debugging or not. | 307 | ``CONFIG_SND_DEBUG=y``, no matter whether you are debugging or not. |
303 | This enables snd_printd() macro and others, and you'll get additional | 308 | This enables snd_printd() macro and others, and you'll get additional |
304 | kernel messages at probing. | 309 | kernel messages at probing. |
305 | 310 | ||
306 | In addition, you can enable `CONFIG_SND_DEBUG_VERBOSE=y`. But this | 311 | In addition, you can enable ``CONFIG_SND_DEBUG_VERBOSE=y``. But this |
307 | will give you far more messages. Thus turn this on only when you are | 312 | will give you far more messages. Thus turn this on only when you are |
308 | sure to want it. | 313 | sure to want it. |
309 | 314 | ||
310 | Don't forget to turn on the appropriate `CONFIG_SND_HDA_CODEC_*` | 315 | Don't forget to turn on the appropriate ``CONFIG_SND_HDA_CODEC_*`` |
311 | options. Note that each of them corresponds to the codec chip, not | 316 | options. Note that each of them corresponds to the codec chip, not |
312 | the controller chip. Thus, even if lspci shows the Nvidia controller, | 317 | the controller chip. Thus, even if lspci shows the Nvidia controller, |
313 | you may need to choose the option for other vendors. If you are | 318 | you may need to choose the option for other vendors. If you are |
314 | unsure, just select all yes. | 319 | unsure, just select all yes. |
315 | 320 | ||
316 | `CONFIG_SND_HDA_HWDEP` is a useful option for debugging the driver. | 321 | ``CONFIG_SND_HDA_HWDEP`` is a useful option for debugging the driver. |
317 | When this is enabled, the driver creates hardware-dependent devices | 322 | When this is enabled, the driver creates hardware-dependent devices |
318 | (one per each codec), and you have a raw access to the device via | 323 | (one per each codec), and you have a raw access to the device via |
319 | these device files. For example, `hwC0D2` will be created for the | 324 | these device files. For example, ``hwC0D2`` will be created for the |
320 | codec slot #2 of the first card (#0). For debug-tools such as | 325 | codec slot #2 of the first card (#0). For debug-tools such as |
321 | hda-verb and hda-analyzer, the hwdep device has to be enabled. | 326 | hda-verb and hda-analyzer, the hwdep device has to be enabled. |
322 | Thus, it'd be better to turn this on always. | 327 | Thus, it'd be better to turn this on always. |
323 | 328 | ||
324 | `CONFIG_SND_HDA_RECONFIG` is a new option, and this depends on the | 329 | ``CONFIG_SND_HDA_RECONFIG`` is a new option, and this depends on the |
325 | hwdep option above. When enabled, you'll have some sysfs files under | 330 | hwdep option above. When enabled, you'll have some sysfs files under |
326 | the corresponding hwdep directory. See "HD-audio reconfiguration" | 331 | the corresponding hwdep directory. See "HD-audio reconfiguration" |
327 | section below. | 332 | section below. |
328 | 333 | ||
329 | `CONFIG_SND_HDA_POWER_SAVE` option enables the power-saving feature. | 334 | ``CONFIG_SND_HDA_POWER_SAVE`` option enables the power-saving feature. |
330 | See "Power-saving" section below. | 335 | See "Power-saving" section below. |
331 | 336 | ||
332 | 337 | ||
333 | Codec Proc-File | 338 | Codec Proc-File |
334 | ~~~~~~~~~~~~~~~ | 339 | --------------- |
335 | The codec proc-file is a treasure-chest for debugging HD-audio. | 340 | The codec proc-file is a treasure-chest for debugging HD-audio. |
336 | It shows most of useful information of each codec widget. | 341 | It shows most of useful information of each codec widget. |
337 | 342 | ||
@@ -351,161 +356,178 @@ will appear as "Realtek ID 0262", instead of "Realtek ALC262". | |||
351 | 356 | ||
352 | 357 | ||
353 | HD-Audio Reconfiguration | 358 | HD-Audio Reconfiguration |
354 | ~~~~~~~~~~~~~~~~~~~~~~~~ | 359 | ------------------------ |
355 | This is an experimental feature to allow you re-configure the HD-audio | 360 | This is an experimental feature to allow you re-configure the HD-audio |
356 | codec dynamically without reloading the driver. The following sysfs | 361 | codec dynamically without reloading the driver. The following sysfs |
357 | files are available under each codec-hwdep device directory (e.g. | 362 | files are available under each codec-hwdep device directory (e.g. |
358 | /sys/class/sound/hwC0D0): | 363 | /sys/class/sound/hwC0D0): |
359 | 364 | ||
360 | vendor_id:: | 365 | vendor_id |
361 | Shows the 32bit codec vendor-id hex number. You can change the | 366 | Shows the 32bit codec vendor-id hex number. You can change the |
362 | vendor-id value by writing to this file. | 367 | vendor-id value by writing to this file. |
363 | subsystem_id:: | 368 | subsystem_id |
364 | Shows the 32bit codec subsystem-id hex number. You can change the | 369 | Shows the 32bit codec subsystem-id hex number. You can change the |
365 | subsystem-id value by writing to this file. | 370 | subsystem-id value by writing to this file. |
366 | revision_id:: | 371 | revision_id |
367 | Shows the 32bit codec revision-id hex number. You can change the | 372 | Shows the 32bit codec revision-id hex number. You can change the |
368 | revision-id value by writing to this file. | 373 | revision-id value by writing to this file. |
369 | afg:: | 374 | afg |
370 | Shows the AFG ID. This is read-only. | 375 | Shows the AFG ID. This is read-only. |
371 | mfg:: | 376 | mfg |
372 | Shows the MFG ID. This is read-only. | 377 | Shows the MFG ID. This is read-only. |
373 | name:: | 378 | name |
374 | Shows the codec name string. Can be changed by writing to this | 379 | Shows the codec name string. Can be changed by writing to this |
375 | file. | 380 | file. |
376 | modelname:: | 381 | modelname |
377 | Shows the currently set `model` option. Can be changed by writing | 382 | Shows the currently set ``model`` option. Can be changed by writing |
378 | to this file. | 383 | to this file. |
379 | init_verbs:: | 384 | init_verbs |
380 | The extra verbs to execute at initialization. You can add a verb by | 385 | The extra verbs to execute at initialization. You can add a verb by |
381 | writing to this file. Pass three numbers: nid, verb and parameter | 386 | writing to this file. Pass three numbers: nid, verb and parameter |
382 | (separated with a space). | 387 | (separated with a space). |
383 | hints:: | 388 | hints |
384 | Shows / stores hint strings for codec parsers for any use. | 389 | Shows / stores hint strings for codec parsers for any use. |
385 | Its format is `key = value`. For example, passing `jack_detect = no` | 390 | Its format is ``key = value``. For example, passing ``jack_detect = no`` |
386 | will disable the jack detection of the machine completely. | 391 | will disable the jack detection of the machine completely. |
387 | init_pin_configs:: | 392 | init_pin_configs |
388 | Shows the initial pin default config values set by BIOS. | 393 | Shows the initial pin default config values set by BIOS. |
389 | driver_pin_configs:: | 394 | driver_pin_configs |
390 | Shows the pin default values set by the codec parser explicitly. | 395 | Shows the pin default values set by the codec parser explicitly. |
391 | This doesn't show all pin values but only the changed values by | 396 | This doesn't show all pin values but only the changed values by |
392 | the parser. That is, if the parser doesn't change the pin default | 397 | the parser. That is, if the parser doesn't change the pin default |
393 | config values by itself, this will contain nothing. | 398 | config values by itself, this will contain nothing. |
394 | user_pin_configs:: | 399 | user_pin_configs |
395 | Shows the pin default config values to override the BIOS setup. | 400 | Shows the pin default config values to override the BIOS setup. |
396 | Writing this (with two numbers, NID and value) appends the new | 401 | Writing this (with two numbers, NID and value) appends the new |
397 | value. The given will be used instead of the initial BIOS value at | 402 | value. The given will be used instead of the initial BIOS value at |
398 | the next reconfiguration time. Note that this config will override | 403 | the next reconfiguration time. Note that this config will override |
399 | even the driver pin configs, too. | 404 | even the driver pin configs, too. |
400 | reconfig:: | 405 | reconfig |
401 | Triggers the codec re-configuration. When any value is written to | 406 | Triggers the codec re-configuration. When any value is written to |
402 | this file, the driver re-initialize and parses the codec tree | 407 | this file, the driver re-initialize and parses the codec tree |
403 | again. All the changes done by the sysfs entries above are taken | 408 | again. All the changes done by the sysfs entries above are taken |
404 | into account. | 409 | into account. |
405 | clear:: | 410 | clear |
406 | Resets the codec, removes the mixer elements and PCM stuff of the | 411 | Resets the codec, removes the mixer elements and PCM stuff of the |
407 | specified codec, and clear all init verbs and hints. | 412 | specified codec, and clear all init verbs and hints. |
408 | 413 | ||
409 | For example, when you want to change the pin default configuration | 414 | For example, when you want to change the pin default configuration |
410 | value of the pin widget 0x14 to 0x9993013f, and let the driver | 415 | value of the pin widget 0x14 to 0x9993013f, and let the driver |
411 | re-configure based on that state, run like below: | 416 | re-configure based on that state, run like below: |
412 | ------------------------------------------------------------------------ | 417 | :: |
413 | # echo 0x14 0x9993013f > /sys/class/sound/hwC0D0/user_pin_configs | 418 | |
414 | # echo 1 > /sys/class/sound/hwC0D0/reconfig | 419 | # echo 0x14 0x9993013f > /sys/class/sound/hwC0D0/user_pin_configs |
415 | ------------------------------------------------------------------------ | 420 | # echo 1 > /sys/class/sound/hwC0D0/reconfig |
416 | 421 | ||
417 | 422 | ||
418 | Hint Strings | 423 | Hint Strings |
419 | ~~~~~~~~~~~~ | 424 | ------------ |
420 | The codec parser have several switches and adjustment knobs for | 425 | The codec parser have several switches and adjustment knobs for |
421 | matching better with the actual codec or device behavior. Many of | 426 | matching better with the actual codec or device behavior. Many of |
422 | them can be adjusted dynamically via "hints" strings as mentioned in | 427 | them can be adjusted dynamically via "hints" strings as mentioned in |
423 | the section above. For example, by passing `jack_detect = no` string | 428 | the section above. For example, by passing ``jack_detect = no`` string |
424 | via sysfs or a patch file, you can disable the jack detection, thus | 429 | via sysfs or a patch file, you can disable the jack detection, thus |
425 | the codec parser will skip the features like auto-mute or mic | 430 | the codec parser will skip the features like auto-mute or mic |
426 | auto-switch. As a boolean value, either `yes`, `no`, `true`, `false`, | 431 | auto-switch. As a boolean value, either ``yes``, ``no``, ``true``, ``false``, |
427 | `1` or `0` can be passed. | 432 | ``1`` or ``0`` can be passed. |
428 | 433 | ||
429 | The generic parser supports the following hints: | 434 | The generic parser supports the following hints: |
430 | 435 | ||
431 | - jack_detect (bool): specify whether the jack detection is available | 436 | jack_detect (bool) |
432 | at all on this machine; default true | 437 | specify whether the jack detection is available at all on this |
433 | - inv_jack_detect (bool): indicates that the jack detection logic is | 438 | machine; default true |
434 | inverted | 439 | inv_jack_detect (bool) |
435 | - trigger_sense (bool): indicates that the jack detection needs the | 440 | indicates that the jack detection logic is inverted |
436 | explicit call of AC_VERB_SET_PIN_SENSE verb | 441 | trigger_sense (bool) |
437 | - inv_eapd (bool): indicates that the EAPD is implemented in the | 442 | indicates that the jack detection needs the explicit call of |
438 | inverted logic | 443 | AC_VERB_SET_PIN_SENSE verb |
439 | - pcm_format_first (bool): sets the PCM format before the stream tag | 444 | inv_eapd (bool) |
440 | and channel ID | 445 | indicates that the EAPD is implemented in the inverted logic |
441 | - sticky_stream (bool): keep the PCM format, stream tag and ID as long | 446 | pcm_format_first (bool) |
442 | as possible; default true | 447 | sets the PCM format before the stream tag and channel ID |
443 | - spdif_status_reset (bool): reset the SPDIF status bits at each time | 448 | sticky_stream (bool) |
444 | the SPDIF stream is set up | 449 | keep the PCM format, stream tag and ID as long as possible; |
445 | - pin_amp_workaround (bool): the output pin may have multiple amp | 450 | default true |
446 | values | 451 | spdif_status_reset (bool) |
447 | - single_adc_amp (bool): ADCs can have only single input amps | 452 | reset the SPDIF status bits at each time the SPDIF stream is set |
448 | - auto_mute (bool): enable/disable the headphone auto-mute feature; | 453 | up |
449 | default true | 454 | pin_amp_workaround (bool) |
450 | - auto_mic (bool): enable/disable the mic auto-switch feature; default | 455 | the output pin may have multiple amp values |
451 | true | 456 | single_adc_amp (bool) |
452 | - line_in_auto_switch (bool): enable/disable the line-in auto-switch | 457 | ADCs can have only single input amps |
453 | feature; default false | 458 | auto_mute (bool) |
454 | - need_dac_fix (bool): limits the DACs depending on the channel count | 459 | enable/disable the headphone auto-mute feature; default true |
455 | - primary_hp (bool): probe headphone jacks as the primary outputs; | 460 | auto_mic (bool) |
456 | default true | 461 | enable/disable the mic auto-switch feature; default true |
457 | - multi_io (bool): try probing multi-I/O config (e.g. shared | 462 | line_in_auto_switch (bool) |
458 | line-in/surround, mic/clfe jacks) | 463 | enable/disable the line-in auto-switch feature; default false |
459 | - multi_cap_vol (bool): provide multiple capture volumes | 464 | need_dac_fix (bool) |
460 | - inv_dmic_split (bool): provide split internal mic volume/switch for | 465 | limits the DACs depending on the channel count |
461 | phase-inverted digital mics | 466 | primary_hp (bool) |
462 | - indep_hp (bool): provide the independent headphone PCM stream and | 467 | probe headphone jacks as the primary outputs; default true |
463 | the corresponding mixer control, if available | 468 | multi_io (bool) |
464 | - add_stereo_mix_input (bool): add the stereo mix (analog-loopback | 469 | try probing multi-I/O config (e.g. shared line-in/surround, |
465 | mix) to the input mux if available | 470 | mic/clfe jacks) |
466 | - add_jack_modes (bool): add "xxx Jack Mode" enum controls to each | 471 | multi_cap_vol (bool) |
467 | I/O jack for allowing to change the headphone amp and mic bias VREF | 472 | provide multiple capture volumes |
468 | capabilities | 473 | inv_dmic_split (bool) |
469 | - power_save_node (bool): advanced power management for each widget, | 474 | provide split internal mic volume/switch for phase-inverted |
470 | controlling the power sate (D0/D3) of each widget node depending on | 475 | digital mics |
471 | the actual pin and stream states | 476 | indep_hp (bool) |
472 | - power_down_unused (bool): power down the unused widgets, a subset of | 477 | provide the independent headphone PCM stream and the corresponding |
473 | power_save_node, and will be dropped in future | 478 | mixer control, if available |
474 | - add_hp_mic (bool): add the headphone to capture source if possible | 479 | add_stereo_mix_input (bool) |
475 | - hp_mic_detect (bool): enable/disable the hp/mic shared input for a | 480 | add the stereo mix (analog-loopback mix) to the input mux if |
476 | single built-in mic case; default true | 481 | available |
477 | - mixer_nid (int): specifies the widget NID of the analog-loopback | 482 | add_jack_modes (bool) |
478 | mixer | 483 | add "xxx Jack Mode" enum controls to each I/O jack for allowing to |
484 | change the headphone amp and mic bias VREF capabilities | ||
485 | power_save_node (bool) | ||
486 | advanced power management for each widget, controlling the power | ||
487 | sate (D0/D3) of each widget node depending on the actual pin and | ||
488 | stream states | ||
489 | power_down_unused (bool) | ||
490 | power down the unused widgets, a subset of power_save_node, and | ||
491 | will be dropped in future | ||
492 | add_hp_mic (bool) | ||
493 | add the headphone to capture source if possible | ||
494 | hp_mic_detect (bool) | ||
495 | enable/disable the hp/mic shared input for a single built-in mic | ||
496 | case; default true | ||
497 | mixer_nid (int) | ||
498 | specifies the widget NID of the analog-loopback mixer | ||
479 | 499 | ||
480 | 500 | ||
481 | Early Patching | 501 | Early Patching |
482 | ~~~~~~~~~~~~~~ | 502 | -------------- |
483 | When CONFIG_SND_HDA_PATCH_LOADER=y is set, you can pass a "patch" as a | 503 | When ``CONFIG_SND_HDA_PATCH_LOADER=y`` is set, you can pass a "patch" |
484 | firmware file for modifying the HD-audio setup before initializing the | 504 | as a firmware file for modifying the HD-audio setup before |
485 | codec. This can work basically like the reconfiguration via sysfs in | 505 | initializing the codec. This can work basically like the |
486 | the above, but it does it before the first codec configuration. | 506 | reconfiguration via sysfs in the above, but it does it before the |
507 | first codec configuration. | ||
487 | 508 | ||
488 | A patch file is a plain text file which looks like below: | 509 | A patch file is a plain text file which looks like below: |
489 | 510 | ||
490 | ------------------------------------------------------------------------ | 511 | :: |
491 | [codec] | 512 | |
492 | 0x12345678 0xabcd1234 2 | 513 | [codec] |
514 | 0x12345678 0xabcd1234 2 | ||
493 | 515 | ||
494 | [model] | 516 | [model] |
495 | auto | 517 | auto |
496 | 518 | ||
497 | [pincfg] | 519 | [pincfg] |
498 | 0x12 0x411111f0 | 520 | 0x12 0x411111f0 |
499 | 521 | ||
500 | [verb] | 522 | [verb] |
501 | 0x20 0x500 0x03 | 523 | 0x20 0x500 0x03 |
502 | 0x20 0x400 0xff | 524 | 0x20 0x400 0xff |
503 | 525 | ||
504 | [hint] | 526 | [hint] |
505 | jack_detect = no | 527 | jack_detect = no |
506 | ------------------------------------------------------------------------ | ||
507 | 528 | ||
508 | The file needs to have a line `[codec]`. The next line should contain | 529 | |
530 | The file needs to have a line ``[codec]``. The next line should contain | ||
509 | three numbers indicating the codec vendor-id (0x12345678 in the | 531 | three numbers indicating the codec vendor-id (0x12345678 in the |
510 | example), the codec subsystem-id (0xabcd1234) and the address (2) of | 532 | example), the codec subsystem-id (0xabcd1234) and the address (2) of |
511 | the codec. The rest patch entries are applied to this specified codec | 533 | the codec. The rest patch entries are applied to this specified codec |
@@ -514,66 +536,68 @@ the first or the second value will make the check of the corresponding | |||
514 | field be skipped. It'll be useful for really broken devices that don't | 536 | field be skipped. It'll be useful for really broken devices that don't |
515 | initialize SSID properly. | 537 | initialize SSID properly. |
516 | 538 | ||
517 | The `[model]` line allows to change the model name of the each codec. | 539 | The ``[model]`` line allows to change the model name of the each codec. |
518 | In the example above, it will be changed to model=auto. | 540 | In the example above, it will be changed to model=auto. |
519 | Note that this overrides the module option. | 541 | Note that this overrides the module option. |
520 | 542 | ||
521 | After the `[pincfg]` line, the contents are parsed as the initial | 543 | After the ``[pincfg]`` line, the contents are parsed as the initial |
522 | default pin-configurations just like `user_pin_configs` sysfs above. | 544 | default pin-configurations just like ``user_pin_configs`` sysfs above. |
523 | The values can be shown in user_pin_configs sysfs file, too. | 545 | The values can be shown in user_pin_configs sysfs file, too. |
524 | 546 | ||
525 | Similarly, the lines after `[verb]` are parsed as `init_verbs` | 547 | Similarly, the lines after ``[verb]`` are parsed as ``init_verbs`` |
526 | sysfs entries, and the lines after `[hint]` are parsed as `hints` | 548 | sysfs entries, and the lines after ``[hint]`` are parsed as ``hints`` |
527 | sysfs entries, respectively. | 549 | sysfs entries, respectively. |
528 | 550 | ||
529 | Another example to override the codec vendor id from 0x12345678 to | 551 | Another example to override the codec vendor id from 0x12345678 to |
530 | 0xdeadbeef is like below: | 552 | 0xdeadbeef is like below: |
531 | ------------------------------------------------------------------------ | 553 | :: |
532 | [codec] | 554 | |
533 | 0x12345678 0xabcd1234 2 | 555 | [codec] |
556 | 0x12345678 0xabcd1234 2 | ||
557 | |||
558 | [vendor_id] | ||
559 | 0xdeadbeef | ||
534 | 560 | ||
535 | [vendor_id] | ||
536 | 0xdeadbeef | ||
537 | ------------------------------------------------------------------------ | ||
538 | 561 | ||
539 | In the similar way, you can override the codec subsystem_id via | 562 | In the similar way, you can override the codec subsystem_id via |
540 | `[subsystem_id]`, the revision id via `[revision_id]` line. | 563 | ``[subsystem_id]``, the revision id via ``[revision_id]`` line. |
541 | Also, the codec chip name can be rewritten via `[chip_name]` line. | 564 | Also, the codec chip name can be rewritten via ``[chip_name]`` line. |
542 | ------------------------------------------------------------------------ | 565 | :: |
543 | [codec] | 566 | |
544 | 0x12345678 0xabcd1234 2 | 567 | [codec] |
568 | 0x12345678 0xabcd1234 2 | ||
569 | |||
570 | [subsystem_id] | ||
571 | 0xffff1111 | ||
545 | 572 | ||
546 | [subsystem_id] | 573 | [revision_id] |
547 | 0xffff1111 | 574 | 0x10 |
548 | 575 | ||
549 | [revision_id] | 576 | [chip_name] |
550 | 0x10 | 577 | My-own NEWS-0002 |
551 | 578 | ||
552 | [chip_name] | ||
553 | My-own NEWS-0002 | ||
554 | ------------------------------------------------------------------------ | ||
555 | 579 | ||
556 | The hd-audio driver reads the file via request_firmware(). Thus, | 580 | The hd-audio driver reads the file via request_firmware(). Thus, |
557 | a patch file has to be located on the appropriate firmware path, | 581 | a patch file has to be located on the appropriate firmware path, |
558 | typically, /lib/firmware. For example, when you pass the option | 582 | typically, /lib/firmware. For example, when you pass the option |
559 | `patch=hda-init.fw`, the file /lib/firmware/hda-init.fw must be | 583 | ``patch=hda-init.fw``, the file /lib/firmware/hda-init.fw must be |
560 | present. | 584 | present. |
561 | 585 | ||
562 | The patch module option is specific to each card instance, and you | 586 | The patch module option is specific to each card instance, and you |
563 | need to give one file name for each instance, separated by commas. | 587 | need to give one file name for each instance, separated by commas. |
564 | For example, if you have two cards, one for an on-board analog and one | 588 | For example, if you have two cards, one for an on-board analog and one |
565 | for an HDMI video board, you may pass patch option like below: | 589 | for an HDMI video board, you may pass patch option like below: |
566 | ------------------------------------------------------------------------ | 590 | :: |
591 | |||
567 | options snd-hda-intel patch=on-board-patch,hdmi-patch | 592 | options snd-hda-intel patch=on-board-patch,hdmi-patch |
568 | ------------------------------------------------------------------------ | ||
569 | 593 | ||
570 | 594 | ||
571 | Power-Saving | 595 | Power-Saving |
572 | ~~~~~~~~~~~~ | 596 | ------------ |
573 | The power-saving is a kind of auto-suspend of the device. When the | 597 | The power-saving is a kind of auto-suspend of the device. When the |
574 | device is inactive for a certain time, the device is automatically | 598 | device is inactive for a certain time, the device is automatically |
575 | turned off to save the power. The time to go down is specified via | 599 | turned off to save the power. The time to go down is specified via |
576 | `power_save` module option, and this option can be changed dynamically | 600 | ``power_save`` module option, and this option can be changed dynamically |
577 | via sysfs. | 601 | via sysfs. |
578 | 602 | ||
579 | The power-saving won't work when the analog loopback is enabled on | 603 | The power-saving won't work when the analog loopback is enabled on |
@@ -592,63 +616,65 @@ The recent kernel supports the runtime PM for the HD-audio controller | |||
592 | chip, too. It means that the HD-audio controller is also powered up / | 616 | chip, too. It means that the HD-audio controller is also powered up / |
593 | down dynamically. The feature is enabled only for certain controller | 617 | down dynamically. The feature is enabled only for certain controller |
594 | chips like Intel LynxPoint. You can enable/disable this feature | 618 | chips like Intel LynxPoint. You can enable/disable this feature |
595 | forcibly by setting `power_save_controller` option, which is also | 619 | forcibly by setting ``power_save_controller`` option, which is also |
596 | available at /sys/module/snd_hda_intel/parameters directory. | 620 | available at /sys/module/snd_hda_intel/parameters directory. |
597 | 621 | ||
598 | 622 | ||
599 | Tracepoints | 623 | Tracepoints |
600 | ~~~~~~~~~~~ | 624 | ----------- |
601 | The hd-audio driver gives a few basic tracepoints. | 625 | The hd-audio driver gives a few basic tracepoints. |
602 | `hda:hda_send_cmd` traces each CORB write while `hda:hda_get_response` | 626 | ``hda:hda_send_cmd`` traces each CORB write while ``hda:hda_get_response`` |
603 | traces the response from RIRB (only when read from the codec driver). | 627 | traces the response from RIRB (only when read from the codec driver). |
604 | `hda:hda_bus_reset` traces the bus-reset due to fatal error, etc, | 628 | ``hda:hda_bus_reset`` traces the bus-reset due to fatal error, etc, |
605 | `hda:hda_unsol_event` traces the unsolicited events, and | 629 | ``hda:hda_unsol_event`` traces the unsolicited events, and |
606 | `hda:hda_power_down` and `hda:hda_power_up` trace the power down/up | 630 | ``hda:hda_power_down`` and ``hda:hda_power_up`` trace the power down/up |
607 | via power-saving behavior. | 631 | via power-saving behavior. |
608 | 632 | ||
609 | Enabling all tracepoints can be done like | 633 | Enabling all tracepoints can be done like |
610 | ------------------------------------------------------------------------ | 634 | :: |
611 | # echo 1 > /sys/kernel/debug/tracing/events/hda/enable | 635 | |
612 | ------------------------------------------------------------------------ | 636 | # echo 1 > /sys/kernel/debug/tracing/events/hda/enable |
637 | |||
613 | then after some commands, you can traces from | 638 | then after some commands, you can traces from |
614 | /sys/kernel/debug/tracing/trace file. For example, when you want to | 639 | /sys/kernel/debug/tracing/trace file. For example, when you want to |
615 | trace what codec command is sent, enable the tracepoint like: | 640 | trace what codec command is sent, enable the tracepoint like: |
616 | ------------------------------------------------------------------------ | 641 | :: |
617 | # cat /sys/kernel/debug/tracing/trace | 642 | |
618 | # tracer: nop | 643 | # cat /sys/kernel/debug/tracing/trace |
619 | # | 644 | # tracer: nop |
620 | # TASK-PID CPU# TIMESTAMP FUNCTION | 645 | # |
621 | # | | | | | | 646 | # TASK-PID CPU# TIMESTAMP FUNCTION |
622 | <...>-7807 [002] 105147.774889: hda_send_cmd: [0:0] val=e3a019 | 647 | # | | | | | |
623 | <...>-7807 [002] 105147.774893: hda_send_cmd: [0:0] val=e39019 | 648 | <...>-7807 [002] 105147.774889: hda_send_cmd: [0:0] val=e3a019 |
624 | <...>-7807 [002] 105147.999542: hda_send_cmd: [0:0] val=e3a01a | 649 | <...>-7807 [002] 105147.774893: hda_send_cmd: [0:0] val=e39019 |
625 | <...>-7807 [002] 105147.999543: hda_send_cmd: [0:0] val=e3901a | 650 | <...>-7807 [002] 105147.999542: hda_send_cmd: [0:0] val=e3a01a |
626 | <...>-26764 [001] 349222.837143: hda_send_cmd: [0:0] val=e3a019 | 651 | <...>-7807 [002] 105147.999543: hda_send_cmd: [0:0] val=e3901a |
627 | <...>-26764 [001] 349222.837148: hda_send_cmd: [0:0] val=e39019 | 652 | <...>-26764 [001] 349222.837143: hda_send_cmd: [0:0] val=e3a019 |
628 | <...>-26764 [001] 349223.058539: hda_send_cmd: [0:0] val=e3a01a | 653 | <...>-26764 [001] 349222.837148: hda_send_cmd: [0:0] val=e39019 |
629 | <...>-26764 [001] 349223.058541: hda_send_cmd: [0:0] val=e3901a | 654 | <...>-26764 [001] 349223.058539: hda_send_cmd: [0:0] val=e3a01a |
630 | ------------------------------------------------------------------------ | 655 | <...>-26764 [001] 349223.058541: hda_send_cmd: [0:0] val=e3901a |
631 | Here `[0:0]` indicates the card number and the codec address, and | 656 | |
632 | `val` shows the value sent to the codec, respectively. The value is | 657 | Here ``[0:0]`` indicates the card number and the codec address, and |
658 | ``val`` shows the value sent to the codec, respectively. The value is | ||
633 | a packed value, and you can decode it via hda-decode-verb program | 659 | a packed value, and you can decode it via hda-decode-verb program |
634 | included in hda-emu package below. For example, the value e3a019 is | 660 | included in hda-emu package below. For example, the value e3a019 is |
635 | to set the left output-amp value to 25. | 661 | to set the left output-amp value to 25. |
636 | ------------------------------------------------------------------------ | 662 | :: |
637 | % hda-decode-verb 0xe3a019 | 663 | |
638 | raw value = 0x00e3a019 | 664 | % hda-decode-verb 0xe3a019 |
639 | cid = 0, nid = 0x0e, verb = 0x3a0, parm = 0x19 | 665 | raw value = 0x00e3a019 |
640 | raw value: verb = 0x3a0, parm = 0x19 | 666 | cid = 0, nid = 0x0e, verb = 0x3a0, parm = 0x19 |
641 | verbname = set_amp_gain_mute | 667 | raw value: verb = 0x3a0, parm = 0x19 |
642 | amp raw val = 0xa019 | 668 | verbname = set_amp_gain_mute |
643 | output, left, idx=0, mute=0, val=25 | 669 | amp raw val = 0xa019 |
644 | ------------------------------------------------------------------------ | 670 | output, left, idx=0, mute=0, val=25 |
645 | 671 | ||
646 | 672 | ||
647 | Development Tree | 673 | Development Tree |
648 | ~~~~~~~~~~~~~~~~ | 674 | ---------------- |
649 | The latest development codes for HD-audio are found on sound git tree: | 675 | The latest development codes for HD-audio are found on sound git tree: |
650 | 676 | ||
651 | - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git | 677 | * git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git |
652 | 678 | ||
653 | The master branch or for-next branches can be used as the main | 679 | The master branch or for-next branches can be used as the main |
654 | development branches in general while the development for the current | 680 | development branches in general while the development for the current |
@@ -657,14 +683,14 @@ respectively. | |||
657 | 683 | ||
658 | 684 | ||
659 | Sending a Bug Report | 685 | Sending a Bug Report |
660 | ~~~~~~~~~~~~~~~~~~~~ | 686 | -------------------- |
661 | If any model or module options don't work for your device, it's time | 687 | If any model or module options don't work for your device, it's time |
662 | to send a bug report to the developers. Give the following in your | 688 | to send a bug report to the developers. Give the following in your |
663 | bug report: | 689 | bug report: |
664 | 690 | ||
665 | - Hardware vendor, product and model names | 691 | * Hardware vendor, product and model names |
666 | - Kernel version (and ALSA-driver version if you built externally) | 692 | * Kernel version (and ALSA-driver version if you built externally) |
667 | - `alsa-info.sh` output; run with `--no-upload` option. See the | 693 | * ``alsa-info.sh`` output; run with ``--no-upload`` option. See the |
668 | section below about alsa-info | 694 | section below about alsa-info |
669 | 695 | ||
670 | If it's a regression, at best, send alsa-info outputs of both working | 696 | If it's a regression, at best, send alsa-info outputs of both working |
@@ -673,60 +699,60 @@ compare the codec registers directly. | |||
673 | 699 | ||
674 | Send a bug report either the followings: | 700 | Send a bug report either the followings: |
675 | 701 | ||
676 | kernel-bugzilla:: | 702 | kernel-bugzilla |
677 | https://bugzilla.kernel.org/ | 703 | https://bugzilla.kernel.org/ |
678 | alsa-devel ML:: | 704 | alsa-devel ML |
679 | alsa-devel@alsa-project.org | 705 | alsa-devel@alsa-project.org |
680 | 706 | ||
681 | 707 | ||
682 | DEBUG TOOLS | 708 | Debug Tools |
683 | ----------- | 709 | =========== |
684 | 710 | ||
685 | This section describes some tools available for debugging HD-audio | 711 | This section describes some tools available for debugging HD-audio |
686 | problems. | 712 | problems. |
687 | 713 | ||
688 | alsa-info | 714 | alsa-info |
689 | ~~~~~~~~~ | 715 | --------- |
690 | The script `alsa-info.sh` is a very useful tool to gather the audio | 716 | The script ``alsa-info.sh`` is a very useful tool to gather the audio |
691 | device information. It's included in alsa-utils package. The latest | 717 | device information. It's included in alsa-utils package. The latest |
692 | version can be found on git repository: | 718 | version can be found on git repository: |
693 | 719 | ||
694 | - git://git.alsa-project.org/alsa-utils.git | 720 | * git://git.alsa-project.org/alsa-utils.git |
695 | 721 | ||
696 | The script can be fetched directly from the following URL, too: | 722 | The script can be fetched directly from the following URL, too: |
697 | 723 | ||
698 | - http://www.alsa-project.org/alsa-info.sh | 724 | * http://www.alsa-project.org/alsa-info.sh |
699 | 725 | ||
700 | Run this script as root, and it will gather the important information | 726 | Run this script as root, and it will gather the important information |
701 | such as the module lists, module parameters, proc file contents | 727 | such as the module lists, module parameters, proc file contents |
702 | including the codec proc files, mixer outputs and the control | 728 | including the codec proc files, mixer outputs and the control |
703 | elements. As default, it will store the information onto a web server | 729 | elements. As default, it will store the information onto a web server |
704 | on alsa-project.org. But, if you send a bug report, it'd be better to | 730 | on alsa-project.org. But, if you send a bug report, it'd be better to |
705 | run with `--no-upload` option, and attach the generated file. | 731 | run with ``--no-upload`` option, and attach the generated file. |
706 | 732 | ||
707 | There are some other useful options. See `--help` option output for | 733 | There are some other useful options. See ``--help`` option output for |
708 | details. | 734 | details. |
709 | 735 | ||
710 | When a probe error occurs or when the driver obviously assigns a | 736 | When a probe error occurs or when the driver obviously assigns a |
711 | mismatched model, it'd be helpful to load the driver with | 737 | mismatched model, it'd be helpful to load the driver with |
712 | `probe_only=1` option (at best after the cold reboot) and run | 738 | ``probe_only=1`` option (at best after the cold reboot) and run |
713 | alsa-info at this state. With this option, the driver won't configure | 739 | alsa-info at this state. With this option, the driver won't configure |
714 | the mixer and PCM but just tries to probe the codec slot. After | 740 | the mixer and PCM but just tries to probe the codec slot. After |
715 | probing, the proc file is available, so you can get the raw codec | 741 | probing, the proc file is available, so you can get the raw codec |
716 | information before modified by the driver. Of course, the driver | 742 | information before modified by the driver. Of course, the driver |
717 | isn't usable with `probe_only=1`. But you can continue the | 743 | isn't usable with ``probe_only=1``. But you can continue the |
718 | configuration via hwdep sysfs file if hda-reconfig option is enabled. | 744 | configuration via hwdep sysfs file if hda-reconfig option is enabled. |
719 | Using `probe_only` mask 2 skips the reset of HDA codecs (use | 745 | Using ``probe_only`` mask 2 skips the reset of HDA codecs (use |
720 | `probe_only=3` as module option). The hwdep interface can be used | 746 | ``probe_only=3`` as module option). The hwdep interface can be used |
721 | to determine the BIOS codec initialization. | 747 | to determine the BIOS codec initialization. |
722 | 748 | ||
723 | 749 | ||
724 | hda-verb | 750 | hda-verb |
725 | ~~~~~~~~ | 751 | -------- |
726 | hda-verb is a tiny program that allows you to access the HD-audio | 752 | hda-verb is a tiny program that allows you to access the HD-audio |
727 | codec directly. You can execute a raw HD-audio codec verb with this. | 753 | codec directly. You can execute a raw HD-audio codec verb with this. |
728 | This program accesses the hwdep device, thus you need to enable the | 754 | This program accesses the hwdep device, thus you need to enable the |
729 | kernel config `CONFIG_SND_HDA_HWDEP=y` beforehand. | 755 | kernel config ``CONFIG_SND_HDA_HWDEP=y`` beforehand. |
730 | 756 | ||
731 | The hda-verb program takes four arguments: the hwdep device file, the | 757 | The hda-verb program takes four arguments: the hwdep device file, the |
732 | widget NID, the verb and the parameter. When you access to the codec | 758 | widget NID, the verb and the parameter. When you access to the codec |
@@ -739,19 +765,20 @@ parameter can be either a hex/digit number or a string corresponding | |||
739 | to a verb. Similarly, the last parameter is the value to write, or | 765 | to a verb. Similarly, the last parameter is the value to write, or |
740 | can be a string for the parameter type. | 766 | can be a string for the parameter type. |
741 | 767 | ||
742 | ------------------------------------------------------------------------ | 768 | :: |
743 | % hda-verb /dev/snd/hwC0D0 0x12 0x701 2 | 769 | |
744 | nid = 0x12, verb = 0x701, param = 0x2 | 770 | % hda-verb /dev/snd/hwC0D0 0x12 0x701 2 |
745 | value = 0x0 | 771 | nid = 0x12, verb = 0x701, param = 0x2 |
772 | value = 0x0 | ||
746 | 773 | ||
747 | % hda-verb /dev/snd/hwC0D0 0x0 PARAMETERS VENDOR_ID | 774 | % hda-verb /dev/snd/hwC0D0 0x0 PARAMETERS VENDOR_ID |
748 | nid = 0x0, verb = 0xf00, param = 0x0 | 775 | nid = 0x0, verb = 0xf00, param = 0x0 |
749 | value = 0x10ec0262 | 776 | value = 0x10ec0262 |
777 | |||
778 | % hda-verb /dev/snd/hwC0D0 2 set_a 0xb080 | ||
779 | nid = 0x2, verb = 0x300, param = 0xb080 | ||
780 | value = 0x0 | ||
750 | 781 | ||
751 | % hda-verb /dev/snd/hwC0D0 2 set_a 0xb080 | ||
752 | nid = 0x2, verb = 0x300, param = 0xb080 | ||
753 | value = 0x0 | ||
754 | ------------------------------------------------------------------------ | ||
755 | 782 | ||
756 | Although you can issue any verbs with this program, the driver state | 783 | Although you can issue any verbs with this program, the driver state |
757 | won't be always updated. For example, the volume values are usually | 784 | won't be always updated. For example, the volume values are usually |
@@ -760,22 +787,22 @@ via hda-verb won't change the mixer value. | |||
760 | 787 | ||
761 | The hda-verb program is included now in alsa-tools: | 788 | The hda-verb program is included now in alsa-tools: |
762 | 789 | ||
763 | - git://git.alsa-project.org/alsa-tools.git | 790 | * git://git.alsa-project.org/alsa-tools.git |
764 | 791 | ||
765 | Also, the old stand-alone package is found in the ftp directory: | 792 | Also, the old stand-alone package is found in the ftp directory: |
766 | 793 | ||
767 | - ftp://ftp.suse.com/pub/people/tiwai/misc/ | 794 | * ftp://ftp.suse.com/pub/people/tiwai/misc/ |
768 | 795 | ||
769 | Also a git repository is available: | 796 | Also a git repository is available: |
770 | 797 | ||
771 | - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/hda-verb.git | 798 | * git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/hda-verb.git |
772 | 799 | ||
773 | See README file in the tarball for more details about hda-verb | 800 | See README file in the tarball for more details about hda-verb |
774 | program. | 801 | program. |
775 | 802 | ||
776 | 803 | ||
777 | hda-analyzer | 804 | hda-analyzer |
778 | ~~~~~~~~~~~~ | 805 | ------------ |
779 | hda-analyzer provides a graphical interface to access the raw HD-audio | 806 | hda-analyzer provides a graphical interface to access the raw HD-audio |
780 | control, based on pyGTK2 binding. It's a more powerful version of | 807 | control, based on pyGTK2 binding. It's a more powerful version of |
781 | hda-verb. The program gives you an easy-to-use GUI stuff for showing | 808 | hda-verb. The program gives you an easy-to-use GUI stuff for showing |
@@ -784,14 +811,14 @@ proc-compatible output. | |||
784 | 811 | ||
785 | The hda-analyzer: | 812 | The hda-analyzer: |
786 | 813 | ||
787 | - http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer | 814 | * http://git.alsa-project.org/?p=alsa.git;a=tree;f=hda-analyzer |
788 | 815 | ||
789 | is a part of alsa.git repository in alsa-project.org: | 816 | is a part of alsa.git repository in alsa-project.org: |
790 | 817 | ||
791 | - git://git.alsa-project.org/alsa.git | 818 | * git://git.alsa-project.org/alsa.git |
792 | 819 | ||
793 | Codecgraph | 820 | Codecgraph |
794 | ~~~~~~~~~~ | 821 | ---------- |
795 | Codecgraph is a utility program to generate a graph and visualizes the | 822 | Codecgraph is a utility program to generate a graph and visualizes the |
796 | codec-node connection of a codec chip. It's especially useful when | 823 | codec-node connection of a codec chip. It's especially useful when |
797 | you analyze or debug a codec without a proper datasheet. The program | 824 | you analyze or debug a codec without a proper datasheet. The program |
@@ -800,11 +827,11 @@ program. | |||
800 | 827 | ||
801 | The tarball and GIT trees are found in the web page at: | 828 | The tarball and GIT trees are found in the web page at: |
802 | 829 | ||
803 | - http://helllabs.org/codecgraph/ | 830 | * http://helllabs.org/codecgraph/ |
804 | 831 | ||
805 | 832 | ||
806 | hda-emu | 833 | hda-emu |
807 | ~~~~~~~ | 834 | ------- |
808 | hda-emu is an HD-audio emulator. The main purpose of this program is | 835 | hda-emu is an HD-audio emulator. The main purpose of this program is |
809 | to debug an HD-audio codec without the real hardware. Thus, it | 836 | to debug an HD-audio codec without the real hardware. Thus, it |
810 | doesn't emulate the behavior with the real audio I/O, but it just | 837 | doesn't emulate the behavior with the real audio I/O, but it just |
@@ -817,13 +844,14 @@ codec proc collections in the tarball. Then, run the program with the | |||
817 | proc file, and the hda-emu program will start parsing the codec file | 844 | proc file, and the hda-emu program will start parsing the codec file |
818 | and simulates the HD-audio driver: | 845 | and simulates the HD-audio driver: |
819 | 846 | ||
820 | ------------------------------------------------------------------------ | 847 | :: |
821 | % hda-emu codecs/stac9200-dell-d820-laptop | 848 | |
822 | # Parsing.. | 849 | % hda-emu codecs/stac9200-dell-d820-laptop |
823 | hda_codec: Unknown model for STAC9200, using BIOS defaults | 850 | # Parsing.. |
824 | hda_codec: pin nid 08 bios pin config 40c003fa | 851 | hda_codec: Unknown model for STAC9200, using BIOS defaults |
825 | .... | 852 | hda_codec: pin nid 08 bios pin config 40c003fa |
826 | ------------------------------------------------------------------------ | 853 | .... |
854 | |||
827 | 855 | ||
828 | The program gives you only a very dumb command-line interface. You | 856 | The program gives you only a very dumb command-line interface. You |
829 | can get a proc-file dump at the current state, get a list of control | 857 | can get a proc-file dump at the current state, get a list of control |
@@ -832,14 +860,14 @@ operation, the jack plugging simulation, etc. | |||
832 | 860 | ||
833 | The program is found in the git repository below: | 861 | The program is found in the git repository below: |
834 | 862 | ||
835 | - git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/hda-emu.git | 863 | * git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/hda-emu.git |
836 | 864 | ||
837 | See README file in the repository for more details about hda-emu | 865 | See README file in the repository for more details about hda-emu |
838 | program. | 866 | program. |
839 | 867 | ||
840 | 868 | ||
841 | hda-jack-retask | 869 | hda-jack-retask |
842 | ~~~~~~~~~~~~~~~ | 870 | --------------- |
843 | hda-jack-retask is a user-friendly GUI program to manipulate the | 871 | hda-jack-retask is a user-friendly GUI program to manipulate the |
844 | HD-audio pin control for jack retasking. If you have a problem about | 872 | HD-audio pin control for jack retasking. If you have a problem about |
845 | the jack assignment, try this program and check whether you can get | 873 | the jack assignment, try this program and check whether you can get |
@@ -849,5 +877,4 @@ firmware patch file (see "Early Patching" section). | |||
849 | 877 | ||
850 | The program is included in alsa-tools now: | 878 | The program is included in alsa-tools now: |
851 | 879 | ||
852 | - git://git.alsa-project.org/alsa-tools.git | 880 | * git://git.alsa-project.org/alsa-tools.git |
853 | |||
diff --git a/Documentation/sound/index.rst b/Documentation/sound/index.rst new file mode 100644 index 000000000000..47b89f014e69 --- /dev/null +++ b/Documentation/sound/index.rst | |||
@@ -0,0 +1,20 @@ | |||
1 | =================================== | ||
2 | Linux Sound Subsystem Documentation | ||
3 | =================================== | ||
4 | |||
5 | .. toctree:: | ||
6 | :maxdepth: 2 | ||
7 | |||
8 | kernel-api/index | ||
9 | designs/index | ||
10 | soc/index | ||
11 | alsa-configuration | ||
12 | hd-audio/index | ||
13 | cards/index | ||
14 | |||
15 | .. only:: subproject | ||
16 | |||
17 | Indices | ||
18 | ======= | ||
19 | |||
20 | * :ref:`genindex` | ||
diff --git a/Documentation/sound/kernel-api/alsa-driver-api.rst b/Documentation/sound/kernel-api/alsa-driver-api.rst new file mode 100644 index 000000000000..14cd138989e3 --- /dev/null +++ b/Documentation/sound/kernel-api/alsa-driver-api.rst | |||
@@ -0,0 +1,134 @@ | |||
1 | =================== | ||
2 | The ALSA Driver API | ||
3 | =================== | ||
4 | |||
5 | Management of Cards and Devices | ||
6 | =============================== | ||
7 | |||
8 | Card Management | ||
9 | --------------- | ||
10 | .. kernel-doc:: sound/core/init.c | ||
11 | |||
12 | Device Components | ||
13 | ----------------- | ||
14 | .. kernel-doc:: sound/core/device.c | ||
15 | |||
16 | Module requests and Device File Entries | ||
17 | --------------------------------------- | ||
18 | .. kernel-doc:: sound/core/sound.c | ||
19 | |||
20 | Memory Management Helpers | ||
21 | ------------------------- | ||
22 | .. kernel-doc:: sound/core/memory.c | ||
23 | .. kernel-doc:: sound/core/memalloc.c | ||
24 | |||
25 | |||
26 | PCM API | ||
27 | ======= | ||
28 | |||
29 | PCM Core | ||
30 | -------- | ||
31 | .. kernel-doc:: sound/core/pcm.c | ||
32 | .. kernel-doc:: sound/core/pcm_lib.c | ||
33 | .. kernel-doc:: sound/core/pcm_native.c | ||
34 | .. kernel-doc:: include/sound/pcm.h | ||
35 | |||
36 | PCM Format Helpers | ||
37 | ------------------ | ||
38 | .. kernel-doc:: sound/core/pcm_misc.c | ||
39 | |||
40 | PCM Memory Management | ||
41 | --------------------- | ||
42 | .. kernel-doc:: sound/core/pcm_memory.c | ||
43 | |||
44 | PCM DMA Engine API | ||
45 | ------------------ | ||
46 | .. kernel-doc:: sound/core/pcm_dmaengine.c | ||
47 | .. kernel-doc:: include/sound/dmaengine_pcm.h | ||
48 | |||
49 | Control/Mixer API | ||
50 | ================= | ||
51 | |||
52 | General Control Interface | ||
53 | ------------------------- | ||
54 | .. kernel-doc:: sound/core/control.c | ||
55 | |||
56 | AC97 Codec API | ||
57 | -------------- | ||
58 | .. kernel-doc:: sound/pci/ac97/ac97_codec.c | ||
59 | .. kernel-doc:: sound/pci/ac97/ac97_pcm.c | ||
60 | |||
61 | Virtual Master Control API | ||
62 | -------------------------- | ||
63 | .. kernel-doc:: sound/core/vmaster.c | ||
64 | .. kernel-doc:: include/sound/control.h | ||
65 | |||
66 | MIDI API | ||
67 | ======== | ||
68 | |||
69 | Raw MIDI API | ||
70 | ------------ | ||
71 | .. kernel-doc:: sound/core/rawmidi.c | ||
72 | |||
73 | MPU401-UART API | ||
74 | --------------- | ||
75 | .. kernel-doc:: sound/drivers/mpu401/mpu401_uart.c | ||
76 | |||
77 | Proc Info API | ||
78 | ============= | ||
79 | |||
80 | Proc Info Interface | ||
81 | ------------------- | ||
82 | .. kernel-doc:: sound/core/info.c | ||
83 | |||
84 | Compress Offload | ||
85 | ================ | ||
86 | |||
87 | Compress Offload API | ||
88 | -------------------- | ||
89 | .. kernel-doc:: sound/core/compress_offload.c | ||
90 | .. kernel-doc:: include/uapi/sound/compress_offload.h | ||
91 | .. kernel-doc:: include/uapi/sound/compress_params.h | ||
92 | .. kernel-doc:: include/sound/compress_driver.h | ||
93 | |||
94 | ASoC | ||
95 | ==== | ||
96 | |||
97 | ASoC Core API | ||
98 | ------------- | ||
99 | .. kernel-doc:: include/sound/soc.h | ||
100 | .. kernel-doc:: sound/soc/soc-core.c | ||
101 | .. kernel-doc:: sound/soc/soc-devres.c | ||
102 | .. kernel-doc:: sound/soc/soc-io.c | ||
103 | .. kernel-doc:: sound/soc/soc-pcm.c | ||
104 | .. kernel-doc:: sound/soc/soc-ops.c | ||
105 | .. kernel-doc:: sound/soc/soc-compress.c | ||
106 | |||
107 | ASoC DAPM API | ||
108 | ------------- | ||
109 | .. kernel-doc:: sound/soc/soc-dapm.c | ||
110 | |||
111 | ASoC DMA Engine API | ||
112 | ------------------- | ||
113 | .. kernel-doc:: sound/soc/soc-generic-dmaengine-pcm.c | ||
114 | |||
115 | Miscellaneous Functions | ||
116 | ======================= | ||
117 | |||
118 | Hardware-Dependent Devices API | ||
119 | ------------------------------ | ||
120 | .. kernel-doc:: sound/core/hwdep.c | ||
121 | |||
122 | Jack Abstraction Layer API | ||
123 | -------------------------- | ||
124 | .. kernel-doc:: include/sound/jack.h | ||
125 | .. kernel-doc:: sound/core/jack.c | ||
126 | .. kernel-doc:: sound/soc/soc-jack.c | ||
127 | |||
128 | ISA DMA Helpers | ||
129 | --------------- | ||
130 | .. kernel-doc:: sound/core/isadma.c | ||
131 | |||
132 | Other Helper Macros | ||
133 | ------------------- | ||
134 | .. kernel-doc:: include/sound/core.h | ||
diff --git a/Documentation/sound/kernel-api/index.rst b/Documentation/sound/kernel-api/index.rst new file mode 100644 index 000000000000..d0e6df35b4b4 --- /dev/null +++ b/Documentation/sound/kernel-api/index.rst | |||
@@ -0,0 +1,8 @@ | |||
1 | ALSA Kernel API Documentation | ||
2 | ============================= | ||
3 | |||
4 | .. toctree:: | ||
5 | :maxdepth: 2 | ||
6 | |||
7 | alsa-driver-api | ||
8 | writing-an-alsa-driver | ||
diff --git a/Documentation/sound/kernel-api/writing-an-alsa-driver.rst b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst new file mode 100644 index 000000000000..95c5443eff38 --- /dev/null +++ b/Documentation/sound/kernel-api/writing-an-alsa-driver.rst | |||
@@ -0,0 +1,4219 @@ | |||
1 | ====================== | ||
2 | Writing an ALSA Driver | ||
3 | ====================== | ||
4 | |||
5 | :Author: Takashi Iwai <tiwai@suse.de> | ||
6 | :Date: Oct 15, 2007 | ||
7 | :Edition: 0.3.7 | ||
8 | |||
9 | Preface | ||
10 | ======= | ||
11 | |||
12 | This document describes how to write an `ALSA (Advanced Linux Sound | ||
13 | Architecture) <http://www.alsa-project.org/>`__ driver. The document | ||
14 | focuses mainly on PCI soundcards. In the case of other device types, the | ||
15 | API might be different, too. However, at least the ALSA kernel API is | ||
16 | consistent, and therefore it would be still a bit help for writing them. | ||
17 | |||
18 | This document targets people who already have enough C language skills | ||
19 | and have basic linux kernel programming knowledge. This document doesn't | ||
20 | explain the general topic of linux kernel coding and doesn't cover | ||
21 | low-level driver implementation details. It only describes the standard | ||
22 | way to write a PCI sound driver on ALSA. | ||
23 | |||
24 | If you are already familiar with the older ALSA ver.0.5.x API, you can | ||
25 | check the drivers such as ``sound/pci/es1938.c`` or | ||
26 | ``sound/pci/maestro3.c`` which have also almost the same code-base in | ||
27 | the ALSA 0.5.x tree, so you can compare the differences. | ||
28 | |||
29 | This document is still a draft version. Any feedback and corrections, | ||
30 | please!! | ||
31 | |||
32 | File Tree Structure | ||
33 | =================== | ||
34 | |||
35 | General | ||
36 | ------- | ||
37 | |||
38 | The ALSA drivers are provided in two ways. | ||
39 | |||
40 | One is the trees provided as a tarball or via cvs from the ALSA's ftp | ||
41 | site, and another is the 2.6 (or later) Linux kernel tree. To | ||
42 | synchronize both, the ALSA driver tree is split into two different | ||
43 | trees: alsa-kernel and alsa-driver. The former contains purely the | ||
44 | source code for the Linux 2.6 (or later) tree. This tree is designed | ||
45 | only for compilation on 2.6 or later environment. The latter, | ||
46 | alsa-driver, contains many subtle files for compiling ALSA drivers | ||
47 | outside of the Linux kernel tree, wrapper functions for older 2.2 and | ||
48 | 2.4 kernels, to adapt the latest kernel API, and additional drivers | ||
49 | which are still in development or in tests. The drivers in alsa-driver | ||
50 | tree will be moved to alsa-kernel (and eventually to the 2.6 kernel | ||
51 | tree) when they are finished and confirmed to work fine. | ||
52 | |||
53 | The file tree structure of ALSA driver is depicted below. Both | ||
54 | alsa-kernel and alsa-driver have almost the same file structure, except | ||
55 | for “core” directory. It's named as “acore” in alsa-driver tree. | ||
56 | |||
57 | :: | ||
58 | |||
59 | sound | ||
60 | /core | ||
61 | /oss | ||
62 | /seq | ||
63 | /oss | ||
64 | /instr | ||
65 | /ioctl32 | ||
66 | /include | ||
67 | /drivers | ||
68 | /mpu401 | ||
69 | /opl3 | ||
70 | /i2c | ||
71 | /l3 | ||
72 | /synth | ||
73 | /emux | ||
74 | /pci | ||
75 | /(cards) | ||
76 | /isa | ||
77 | /(cards) | ||
78 | /arm | ||
79 | /ppc | ||
80 | /sparc | ||
81 | /usb | ||
82 | /pcmcia /(cards) | ||
83 | /oss | ||
84 | |||
85 | |||
86 | core directory | ||
87 | -------------- | ||
88 | |||
89 | This directory contains the middle layer which is the heart of ALSA | ||
90 | drivers. In this directory, the native ALSA modules are stored. The | ||
91 | sub-directories contain different modules and are dependent upon the | ||
92 | kernel config. | ||
93 | |||
94 | core/oss | ||
95 | ~~~~~~~~ | ||
96 | |||
97 | The codes for PCM and mixer OSS emulation modules are stored in this | ||
98 | directory. The rawmidi OSS emulation is included in the ALSA rawmidi | ||
99 | code since it's quite small. The sequencer code is stored in | ||
100 | ``core/seq/oss`` directory (see `below <#core-seq-oss>`__). | ||
101 | |||
102 | core/ioctl32 | ||
103 | ~~~~~~~~~~~~ | ||
104 | |||
105 | This directory contains the 32bit-ioctl wrappers for 64bit architectures | ||
106 | such like x86-64, ppc64 and sparc64. For 32bit and alpha architectures, | ||
107 | these are not compiled. | ||
108 | |||
109 | core/seq | ||
110 | ~~~~~~~~ | ||
111 | |||
112 | This directory and its sub-directories are for the ALSA sequencer. This | ||
113 | directory contains the sequencer core and primary sequencer modules such | ||
114 | like snd-seq-midi, snd-seq-virmidi, etc. They are compiled only when | ||
115 | ``CONFIG_SND_SEQUENCER`` is set in the kernel config. | ||
116 | |||
117 | core/seq/oss | ||
118 | ~~~~~~~~~~~~ | ||
119 | |||
120 | This contains the OSS sequencer emulation codes. | ||
121 | |||
122 | core/seq/instr | ||
123 | ~~~~~~~~~~~~~~ | ||
124 | |||
125 | This directory contains the modules for the sequencer instrument layer. | ||
126 | |||
127 | include directory | ||
128 | ----------------- | ||
129 | |||
130 | This is the place for the public header files of ALSA drivers, which are | ||
131 | to be exported to user-space, or included by several files at different | ||
132 | directories. Basically, the private header files should not be placed in | ||
133 | this directory, but you may still find files there, due to historical | ||
134 | reasons :) | ||
135 | |||
136 | drivers directory | ||
137 | ----------------- | ||
138 | |||
139 | This directory contains code shared among different drivers on different | ||
140 | architectures. They are hence supposed not to be architecture-specific. | ||
141 | For example, the dummy pcm driver and the serial MIDI driver are found | ||
142 | in this directory. In the sub-directories, there is code for components | ||
143 | which are independent from bus and cpu architectures. | ||
144 | |||
145 | drivers/mpu401 | ||
146 | ~~~~~~~~~~~~~~ | ||
147 | |||
148 | The MPU401 and MPU401-UART modules are stored here. | ||
149 | |||
150 | drivers/opl3 and opl4 | ||
151 | ~~~~~~~~~~~~~~~~~~~~~ | ||
152 | |||
153 | The OPL3 and OPL4 FM-synth stuff is found here. | ||
154 | |||
155 | i2c directory | ||
156 | ------------- | ||
157 | |||
158 | This contains the ALSA i2c components. | ||
159 | |||
160 | Although there is a standard i2c layer on Linux, ALSA has its own i2c | ||
161 | code for some cards, because the soundcard needs only a simple operation | ||
162 | and the standard i2c API is too complicated for such a purpose. | ||
163 | |||
164 | i2c/l3 | ||
165 | ~~~~~~ | ||
166 | |||
167 | This is a sub-directory for ARM L3 i2c. | ||
168 | |||
169 | synth directory | ||
170 | --------------- | ||
171 | |||
172 | This contains the synth middle-level modules. | ||
173 | |||
174 | So far, there is only Emu8000/Emu10k1 synth driver under the | ||
175 | ``synth/emux`` sub-directory. | ||
176 | |||
177 | pci directory | ||
178 | ------------- | ||
179 | |||
180 | This directory and its sub-directories hold the top-level card modules | ||
181 | for PCI soundcards and the code specific to the PCI BUS. | ||
182 | |||
183 | The drivers compiled from a single file are stored directly in the pci | ||
184 | directory, while the drivers with several source files are stored on | ||
185 | their own sub-directory (e.g. emu10k1, ice1712). | ||
186 | |||
187 | isa directory | ||
188 | ------------- | ||
189 | |||
190 | This directory and its sub-directories hold the top-level card modules | ||
191 | for ISA soundcards. | ||
192 | |||
193 | arm, ppc, and sparc directories | ||
194 | ------------------------------- | ||
195 | |||
196 | They are used for top-level card modules which are specific to one of | ||
197 | these architectures. | ||
198 | |||
199 | usb directory | ||
200 | ------------- | ||
201 | |||
202 | This directory contains the USB-audio driver. In the latest version, the | ||
203 | USB MIDI driver is integrated in the usb-audio driver. | ||
204 | |||
205 | pcmcia directory | ||
206 | ---------------- | ||
207 | |||
208 | The PCMCIA, especially PCCard drivers will go here. CardBus drivers will | ||
209 | be in the pci directory, because their API is identical to that of | ||
210 | standard PCI cards. | ||
211 | |||
212 | oss directory | ||
213 | ------------- | ||
214 | |||
215 | The OSS/Lite source files are stored here in Linux 2.6 (or later) tree. | ||
216 | In the ALSA driver tarball, this directory is empty, of course :) | ||
217 | |||
218 | Basic Flow for PCI Drivers | ||
219 | ========================== | ||
220 | |||
221 | Outline | ||
222 | ------- | ||
223 | |||
224 | The minimum flow for PCI soundcards is as follows: | ||
225 | |||
226 | - define the PCI ID table (see the section `PCI Entries`_). | ||
227 | |||
228 | - create ``probe`` callback. | ||
229 | |||
230 | - create ``remove`` callback. | ||
231 | |||
232 | - create a :c:type:`struct pci_driver <pci_driver>` structure | ||
233 | containing the three pointers above. | ||
234 | |||
235 | - create an ``init`` function just calling the | ||
236 | :c:func:`pci_register_driver()` to register the pci_driver | ||
237 | table defined above. | ||
238 | |||
239 | - create an ``exit`` function to call the | ||
240 | :c:func:`pci_unregister_driver()` function. | ||
241 | |||
242 | Full Code Example | ||
243 | ----------------- | ||
244 | |||
245 | The code example is shown below. Some parts are kept unimplemented at | ||
246 | this moment but will be filled in the next sections. The numbers in the | ||
247 | comment lines of the :c:func:`snd_mychip_probe()` function refer | ||
248 | to details explained in the following section. | ||
249 | |||
250 | :: | ||
251 | |||
252 | #include <linux/init.h> | ||
253 | #include <linux/pci.h> | ||
254 | #include <linux/slab.h> | ||
255 | #include <sound/core.h> | ||
256 | #include <sound/initval.h> | ||
257 | |||
258 | /* module parameters (see "Module Parameters") */ | ||
259 | /* SNDRV_CARDS: maximum number of cards supported by this module */ | ||
260 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | ||
261 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | ||
262 | static bool enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | ||
263 | |||
264 | /* definition of the chip-specific record */ | ||
265 | struct mychip { | ||
266 | struct snd_card *card; | ||
267 | /* the rest of the implementation will be in section | ||
268 | * "PCI Resource Management" | ||
269 | */ | ||
270 | }; | ||
271 | |||
272 | /* chip-specific destructor | ||
273 | * (see "PCI Resource Management") | ||
274 | */ | ||
275 | static int snd_mychip_free(struct mychip *chip) | ||
276 | { | ||
277 | .... /* will be implemented later... */ | ||
278 | } | ||
279 | |||
280 | /* component-destructor | ||
281 | * (see "Management of Cards and Components") | ||
282 | */ | ||
283 | static int snd_mychip_dev_free(struct snd_device *device) | ||
284 | { | ||
285 | return snd_mychip_free(device->device_data); | ||
286 | } | ||
287 | |||
288 | /* chip-specific constructor | ||
289 | * (see "Management of Cards and Components") | ||
290 | */ | ||
291 | static int snd_mychip_create(struct snd_card *card, | ||
292 | struct pci_dev *pci, | ||
293 | struct mychip **rchip) | ||
294 | { | ||
295 | struct mychip *chip; | ||
296 | int err; | ||
297 | static struct snd_device_ops ops = { | ||
298 | .dev_free = snd_mychip_dev_free, | ||
299 | }; | ||
300 | |||
301 | *rchip = NULL; | ||
302 | |||
303 | /* check PCI availability here | ||
304 | * (see "PCI Resource Management") | ||
305 | */ | ||
306 | .... | ||
307 | |||
308 | /* allocate a chip-specific data with zero filled */ | ||
309 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); | ||
310 | if (chip == NULL) | ||
311 | return -ENOMEM; | ||
312 | |||
313 | chip->card = card; | ||
314 | |||
315 | /* rest of initialization here; will be implemented | ||
316 | * later, see "PCI Resource Management" | ||
317 | */ | ||
318 | .... | ||
319 | |||
320 | err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); | ||
321 | if (err < 0) { | ||
322 | snd_mychip_free(chip); | ||
323 | return err; | ||
324 | } | ||
325 | |||
326 | *rchip = chip; | ||
327 | return 0; | ||
328 | } | ||
329 | |||
330 | /* constructor -- see "Driver Constructor" sub-section */ | ||
331 | static int snd_mychip_probe(struct pci_dev *pci, | ||
332 | const struct pci_device_id *pci_id) | ||
333 | { | ||
334 | static int dev; | ||
335 | struct snd_card *card; | ||
336 | struct mychip *chip; | ||
337 | int err; | ||
338 | |||
339 | /* (1) */ | ||
340 | if (dev >= SNDRV_CARDS) | ||
341 | return -ENODEV; | ||
342 | if (!enable[dev]) { | ||
343 | dev++; | ||
344 | return -ENOENT; | ||
345 | } | ||
346 | |||
347 | /* (2) */ | ||
348 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, | ||
349 | 0, &card); | ||
350 | if (err < 0) | ||
351 | return err; | ||
352 | |||
353 | /* (3) */ | ||
354 | err = snd_mychip_create(card, pci, &chip); | ||
355 | if (err < 0) { | ||
356 | snd_card_free(card); | ||
357 | return err; | ||
358 | } | ||
359 | |||
360 | /* (4) */ | ||
361 | strcpy(card->driver, "My Chip"); | ||
362 | strcpy(card->shortname, "My Own Chip 123"); | ||
363 | sprintf(card->longname, "%s at 0x%lx irq %i", | ||
364 | card->shortname, chip->ioport, chip->irq); | ||
365 | |||
366 | /* (5) */ | ||
367 | .... /* implemented later */ | ||
368 | |||
369 | /* (6) */ | ||
370 | err = snd_card_register(card); | ||
371 | if (err < 0) { | ||
372 | snd_card_free(card); | ||
373 | return err; | ||
374 | } | ||
375 | |||
376 | /* (7) */ | ||
377 | pci_set_drvdata(pci, card); | ||
378 | dev++; | ||
379 | return 0; | ||
380 | } | ||
381 | |||
382 | /* destructor -- see the "Destructor" sub-section */ | ||
383 | static void snd_mychip_remove(struct pci_dev *pci) | ||
384 | { | ||
385 | snd_card_free(pci_get_drvdata(pci)); | ||
386 | pci_set_drvdata(pci, NULL); | ||
387 | } | ||
388 | |||
389 | |||
390 | |||
391 | Driver Constructor | ||
392 | ------------------ | ||
393 | |||
394 | The real constructor of PCI drivers is the ``probe`` callback. The | ||
395 | ``probe`` callback and other component-constructors which are called | ||
396 | from the ``probe`` callback cannot be used with the ``__init`` prefix | ||
397 | because any PCI device could be a hotplug device. | ||
398 | |||
399 | In the ``probe`` callback, the following scheme is often used. | ||
400 | |||
401 | 1) Check and increment the device index. | ||
402 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
403 | |||
404 | :: | ||
405 | |||
406 | static int dev; | ||
407 | .... | ||
408 | if (dev >= SNDRV_CARDS) | ||
409 | return -ENODEV; | ||
410 | if (!enable[dev]) { | ||
411 | dev++; | ||
412 | return -ENOENT; | ||
413 | } | ||
414 | |||
415 | |||
416 | where ``enable[dev]`` is the module option. | ||
417 | |||
418 | Each time the ``probe`` callback is called, check the availability of | ||
419 | the device. If not available, simply increment the device index and | ||
420 | returns. dev will be incremented also later (`step 7 | ||
421 | <#set-the-pci-driver-data-and-return-zero>`__). | ||
422 | |||
423 | 2) Create a card instance | ||
424 | ~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
425 | |||
426 | :: | ||
427 | |||
428 | struct snd_card *card; | ||
429 | int err; | ||
430 | .... | ||
431 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, | ||
432 | 0, &card); | ||
433 | |||
434 | |||
435 | The details will be explained in the section `Management of Cards and | ||
436 | Components`_. | ||
437 | |||
438 | 3) Create a main component | ||
439 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
440 | |||
441 | In this part, the PCI resources are allocated. | ||
442 | |||
443 | :: | ||
444 | |||
445 | struct mychip *chip; | ||
446 | .... | ||
447 | err = snd_mychip_create(card, pci, &chip); | ||
448 | if (err < 0) { | ||
449 | snd_card_free(card); | ||
450 | return err; | ||
451 | } | ||
452 | |||
453 | The details will be explained in the section `PCI Resource | ||
454 | Management`_. | ||
455 | |||
456 | 4) Set the driver ID and name strings. | ||
457 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
458 | |||
459 | :: | ||
460 | |||
461 | strcpy(card->driver, "My Chip"); | ||
462 | strcpy(card->shortname, "My Own Chip 123"); | ||
463 | sprintf(card->longname, "%s at 0x%lx irq %i", | ||
464 | card->shortname, chip->ioport, chip->irq); | ||
465 | |||
466 | The driver field holds the minimal ID string of the chip. This is used | ||
467 | by alsa-lib's configurator, so keep it simple but unique. Even the | ||
468 | same driver can have different driver IDs to distinguish the | ||
469 | functionality of each chip type. | ||
470 | |||
471 | The shortname field is a string shown as more verbose name. The longname | ||
472 | field contains the information shown in ``/proc/asound/cards``. | ||
473 | |||
474 | 5) Create other components, such as mixer, MIDI, etc. | ||
475 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
476 | |||
477 | Here you define the basic components such as `PCM <#PCM-Interface>`__, | ||
478 | mixer (e.g. `AC97 <#API-for-AC97-Codec>`__), MIDI (e.g. | ||
479 | `MPU-401 <#MIDI-MPU401-UART-Interface>`__), and other interfaces. | ||
480 | Also, if you want a `proc file <#Proc-Interface>`__, define it here, | ||
481 | too. | ||
482 | |||
483 | 6) Register the card instance. | ||
484 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
485 | |||
486 | :: | ||
487 | |||
488 | err = snd_card_register(card); | ||
489 | if (err < 0) { | ||
490 | snd_card_free(card); | ||
491 | return err; | ||
492 | } | ||
493 | |||
494 | Will be explained in the section `Management of Cards and | ||
495 | Components`_, too. | ||
496 | |||
497 | 7) Set the PCI driver data and return zero. | ||
498 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
499 | |||
500 | :: | ||
501 | |||
502 | pci_set_drvdata(pci, card); | ||
503 | dev++; | ||
504 | return 0; | ||
505 | |||
506 | In the above, the card record is stored. This pointer is used in the | ||
507 | remove callback and power-management callbacks, too. | ||
508 | |||
509 | Destructor | ||
510 | ---------- | ||
511 | |||
512 | The destructor, remove callback, simply releases the card instance. Then | ||
513 | the ALSA middle layer will release all the attached components | ||
514 | automatically. | ||
515 | |||
516 | It would be typically like the following: | ||
517 | |||
518 | :: | ||
519 | |||
520 | static void snd_mychip_remove(struct pci_dev *pci) | ||
521 | { | ||
522 | snd_card_free(pci_get_drvdata(pci)); | ||
523 | pci_set_drvdata(pci, NULL); | ||
524 | } | ||
525 | |||
526 | |||
527 | The above code assumes that the card pointer is set to the PCI driver | ||
528 | data. | ||
529 | |||
530 | Header Files | ||
531 | ------------ | ||
532 | |||
533 | For the above example, at least the following include files are | ||
534 | necessary. | ||
535 | |||
536 | :: | ||
537 | |||
538 | #include <linux/init.h> | ||
539 | #include <linux/pci.h> | ||
540 | #include <linux/slab.h> | ||
541 | #include <sound/core.h> | ||
542 | #include <sound/initval.h> | ||
543 | |||
544 | where the last one is necessary only when module options are defined | ||
545 | in the source file. If the code is split into several files, the files | ||
546 | without module options don't need them. | ||
547 | |||
548 | In addition to these headers, you'll need ``<linux/interrupt.h>`` for | ||
549 | interrupt handling, and ``<asm/io.h>`` for I/O access. If you use the | ||
550 | :c:func:`mdelay()` or :c:func:`udelay()` functions, you'll need | ||
551 | to include ``<linux/delay.h>`` too. | ||
552 | |||
553 | The ALSA interfaces like the PCM and control APIs are defined in other | ||
554 | ``<sound/xxx.h>`` header files. They have to be included after | ||
555 | ``<sound/core.h>``. | ||
556 | |||
557 | Management of Cards and Components | ||
558 | ================================== | ||
559 | |||
560 | Card Instance | ||
561 | ------------- | ||
562 | |||
563 | For each soundcard, a “card” record must be allocated. | ||
564 | |||
565 | A card record is the headquarters of the soundcard. It manages the whole | ||
566 | list of devices (components) on the soundcard, such as PCM, mixers, | ||
567 | MIDI, synthesizer, and so on. Also, the card record holds the ID and the | ||
568 | name strings of the card, manages the root of proc files, and controls | ||
569 | the power-management states and hotplug disconnections. The component | ||
570 | list on the card record is used to manage the correct release of | ||
571 | resources at destruction. | ||
572 | |||
573 | As mentioned above, to create a card instance, call | ||
574 | :c:func:`snd_card_new()`. | ||
575 | |||
576 | :: | ||
577 | |||
578 | struct snd_card *card; | ||
579 | int err; | ||
580 | err = snd_card_new(&pci->dev, index, id, module, extra_size, &card); | ||
581 | |||
582 | |||
583 | The function takes six arguments: the parent device pointer, the | ||
584 | card-index number, the id string, the module pointer (usually | ||
585 | ``THIS_MODULE``), the size of extra-data space, and the pointer to | ||
586 | return the card instance. The extra_size argument is used to allocate | ||
587 | card->private_data for the chip-specific data. Note that these data are | ||
588 | allocated by :c:func:`snd_card_new()`. | ||
589 | |||
590 | The first argument, the pointer of struct :c:type:`struct device | ||
591 | <device>`, specifies the parent device. For PCI devices, typically | ||
592 | ``&pci->`` is passed there. | ||
593 | |||
594 | Components | ||
595 | ---------- | ||
596 | |||
597 | After the card is created, you can attach the components (devices) to | ||
598 | the card instance. In an ALSA driver, a component is represented as a | ||
599 | :c:type:`struct snd_device <snd_device>` object. A component | ||
600 | can be a PCM instance, a control interface, a raw MIDI interface, etc. | ||
601 | Each such instance has one component entry. | ||
602 | |||
603 | A component can be created via :c:func:`snd_device_new()` | ||
604 | function. | ||
605 | |||
606 | :: | ||
607 | |||
608 | snd_device_new(card, SNDRV_DEV_XXX, chip, &ops); | ||
609 | |||
610 | This takes the card pointer, the device-level (``SNDRV_DEV_XXX``), the | ||
611 | data pointer, and the callback pointers (``&ops``). The device-level | ||
612 | defines the type of components and the order of registration and | ||
613 | de-registration. For most components, the device-level is already | ||
614 | defined. For a user-defined component, you can use | ||
615 | ``SNDRV_DEV_LOWLEVEL``. | ||
616 | |||
617 | This function itself doesn't allocate the data space. The data must be | ||
618 | allocated manually beforehand, and its pointer is passed as the | ||
619 | argument. This pointer (``chip`` in the above example) is used as the | ||
620 | identifier for the instance. | ||
621 | |||
622 | Each pre-defined ALSA component such as ac97 and pcm calls | ||
623 | :c:func:`snd_device_new()` inside its constructor. The destructor | ||
624 | for each component is defined in the callback pointers. Hence, you don't | ||
625 | need to take care of calling a destructor for such a component. | ||
626 | |||
627 | If you wish to create your own component, you need to set the destructor | ||
628 | function to the dev_free callback in the ``ops``, so that it can be | ||
629 | released automatically via :c:func:`snd_card_free()`. The next | ||
630 | example will show an implementation of chip-specific data. | ||
631 | |||
632 | Chip-Specific Data | ||
633 | ------------------ | ||
634 | |||
635 | Chip-specific information, e.g. the I/O port address, its resource | ||
636 | pointer, or the irq number, is stored in the chip-specific record. | ||
637 | |||
638 | :: | ||
639 | |||
640 | struct mychip { | ||
641 | .... | ||
642 | }; | ||
643 | |||
644 | |||
645 | In general, there are two ways of allocating the chip record. | ||
646 | |||
647 | 1. Allocating via :c:func:`snd_card_new()`. | ||
648 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
649 | |||
650 | As mentioned above, you can pass the extra-data-length to the 5th | ||
651 | argument of :c:func:`snd_card_new()`, i.e. | ||
652 | |||
653 | :: | ||
654 | |||
655 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, | ||
656 | sizeof(struct mychip), &card); | ||
657 | |||
658 | :c:type:`struct mychip <mychip>` is the type of the chip record. | ||
659 | |||
660 | In return, the allocated record can be accessed as | ||
661 | |||
662 | :: | ||
663 | |||
664 | struct mychip *chip = card->private_data; | ||
665 | |||
666 | With this method, you don't have to allocate twice. The record is | ||
667 | released together with the card instance. | ||
668 | |||
669 | 2. Allocating an extra device. | ||
670 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
671 | |||
672 | After allocating a card instance via :c:func:`snd_card_new()` | ||
673 | (with ``0`` on the 4th arg), call :c:func:`kzalloc()`. | ||
674 | |||
675 | :: | ||
676 | |||
677 | struct snd_card *card; | ||
678 | struct mychip *chip; | ||
679 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, | ||
680 | 0, &card); | ||
681 | ..... | ||
682 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); | ||
683 | |||
684 | The chip record should have the field to hold the card pointer at least, | ||
685 | |||
686 | :: | ||
687 | |||
688 | struct mychip { | ||
689 | struct snd_card *card; | ||
690 | .... | ||
691 | }; | ||
692 | |||
693 | |||
694 | Then, set the card pointer in the returned chip instance. | ||
695 | |||
696 | :: | ||
697 | |||
698 | chip->card = card; | ||
699 | |||
700 | Next, initialize the fields, and register this chip record as a | ||
701 | low-level device with a specified ``ops``, | ||
702 | |||
703 | :: | ||
704 | |||
705 | static struct snd_device_ops ops = { | ||
706 | .dev_free = snd_mychip_dev_free, | ||
707 | }; | ||
708 | .... | ||
709 | snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); | ||
710 | |||
711 | :c:func:`snd_mychip_dev_free()` is the device-destructor | ||
712 | function, which will call the real destructor. | ||
713 | |||
714 | :: | ||
715 | |||
716 | static int snd_mychip_dev_free(struct snd_device *device) | ||
717 | { | ||
718 | return snd_mychip_free(device->device_data); | ||
719 | } | ||
720 | |||
721 | where :c:func:`snd_mychip_free()` is the real destructor. | ||
722 | |||
723 | Registration and Release | ||
724 | ------------------------ | ||
725 | |||
726 | After all components are assigned, register the card instance by calling | ||
727 | :c:func:`snd_card_register()`. Access to the device files is | ||
728 | enabled at this point. That is, before | ||
729 | :c:func:`snd_card_register()` is called, the components are safely | ||
730 | inaccessible from external side. If this call fails, exit the probe | ||
731 | function after releasing the card via :c:func:`snd_card_free()`. | ||
732 | |||
733 | For releasing the card instance, you can call simply | ||
734 | :c:func:`snd_card_free()`. As mentioned earlier, all components | ||
735 | are released automatically by this call. | ||
736 | |||
737 | For a device which allows hotplugging, you can use | ||
738 | :c:func:`snd_card_free_when_closed()`. This one will postpone | ||
739 | the destruction until all devices are closed. | ||
740 | |||
741 | PCI Resource Management | ||
742 | ======================= | ||
743 | |||
744 | Full Code Example | ||
745 | ----------------- | ||
746 | |||
747 | In this section, we'll complete the chip-specific constructor, | ||
748 | destructor and PCI entries. Example code is shown first, below. | ||
749 | |||
750 | :: | ||
751 | |||
752 | struct mychip { | ||
753 | struct snd_card *card; | ||
754 | struct pci_dev *pci; | ||
755 | |||
756 | unsigned long port; | ||
757 | int irq; | ||
758 | }; | ||
759 | |||
760 | static int snd_mychip_free(struct mychip *chip) | ||
761 | { | ||
762 | /* disable hardware here if any */ | ||
763 | .... /* (not implemented in this document) */ | ||
764 | |||
765 | /* release the irq */ | ||
766 | if (chip->irq >= 0) | ||
767 | free_irq(chip->irq, chip); | ||
768 | /* release the I/O ports & memory */ | ||
769 | pci_release_regions(chip->pci); | ||
770 | /* disable the PCI entry */ | ||
771 | pci_disable_device(chip->pci); | ||
772 | /* release the data */ | ||
773 | kfree(chip); | ||
774 | return 0; | ||
775 | } | ||
776 | |||
777 | /* chip-specific constructor */ | ||
778 | static int snd_mychip_create(struct snd_card *card, | ||
779 | struct pci_dev *pci, | ||
780 | struct mychip **rchip) | ||
781 | { | ||
782 | struct mychip *chip; | ||
783 | int err; | ||
784 | static struct snd_device_ops ops = { | ||
785 | .dev_free = snd_mychip_dev_free, | ||
786 | }; | ||
787 | |||
788 | *rchip = NULL; | ||
789 | |||
790 | /* initialize the PCI entry */ | ||
791 | err = pci_enable_device(pci); | ||
792 | if (err < 0) | ||
793 | return err; | ||
794 | /* check PCI availability (28bit DMA) */ | ||
795 | if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || | ||
796 | pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { | ||
797 | printk(KERN_ERR "error to set 28bit mask DMA\n"); | ||
798 | pci_disable_device(pci); | ||
799 | return -ENXIO; | ||
800 | } | ||
801 | |||
802 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); | ||
803 | if (chip == NULL) { | ||
804 | pci_disable_device(pci); | ||
805 | return -ENOMEM; | ||
806 | } | ||
807 | |||
808 | /* initialize the stuff */ | ||
809 | chip->card = card; | ||
810 | chip->pci = pci; | ||
811 | chip->irq = -1; | ||
812 | |||
813 | /* (1) PCI resource allocation */ | ||
814 | err = pci_request_regions(pci, "My Chip"); | ||
815 | if (err < 0) { | ||
816 | kfree(chip); | ||
817 | pci_disable_device(pci); | ||
818 | return err; | ||
819 | } | ||
820 | chip->port = pci_resource_start(pci, 0); | ||
821 | if (request_irq(pci->irq, snd_mychip_interrupt, | ||
822 | IRQF_SHARED, KBUILD_MODNAME, chip)) { | ||
823 | printk(KERN_ERR "cannot grab irq %d\n", pci->irq); | ||
824 | snd_mychip_free(chip); | ||
825 | return -EBUSY; | ||
826 | } | ||
827 | chip->irq = pci->irq; | ||
828 | |||
829 | /* (2) initialization of the chip hardware */ | ||
830 | .... /* (not implemented in this document) */ | ||
831 | |||
832 | err = snd_device_new(card, SNDRV_DEV_LOWLEVEL, chip, &ops); | ||
833 | if (err < 0) { | ||
834 | snd_mychip_free(chip); | ||
835 | return err; | ||
836 | } | ||
837 | |||
838 | *rchip = chip; | ||
839 | return 0; | ||
840 | } | ||
841 | |||
842 | /* PCI IDs */ | ||
843 | static struct pci_device_id snd_mychip_ids[] = { | ||
844 | { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, | ||
845 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | ||
846 | .... | ||
847 | { 0, } | ||
848 | }; | ||
849 | MODULE_DEVICE_TABLE(pci, snd_mychip_ids); | ||
850 | |||
851 | /* pci_driver definition */ | ||
852 | static struct pci_driver driver = { | ||
853 | .name = KBUILD_MODNAME, | ||
854 | .id_table = snd_mychip_ids, | ||
855 | .probe = snd_mychip_probe, | ||
856 | .remove = snd_mychip_remove, | ||
857 | }; | ||
858 | |||
859 | /* module initialization */ | ||
860 | static int __init alsa_card_mychip_init(void) | ||
861 | { | ||
862 | return pci_register_driver(&driver); | ||
863 | } | ||
864 | |||
865 | /* module clean up */ | ||
866 | static void __exit alsa_card_mychip_exit(void) | ||
867 | { | ||
868 | pci_unregister_driver(&driver); | ||
869 | } | ||
870 | |||
871 | module_init(alsa_card_mychip_init) | ||
872 | module_exit(alsa_card_mychip_exit) | ||
873 | |||
874 | EXPORT_NO_SYMBOLS; /* for old kernels only */ | ||
875 | |||
876 | Some Hafta's | ||
877 | ------------ | ||
878 | |||
879 | The allocation of PCI resources is done in the ``probe`` function, and | ||
880 | usually an extra :c:func:`xxx_create()` function is written for this | ||
881 | purpose. | ||
882 | |||
883 | In the case of PCI devices, you first have to call the | ||
884 | :c:func:`pci_enable_device()` function before allocating | ||
885 | resources. Also, you need to set the proper PCI DMA mask to limit the | ||
886 | accessed I/O range. In some cases, you might need to call | ||
887 | :c:func:`pci_set_master()` function, too. | ||
888 | |||
889 | Suppose the 28bit mask, and the code to be added would be like: | ||
890 | |||
891 | :: | ||
892 | |||
893 | err = pci_enable_device(pci); | ||
894 | if (err < 0) | ||
895 | return err; | ||
896 | if (pci_set_dma_mask(pci, DMA_BIT_MASK(28)) < 0 || | ||
897 | pci_set_consistent_dma_mask(pci, DMA_BIT_MASK(28)) < 0) { | ||
898 | printk(KERN_ERR "error to set 28bit mask DMA\n"); | ||
899 | pci_disable_device(pci); | ||
900 | return -ENXIO; | ||
901 | } | ||
902 | |||
903 | |||
904 | Resource Allocation | ||
905 | ------------------- | ||
906 | |||
907 | The allocation of I/O ports and irqs is done via standard kernel | ||
908 | functions. Unlike ALSA ver.0.5.x., there are no helpers for that. And | ||
909 | these resources must be released in the destructor function (see below). | ||
910 | Also, on ALSA 0.9.x, you don't need to allocate (pseudo-)DMA for PCI | ||
911 | like in ALSA 0.5.x. | ||
912 | |||
913 | Now assume that the PCI device has an I/O port with 8 bytes and an | ||
914 | interrupt. Then :c:type:`struct mychip <mychip>` will have the | ||
915 | following fields: | ||
916 | |||
917 | :: | ||
918 | |||
919 | struct mychip { | ||
920 | struct snd_card *card; | ||
921 | |||
922 | unsigned long port; | ||
923 | int irq; | ||
924 | }; | ||
925 | |||
926 | |||
927 | For an I/O port (and also a memory region), you need to have the | ||
928 | resource pointer for the standard resource management. For an irq, you | ||
929 | have to keep only the irq number (integer). But you need to initialize | ||
930 | this number as -1 before actual allocation, since irq 0 is valid. The | ||
931 | port address and its resource pointer can be initialized as null by | ||
932 | :c:func:`kzalloc()` automatically, so you don't have to take care of | ||
933 | resetting them. | ||
934 | |||
935 | The allocation of an I/O port is done like this: | ||
936 | |||
937 | :: | ||
938 | |||
939 | err = pci_request_regions(pci, "My Chip"); | ||
940 | if (err < 0) { | ||
941 | kfree(chip); | ||
942 | pci_disable_device(pci); | ||
943 | return err; | ||
944 | } | ||
945 | chip->port = pci_resource_start(pci, 0); | ||
946 | |||
947 | It will reserve the I/O port region of 8 bytes of the given PCI device. | ||
948 | The returned value, ``chip->res_port``, is allocated via | ||
949 | :c:func:`kmalloc()` by :c:func:`request_region()`. The pointer | ||
950 | must be released via :c:func:`kfree()`, but there is a problem with | ||
951 | this. This issue will be explained later. | ||
952 | |||
953 | The allocation of an interrupt source is done like this: | ||
954 | |||
955 | :: | ||
956 | |||
957 | if (request_irq(pci->irq, snd_mychip_interrupt, | ||
958 | IRQF_SHARED, KBUILD_MODNAME, chip)) { | ||
959 | printk(KERN_ERR "cannot grab irq %d\n", pci->irq); | ||
960 | snd_mychip_free(chip); | ||
961 | return -EBUSY; | ||
962 | } | ||
963 | chip->irq = pci->irq; | ||
964 | |||
965 | where :c:func:`snd_mychip_interrupt()` is the interrupt handler | ||
966 | defined `later <#pcm-interface-interrupt-handler>`__. Note that | ||
967 | ``chip->irq`` should be defined only when :c:func:`request_irq()` | ||
968 | succeeded. | ||
969 | |||
970 | On the PCI bus, interrupts can be shared. Thus, ``IRQF_SHARED`` is used | ||
971 | as the interrupt flag of :c:func:`request_irq()`. | ||
972 | |||
973 | The last argument of :c:func:`request_irq()` is the data pointer | ||
974 | passed to the interrupt handler. Usually, the chip-specific record is | ||
975 | used for that, but you can use what you like, too. | ||
976 | |||
977 | I won't give details about the interrupt handler at this point, but at | ||
978 | least its appearance can be explained now. The interrupt handler looks | ||
979 | usually like the following: | ||
980 | |||
981 | :: | ||
982 | |||
983 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id) | ||
984 | { | ||
985 | struct mychip *chip = dev_id; | ||
986 | .... | ||
987 | return IRQ_HANDLED; | ||
988 | } | ||
989 | |||
990 | |||
991 | Now let's write the corresponding destructor for the resources above. | ||
992 | The role of destructor is simple: disable the hardware (if already | ||
993 | activated) and release the resources. So far, we have no hardware part, | ||
994 | so the disabling code is not written here. | ||
995 | |||
996 | To release the resources, the “check-and-release” method is a safer way. | ||
997 | For the interrupt, do like this: | ||
998 | |||
999 | :: | ||
1000 | |||
1001 | if (chip->irq >= 0) | ||
1002 | free_irq(chip->irq, chip); | ||
1003 | |||
1004 | Since the irq number can start from 0, you should initialize | ||
1005 | ``chip->irq`` with a negative value (e.g. -1), so that you can check | ||
1006 | the validity of the irq number as above. | ||
1007 | |||
1008 | When you requested I/O ports or memory regions via | ||
1009 | :c:func:`pci_request_region()` or | ||
1010 | :c:func:`pci_request_regions()` like in this example, release the | ||
1011 | resource(s) using the corresponding function, | ||
1012 | :c:func:`pci_release_region()` or | ||
1013 | :c:func:`pci_release_regions()`. | ||
1014 | |||
1015 | :: | ||
1016 | |||
1017 | pci_release_regions(chip->pci); | ||
1018 | |||
1019 | When you requested manually via :c:func:`request_region()` or | ||
1020 | :c:func:`request_mem_region()`, you can release it via | ||
1021 | :c:func:`release_resource()`. Suppose that you keep the resource | ||
1022 | pointer returned from :c:func:`request_region()` in | ||
1023 | chip->res_port, the release procedure looks like: | ||
1024 | |||
1025 | :: | ||
1026 | |||
1027 | release_and_free_resource(chip->res_port); | ||
1028 | |||
1029 | Don't forget to call :c:func:`pci_disable_device()` before the | ||
1030 | end. | ||
1031 | |||
1032 | And finally, release the chip-specific record. | ||
1033 | |||
1034 | :: | ||
1035 | |||
1036 | kfree(chip); | ||
1037 | |||
1038 | We didn't implement the hardware disabling part in the above. If you | ||
1039 | need to do this, please note that the destructor may be called even | ||
1040 | before the initialization of the chip is completed. It would be better | ||
1041 | to have a flag to skip hardware disabling if the hardware was not | ||
1042 | initialized yet. | ||
1043 | |||
1044 | When the chip-data is assigned to the card using | ||
1045 | :c:func:`snd_device_new()` with ``SNDRV_DEV_LOWLELVEL`` , its | ||
1046 | destructor is called at the last. That is, it is assured that all other | ||
1047 | components like PCMs and controls have already been released. You don't | ||
1048 | have to stop PCMs, etc. explicitly, but just call low-level hardware | ||
1049 | stopping. | ||
1050 | |||
1051 | The management of a memory-mapped region is almost as same as the | ||
1052 | management of an I/O port. You'll need three fields like the | ||
1053 | following: | ||
1054 | |||
1055 | :: | ||
1056 | |||
1057 | struct mychip { | ||
1058 | .... | ||
1059 | unsigned long iobase_phys; | ||
1060 | void __iomem *iobase_virt; | ||
1061 | }; | ||
1062 | |||
1063 | and the allocation would be like below: | ||
1064 | |||
1065 | :: | ||
1066 | |||
1067 | if ((err = pci_request_regions(pci, "My Chip")) < 0) { | ||
1068 | kfree(chip); | ||
1069 | return err; | ||
1070 | } | ||
1071 | chip->iobase_phys = pci_resource_start(pci, 0); | ||
1072 | chip->iobase_virt = ioremap_nocache(chip->iobase_phys, | ||
1073 | pci_resource_len(pci, 0)); | ||
1074 | |||
1075 | and the corresponding destructor would be: | ||
1076 | |||
1077 | :: | ||
1078 | |||
1079 | static int snd_mychip_free(struct mychip *chip) | ||
1080 | { | ||
1081 | .... | ||
1082 | if (chip->iobase_virt) | ||
1083 | iounmap(chip->iobase_virt); | ||
1084 | .... | ||
1085 | pci_release_regions(chip->pci); | ||
1086 | .... | ||
1087 | } | ||
1088 | |||
1089 | PCI Entries | ||
1090 | ----------- | ||
1091 | |||
1092 | So far, so good. Let's finish the missing PCI stuff. At first, we need a | ||
1093 | :c:type:`struct pci_device_id <pci_device_id>` table for | ||
1094 | this chipset. It's a table of PCI vendor/device ID number, and some | ||
1095 | masks. | ||
1096 | |||
1097 | For example, | ||
1098 | |||
1099 | :: | ||
1100 | |||
1101 | static struct pci_device_id snd_mychip_ids[] = { | ||
1102 | { PCI_VENDOR_ID_FOO, PCI_DEVICE_ID_BAR, | ||
1103 | PCI_ANY_ID, PCI_ANY_ID, 0, 0, 0, }, | ||
1104 | .... | ||
1105 | { 0, } | ||
1106 | }; | ||
1107 | MODULE_DEVICE_TABLE(pci, snd_mychip_ids); | ||
1108 | |||
1109 | The first and second fields of the :c:type:`struct pci_device_id | ||
1110 | <pci_device_id>` structure are the vendor and device IDs. If you | ||
1111 | have no reason to filter the matching devices, you can leave the | ||
1112 | remaining fields as above. The last field of the :c:type:`struct | ||
1113 | pci_device_id <pci_device_id>` struct contains private data | ||
1114 | for this entry. You can specify any value here, for example, to define | ||
1115 | specific operations for supported device IDs. Such an example is found | ||
1116 | in the intel8x0 driver. | ||
1117 | |||
1118 | The last entry of this list is the terminator. You must specify this | ||
1119 | all-zero entry. | ||
1120 | |||
1121 | Then, prepare the :c:type:`struct pci_driver <pci_driver>` | ||
1122 | record: | ||
1123 | |||
1124 | :: | ||
1125 | |||
1126 | static struct pci_driver driver = { | ||
1127 | .name = KBUILD_MODNAME, | ||
1128 | .id_table = snd_mychip_ids, | ||
1129 | .probe = snd_mychip_probe, | ||
1130 | .remove = snd_mychip_remove, | ||
1131 | }; | ||
1132 | |||
1133 | The ``probe`` and ``remove`` functions have already been defined in | ||
1134 | the previous sections. The ``name`` field is the name string of this | ||
1135 | device. Note that you must not use a slash “/” in this string. | ||
1136 | |||
1137 | And at last, the module entries: | ||
1138 | |||
1139 | :: | ||
1140 | |||
1141 | static int __init alsa_card_mychip_init(void) | ||
1142 | { | ||
1143 | return pci_register_driver(&driver); | ||
1144 | } | ||
1145 | |||
1146 | static void __exit alsa_card_mychip_exit(void) | ||
1147 | { | ||
1148 | pci_unregister_driver(&driver); | ||
1149 | } | ||
1150 | |||
1151 | module_init(alsa_card_mychip_init) | ||
1152 | module_exit(alsa_card_mychip_exit) | ||
1153 | |||
1154 | Note that these module entries are tagged with ``__init`` and ``__exit`` | ||
1155 | prefixes. | ||
1156 | |||
1157 | Oh, one thing was forgotten. If you have no exported symbols, you need | ||
1158 | to declare it in 2.2 or 2.4 kernels (it's not necessary in 2.6 kernels). | ||
1159 | |||
1160 | :: | ||
1161 | |||
1162 | EXPORT_NO_SYMBOLS; | ||
1163 | |||
1164 | That's all! | ||
1165 | |||
1166 | PCM Interface | ||
1167 | ============= | ||
1168 | |||
1169 | General | ||
1170 | ------- | ||
1171 | |||
1172 | The PCM middle layer of ALSA is quite powerful and it is only necessary | ||
1173 | for each driver to implement the low-level functions to access its | ||
1174 | hardware. | ||
1175 | |||
1176 | For accessing to the PCM layer, you need to include ``<sound/pcm.h>`` | ||
1177 | first. In addition, ``<sound/pcm_params.h>`` might be needed if you | ||
1178 | access to some functions related with hw_param. | ||
1179 | |||
1180 | Each card device can have up to four pcm instances. A pcm instance | ||
1181 | corresponds to a pcm device file. The limitation of number of instances | ||
1182 | comes only from the available bit size of the Linux's device numbers. | ||
1183 | Once when 64bit device number is used, we'll have more pcm instances | ||
1184 | available. | ||
1185 | |||
1186 | A pcm instance consists of pcm playback and capture streams, and each | ||
1187 | pcm stream consists of one or more pcm substreams. Some soundcards | ||
1188 | support multiple playback functions. For example, emu10k1 has a PCM | ||
1189 | playback of 32 stereo substreams. In this case, at each open, a free | ||
1190 | substream is (usually) automatically chosen and opened. Meanwhile, when | ||
1191 | only one substream exists and it was already opened, the successful open | ||
1192 | will either block or error with ``EAGAIN`` according to the file open | ||
1193 | mode. But you don't have to care about such details in your driver. The | ||
1194 | PCM middle layer will take care of such work. | ||
1195 | |||
1196 | Full Code Example | ||
1197 | ----------------- | ||
1198 | |||
1199 | The example code below does not include any hardware access routines but | ||
1200 | shows only the skeleton, how to build up the PCM interfaces. | ||
1201 | |||
1202 | :: | ||
1203 | |||
1204 | #include <sound/pcm.h> | ||
1205 | .... | ||
1206 | |||
1207 | /* hardware definition */ | ||
1208 | static struct snd_pcm_hardware snd_mychip_playback_hw = { | ||
1209 | .info = (SNDRV_PCM_INFO_MMAP | | ||
1210 | SNDRV_PCM_INFO_INTERLEAVED | | ||
1211 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | ||
1212 | SNDRV_PCM_INFO_MMAP_VALID), | ||
1213 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | ||
1214 | .rates = SNDRV_PCM_RATE_8000_48000, | ||
1215 | .rate_min = 8000, | ||
1216 | .rate_max = 48000, | ||
1217 | .channels_min = 2, | ||
1218 | .channels_max = 2, | ||
1219 | .buffer_bytes_max = 32768, | ||
1220 | .period_bytes_min = 4096, | ||
1221 | .period_bytes_max = 32768, | ||
1222 | .periods_min = 1, | ||
1223 | .periods_max = 1024, | ||
1224 | }; | ||
1225 | |||
1226 | /* hardware definition */ | ||
1227 | static struct snd_pcm_hardware snd_mychip_capture_hw = { | ||
1228 | .info = (SNDRV_PCM_INFO_MMAP | | ||
1229 | SNDRV_PCM_INFO_INTERLEAVED | | ||
1230 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | ||
1231 | SNDRV_PCM_INFO_MMAP_VALID), | ||
1232 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | ||
1233 | .rates = SNDRV_PCM_RATE_8000_48000, | ||
1234 | .rate_min = 8000, | ||
1235 | .rate_max = 48000, | ||
1236 | .channels_min = 2, | ||
1237 | .channels_max = 2, | ||
1238 | .buffer_bytes_max = 32768, | ||
1239 | .period_bytes_min = 4096, | ||
1240 | .period_bytes_max = 32768, | ||
1241 | .periods_min = 1, | ||
1242 | .periods_max = 1024, | ||
1243 | }; | ||
1244 | |||
1245 | /* open callback */ | ||
1246 | static int snd_mychip_playback_open(struct snd_pcm_substream *substream) | ||
1247 | { | ||
1248 | struct mychip *chip = snd_pcm_substream_chip(substream); | ||
1249 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
1250 | |||
1251 | runtime->hw = snd_mychip_playback_hw; | ||
1252 | /* more hardware-initialization will be done here */ | ||
1253 | .... | ||
1254 | return 0; | ||
1255 | } | ||
1256 | |||
1257 | /* close callback */ | ||
1258 | static int snd_mychip_playback_close(struct snd_pcm_substream *substream) | ||
1259 | { | ||
1260 | struct mychip *chip = snd_pcm_substream_chip(substream); | ||
1261 | /* the hardware-specific codes will be here */ | ||
1262 | .... | ||
1263 | return 0; | ||
1264 | |||
1265 | } | ||
1266 | |||
1267 | /* open callback */ | ||
1268 | static int snd_mychip_capture_open(struct snd_pcm_substream *substream) | ||
1269 | { | ||
1270 | struct mychip *chip = snd_pcm_substream_chip(substream); | ||
1271 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
1272 | |||
1273 | runtime->hw = snd_mychip_capture_hw; | ||
1274 | /* more hardware-initialization will be done here */ | ||
1275 | .... | ||
1276 | return 0; | ||
1277 | } | ||
1278 | |||
1279 | /* close callback */ | ||
1280 | static int snd_mychip_capture_close(struct snd_pcm_substream *substream) | ||
1281 | { | ||
1282 | struct mychip *chip = snd_pcm_substream_chip(substream); | ||
1283 | /* the hardware-specific codes will be here */ | ||
1284 | .... | ||
1285 | return 0; | ||
1286 | |||
1287 | } | ||
1288 | |||
1289 | /* hw_params callback */ | ||
1290 | static int snd_mychip_pcm_hw_params(struct snd_pcm_substream *substream, | ||
1291 | struct snd_pcm_hw_params *hw_params) | ||
1292 | { | ||
1293 | return snd_pcm_lib_malloc_pages(substream, | ||
1294 | params_buffer_bytes(hw_params)); | ||
1295 | } | ||
1296 | |||
1297 | /* hw_free callback */ | ||
1298 | static int snd_mychip_pcm_hw_free(struct snd_pcm_substream *substream) | ||
1299 | { | ||
1300 | return snd_pcm_lib_free_pages(substream); | ||
1301 | } | ||
1302 | |||
1303 | /* prepare callback */ | ||
1304 | static int snd_mychip_pcm_prepare(struct snd_pcm_substream *substream) | ||
1305 | { | ||
1306 | struct mychip *chip = snd_pcm_substream_chip(substream); | ||
1307 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
1308 | |||
1309 | /* set up the hardware with the current configuration | ||
1310 | * for example... | ||
1311 | */ | ||
1312 | mychip_set_sample_format(chip, runtime->format); | ||
1313 | mychip_set_sample_rate(chip, runtime->rate); | ||
1314 | mychip_set_channels(chip, runtime->channels); | ||
1315 | mychip_set_dma_setup(chip, runtime->dma_addr, | ||
1316 | chip->buffer_size, | ||
1317 | chip->period_size); | ||
1318 | return 0; | ||
1319 | } | ||
1320 | |||
1321 | /* trigger callback */ | ||
1322 | static int snd_mychip_pcm_trigger(struct snd_pcm_substream *substream, | ||
1323 | int cmd) | ||
1324 | { | ||
1325 | switch (cmd) { | ||
1326 | case SNDRV_PCM_TRIGGER_START: | ||
1327 | /* do something to start the PCM engine */ | ||
1328 | .... | ||
1329 | break; | ||
1330 | case SNDRV_PCM_TRIGGER_STOP: | ||
1331 | /* do something to stop the PCM engine */ | ||
1332 | .... | ||
1333 | break; | ||
1334 | default: | ||
1335 | return -EINVAL; | ||
1336 | } | ||
1337 | } | ||
1338 | |||
1339 | /* pointer callback */ | ||
1340 | static snd_pcm_uframes_t | ||
1341 | snd_mychip_pcm_pointer(struct snd_pcm_substream *substream) | ||
1342 | { | ||
1343 | struct mychip *chip = snd_pcm_substream_chip(substream); | ||
1344 | unsigned int current_ptr; | ||
1345 | |||
1346 | /* get the current hardware pointer */ | ||
1347 | current_ptr = mychip_get_hw_pointer(chip); | ||
1348 | return current_ptr; | ||
1349 | } | ||
1350 | |||
1351 | /* operators */ | ||
1352 | static struct snd_pcm_ops snd_mychip_playback_ops = { | ||
1353 | .open = snd_mychip_playback_open, | ||
1354 | .close = snd_mychip_playback_close, | ||
1355 | .ioctl = snd_pcm_lib_ioctl, | ||
1356 | .hw_params = snd_mychip_pcm_hw_params, | ||
1357 | .hw_free = snd_mychip_pcm_hw_free, | ||
1358 | .prepare = snd_mychip_pcm_prepare, | ||
1359 | .trigger = snd_mychip_pcm_trigger, | ||
1360 | .pointer = snd_mychip_pcm_pointer, | ||
1361 | }; | ||
1362 | |||
1363 | /* operators */ | ||
1364 | static struct snd_pcm_ops snd_mychip_capture_ops = { | ||
1365 | .open = snd_mychip_capture_open, | ||
1366 | .close = snd_mychip_capture_close, | ||
1367 | .ioctl = snd_pcm_lib_ioctl, | ||
1368 | .hw_params = snd_mychip_pcm_hw_params, | ||
1369 | .hw_free = snd_mychip_pcm_hw_free, | ||
1370 | .prepare = snd_mychip_pcm_prepare, | ||
1371 | .trigger = snd_mychip_pcm_trigger, | ||
1372 | .pointer = snd_mychip_pcm_pointer, | ||
1373 | }; | ||
1374 | |||
1375 | /* | ||
1376 | * definitions of capture are omitted here... | ||
1377 | */ | ||
1378 | |||
1379 | /* create a pcm device */ | ||
1380 | static int snd_mychip_new_pcm(struct mychip *chip) | ||
1381 | { | ||
1382 | struct snd_pcm *pcm; | ||
1383 | int err; | ||
1384 | |||
1385 | err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, &pcm); | ||
1386 | if (err < 0) | ||
1387 | return err; | ||
1388 | pcm->private_data = chip; | ||
1389 | strcpy(pcm->name, "My Chip"); | ||
1390 | chip->pcm = pcm; | ||
1391 | /* set operators */ | ||
1392 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, | ||
1393 | &snd_mychip_playback_ops); | ||
1394 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, | ||
1395 | &snd_mychip_capture_ops); | ||
1396 | /* pre-allocation of buffers */ | ||
1397 | /* NOTE: this may fail */ | ||
1398 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | ||
1399 | snd_dma_pci_data(chip->pci), | ||
1400 | 64*1024, 64*1024); | ||
1401 | return 0; | ||
1402 | } | ||
1403 | |||
1404 | |||
1405 | PCM Constructor | ||
1406 | --------------- | ||
1407 | |||
1408 | A pcm instance is allocated by the :c:func:`snd_pcm_new()` | ||
1409 | function. It would be better to create a constructor for pcm, namely, | ||
1410 | |||
1411 | :: | ||
1412 | |||
1413 | static int snd_mychip_new_pcm(struct mychip *chip) | ||
1414 | { | ||
1415 | struct snd_pcm *pcm; | ||
1416 | int err; | ||
1417 | |||
1418 | err = snd_pcm_new(chip->card, "My Chip", 0, 1, 1, &pcm); | ||
1419 | if (err < 0) | ||
1420 | return err; | ||
1421 | pcm->private_data = chip; | ||
1422 | strcpy(pcm->name, "My Chip"); | ||
1423 | chip->pcm = pcm; | ||
1424 | .... | ||
1425 | return 0; | ||
1426 | } | ||
1427 | |||
1428 | The :c:func:`snd_pcm_new()` function takes four arguments. The | ||
1429 | first argument is the card pointer to which this pcm is assigned, and | ||
1430 | the second is the ID string. | ||
1431 | |||
1432 | The third argument (``index``, 0 in the above) is the index of this new | ||
1433 | pcm. It begins from zero. If you create more than one pcm instances, | ||
1434 | specify the different numbers in this argument. For example, ``index = | ||
1435 | 1`` for the second PCM device. | ||
1436 | |||
1437 | The fourth and fifth arguments are the number of substreams for playback | ||
1438 | and capture, respectively. Here 1 is used for both arguments. When no | ||
1439 | playback or capture substreams are available, pass 0 to the | ||
1440 | corresponding argument. | ||
1441 | |||
1442 | If a chip supports multiple playbacks or captures, you can specify more | ||
1443 | numbers, but they must be handled properly in open/close, etc. | ||
1444 | callbacks. When you need to know which substream you are referring to, | ||
1445 | then it can be obtained from :c:type:`struct snd_pcm_substream | ||
1446 | <snd_pcm_substream>` data passed to each callback as follows: | ||
1447 | |||
1448 | :: | ||
1449 | |||
1450 | struct snd_pcm_substream *substream; | ||
1451 | int index = substream->number; | ||
1452 | |||
1453 | |||
1454 | After the pcm is created, you need to set operators for each pcm stream. | ||
1455 | |||
1456 | :: | ||
1457 | |||
1458 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_PLAYBACK, | ||
1459 | &snd_mychip_playback_ops); | ||
1460 | snd_pcm_set_ops(pcm, SNDRV_PCM_STREAM_CAPTURE, | ||
1461 | &snd_mychip_capture_ops); | ||
1462 | |||
1463 | The operators are defined typically like this: | ||
1464 | |||
1465 | :: | ||
1466 | |||
1467 | static struct snd_pcm_ops snd_mychip_playback_ops = { | ||
1468 | .open = snd_mychip_pcm_open, | ||
1469 | .close = snd_mychip_pcm_close, | ||
1470 | .ioctl = snd_pcm_lib_ioctl, | ||
1471 | .hw_params = snd_mychip_pcm_hw_params, | ||
1472 | .hw_free = snd_mychip_pcm_hw_free, | ||
1473 | .prepare = snd_mychip_pcm_prepare, | ||
1474 | .trigger = snd_mychip_pcm_trigger, | ||
1475 | .pointer = snd_mychip_pcm_pointer, | ||
1476 | }; | ||
1477 | |||
1478 | All the callbacks are described in the Operators_ subsection. | ||
1479 | |||
1480 | After setting the operators, you probably will want to pre-allocate the | ||
1481 | buffer. For the pre-allocation, simply call the following: | ||
1482 | |||
1483 | :: | ||
1484 | |||
1485 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | ||
1486 | snd_dma_pci_data(chip->pci), | ||
1487 | 64*1024, 64*1024); | ||
1488 | |||
1489 | It will allocate a buffer up to 64kB as default. Buffer management | ||
1490 | details will be described in the later section `Buffer and Memory | ||
1491 | Management`_. | ||
1492 | |||
1493 | Additionally, you can set some extra information for this pcm in | ||
1494 | ``pcm->info_flags``. The available values are defined as | ||
1495 | ``SNDRV_PCM_INFO_XXX`` in ``<sound/asound.h>``, which is used for the | ||
1496 | hardware definition (described later). When your soundchip supports only | ||
1497 | half-duplex, specify like this: | ||
1498 | |||
1499 | :: | ||
1500 | |||
1501 | pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX; | ||
1502 | |||
1503 | |||
1504 | ... And the Destructor? | ||
1505 | ----------------------- | ||
1506 | |||
1507 | The destructor for a pcm instance is not always necessary. Since the pcm | ||
1508 | device will be released by the middle layer code automatically, you | ||
1509 | don't have to call the destructor explicitly. | ||
1510 | |||
1511 | The destructor would be necessary if you created special records | ||
1512 | internally and needed to release them. In such a case, set the | ||
1513 | destructor function to ``pcm->private_free``: | ||
1514 | |||
1515 | :: | ||
1516 | |||
1517 | static void mychip_pcm_free(struct snd_pcm *pcm) | ||
1518 | { | ||
1519 | struct mychip *chip = snd_pcm_chip(pcm); | ||
1520 | /* free your own data */ | ||
1521 | kfree(chip->my_private_pcm_data); | ||
1522 | /* do what you like else */ | ||
1523 | .... | ||
1524 | } | ||
1525 | |||
1526 | static int snd_mychip_new_pcm(struct mychip *chip) | ||
1527 | { | ||
1528 | struct snd_pcm *pcm; | ||
1529 | .... | ||
1530 | /* allocate your own data */ | ||
1531 | chip->my_private_pcm_data = kmalloc(...); | ||
1532 | /* set the destructor */ | ||
1533 | pcm->private_data = chip; | ||
1534 | pcm->private_free = mychip_pcm_free; | ||
1535 | .... | ||
1536 | } | ||
1537 | |||
1538 | |||
1539 | |||
1540 | Runtime Pointer - The Chest of PCM Information | ||
1541 | ---------------------------------------------- | ||
1542 | |||
1543 | When the PCM substream is opened, a PCM runtime instance is allocated | ||
1544 | and assigned to the substream. This pointer is accessible via | ||
1545 | ``substream->runtime``. This runtime pointer holds most information you | ||
1546 | need to control the PCM: the copy of hw_params and sw_params | ||
1547 | configurations, the buffer pointers, mmap records, spinlocks, etc. | ||
1548 | |||
1549 | The definition of runtime instance is found in ``<sound/pcm.h>``. Here | ||
1550 | are the contents of this file: | ||
1551 | |||
1552 | :: | ||
1553 | |||
1554 | struct _snd_pcm_runtime { | ||
1555 | /* -- Status -- */ | ||
1556 | struct snd_pcm_substream *trigger_master; | ||
1557 | snd_timestamp_t trigger_tstamp; /* trigger timestamp */ | ||
1558 | int overrange; | ||
1559 | snd_pcm_uframes_t avail_max; | ||
1560 | snd_pcm_uframes_t hw_ptr_base; /* Position at buffer restart */ | ||
1561 | snd_pcm_uframes_t hw_ptr_interrupt; /* Position at interrupt time*/ | ||
1562 | |||
1563 | /* -- HW params -- */ | ||
1564 | snd_pcm_access_t access; /* access mode */ | ||
1565 | snd_pcm_format_t format; /* SNDRV_PCM_FORMAT_* */ | ||
1566 | snd_pcm_subformat_t subformat; /* subformat */ | ||
1567 | unsigned int rate; /* rate in Hz */ | ||
1568 | unsigned int channels; /* channels */ | ||
1569 | snd_pcm_uframes_t period_size; /* period size */ | ||
1570 | unsigned int periods; /* periods */ | ||
1571 | snd_pcm_uframes_t buffer_size; /* buffer size */ | ||
1572 | unsigned int tick_time; /* tick time */ | ||
1573 | snd_pcm_uframes_t min_align; /* Min alignment for the format */ | ||
1574 | size_t byte_align; | ||
1575 | unsigned int frame_bits; | ||
1576 | unsigned int sample_bits; | ||
1577 | unsigned int info; | ||
1578 | unsigned int rate_num; | ||
1579 | unsigned int rate_den; | ||
1580 | |||
1581 | /* -- SW params -- */ | ||
1582 | struct timespec tstamp_mode; /* mmap timestamp is updated */ | ||
1583 | unsigned int period_step; | ||
1584 | unsigned int sleep_min; /* min ticks to sleep */ | ||
1585 | snd_pcm_uframes_t start_threshold; | ||
1586 | snd_pcm_uframes_t stop_threshold; | ||
1587 | snd_pcm_uframes_t silence_threshold; /* Silence filling happens when | ||
1588 | noise is nearest than this */ | ||
1589 | snd_pcm_uframes_t silence_size; /* Silence filling size */ | ||
1590 | snd_pcm_uframes_t boundary; /* pointers wrap point */ | ||
1591 | |||
1592 | snd_pcm_uframes_t silenced_start; | ||
1593 | snd_pcm_uframes_t silenced_size; | ||
1594 | |||
1595 | snd_pcm_sync_id_t sync; /* hardware synchronization ID */ | ||
1596 | |||
1597 | /* -- mmap -- */ | ||
1598 | volatile struct snd_pcm_mmap_status *status; | ||
1599 | volatile struct snd_pcm_mmap_control *control; | ||
1600 | atomic_t mmap_count; | ||
1601 | |||
1602 | /* -- locking / scheduling -- */ | ||
1603 | spinlock_t lock; | ||
1604 | wait_queue_head_t sleep; | ||
1605 | struct timer_list tick_timer; | ||
1606 | struct fasync_struct *fasync; | ||
1607 | |||
1608 | /* -- private section -- */ | ||
1609 | void *private_data; | ||
1610 | void (*private_free)(struct snd_pcm_runtime *runtime); | ||
1611 | |||
1612 | /* -- hardware description -- */ | ||
1613 | struct snd_pcm_hardware hw; | ||
1614 | struct snd_pcm_hw_constraints hw_constraints; | ||
1615 | |||
1616 | /* -- timer -- */ | ||
1617 | unsigned int timer_resolution; /* timer resolution */ | ||
1618 | |||
1619 | /* -- DMA -- */ | ||
1620 | unsigned char *dma_area; /* DMA area */ | ||
1621 | dma_addr_t dma_addr; /* physical bus address (not accessible from main CPU) */ | ||
1622 | size_t dma_bytes; /* size of DMA area */ | ||
1623 | |||
1624 | struct snd_dma_buffer *dma_buffer_p; /* allocated buffer */ | ||
1625 | |||
1626 | #if defined(CONFIG_SND_PCM_OSS) || defined(CONFIG_SND_PCM_OSS_MODULE) | ||
1627 | /* -- OSS things -- */ | ||
1628 | struct snd_pcm_oss_runtime oss; | ||
1629 | #endif | ||
1630 | }; | ||
1631 | |||
1632 | |||
1633 | For the operators (callbacks) of each sound driver, most of these | ||
1634 | records are supposed to be read-only. Only the PCM middle-layer changes | ||
1635 | / updates them. The exceptions are the hardware description (hw) DMA | ||
1636 | buffer information and the private data. Besides, if you use the | ||
1637 | standard buffer allocation method via | ||
1638 | :c:func:`snd_pcm_lib_malloc_pages()`, you don't need to set the | ||
1639 | DMA buffer information by yourself. | ||
1640 | |||
1641 | In the sections below, important records are explained. | ||
1642 | |||
1643 | Hardware Description | ||
1644 | ~~~~~~~~~~~~~~~~~~~~ | ||
1645 | |||
1646 | The hardware descriptor (:c:type:`struct snd_pcm_hardware | ||
1647 | <snd_pcm_hardware>`) contains the definitions of the fundamental | ||
1648 | hardware configuration. Above all, you'll need to define this in the | ||
1649 | `PCM open callback`_. Note that the runtime instance holds the copy of | ||
1650 | the descriptor, not the pointer to the existing descriptor. That is, | ||
1651 | in the open callback, you can modify the copied descriptor | ||
1652 | (``runtime->hw``) as you need. For example, if the maximum number of | ||
1653 | channels is 1 only on some chip models, you can still use the same | ||
1654 | hardware descriptor and change the channels_max later: | ||
1655 | |||
1656 | :: | ||
1657 | |||
1658 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
1659 | ... | ||
1660 | runtime->hw = snd_mychip_playback_hw; /* common definition */ | ||
1661 | if (chip->model == VERY_OLD_ONE) | ||
1662 | runtime->hw.channels_max = 1; | ||
1663 | |||
1664 | Typically, you'll have a hardware descriptor as below: | ||
1665 | |||
1666 | :: | ||
1667 | |||
1668 | static struct snd_pcm_hardware snd_mychip_playback_hw = { | ||
1669 | .info = (SNDRV_PCM_INFO_MMAP | | ||
1670 | SNDRV_PCM_INFO_INTERLEAVED | | ||
1671 | SNDRV_PCM_INFO_BLOCK_TRANSFER | | ||
1672 | SNDRV_PCM_INFO_MMAP_VALID), | ||
1673 | .formats = SNDRV_PCM_FMTBIT_S16_LE, | ||
1674 | .rates = SNDRV_PCM_RATE_8000_48000, | ||
1675 | .rate_min = 8000, | ||
1676 | .rate_max = 48000, | ||
1677 | .channels_min = 2, | ||
1678 | .channels_max = 2, | ||
1679 | .buffer_bytes_max = 32768, | ||
1680 | .period_bytes_min = 4096, | ||
1681 | .period_bytes_max = 32768, | ||
1682 | .periods_min = 1, | ||
1683 | .periods_max = 1024, | ||
1684 | }; | ||
1685 | |||
1686 | - The ``info`` field contains the type and capabilities of this | ||
1687 | pcm. The bit flags are defined in ``<sound/asound.h>`` as | ||
1688 | ``SNDRV_PCM_INFO_XXX``. Here, at least, you have to specify whether | ||
1689 | the mmap is supported and which interleaved format is | ||
1690 | supported. When the hardware supports mmap, add the | ||
1691 | ``SNDRV_PCM_INFO_MMAP`` flag here. When the hardware supports the | ||
1692 | interleaved or the non-interleaved formats, | ||
1693 | ``SNDRV_PCM_INFO_INTERLEAVED`` or ``SNDRV_PCM_INFO_NONINTERLEAVED`` | ||
1694 | flag must be set, respectively. If both are supported, you can set | ||
1695 | both, too. | ||
1696 | |||
1697 | In the above example, ``MMAP_VALID`` and ``BLOCK_TRANSFER`` are | ||
1698 | specified for the OSS mmap mode. Usually both are set. Of course, | ||
1699 | ``MMAP_VALID`` is set only if the mmap is really supported. | ||
1700 | |||
1701 | The other possible flags are ``SNDRV_PCM_INFO_PAUSE`` and | ||
1702 | ``SNDRV_PCM_INFO_RESUME``. The ``PAUSE`` bit means that the pcm | ||
1703 | supports the “pause” operation, while the ``RESUME`` bit means that | ||
1704 | the pcm supports the full “suspend/resume” operation. If the | ||
1705 | ``PAUSE`` flag is set, the ``trigger`` callback below must handle | ||
1706 | the corresponding (pause push/release) commands. The suspend/resume | ||
1707 | trigger commands can be defined even without the ``RESUME`` | ||
1708 | flag. See `Power Management`_ section for details. | ||
1709 | |||
1710 | When the PCM substreams can be synchronized (typically, | ||
1711 | synchronized start/stop of a playback and a capture streams), you | ||
1712 | can give ``SNDRV_PCM_INFO_SYNC_START``, too. In this case, you'll | ||
1713 | need to check the linked-list of PCM substreams in the trigger | ||
1714 | callback. This will be described in the later section. | ||
1715 | |||
1716 | - ``formats`` field contains the bit-flags of supported formats | ||
1717 | (``SNDRV_PCM_FMTBIT_XXX``). If the hardware supports more than one | ||
1718 | format, give all or'ed bits. In the example above, the signed 16bit | ||
1719 | little-endian format is specified. | ||
1720 | |||
1721 | - ``rates`` field contains the bit-flags of supported rates | ||
1722 | (``SNDRV_PCM_RATE_XXX``). When the chip supports continuous rates, | ||
1723 | pass ``CONTINUOUS`` bit additionally. The pre-defined rate bits are | ||
1724 | provided only for typical rates. If your chip supports | ||
1725 | unconventional rates, you need to add the ``KNOT`` bit and set up | ||
1726 | the hardware constraint manually (explained later). | ||
1727 | |||
1728 | - ``rate_min`` and ``rate_max`` define the minimum and maximum sample | ||
1729 | rate. This should correspond somehow to ``rates`` bits. | ||
1730 | |||
1731 | - ``channel_min`` and ``channel_max`` define, as you might already | ||
1732 | expected, the minimum and maximum number of channels. | ||
1733 | |||
1734 | - ``buffer_bytes_max`` defines the maximum buffer size in | ||
1735 | bytes. There is no ``buffer_bytes_min`` field, since it can be | ||
1736 | calculated from the minimum period size and the minimum number of | ||
1737 | periods. Meanwhile, ``period_bytes_min`` and define the minimum and | ||
1738 | maximum size of the period in bytes. ``periods_max`` and | ||
1739 | ``periods_min`` define the maximum and minimum number of periods in | ||
1740 | the buffer. | ||
1741 | |||
1742 | The “period” is a term that corresponds to a fragment in the OSS | ||
1743 | world. The period defines the size at which a PCM interrupt is | ||
1744 | generated. This size strongly depends on the hardware. Generally, | ||
1745 | the smaller period size will give you more interrupts, that is, | ||
1746 | more controls. In the case of capture, this size defines the input | ||
1747 | latency. On the other hand, the whole buffer size defines the | ||
1748 | output latency for the playback direction. | ||
1749 | |||
1750 | - There is also a field ``fifo_size``. This specifies the size of the | ||
1751 | hardware FIFO, but currently it is neither used in the driver nor | ||
1752 | in the alsa-lib. So, you can ignore this field. | ||
1753 | |||
1754 | PCM Configurations | ||
1755 | ~~~~~~~~~~~~~~~~~~ | ||
1756 | |||
1757 | Ok, let's go back again to the PCM runtime records. The most | ||
1758 | frequently referred records in the runtime instance are the PCM | ||
1759 | configurations. The PCM configurations are stored in the runtime | ||
1760 | instance after the application sends ``hw_params`` data via | ||
1761 | alsa-lib. There are many fields copied from hw_params and sw_params | ||
1762 | structs. For example, ``format`` holds the format type chosen by the | ||
1763 | application. This field contains the enum value | ||
1764 | ``SNDRV_PCM_FORMAT_XXX``. | ||
1765 | |||
1766 | One thing to be noted is that the configured buffer and period sizes | ||
1767 | are stored in “frames” in the runtime. In the ALSA world, ``1 frame = | ||
1768 | channels \* samples-size``. For conversion between frames and bytes, | ||
1769 | you can use the :c:func:`frames_to_bytes()` and | ||
1770 | :c:func:`bytes_to_frames()` helper functions. | ||
1771 | |||
1772 | :: | ||
1773 | |||
1774 | period_bytes = frames_to_bytes(runtime, runtime->period_size); | ||
1775 | |||
1776 | Also, many software parameters (sw_params) are stored in frames, too. | ||
1777 | Please check the type of the field. ``snd_pcm_uframes_t`` is for the | ||
1778 | frames as unsigned integer while ``snd_pcm_sframes_t`` is for the | ||
1779 | frames as signed integer. | ||
1780 | |||
1781 | DMA Buffer Information | ||
1782 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
1783 | |||
1784 | The DMA buffer is defined by the following four fields, ``dma_area``, | ||
1785 | ``dma_addr``, ``dma_bytes`` and ``dma_private``. The ``dma_area`` | ||
1786 | holds the buffer pointer (the logical address). You can call | ||
1787 | :c:func:`memcpy()` from/to this pointer. Meanwhile, ``dma_addr`` holds | ||
1788 | the physical address of the buffer. This field is specified only when | ||
1789 | the buffer is a linear buffer. ``dma_bytes`` holds the size of buffer | ||
1790 | in bytes. ``dma_private`` is used for the ALSA DMA allocator. | ||
1791 | |||
1792 | If you use a standard ALSA function, | ||
1793 | :c:func:`snd_pcm_lib_malloc_pages()`, for allocating the buffer, | ||
1794 | these fields are set by the ALSA middle layer, and you should *not* | ||
1795 | change them by yourself. You can read them but not write them. On the | ||
1796 | other hand, if you want to allocate the buffer by yourself, you'll | ||
1797 | need to manage it in hw_params callback. At least, ``dma_bytes`` is | ||
1798 | mandatory. ``dma_area`` is necessary when the buffer is mmapped. If | ||
1799 | your driver doesn't support mmap, this field is not | ||
1800 | necessary. ``dma_addr`` is also optional. You can use dma_private as | ||
1801 | you like, too. | ||
1802 | |||
1803 | Running Status | ||
1804 | ~~~~~~~~~~~~~~ | ||
1805 | |||
1806 | The running status can be referred via ``runtime->status``. This is | ||
1807 | the pointer to the :c:type:`struct snd_pcm_mmap_status | ||
1808 | <snd_pcm_mmap_status>` record. For example, you can get the current | ||
1809 | DMA hardware pointer via ``runtime->status->hw_ptr``. | ||
1810 | |||
1811 | The DMA application pointer can be referred via ``runtime->control``, | ||
1812 | which points to the :c:type:`struct snd_pcm_mmap_control | ||
1813 | <snd_pcm_mmap_control>` record. However, accessing directly to | ||
1814 | this value is not recommended. | ||
1815 | |||
1816 | Private Data | ||
1817 | ~~~~~~~~~~~~ | ||
1818 | |||
1819 | You can allocate a record for the substream and store it in | ||
1820 | ``runtime->private_data``. Usually, this is done in the `PCM open | ||
1821 | callback`_. Don't mix this with ``pcm->private_data``. The | ||
1822 | ``pcm->private_data`` usually points to the chip instance assigned | ||
1823 | statically at the creation of PCM, while the ``runtime->private_data`` | ||
1824 | points to a dynamic data structure created at the PCM open | ||
1825 | callback. | ||
1826 | |||
1827 | :: | ||
1828 | |||
1829 | static int snd_xxx_open(struct snd_pcm_substream *substream) | ||
1830 | { | ||
1831 | struct my_pcm_data *data; | ||
1832 | .... | ||
1833 | data = kmalloc(sizeof(*data), GFP_KERNEL); | ||
1834 | substream->runtime->private_data = data; | ||
1835 | .... | ||
1836 | } | ||
1837 | |||
1838 | |||
1839 | The allocated object must be released in the `close callback`_. | ||
1840 | |||
1841 | Operators | ||
1842 | --------- | ||
1843 | |||
1844 | OK, now let me give details about each pcm callback (``ops``). In | ||
1845 | general, every callback must return 0 if successful, or a negative | ||
1846 | error number such as ``-EINVAL``. To choose an appropriate error | ||
1847 | number, it is advised to check what value other parts of the kernel | ||
1848 | return when the same kind of request fails. | ||
1849 | |||
1850 | The callback function takes at least the argument with :c:type:`struct | ||
1851 | snd_pcm_substream <snd_pcm_substream>` pointer. To retrieve the chip | ||
1852 | record from the given substream instance, you can use the following | ||
1853 | macro. | ||
1854 | |||
1855 | :: | ||
1856 | |||
1857 | int xxx() { | ||
1858 | struct mychip *chip = snd_pcm_substream_chip(substream); | ||
1859 | .... | ||
1860 | } | ||
1861 | |||
1862 | The macro reads ``substream->private_data``, which is a copy of | ||
1863 | ``pcm->private_data``. You can override the former if you need to | ||
1864 | assign different data records per PCM substream. For example, the | ||
1865 | cmi8330 driver assigns different ``private_data`` for playback and | ||
1866 | capture directions, because it uses two different codecs (SB- and | ||
1867 | AD-compatible) for different directions. | ||
1868 | |||
1869 | PCM open callback | ||
1870 | ~~~~~~~~~~~~~~~~~ | ||
1871 | |||
1872 | :: | ||
1873 | |||
1874 | static int snd_xxx_open(struct snd_pcm_substream *substream); | ||
1875 | |||
1876 | This is called when a pcm substream is opened. | ||
1877 | |||
1878 | At least, here you have to initialize the ``runtime->hw`` | ||
1879 | record. Typically, this is done by like this: | ||
1880 | |||
1881 | :: | ||
1882 | |||
1883 | static int snd_xxx_open(struct snd_pcm_substream *substream) | ||
1884 | { | ||
1885 | struct mychip *chip = snd_pcm_substream_chip(substream); | ||
1886 | struct snd_pcm_runtime *runtime = substream->runtime; | ||
1887 | |||
1888 | runtime->hw = snd_mychip_playback_hw; | ||
1889 | return 0; | ||
1890 | } | ||
1891 | |||
1892 | where ``snd_mychip_playback_hw`` is the pre-defined hardware | ||
1893 | description. | ||
1894 | |||
1895 | You can allocate a private data in this callback, as described in | ||
1896 | `Private Data`_ section. | ||
1897 | |||
1898 | If the hardware configuration needs more constraints, set the hardware | ||
1899 | constraints here, too. See Constraints_ for more details. | ||
1900 | |||
1901 | close callback | ||
1902 | ~~~~~~~~~~~~~~ | ||
1903 | |||
1904 | :: | ||
1905 | |||
1906 | static int snd_xxx_close(struct snd_pcm_substream *substream); | ||
1907 | |||
1908 | |||
1909 | Obviously, this is called when a pcm substream is closed. | ||
1910 | |||
1911 | Any private instance for a pcm substream allocated in the ``open`` | ||
1912 | callback will be released here. | ||
1913 | |||
1914 | :: | ||
1915 | |||
1916 | static int snd_xxx_close(struct snd_pcm_substream *substream) | ||
1917 | { | ||
1918 | .... | ||
1919 | kfree(substream->runtime->private_data); | ||
1920 | .... | ||
1921 | } | ||
1922 | |||
1923 | ioctl callback | ||
1924 | ~~~~~~~~~~~~~~ | ||
1925 | |||
1926 | This is used for any special call to pcm ioctls. But usually you can | ||
1927 | pass a generic ioctl callback, :c:func:`snd_pcm_lib_ioctl()`. | ||
1928 | |||
1929 | hw_params callback | ||
1930 | ~~~~~~~~~~~~~~~~~~~ | ||
1931 | |||
1932 | :: | ||
1933 | |||
1934 | static int snd_xxx_hw_params(struct snd_pcm_substream *substream, | ||
1935 | struct snd_pcm_hw_params *hw_params); | ||
1936 | |||
1937 | This is called when the hardware parameter (``hw_params``) is set up | ||
1938 | by the application, that is, once when the buffer size, the period | ||
1939 | size, the format, etc. are defined for the pcm substream. | ||
1940 | |||
1941 | Many hardware setups should be done in this callback, including the | ||
1942 | allocation of buffers. | ||
1943 | |||
1944 | Parameters to be initialized are retrieved by | ||
1945 | :c:func:`params_xxx()` macros. To allocate buffer, you can call a | ||
1946 | helper function, | ||
1947 | |||
1948 | :: | ||
1949 | |||
1950 | snd_pcm_lib_malloc_pages(substream, params_buffer_bytes(hw_params)); | ||
1951 | |||
1952 | :c:func:`snd_pcm_lib_malloc_pages()` is available only when the | ||
1953 | DMA buffers have been pre-allocated. See the section `Buffer Types`_ | ||
1954 | for more details. | ||
1955 | |||
1956 | Note that this and ``prepare`` callbacks may be called multiple times | ||
1957 | per initialization. For example, the OSS emulation may call these | ||
1958 | callbacks at each change via its ioctl. | ||
1959 | |||
1960 | Thus, you need to be careful not to allocate the same buffers many | ||
1961 | times, which will lead to memory leaks! Calling the helper function | ||
1962 | above many times is OK. It will release the previous buffer | ||
1963 | automatically when it was already allocated. | ||
1964 | |||
1965 | Another note is that this callback is non-atomic (schedulable) as | ||
1966 | default, i.e. when no ``nonatomic`` flag set. This is important, | ||
1967 | because the ``trigger`` callback is atomic (non-schedulable). That is, | ||
1968 | mutexes or any schedule-related functions are not available in | ||
1969 | ``trigger`` callback. Please see the subsection Atomicity_ for | ||
1970 | details. | ||
1971 | |||
1972 | hw_free callback | ||
1973 | ~~~~~~~~~~~~~~~~~ | ||
1974 | |||
1975 | :: | ||
1976 | |||
1977 | static int snd_xxx_hw_free(struct snd_pcm_substream *substream); | ||
1978 | |||
1979 | This is called to release the resources allocated via | ||
1980 | ``hw_params``. For example, releasing the buffer via | ||
1981 | :c:func:`snd_pcm_lib_malloc_pages()` is done by calling the | ||
1982 | following: | ||
1983 | |||
1984 | :: | ||
1985 | |||
1986 | snd_pcm_lib_free_pages(substream); | ||
1987 | |||
1988 | This function is always called before the close callback is called. | ||
1989 | Also, the callback may be called multiple times, too. Keep track | ||
1990 | whether the resource was already released. | ||
1991 | |||
1992 | prepare callback | ||
1993 | ~~~~~~~~~~~~~~~~ | ||
1994 | |||
1995 | :: | ||
1996 | |||
1997 | static int snd_xxx_prepare(struct snd_pcm_substream *substream); | ||
1998 | |||
1999 | This callback is called when the pcm is “prepared”. You can set the | ||
2000 | format type, sample rate, etc. here. The difference from ``hw_params`` | ||
2001 | is that the ``prepare`` callback will be called each time | ||
2002 | :c:func:`snd_pcm_prepare()` is called, i.e. when recovering after | ||
2003 | underruns, etc. | ||
2004 | |||
2005 | Note that this callback is now non-atomic. You can use | ||
2006 | schedule-related functions safely in this callback. | ||
2007 | |||
2008 | In this and the following callbacks, you can refer to the values via | ||
2009 | the runtime record, ``substream->runtime``. For example, to get the | ||
2010 | current rate, format or channels, access to ``runtime->rate``, | ||
2011 | ``runtime->format`` or ``runtime->channels``, respectively. The | ||
2012 | physical address of the allocated buffer is set to | ||
2013 | ``runtime->dma_area``. The buffer and period sizes are in | ||
2014 | ``runtime->buffer_size`` and ``runtime->period_size``, respectively. | ||
2015 | |||
2016 | Be careful that this callback will be called many times at each setup, | ||
2017 | too. | ||
2018 | |||
2019 | trigger callback | ||
2020 | ~~~~~~~~~~~~~~~~ | ||
2021 | |||
2022 | :: | ||
2023 | |||
2024 | static int snd_xxx_trigger(struct snd_pcm_substream *substream, int cmd); | ||
2025 | |||
2026 | This is called when the pcm is started, stopped or paused. | ||
2027 | |||
2028 | Which action is specified in the second argument, | ||
2029 | ``SNDRV_PCM_TRIGGER_XXX`` in ``<sound/pcm.h>``. At least, the ``START`` | ||
2030 | and ``STOP`` commands must be defined in this callback. | ||
2031 | |||
2032 | :: | ||
2033 | |||
2034 | switch (cmd) { | ||
2035 | case SNDRV_PCM_TRIGGER_START: | ||
2036 | /* do something to start the PCM engine */ | ||
2037 | break; | ||
2038 | case SNDRV_PCM_TRIGGER_STOP: | ||
2039 | /* do something to stop the PCM engine */ | ||
2040 | break; | ||
2041 | default: | ||
2042 | return -EINVAL; | ||
2043 | } | ||
2044 | |||
2045 | When the pcm supports the pause operation (given in the info field of | ||
2046 | the hardware table), the ``PAUSE_PUSH`` and ``PAUSE_RELEASE`` commands | ||
2047 | must be handled here, too. The former is the command to pause the pcm, | ||
2048 | and the latter to restart the pcm again. | ||
2049 | |||
2050 | When the pcm supports the suspend/resume operation, regardless of full | ||
2051 | or partial suspend/resume support, the ``SUSPEND`` and ``RESUME`` | ||
2052 | commands must be handled, too. These commands are issued when the | ||
2053 | power-management status is changed. Obviously, the ``SUSPEND`` and | ||
2054 | ``RESUME`` commands suspend and resume the pcm substream, and usually, | ||
2055 | they are identical to the ``STOP`` and ``START`` commands, respectively. | ||
2056 | See the `Power Management`_ section for details. | ||
2057 | |||
2058 | As mentioned, this callback is atomic as default unless ``nonatomic`` | ||
2059 | flag set, and you cannot call functions which may sleep. The | ||
2060 | ``trigger`` callback should be as minimal as possible, just really | ||
2061 | triggering the DMA. The other stuff should be initialized | ||
2062 | ``hw_params`` and ``prepare`` callbacks properly beforehand. | ||
2063 | |||
2064 | pointer callback | ||
2065 | ~~~~~~~~~~~~~~~~ | ||
2066 | |||
2067 | :: | ||
2068 | |||
2069 | static snd_pcm_uframes_t snd_xxx_pointer(struct snd_pcm_substream *substream) | ||
2070 | |||
2071 | This callback is called when the PCM middle layer inquires the current | ||
2072 | hardware position on the buffer. The position must be returned in | ||
2073 | frames, ranging from 0 to ``buffer_size - 1``. | ||
2074 | |||
2075 | This is called usually from the buffer-update routine in the pcm | ||
2076 | middle layer, which is invoked when :c:func:`snd_pcm_period_elapsed()` | ||
2077 | is called in the interrupt routine. Then the pcm middle layer updates | ||
2078 | the position and calculates the available space, and wakes up the | ||
2079 | sleeping poll threads, etc. | ||
2080 | |||
2081 | This callback is also atomic as default. | ||
2082 | |||
2083 | copy and silence callbacks | ||
2084 | ~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
2085 | |||
2086 | These callbacks are not mandatory, and can be omitted in most cases. | ||
2087 | These callbacks are used when the hardware buffer cannot be in the | ||
2088 | normal memory space. Some chips have their own buffer on the hardware | ||
2089 | which is not mappable. In such a case, you have to transfer the data | ||
2090 | manually from the memory buffer to the hardware buffer. Or, if the | ||
2091 | buffer is non-contiguous on both physical and virtual memory spaces, | ||
2092 | these callbacks must be defined, too. | ||
2093 | |||
2094 | If these two callbacks are defined, copy and set-silence operations | ||
2095 | are done by them. The detailed will be described in the later section | ||
2096 | `Buffer and Memory Management`_. | ||
2097 | |||
2098 | ack callback | ||
2099 | ~~~~~~~~~~~~ | ||
2100 | |||
2101 | This callback is also not mandatory. This callback is called when the | ||
2102 | ``appl_ptr`` is updated in read or write operations. Some drivers like | ||
2103 | emu10k1-fx and cs46xx need to track the current ``appl_ptr`` for the | ||
2104 | internal buffer, and this callback is useful only for such a purpose. | ||
2105 | |||
2106 | This callback is atomic as default. | ||
2107 | |||
2108 | page callback | ||
2109 | ~~~~~~~~~~~~~ | ||
2110 | |||
2111 | This callback is optional too. This callback is used mainly for | ||
2112 | non-contiguous buffers. The mmap calls this callback to get the page | ||
2113 | address. Some examples will be explained in the later section `Buffer | ||
2114 | and Memory Management`_, too. | ||
2115 | |||
2116 | PCM Interrupt Handler | ||
2117 | --------------------- | ||
2118 | |||
2119 | The rest of pcm stuff is the PCM interrupt handler. The role of PCM | ||
2120 | interrupt handler in the sound driver is to update the buffer position | ||
2121 | and to tell the PCM middle layer when the buffer position goes across | ||
2122 | the prescribed period size. To inform this, call the | ||
2123 | :c:func:`snd_pcm_period_elapsed()` function. | ||
2124 | |||
2125 | There are several types of sound chips to generate the interrupts. | ||
2126 | |||
2127 | Interrupts at the period (fragment) boundary | ||
2128 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
2129 | |||
2130 | This is the most frequently found type: the hardware generates an | ||
2131 | interrupt at each period boundary. In this case, you can call | ||
2132 | :c:func:`snd_pcm_period_elapsed()` at each interrupt. | ||
2133 | |||
2134 | :c:func:`snd_pcm_period_elapsed()` takes the substream pointer as | ||
2135 | its argument. Thus, you need to keep the substream pointer accessible | ||
2136 | from the chip instance. For example, define ``substream`` field in the | ||
2137 | chip record to hold the current running substream pointer, and set the | ||
2138 | pointer value at ``open`` callback (and reset at ``close`` callback). | ||
2139 | |||
2140 | If you acquire a spinlock in the interrupt handler, and the lock is used | ||
2141 | in other pcm callbacks, too, then you have to release the lock before | ||
2142 | calling :c:func:`snd_pcm_period_elapsed()`, because | ||
2143 | :c:func:`snd_pcm_period_elapsed()` calls other pcm callbacks | ||
2144 | inside. | ||
2145 | |||
2146 | Typical code would be like: | ||
2147 | |||
2148 | :: | ||
2149 | |||
2150 | |||
2151 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id) | ||
2152 | { | ||
2153 | struct mychip *chip = dev_id; | ||
2154 | spin_lock(&chip->lock); | ||
2155 | .... | ||
2156 | if (pcm_irq_invoked(chip)) { | ||
2157 | /* call updater, unlock before it */ | ||
2158 | spin_unlock(&chip->lock); | ||
2159 | snd_pcm_period_elapsed(chip->substream); | ||
2160 | spin_lock(&chip->lock); | ||
2161 | /* acknowledge the interrupt if necessary */ | ||
2162 | } | ||
2163 | .... | ||
2164 | spin_unlock(&chip->lock); | ||
2165 | return IRQ_HANDLED; | ||
2166 | } | ||
2167 | |||
2168 | |||
2169 | |||
2170 | High frequency timer interrupts | ||
2171 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
2172 | |||
2173 | This happens when the hardware doesn't generate interrupts at the period | ||
2174 | boundary but issues timer interrupts at a fixed timer rate (e.g. es1968 | ||
2175 | or ymfpci drivers). In this case, you need to check the current hardware | ||
2176 | position and accumulate the processed sample length at each interrupt. | ||
2177 | When the accumulated size exceeds the period size, call | ||
2178 | :c:func:`snd_pcm_period_elapsed()` and reset the accumulator. | ||
2179 | |||
2180 | Typical code would be like the following. | ||
2181 | |||
2182 | :: | ||
2183 | |||
2184 | |||
2185 | static irqreturn_t snd_mychip_interrupt(int irq, void *dev_id) | ||
2186 | { | ||
2187 | struct mychip *chip = dev_id; | ||
2188 | spin_lock(&chip->lock); | ||
2189 | .... | ||
2190 | if (pcm_irq_invoked(chip)) { | ||
2191 | unsigned int last_ptr, size; | ||
2192 | /* get the current hardware pointer (in frames) */ | ||
2193 | last_ptr = get_hw_ptr(chip); | ||
2194 | /* calculate the processed frames since the | ||
2195 | * last update | ||
2196 | */ | ||
2197 | if (last_ptr < chip->last_ptr) | ||
2198 | size = runtime->buffer_size + last_ptr | ||
2199 | - chip->last_ptr; | ||
2200 | else | ||
2201 | size = last_ptr - chip->last_ptr; | ||
2202 | /* remember the last updated point */ | ||
2203 | chip->last_ptr = last_ptr; | ||
2204 | /* accumulate the size */ | ||
2205 | chip->size += size; | ||
2206 | /* over the period boundary? */ | ||
2207 | if (chip->size >= runtime->period_size) { | ||
2208 | /* reset the accumulator */ | ||
2209 | chip->size %= runtime->period_size; | ||
2210 | /* call updater */ | ||
2211 | spin_unlock(&chip->lock); | ||
2212 | snd_pcm_period_elapsed(substream); | ||
2213 | spin_lock(&chip->lock); | ||
2214 | } | ||
2215 | /* acknowledge the interrupt if necessary */ | ||
2216 | } | ||
2217 | .... | ||
2218 | spin_unlock(&chip->lock); | ||
2219 | return IRQ_HANDLED; | ||
2220 | } | ||
2221 | |||
2222 | |||
2223 | |||
2224 | On calling :c:func:`snd_pcm_period_elapsed()` | ||
2225 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
2226 | |||
2227 | In both cases, even if more than one period are elapsed, you don't have | ||
2228 | to call :c:func:`snd_pcm_period_elapsed()` many times. Call only | ||
2229 | once. And the pcm layer will check the current hardware pointer and | ||
2230 | update to the latest status. | ||
2231 | |||
2232 | Atomicity | ||
2233 | --------- | ||
2234 | |||
2235 | One of the most important (and thus difficult to debug) problems in | ||
2236 | kernel programming are race conditions. In the Linux kernel, they are | ||
2237 | usually avoided via spin-locks, mutexes or semaphores. In general, if a | ||
2238 | race condition can happen in an interrupt handler, it has to be managed | ||
2239 | atomically, and you have to use a spinlock to protect the critical | ||
2240 | session. If the critical section is not in interrupt handler code and if | ||
2241 | taking a relatively long time to execute is acceptable, you should use | ||
2242 | mutexes or semaphores instead. | ||
2243 | |||
2244 | As already seen, some pcm callbacks are atomic and some are not. For | ||
2245 | example, the ``hw_params`` callback is non-atomic, while ``trigger`` | ||
2246 | callback is atomic. This means, the latter is called already in a | ||
2247 | spinlock held by the PCM middle layer. Please take this atomicity into | ||
2248 | account when you choose a locking scheme in the callbacks. | ||
2249 | |||
2250 | In the atomic callbacks, you cannot use functions which may call | ||
2251 | :c:func:`schedule()` or go to :c:func:`sleep()`. Semaphores and | ||
2252 | mutexes can sleep, and hence they cannot be used inside the atomic | ||
2253 | callbacks (e.g. ``trigger`` callback). To implement some delay in such a | ||
2254 | callback, please use :c:func:`udelay()` or :c:func:`mdelay()`. | ||
2255 | |||
2256 | All three atomic callbacks (trigger, pointer, and ack) are called with | ||
2257 | local interrupts disabled. | ||
2258 | |||
2259 | The recent changes in PCM core code, however, allow all PCM operations | ||
2260 | to be non-atomic. This assumes that the all caller sides are in | ||
2261 | non-atomic contexts. For example, the function | ||
2262 | :c:func:`snd_pcm_period_elapsed()` is called typically from the | ||
2263 | interrupt handler. But, if you set up the driver to use a threaded | ||
2264 | interrupt handler, this call can be in non-atomic context, too. In such | ||
2265 | a case, you can set ``nonatomic`` filed of :c:type:`struct snd_pcm | ||
2266 | <snd_pcm>` object after creating it. When this flag is set, mutex | ||
2267 | and rwsem are used internally in the PCM core instead of spin and | ||
2268 | rwlocks, so that you can call all PCM functions safely in a non-atomic | ||
2269 | context. | ||
2270 | |||
2271 | Constraints | ||
2272 | ----------- | ||
2273 | |||
2274 | If your chip supports unconventional sample rates, or only the limited | ||
2275 | samples, you need to set a constraint for the condition. | ||
2276 | |||
2277 | For example, in order to restrict the sample rates in the some supported | ||
2278 | values, use :c:func:`snd_pcm_hw_constraint_list()`. You need to | ||
2279 | call this function in the open callback. | ||
2280 | |||
2281 | :: | ||
2282 | |||
2283 | static unsigned int rates[] = | ||
2284 | {4000, 10000, 22050, 44100}; | ||
2285 | static struct snd_pcm_hw_constraint_list constraints_rates = { | ||
2286 | .count = ARRAY_SIZE(rates), | ||
2287 | .list = rates, | ||
2288 | .mask = 0, | ||
2289 | }; | ||
2290 | |||
2291 | static int snd_mychip_pcm_open(struct snd_pcm_substream *substream) | ||
2292 | { | ||
2293 | int err; | ||
2294 | .... | ||
2295 | err = snd_pcm_hw_constraint_list(substream->runtime, 0, | ||
2296 | SNDRV_PCM_HW_PARAM_RATE, | ||
2297 | &constraints_rates); | ||
2298 | if (err < 0) | ||
2299 | return err; | ||
2300 | .... | ||
2301 | } | ||
2302 | |||
2303 | |||
2304 | |||
2305 | There are many different constraints. Look at ``sound/pcm.h`` for a | ||
2306 | complete list. You can even define your own constraint rules. For | ||
2307 | example, let's suppose my_chip can manage a substream of 1 channel if | ||
2308 | and only if the format is ``S16_LE``, otherwise it supports any format | ||
2309 | specified in the :c:type:`struct snd_pcm_hardware | ||
2310 | <snd_pcm_hardware>` structure (or in any other | ||
2311 | constraint_list). You can build a rule like this: | ||
2312 | |||
2313 | :: | ||
2314 | |||
2315 | static int hw_rule_channels_by_format(struct snd_pcm_hw_params *params, | ||
2316 | struct snd_pcm_hw_rule *rule) | ||
2317 | { | ||
2318 | struct snd_interval *c = hw_param_interval(params, | ||
2319 | SNDRV_PCM_HW_PARAM_CHANNELS); | ||
2320 | struct snd_mask *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); | ||
2321 | struct snd_interval ch; | ||
2322 | |||
2323 | snd_interval_any(&ch); | ||
2324 | if (f->bits[0] == SNDRV_PCM_FMTBIT_S16_LE) { | ||
2325 | ch.min = ch.max = 1; | ||
2326 | ch.integer = 1; | ||
2327 | return snd_interval_refine(c, &ch); | ||
2328 | } | ||
2329 | return 0; | ||
2330 | } | ||
2331 | |||
2332 | |||
2333 | Then you need to call this function to add your rule: | ||
2334 | |||
2335 | :: | ||
2336 | |||
2337 | snd_pcm_hw_rule_add(substream->runtime, 0, SNDRV_PCM_HW_PARAM_CHANNELS, | ||
2338 | hw_rule_channels_by_format, NULL, | ||
2339 | SNDRV_PCM_HW_PARAM_FORMAT, -1); | ||
2340 | |||
2341 | The rule function is called when an application sets the PCM format, and | ||
2342 | it refines the number of channels accordingly. But an application may | ||
2343 | set the number of channels before setting the format. Thus you also need | ||
2344 | to define the inverse rule: | ||
2345 | |||
2346 | :: | ||
2347 | |||
2348 | static int hw_rule_format_by_channels(struct snd_pcm_hw_params *params, | ||
2349 | struct snd_pcm_hw_rule *rule) | ||
2350 | { | ||
2351 | struct snd_interval *c = hw_param_interval(params, | ||
2352 | SNDRV_PCM_HW_PARAM_CHANNELS); | ||
2353 | struct snd_mask *f = hw_param_mask(params, SNDRV_PCM_HW_PARAM_FORMAT); | ||
2354 | struct snd_mask fmt; | ||
2355 | |||
2356 | snd_mask_any(&fmt); /* Init the struct */ | ||
2357 | if (c->min < 2) { | ||
2358 | fmt.bits[0] &= SNDRV_PCM_FMTBIT_S16_LE; | ||
2359 | return snd_mask_refine(f, &fmt); | ||
2360 | } | ||
2361 | return 0; | ||
2362 | } | ||
2363 | |||
2364 | |||
2365 | ... and in the open callback: | ||
2366 | |||
2367 | :: | ||
2368 | |||
2369 | snd_pcm_hw_rule_add(substream->runtime, 0, SNDRV_PCM_HW_PARAM_FORMAT, | ||
2370 | hw_rule_format_by_channels, NULL, | ||
2371 | SNDRV_PCM_HW_PARAM_CHANNELS, -1); | ||
2372 | |||
2373 | I won't give more details here, rather I would like to say, “Luke, use | ||
2374 | the source.” | ||
2375 | |||
2376 | Control Interface | ||
2377 | ================= | ||
2378 | |||
2379 | General | ||
2380 | ------- | ||
2381 | |||
2382 | The control interface is used widely for many switches, sliders, etc. | ||
2383 | which are accessed from user-space. Its most important use is the mixer | ||
2384 | interface. In other words, since ALSA 0.9.x, all the mixer stuff is | ||
2385 | implemented on the control kernel API. | ||
2386 | |||
2387 | ALSA has a well-defined AC97 control module. If your chip supports only | ||
2388 | the AC97 and nothing else, you can skip this section. | ||
2389 | |||
2390 | The control API is defined in ``<sound/control.h>``. Include this file | ||
2391 | if you want to add your own controls. | ||
2392 | |||
2393 | Definition of Controls | ||
2394 | ---------------------- | ||
2395 | |||
2396 | To create a new control, you need to define the following three | ||
2397 | callbacks: ``info``, ``get`` and ``put``. Then, define a | ||
2398 | :c:type:`struct snd_kcontrol_new <snd_kcontrol_new>` record, such as: | ||
2399 | |||
2400 | :: | ||
2401 | |||
2402 | |||
2403 | static struct snd_kcontrol_new my_control = { | ||
2404 | .iface = SNDRV_CTL_ELEM_IFACE_MIXER, | ||
2405 | .name = "PCM Playback Switch", | ||
2406 | .index = 0, | ||
2407 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE, | ||
2408 | .private_value = 0xffff, | ||
2409 | .info = my_control_info, | ||
2410 | .get = my_control_get, | ||
2411 | .put = my_control_put | ||
2412 | }; | ||
2413 | |||
2414 | |||
2415 | The ``iface`` field specifies the control type, | ||
2416 | ``SNDRV_CTL_ELEM_IFACE_XXX``, which is usually ``MIXER``. Use ``CARD`` | ||
2417 | for global controls that are not logically part of the mixer. If the | ||
2418 | control is closely associated with some specific device on the sound | ||
2419 | card, use ``HWDEP``, ``PCM``, ``RAWMIDI``, ``TIMER``, or ``SEQUENCER``, | ||
2420 | and specify the device number with the ``device`` and ``subdevice`` | ||
2421 | fields. | ||
2422 | |||
2423 | The ``name`` is the name identifier string. Since ALSA 0.9.x, the | ||
2424 | control name is very important, because its role is classified from | ||
2425 | its name. There are pre-defined standard control names. The details | ||
2426 | are described in the `Control Names`_ subsection. | ||
2427 | |||
2428 | The ``index`` field holds the index number of this control. If there | ||
2429 | are several different controls with the same name, they can be | ||
2430 | distinguished by the index number. This is the case when several | ||
2431 | codecs exist on the card. If the index is zero, you can omit the | ||
2432 | definition above. | ||
2433 | |||
2434 | The ``access`` field contains the access type of this control. Give | ||
2435 | the combination of bit masks, ``SNDRV_CTL_ELEM_ACCESS_XXX``, | ||
2436 | there. The details will be explained in the `Access Flags`_ | ||
2437 | subsection. | ||
2438 | |||
2439 | The ``private_value`` field contains an arbitrary long integer value | ||
2440 | for this record. When using the generic ``info``, ``get`` and ``put`` | ||
2441 | callbacks, you can pass a value through this field. If several small | ||
2442 | numbers are necessary, you can combine them in bitwise. Or, it's | ||
2443 | possible to give a pointer (casted to unsigned long) of some record to | ||
2444 | this field, too. | ||
2445 | |||
2446 | The ``tlv`` field can be used to provide metadata about the control; | ||
2447 | see the `Metadata`_ subsection. | ||
2448 | |||
2449 | The other three are `Control Callbacks`_. | ||
2450 | |||
2451 | Control Names | ||
2452 | ------------- | ||
2453 | |||
2454 | There are some standards to define the control names. A control is | ||
2455 | usually defined from the three parts as “SOURCE DIRECTION FUNCTION”. | ||
2456 | |||
2457 | The first, ``SOURCE``, specifies the source of the control, and is a | ||
2458 | string such as “Master”, “PCM”, “CD” and “Line”. There are many | ||
2459 | pre-defined sources. | ||
2460 | |||
2461 | The second, ``DIRECTION``, is one of the following strings according to | ||
2462 | the direction of the control: “Playback”, “Capture”, “Bypass Playback” | ||
2463 | and “Bypass Capture”. Or, it can be omitted, meaning both playback and | ||
2464 | capture directions. | ||
2465 | |||
2466 | The third, ``FUNCTION``, is one of the following strings according to | ||
2467 | the function of the control: “Switch”, “Volume” and “Route”. | ||
2468 | |||
2469 | The example of control names are, thus, “Master Capture Switch” or “PCM | ||
2470 | Playback Volume”. | ||
2471 | |||
2472 | There are some exceptions: | ||
2473 | |||
2474 | Global capture and playback | ||
2475 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
2476 | |||
2477 | “Capture Source”, “Capture Switch” and “Capture Volume” are used for the | ||
2478 | global capture (input) source, switch and volume. Similarly, “Playback | ||
2479 | Switch” and “Playback Volume” are used for the global output gain switch | ||
2480 | and volume. | ||
2481 | |||
2482 | Tone-controls | ||
2483 | ~~~~~~~~~~~~~ | ||
2484 | |||
2485 | tone-control switch and volumes are specified like “Tone Control - XXX”, | ||
2486 | e.g. “Tone Control - Switch”, “Tone Control - Bass”, “Tone Control - | ||
2487 | Center”. | ||
2488 | |||
2489 | 3D controls | ||
2490 | ~~~~~~~~~~~ | ||
2491 | |||
2492 | 3D-control switches and volumes are specified like “3D Control - XXX”, | ||
2493 | e.g. “3D Control - Switch”, “3D Control - Center”, “3D Control - Space”. | ||
2494 | |||
2495 | Mic boost | ||
2496 | ~~~~~~~~~ | ||
2497 | |||
2498 | Mic-boost switch is set as “Mic Boost” or “Mic Boost (6dB)”. | ||
2499 | |||
2500 | More precise information can be found in | ||
2501 | ``Documentation/sound/alsa/ControlNames.txt``. | ||
2502 | |||
2503 | Access Flags | ||
2504 | ------------ | ||
2505 | |||
2506 | The access flag is the bitmask which specifies the access type of the | ||
2507 | given control. The default access type is | ||
2508 | ``SNDRV_CTL_ELEM_ACCESS_READWRITE``, which means both read and write are | ||
2509 | allowed to this control. When the access flag is omitted (i.e. = 0), it | ||
2510 | is considered as ``READWRITE`` access as default. | ||
2511 | |||
2512 | When the control is read-only, pass ``SNDRV_CTL_ELEM_ACCESS_READ`` | ||
2513 | instead. In this case, you don't have to define the ``put`` callback. | ||
2514 | Similarly, when the control is write-only (although it's a rare case), | ||
2515 | you can use the ``WRITE`` flag instead, and you don't need the ``get`` | ||
2516 | callback. | ||
2517 | |||
2518 | If the control value changes frequently (e.g. the VU meter), | ||
2519 | ``VOLATILE`` flag should be given. This means that the control may be | ||
2520 | changed without `Change notification`_. Applications should poll such | ||
2521 | a control constantly. | ||
2522 | |||
2523 | When the control is inactive, set the ``INACTIVE`` flag, too. There are | ||
2524 | ``LOCK`` and ``OWNER`` flags to change the write permissions. | ||
2525 | |||
2526 | Control Callbacks | ||
2527 | ----------------- | ||
2528 | |||
2529 | info callback | ||
2530 | ~~~~~~~~~~~~~ | ||
2531 | |||
2532 | The ``info`` callback is used to get detailed information on this | ||
2533 | control. This must store the values of the given :c:type:`struct | ||
2534 | snd_ctl_elem_info <snd_ctl_elem_info>` object. For example, | ||
2535 | for a boolean control with a single element: | ||
2536 | |||
2537 | :: | ||
2538 | |||
2539 | |||
2540 | static int snd_myctl_mono_info(struct snd_kcontrol *kcontrol, | ||
2541 | struct snd_ctl_elem_info *uinfo) | ||
2542 | { | ||
2543 | uinfo->type = SNDRV_CTL_ELEM_TYPE_BOOLEAN; | ||
2544 | uinfo->count = 1; | ||
2545 | uinfo->value.integer.min = 0; | ||
2546 | uinfo->value.integer.max = 1; | ||
2547 | return 0; | ||
2548 | } | ||
2549 | |||
2550 | |||
2551 | |||
2552 | The ``type`` field specifies the type of the control. There are | ||
2553 | ``BOOLEAN``, ``INTEGER``, ``ENUMERATED``, ``BYTES``, ``IEC958`` and | ||
2554 | ``INTEGER64``. The ``count`` field specifies the number of elements in | ||
2555 | this control. For example, a stereo volume would have count = 2. The | ||
2556 | ``value`` field is a union, and the values stored are depending on the | ||
2557 | type. The boolean and integer types are identical. | ||
2558 | |||
2559 | The enumerated type is a bit different from others. You'll need to set | ||
2560 | the string for the currently given item index. | ||
2561 | |||
2562 | :: | ||
2563 | |||
2564 | static int snd_myctl_enum_info(struct snd_kcontrol *kcontrol, | ||
2565 | struct snd_ctl_elem_info *uinfo) | ||
2566 | { | ||
2567 | static char *texts[4] = { | ||
2568 | "First", "Second", "Third", "Fourth" | ||
2569 | }; | ||
2570 | uinfo->type = SNDRV_CTL_ELEM_TYPE_ENUMERATED; | ||
2571 | uinfo->count = 1; | ||
2572 | uinfo->value.enumerated.items = 4; | ||
2573 | if (uinfo->value.enumerated.item > 3) | ||
2574 | uinfo->value.enumerated.item = 3; | ||
2575 | strcpy(uinfo->value.enumerated.name, | ||
2576 | texts[uinfo->value.enumerated.item]); | ||
2577 | return 0; | ||
2578 | } | ||
2579 | |||
2580 | The above callback can be simplified with a helper function, | ||
2581 | :c:func:`snd_ctl_enum_info()`. The final code looks like below. | ||
2582 | (You can pass ``ARRAY_SIZE(texts)`` instead of 4 in the third argument; | ||
2583 | it's a matter of taste.) | ||
2584 | |||
2585 | :: | ||
2586 | |||
2587 | static int snd_myctl_enum_info(struct snd_kcontrol *kcontrol, | ||
2588 | struct snd_ctl_elem_info *uinfo) | ||
2589 | { | ||
2590 | static char *texts[4] = { | ||
2591 | "First", "Second", "Third", "Fourth" | ||
2592 | }; | ||
2593 | return snd_ctl_enum_info(uinfo, 1, 4, texts); | ||
2594 | } | ||
2595 | |||
2596 | |||
2597 | Some common info callbacks are available for your convenience: | ||
2598 | :c:func:`snd_ctl_boolean_mono_info()` and | ||
2599 | :c:func:`snd_ctl_boolean_stereo_info()`. Obviously, the former | ||
2600 | is an info callback for a mono channel boolean item, just like | ||
2601 | :c:func:`snd_myctl_mono_info()` above, and the latter is for a | ||
2602 | stereo channel boolean item. | ||
2603 | |||
2604 | get callback | ||
2605 | ~~~~~~~~~~~~ | ||
2606 | |||
2607 | This callback is used to read the current value of the control and to | ||
2608 | return to user-space. | ||
2609 | |||
2610 | For example, | ||
2611 | |||
2612 | :: | ||
2613 | |||
2614 | |||
2615 | static int snd_myctl_get(struct snd_kcontrol *kcontrol, | ||
2616 | struct snd_ctl_elem_value *ucontrol) | ||
2617 | { | ||
2618 | struct mychip *chip = snd_kcontrol_chip(kcontrol); | ||
2619 | ucontrol->value.integer.value[0] = get_some_value(chip); | ||
2620 | return 0; | ||
2621 | } | ||
2622 | |||
2623 | |||
2624 | |||
2625 | The ``value`` field depends on the type of control as well as on the | ||
2626 | info callback. For example, the sb driver uses this field to store the | ||
2627 | register offset, the bit-shift and the bit-mask. The ``private_value`` | ||
2628 | field is set as follows: | ||
2629 | |||
2630 | :: | ||
2631 | |||
2632 | .private_value = reg | (shift << 16) | (mask << 24) | ||
2633 | |||
2634 | and is retrieved in callbacks like | ||
2635 | |||
2636 | :: | ||
2637 | |||
2638 | static int snd_sbmixer_get_single(struct snd_kcontrol *kcontrol, | ||
2639 | struct snd_ctl_elem_value *ucontrol) | ||
2640 | { | ||
2641 | int reg = kcontrol->private_value & 0xff; | ||
2642 | int shift = (kcontrol->private_value >> 16) & 0xff; | ||
2643 | int mask = (kcontrol->private_value >> 24) & 0xff; | ||
2644 | .... | ||
2645 | } | ||
2646 | |||
2647 | In the ``get`` callback, you have to fill all the elements if the | ||
2648 | control has more than one elements, i.e. ``count > 1``. In the example | ||
2649 | above, we filled only one element (``value.integer.value[0]``) since | ||
2650 | it's assumed as ``count = 1``. | ||
2651 | |||
2652 | put callback | ||
2653 | ~~~~~~~~~~~~ | ||
2654 | |||
2655 | This callback is used to write a value from user-space. | ||
2656 | |||
2657 | For example, | ||
2658 | |||
2659 | :: | ||
2660 | |||
2661 | |||
2662 | static int snd_myctl_put(struct snd_kcontrol *kcontrol, | ||
2663 | struct snd_ctl_elem_value *ucontrol) | ||
2664 | { | ||
2665 | struct mychip *chip = snd_kcontrol_chip(kcontrol); | ||
2666 | int changed = 0; | ||
2667 | if (chip->current_value != | ||
2668 | ucontrol->value.integer.value[0]) { | ||
2669 | change_current_value(chip, | ||
2670 | ucontrol->value.integer.value[0]); | ||
2671 | changed = 1; | ||
2672 | } | ||
2673 | return changed; | ||
2674 | } | ||
2675 | |||
2676 | |||
2677 | |||
2678 | As seen above, you have to return 1 if the value is changed. If the | ||
2679 | value is not changed, return 0 instead. If any fatal error happens, | ||
2680 | return a negative error code as usual. | ||
2681 | |||
2682 | As in the ``get`` callback, when the control has more than one | ||
2683 | elements, all elements must be evaluated in this callback, too. | ||
2684 | |||
2685 | Callbacks are not atomic | ||
2686 | ~~~~~~~~~~~~~~~~~~~~~~~~ | ||
2687 | |||
2688 | All these three callbacks are basically not atomic. | ||
2689 | |||
2690 | Control Constructor | ||
2691 | ------------------- | ||
2692 | |||
2693 | When everything is ready, finally we can create a new control. To create | ||
2694 | a control, there are two functions to be called, | ||
2695 | :c:func:`snd_ctl_new1()` and :c:func:`snd_ctl_add()`. | ||
2696 | |||
2697 | In the simplest way, you can do like this: | ||
2698 | |||
2699 | :: | ||
2700 | |||
2701 | err = snd_ctl_add(card, snd_ctl_new1(&my_control, chip)); | ||
2702 | if (err < 0) | ||
2703 | return err; | ||
2704 | |||
2705 | where ``my_control`` is the :c:type:`struct snd_kcontrol_new | ||
2706 | <snd_kcontrol_new>` object defined above, and chip is the object | ||
2707 | pointer to be passed to kcontrol->private_data which can be referred | ||
2708 | to in callbacks. | ||
2709 | |||
2710 | :c:func:`snd_ctl_new1()` allocates a new :c:type:`struct | ||
2711 | snd_kcontrol <snd_kcontrol>` instance, and | ||
2712 | :c:func:`snd_ctl_add()` assigns the given control component to the | ||
2713 | card. | ||
2714 | |||
2715 | Change Notification | ||
2716 | ------------------- | ||
2717 | |||
2718 | If you need to change and update a control in the interrupt routine, you | ||
2719 | can call :c:func:`snd_ctl_notify()`. For example, | ||
2720 | |||
2721 | :: | ||
2722 | |||
2723 | snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, id_pointer); | ||
2724 | |||
2725 | This function takes the card pointer, the event-mask, and the control id | ||
2726 | pointer for the notification. The event-mask specifies the types of | ||
2727 | notification, for example, in the above example, the change of control | ||
2728 | values is notified. The id pointer is the pointer of :c:type:`struct | ||
2729 | snd_ctl_elem_id <snd_ctl_elem_id>` to be notified. You can | ||
2730 | find some examples in ``es1938.c`` or ``es1968.c`` for hardware volume | ||
2731 | interrupts. | ||
2732 | |||
2733 | Metadata | ||
2734 | -------- | ||
2735 | |||
2736 | To provide information about the dB values of a mixer control, use on of | ||
2737 | the ``DECLARE_TLV_xxx`` macros from ``<sound/tlv.h>`` to define a | ||
2738 | variable containing this information, set the ``tlv.p`` field to point to | ||
2739 | this variable, and include the ``SNDRV_CTL_ELEM_ACCESS_TLV_READ`` flag | ||
2740 | in the ``access`` field; like this: | ||
2741 | |||
2742 | :: | ||
2743 | |||
2744 | static DECLARE_TLV_DB_SCALE(db_scale_my_control, -4050, 150, 0); | ||
2745 | |||
2746 | static struct snd_kcontrol_new my_control = { | ||
2747 | ... | ||
2748 | .access = SNDRV_CTL_ELEM_ACCESS_READWRITE | | ||
2749 | SNDRV_CTL_ELEM_ACCESS_TLV_READ, | ||
2750 | ... | ||
2751 | .tlv.p = db_scale_my_control, | ||
2752 | }; | ||
2753 | |||
2754 | |||
2755 | The :c:func:`DECLARE_TLV_DB_SCALE()` macro defines information | ||
2756 | about a mixer control where each step in the control's value changes the | ||
2757 | dB value by a constant dB amount. The first parameter is the name of the | ||
2758 | variable to be defined. The second parameter is the minimum value, in | ||
2759 | units of 0.01 dB. The third parameter is the step size, in units of 0.01 | ||
2760 | dB. Set the fourth parameter to 1 if the minimum value actually mutes | ||
2761 | the control. | ||
2762 | |||
2763 | The :c:func:`DECLARE_TLV_DB_LINEAR()` macro defines information | ||
2764 | about a mixer control where the control's value affects the output | ||
2765 | linearly. The first parameter is the name of the variable to be defined. | ||
2766 | The second parameter is the minimum value, in units of 0.01 dB. The | ||
2767 | third parameter is the maximum value, in units of 0.01 dB. If the | ||
2768 | minimum value mutes the control, set the second parameter to | ||
2769 | ``TLV_DB_GAIN_MUTE``. | ||
2770 | |||
2771 | API for AC97 Codec | ||
2772 | ================== | ||
2773 | |||
2774 | General | ||
2775 | ------- | ||
2776 | |||
2777 | The ALSA AC97 codec layer is a well-defined one, and you don't have to | ||
2778 | write much code to control it. Only low-level control routines are | ||
2779 | necessary. The AC97 codec API is defined in ``<sound/ac97_codec.h>``. | ||
2780 | |||
2781 | Full Code Example | ||
2782 | ----------------- | ||
2783 | |||
2784 | :: | ||
2785 | |||
2786 | struct mychip { | ||
2787 | .... | ||
2788 | struct snd_ac97 *ac97; | ||
2789 | .... | ||
2790 | }; | ||
2791 | |||
2792 | static unsigned short snd_mychip_ac97_read(struct snd_ac97 *ac97, | ||
2793 | unsigned short reg) | ||
2794 | { | ||
2795 | struct mychip *chip = ac97->private_data; | ||
2796 | .... | ||
2797 | /* read a register value here from the codec */ | ||
2798 | return the_register_value; | ||
2799 | } | ||
2800 | |||
2801 | static void snd_mychip_ac97_write(struct snd_ac97 *ac97, | ||
2802 | unsigned short reg, unsigned short val) | ||
2803 | { | ||
2804 | struct mychip *chip = ac97->private_data; | ||
2805 | .... | ||
2806 | /* write the given register value to the codec */ | ||
2807 | } | ||
2808 | |||
2809 | static int snd_mychip_ac97(struct mychip *chip) | ||
2810 | { | ||
2811 | struct snd_ac97_bus *bus; | ||
2812 | struct snd_ac97_template ac97; | ||
2813 | int err; | ||
2814 | static struct snd_ac97_bus_ops ops = { | ||
2815 | .write = snd_mychip_ac97_write, | ||
2816 | .read = snd_mychip_ac97_read, | ||
2817 | }; | ||
2818 | |||
2819 | err = snd_ac97_bus(chip->card, 0, &ops, NULL, &bus); | ||
2820 | if (err < 0) | ||
2821 | return err; | ||
2822 | memset(&ac97, 0, sizeof(ac97)); | ||
2823 | ac97.private_data = chip; | ||
2824 | return snd_ac97_mixer(bus, &ac97, &chip->ac97); | ||
2825 | } | ||
2826 | |||
2827 | |||
2828 | AC97 Constructor | ||
2829 | ---------------- | ||
2830 | |||
2831 | To create an ac97 instance, first call :c:func:`snd_ac97_bus()` | ||
2832 | with an ``ac97_bus_ops_t`` record with callback functions. | ||
2833 | |||
2834 | :: | ||
2835 | |||
2836 | struct snd_ac97_bus *bus; | ||
2837 | static struct snd_ac97_bus_ops ops = { | ||
2838 | .write = snd_mychip_ac97_write, | ||
2839 | .read = snd_mychip_ac97_read, | ||
2840 | }; | ||
2841 | |||
2842 | snd_ac97_bus(card, 0, &ops, NULL, &pbus); | ||
2843 | |||
2844 | The bus record is shared among all belonging ac97 instances. | ||
2845 | |||
2846 | And then call :c:func:`snd_ac97_mixer()` with an :c:type:`struct | ||
2847 | snd_ac97_template <snd_ac97_template>` record together with | ||
2848 | the bus pointer created above. | ||
2849 | |||
2850 | :: | ||
2851 | |||
2852 | struct snd_ac97_template ac97; | ||
2853 | int err; | ||
2854 | |||
2855 | memset(&ac97, 0, sizeof(ac97)); | ||
2856 | ac97.private_data = chip; | ||
2857 | snd_ac97_mixer(bus, &ac97, &chip->ac97); | ||
2858 | |||
2859 | where chip->ac97 is a pointer to a newly created ``ac97_t`` | ||
2860 | instance. In this case, the chip pointer is set as the private data, | ||
2861 | so that the read/write callback functions can refer to this chip | ||
2862 | instance. This instance is not necessarily stored in the chip | ||
2863 | record. If you need to change the register values from the driver, or | ||
2864 | need the suspend/resume of ac97 codecs, keep this pointer to pass to | ||
2865 | the corresponding functions. | ||
2866 | |||
2867 | AC97 Callbacks | ||
2868 | -------------- | ||
2869 | |||
2870 | The standard callbacks are ``read`` and ``write``. Obviously they | ||
2871 | correspond to the functions for read and write accesses to the | ||
2872 | hardware low-level codes. | ||
2873 | |||
2874 | The ``read`` callback returns the register value specified in the | ||
2875 | argument. | ||
2876 | |||
2877 | :: | ||
2878 | |||
2879 | static unsigned short snd_mychip_ac97_read(struct snd_ac97 *ac97, | ||
2880 | unsigned short reg) | ||
2881 | { | ||
2882 | struct mychip *chip = ac97->private_data; | ||
2883 | .... | ||
2884 | return the_register_value; | ||
2885 | } | ||
2886 | |||
2887 | Here, the chip can be cast from ``ac97->private_data``. | ||
2888 | |||
2889 | Meanwhile, the ``write`` callback is used to set the register | ||
2890 | value | ||
2891 | |||
2892 | :: | ||
2893 | |||
2894 | static void snd_mychip_ac97_write(struct snd_ac97 *ac97, | ||
2895 | unsigned short reg, unsigned short val) | ||
2896 | |||
2897 | |||
2898 | These callbacks are non-atomic like the control API callbacks. | ||
2899 | |||
2900 | There are also other callbacks: ``reset``, ``wait`` and ``init``. | ||
2901 | |||
2902 | The ``reset`` callback is used to reset the codec. If the chip | ||
2903 | requires a special kind of reset, you can define this callback. | ||
2904 | |||
2905 | The ``wait`` callback is used to add some waiting time in the standard | ||
2906 | initialization of the codec. If the chip requires the extra waiting | ||
2907 | time, define this callback. | ||
2908 | |||
2909 | The ``init`` callback is used for additional initialization of the | ||
2910 | codec. | ||
2911 | |||
2912 | Updating Registers in The Driver | ||
2913 | -------------------------------- | ||
2914 | |||
2915 | If you need to access to the codec from the driver, you can call the | ||
2916 | following functions: :c:func:`snd_ac97_write()`, | ||
2917 | :c:func:`snd_ac97_read()`, :c:func:`snd_ac97_update()` and | ||
2918 | :c:func:`snd_ac97_update_bits()`. | ||
2919 | |||
2920 | Both :c:func:`snd_ac97_write()` and | ||
2921 | :c:func:`snd_ac97_update()` functions are used to set a value to | ||
2922 | the given register (``AC97_XXX``). The difference between them is that | ||
2923 | :c:func:`snd_ac97_update()` doesn't write a value if the given | ||
2924 | value has been already set, while :c:func:`snd_ac97_write()` | ||
2925 | always rewrites the value. | ||
2926 | |||
2927 | :: | ||
2928 | |||
2929 | snd_ac97_write(ac97, AC97_MASTER, 0x8080); | ||
2930 | snd_ac97_update(ac97, AC97_MASTER, 0x8080); | ||
2931 | |||
2932 | :c:func:`snd_ac97_read()` is used to read the value of the given | ||
2933 | register. For example, | ||
2934 | |||
2935 | :: | ||
2936 | |||
2937 | value = snd_ac97_read(ac97, AC97_MASTER); | ||
2938 | |||
2939 | :c:func:`snd_ac97_update_bits()` is used to update some bits in | ||
2940 | the given register. | ||
2941 | |||
2942 | :: | ||
2943 | |||
2944 | snd_ac97_update_bits(ac97, reg, mask, value); | ||
2945 | |||
2946 | Also, there is a function to change the sample rate (of a given register | ||
2947 | such as ``AC97_PCM_FRONT_DAC_RATE``) when VRA or DRA is supported by the | ||
2948 | codec: :c:func:`snd_ac97_set_rate()`. | ||
2949 | |||
2950 | :: | ||
2951 | |||
2952 | snd_ac97_set_rate(ac97, AC97_PCM_FRONT_DAC_RATE, 44100); | ||
2953 | |||
2954 | |||
2955 | The following registers are available to set the rate: | ||
2956 | ``AC97_PCM_MIC_ADC_RATE``, ``AC97_PCM_FRONT_DAC_RATE``, | ||
2957 | ``AC97_PCM_LR_ADC_RATE``, ``AC97_SPDIF``. When ``AC97_SPDIF`` is | ||
2958 | specified, the register is not really changed but the corresponding | ||
2959 | IEC958 status bits will be updated. | ||
2960 | |||
2961 | Clock Adjustment | ||
2962 | ---------------- | ||
2963 | |||
2964 | In some chips, the clock of the codec isn't 48000 but using a PCI clock | ||
2965 | (to save a quartz!). In this case, change the field ``bus->clock`` to | ||
2966 | the corresponding value. For example, intel8x0 and es1968 drivers have | ||
2967 | their own function to read from the clock. | ||
2968 | |||
2969 | Proc Files | ||
2970 | ---------- | ||
2971 | |||
2972 | The ALSA AC97 interface will create a proc file such as | ||
2973 | ``/proc/asound/card0/codec97#0/ac97#0-0`` and ``ac97#0-0+regs``. You | ||
2974 | can refer to these files to see the current status and registers of | ||
2975 | the codec. | ||
2976 | |||
2977 | Multiple Codecs | ||
2978 | --------------- | ||
2979 | |||
2980 | When there are several codecs on the same card, you need to call | ||
2981 | :c:func:`snd_ac97_mixer()` multiple times with ``ac97.num=1`` or | ||
2982 | greater. The ``num`` field specifies the codec number. | ||
2983 | |||
2984 | If you set up multiple codecs, you either need to write different | ||
2985 | callbacks for each codec or check ``ac97->num`` in the callback | ||
2986 | routines. | ||
2987 | |||
2988 | MIDI (MPU401-UART) Interface | ||
2989 | ============================ | ||
2990 | |||
2991 | General | ||
2992 | ------- | ||
2993 | |||
2994 | Many soundcards have built-in MIDI (MPU401-UART) interfaces. When the | ||
2995 | soundcard supports the standard MPU401-UART interface, most likely you | ||
2996 | can use the ALSA MPU401-UART API. The MPU401-UART API is defined in | ||
2997 | ``<sound/mpu401.h>``. | ||
2998 | |||
2999 | Some soundchips have a similar but slightly different implementation of | ||
3000 | mpu401 stuff. For example, emu10k1 has its own mpu401 routines. | ||
3001 | |||
3002 | MIDI Constructor | ||
3003 | ---------------- | ||
3004 | |||
3005 | To create a rawmidi object, call :c:func:`snd_mpu401_uart_new()`. | ||
3006 | |||
3007 | :: | ||
3008 | |||
3009 | struct snd_rawmidi *rmidi; | ||
3010 | snd_mpu401_uart_new(card, 0, MPU401_HW_MPU401, port, info_flags, | ||
3011 | irq, &rmidi); | ||
3012 | |||
3013 | |||
3014 | The first argument is the card pointer, and the second is the index of | ||
3015 | this component. You can create up to 8 rawmidi devices. | ||
3016 | |||
3017 | The third argument is the type of the hardware, ``MPU401_HW_XXX``. If | ||
3018 | it's not a special one, you can use ``MPU401_HW_MPU401``. | ||
3019 | |||
3020 | The 4th argument is the I/O port address. Many backward-compatible | ||
3021 | MPU401 have an I/O port such as 0x330. Or, it might be a part of its own | ||
3022 | PCI I/O region. It depends on the chip design. | ||
3023 | |||
3024 | The 5th argument is a bitflag for additional information. When the I/O | ||
3025 | port address above is part of the PCI I/O region, the MPU401 I/O port | ||
3026 | might have been already allocated (reserved) by the driver itself. In | ||
3027 | such a case, pass a bit flag ``MPU401_INFO_INTEGRATED``, and the | ||
3028 | mpu401-uart layer will allocate the I/O ports by itself. | ||
3029 | |||
3030 | When the controller supports only the input or output MIDI stream, pass | ||
3031 | the ``MPU401_INFO_INPUT`` or ``MPU401_INFO_OUTPUT`` bitflag, | ||
3032 | respectively. Then the rawmidi instance is created as a single stream. | ||
3033 | |||
3034 | ``MPU401_INFO_MMIO`` bitflag is used to change the access method to MMIO | ||
3035 | (via readb and writeb) instead of iob and outb. In this case, you have | ||
3036 | to pass the iomapped address to :c:func:`snd_mpu401_uart_new()`. | ||
3037 | |||
3038 | When ``MPU401_INFO_TX_IRQ`` is set, the output stream isn't checked in | ||
3039 | the default interrupt handler. The driver needs to call | ||
3040 | :c:func:`snd_mpu401_uart_interrupt_tx()` by itself to start | ||
3041 | processing the output stream in the irq handler. | ||
3042 | |||
3043 | If the MPU-401 interface shares its interrupt with the other logical | ||
3044 | devices on the card, set ``MPU401_INFO_IRQ_HOOK`` (see | ||
3045 | `below <#MIDI-Interrupt-Handler>`__). | ||
3046 | |||
3047 | Usually, the port address corresponds to the command port and port + 1 | ||
3048 | corresponds to the data port. If not, you may change the ``cport`` | ||
3049 | field of :c:type:`struct snd_mpu401 <snd_mpu401>` manually afterward. | ||
3050 | However, :c:type:`struct snd_mpu401 <snd_mpu401>` pointer is | ||
3051 | not returned explicitly by :c:func:`snd_mpu401_uart_new()`. You | ||
3052 | need to cast ``rmidi->private_data`` to :c:type:`struct snd_mpu401 | ||
3053 | <snd_mpu401>` explicitly, | ||
3054 | |||
3055 | :: | ||
3056 | |||
3057 | struct snd_mpu401 *mpu; | ||
3058 | mpu = rmidi->private_data; | ||
3059 | |||
3060 | and reset the ``cport`` as you like: | ||
3061 | |||
3062 | :: | ||
3063 | |||
3064 | mpu->cport = my_own_control_port; | ||
3065 | |||
3066 | The 6th argument specifies the ISA irq number that will be allocated. If | ||
3067 | no interrupt is to be allocated (because your code is already allocating | ||
3068 | a shared interrupt, or because the device does not use interrupts), pass | ||
3069 | -1 instead. For a MPU-401 device without an interrupt, a polling timer | ||
3070 | will be used instead. | ||
3071 | |||
3072 | MIDI Interrupt Handler | ||
3073 | ---------------------- | ||
3074 | |||
3075 | When the interrupt is allocated in | ||
3076 | :c:func:`snd_mpu401_uart_new()`, an exclusive ISA interrupt | ||
3077 | handler is automatically used, hence you don't have anything else to do | ||
3078 | than creating the mpu401 stuff. Otherwise, you have to set | ||
3079 | ``MPU401_INFO_IRQ_HOOK``, and call | ||
3080 | :c:func:`snd_mpu401_uart_interrupt()` explicitly from your own | ||
3081 | interrupt handler when it has determined that a UART interrupt has | ||
3082 | occurred. | ||
3083 | |||
3084 | In this case, you need to pass the private_data of the returned rawmidi | ||
3085 | object from :c:func:`snd_mpu401_uart_new()` as the second | ||
3086 | argument of :c:func:`snd_mpu401_uart_interrupt()`. | ||
3087 | |||
3088 | :: | ||
3089 | |||
3090 | snd_mpu401_uart_interrupt(irq, rmidi->private_data, regs); | ||
3091 | |||
3092 | |||
3093 | RawMIDI Interface | ||
3094 | ================= | ||
3095 | |||
3096 | Overview | ||
3097 | -------- | ||
3098 | |||
3099 | The raw MIDI interface is used for hardware MIDI ports that can be | ||
3100 | accessed as a byte stream. It is not used for synthesizer chips that do | ||
3101 | not directly understand MIDI. | ||
3102 | |||
3103 | ALSA handles file and buffer management. All you have to do is to write | ||
3104 | some code to move data between the buffer and the hardware. | ||
3105 | |||
3106 | The rawmidi API is defined in ``<sound/rawmidi.h>``. | ||
3107 | |||
3108 | RawMIDI Constructor | ||
3109 | ------------------- | ||
3110 | |||
3111 | To create a rawmidi device, call the :c:func:`snd_rawmidi_new()` | ||
3112 | function: | ||
3113 | |||
3114 | :: | ||
3115 | |||
3116 | struct snd_rawmidi *rmidi; | ||
3117 | err = snd_rawmidi_new(chip->card, "MyMIDI", 0, outs, ins, &rmidi); | ||
3118 | if (err < 0) | ||
3119 | return err; | ||
3120 | rmidi->private_data = chip; | ||
3121 | strcpy(rmidi->name, "My MIDI"); | ||
3122 | rmidi->info_flags = SNDRV_RAWMIDI_INFO_OUTPUT | | ||
3123 | SNDRV_RAWMIDI_INFO_INPUT | | ||
3124 | SNDRV_RAWMIDI_INFO_DUPLEX; | ||
3125 | |||
3126 | The first argument is the card pointer, the second argument is the ID | ||
3127 | string. | ||
3128 | |||
3129 | The third argument is the index of this component. You can create up to | ||
3130 | 8 rawmidi devices. | ||
3131 | |||
3132 | The fourth and fifth arguments are the number of output and input | ||
3133 | substreams, respectively, of this device (a substream is the equivalent | ||
3134 | of a MIDI port). | ||
3135 | |||
3136 | Set the ``info_flags`` field to specify the capabilities of the | ||
3137 | device. Set ``SNDRV_RAWMIDI_INFO_OUTPUT`` if there is at least one | ||
3138 | output port, ``SNDRV_RAWMIDI_INFO_INPUT`` if there is at least one | ||
3139 | input port, and ``SNDRV_RAWMIDI_INFO_DUPLEX`` if the device can handle | ||
3140 | output and input at the same time. | ||
3141 | |||
3142 | After the rawmidi device is created, you need to set the operators | ||
3143 | (callbacks) for each substream. There are helper functions to set the | ||
3144 | operators for all the substreams of a device: | ||
3145 | |||
3146 | :: | ||
3147 | |||
3148 | snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_OUTPUT, &snd_mymidi_output_ops); | ||
3149 | snd_rawmidi_set_ops(rmidi, SNDRV_RAWMIDI_STREAM_INPUT, &snd_mymidi_input_ops); | ||
3150 | |||
3151 | The operators are usually defined like this: | ||
3152 | |||
3153 | :: | ||
3154 | |||
3155 | static struct snd_rawmidi_ops snd_mymidi_output_ops = { | ||
3156 | .open = snd_mymidi_output_open, | ||
3157 | .close = snd_mymidi_output_close, | ||
3158 | .trigger = snd_mymidi_output_trigger, | ||
3159 | }; | ||
3160 | |||
3161 | These callbacks are explained in the `RawMIDI Callbacks`_ section. | ||
3162 | |||
3163 | If there are more than one substream, you should give a unique name to | ||
3164 | each of them: | ||
3165 | |||
3166 | :: | ||
3167 | |||
3168 | struct snd_rawmidi_substream *substream; | ||
3169 | list_for_each_entry(substream, | ||
3170 | &rmidi->streams[SNDRV_RAWMIDI_STREAM_OUTPUT].substreams, | ||
3171 | list { | ||
3172 | sprintf(substream->name, "My MIDI Port %d", substream->number + 1); | ||
3173 | } | ||
3174 | /* same for SNDRV_RAWMIDI_STREAM_INPUT */ | ||
3175 | |||
3176 | RawMIDI Callbacks | ||
3177 | ----------------- | ||
3178 | |||
3179 | In all the callbacks, the private data that you've set for the rawmidi | ||
3180 | device can be accessed as ``substream->rmidi->private_data``. | ||
3181 | |||
3182 | If there is more than one port, your callbacks can determine the port | ||
3183 | index from the struct snd_rawmidi_substream data passed to each | ||
3184 | callback: | ||
3185 | |||
3186 | :: | ||
3187 | |||
3188 | struct snd_rawmidi_substream *substream; | ||
3189 | int index = substream->number; | ||
3190 | |||
3191 | RawMIDI open callback | ||
3192 | ~~~~~~~~~~~~~~~~~~~~~ | ||
3193 | |||
3194 | :: | ||
3195 | |||
3196 | static int snd_xxx_open(struct snd_rawmidi_substream *substream); | ||
3197 | |||
3198 | |||
3199 | This is called when a substream is opened. You can initialize the | ||
3200 | hardware here, but you shouldn't start transmitting/receiving data yet. | ||
3201 | |||
3202 | RawMIDI close callback | ||
3203 | ~~~~~~~~~~~~~~~~~~~~~~ | ||
3204 | |||
3205 | :: | ||
3206 | |||
3207 | static int snd_xxx_close(struct snd_rawmidi_substream *substream); | ||
3208 | |||
3209 | Guess what. | ||
3210 | |||
3211 | The ``open`` and ``close`` callbacks of a rawmidi device are | ||
3212 | serialized with a mutex, and can sleep. | ||
3213 | |||
3214 | Rawmidi trigger callback for output substreams | ||
3215 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
3216 | |||
3217 | :: | ||
3218 | |||
3219 | static void snd_xxx_output_trigger(struct snd_rawmidi_substream *substream, int up); | ||
3220 | |||
3221 | |||
3222 | This is called with a nonzero ``up`` parameter when there is some data | ||
3223 | in the substream buffer that must be transmitted. | ||
3224 | |||
3225 | To read data from the buffer, call | ||
3226 | :c:func:`snd_rawmidi_transmit_peek()`. It will return the number | ||
3227 | of bytes that have been read; this will be less than the number of bytes | ||
3228 | requested when there are no more data in the buffer. After the data have | ||
3229 | been transmitted successfully, call | ||
3230 | :c:func:`snd_rawmidi_transmit_ack()` to remove the data from the | ||
3231 | substream buffer: | ||
3232 | |||
3233 | :: | ||
3234 | |||
3235 | unsigned char data; | ||
3236 | while (snd_rawmidi_transmit_peek(substream, &data, 1) == 1) { | ||
3237 | if (snd_mychip_try_to_transmit(data)) | ||
3238 | snd_rawmidi_transmit_ack(substream, 1); | ||
3239 | else | ||
3240 | break; /* hardware FIFO full */ | ||
3241 | } | ||
3242 | |||
3243 | If you know beforehand that the hardware will accept data, you can use | ||
3244 | the :c:func:`snd_rawmidi_transmit()` function which reads some | ||
3245 | data and removes them from the buffer at once: | ||
3246 | |||
3247 | :: | ||
3248 | |||
3249 | while (snd_mychip_transmit_possible()) { | ||
3250 | unsigned char data; | ||
3251 | if (snd_rawmidi_transmit(substream, &data, 1) != 1) | ||
3252 | break; /* no more data */ | ||
3253 | snd_mychip_transmit(data); | ||
3254 | } | ||
3255 | |||
3256 | If you know beforehand how many bytes you can accept, you can use a | ||
3257 | buffer size greater than one with the | ||
3258 | :c:func:`snd_rawmidi_transmit\*()` functions. | ||
3259 | |||
3260 | The ``trigger`` callback must not sleep. If the hardware FIFO is full | ||
3261 | before the substream buffer has been emptied, you have to continue | ||
3262 | transmitting data later, either in an interrupt handler, or with a | ||
3263 | timer if the hardware doesn't have a MIDI transmit interrupt. | ||
3264 | |||
3265 | The ``trigger`` callback is called with a zero ``up`` parameter when | ||
3266 | the transmission of data should be aborted. | ||
3267 | |||
3268 | RawMIDI trigger callback for input substreams | ||
3269 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | ||
3270 | |||
3271 | :: | ||
3272 | |||
3273 | static void snd_xxx_input_trigger(struct snd_rawmidi_substream *substream, int up); | ||
3274 | |||
3275 | |||
3276 | This is called with a nonzero ``up`` parameter to enable receiving data, | ||
3277 | or with a zero ``up`` parameter do disable receiving data. | ||
3278 | |||
3279 | The ``trigger`` callback must not sleep; the actual reading of data | ||
3280 | from the device is usually done in an interrupt handler. | ||
3281 | |||
3282 | When data reception is enabled, your interrupt handler should call | ||
3283 | :c:func:`snd_rawmidi_receive()` for all received data: | ||
3284 | |||
3285 | :: | ||
3286 | |||
3287 | void snd_mychip_midi_interrupt(...) | ||
3288 | { | ||
3289 | while (mychip_midi_available()) { | ||
3290 | unsigned char data; | ||
3291 | data = mychip_midi_read(); | ||
3292 | snd_rawmidi_receive(substream, &data, 1); | ||
3293 | } | ||
3294 | } | ||
3295 | |||
3296 | |||
3297 | drain callback | ||
3298 | ~~~~~~~~~~~~~~ | ||
3299 | |||
3300 | :: | ||
3301 | |||
3302 | static void snd_xxx_drain(struct snd_rawmidi_substream *substream); | ||
3303 | |||
3304 | |||
3305 | This is only used with output substreams. This function should wait | ||
3306 | until all data read from the substream buffer have been transmitted. | ||
3307 | This ensures that the device can be closed and the driver unloaded | ||
3308 | without losing data. | ||
3309 | |||
3310 | This callback is optional. If you do not set ``drain`` in the struct | ||
3311 | snd_rawmidi_ops structure, ALSA will simply wait for 50 milliseconds | ||
3312 | instead. | ||
3313 | |||
3314 | Miscellaneous Devices | ||
3315 | ===================== | ||
3316 | |||
3317 | FM OPL3 | ||
3318 | ------- | ||
3319 | |||
3320 | The FM OPL3 is still used in many chips (mainly for backward | ||
3321 | compatibility). ALSA has a nice OPL3 FM control layer, too. The OPL3 API | ||
3322 | is defined in ``<sound/opl3.h>``. | ||
3323 | |||
3324 | FM registers can be directly accessed through the direct-FM API, defined | ||
3325 | in ``<sound/asound_fm.h>``. In ALSA native mode, FM registers are | ||
3326 | accessed through the Hardware-Dependent Device direct-FM extension API, | ||
3327 | whereas in OSS compatible mode, FM registers can be accessed with the | ||
3328 | OSS direct-FM compatible API in ``/dev/dmfmX`` device. | ||
3329 | |||
3330 | To create the OPL3 component, you have two functions to call. The first | ||
3331 | one is a constructor for the ``opl3_t`` instance. | ||
3332 | |||
3333 | :: | ||
3334 | |||
3335 | struct snd_opl3 *opl3; | ||
3336 | snd_opl3_create(card, lport, rport, OPL3_HW_OPL3_XXX, | ||
3337 | integrated, &opl3); | ||
3338 | |||
3339 | The first argument is the card pointer, the second one is the left port | ||
3340 | address, and the third is the right port address. In most cases, the | ||
3341 | right port is placed at the left port + 2. | ||
3342 | |||
3343 | The fourth argument is the hardware type. | ||
3344 | |||
3345 | When the left and right ports have been already allocated by the card | ||
3346 | driver, pass non-zero to the fifth argument (``integrated``). Otherwise, | ||
3347 | the opl3 module will allocate the specified ports by itself. | ||
3348 | |||
3349 | When the accessing the hardware requires special method instead of the | ||
3350 | standard I/O access, you can create opl3 instance separately with | ||
3351 | :c:func:`snd_opl3_new()`. | ||
3352 | |||
3353 | :: | ||
3354 | |||
3355 | struct snd_opl3 *opl3; | ||
3356 | snd_opl3_new(card, OPL3_HW_OPL3_XXX, &opl3); | ||
3357 | |||
3358 | Then set ``command``, ``private_data`` and ``private_free`` for the | ||
3359 | private access function, the private data and the destructor. The | ||
3360 | ``l_port`` and ``r_port`` are not necessarily set. Only the command | ||
3361 | must be set properly. You can retrieve the data from the | ||
3362 | ``opl3->private_data`` field. | ||
3363 | |||
3364 | After creating the opl3 instance via :c:func:`snd_opl3_new()`, | ||
3365 | call :c:func:`snd_opl3_init()` to initialize the chip to the | ||
3366 | proper state. Note that :c:func:`snd_opl3_create()` always calls | ||
3367 | it internally. | ||
3368 | |||
3369 | If the opl3 instance is created successfully, then create a hwdep device | ||
3370 | for this opl3. | ||
3371 | |||
3372 | :: | ||
3373 | |||
3374 | struct snd_hwdep *opl3hwdep; | ||
3375 | snd_opl3_hwdep_new(opl3, 0, 1, &opl3hwdep); | ||
3376 | |||
3377 | The first argument is the ``opl3_t`` instance you created, and the | ||
3378 | second is the index number, usually 0. | ||
3379 | |||
3380 | The third argument is the index-offset for the sequencer client assigned | ||
3381 | to the OPL3 port. When there is an MPU401-UART, give 1 for here (UART | ||
3382 | always takes 0). | ||
3383 | |||
3384 | Hardware-Dependent Devices | ||
3385 | -------------------------- | ||
3386 | |||
3387 | Some chips need user-space access for special controls or for loading | ||
3388 | the micro code. In such a case, you can create a hwdep | ||
3389 | (hardware-dependent) device. The hwdep API is defined in | ||
3390 | ``<sound/hwdep.h>``. You can find examples in opl3 driver or | ||
3391 | ``isa/sb/sb16_csp.c``. | ||
3392 | |||
3393 | The creation of the ``hwdep`` instance is done via | ||
3394 | :c:func:`snd_hwdep_new()`. | ||
3395 | |||
3396 | :: | ||
3397 | |||
3398 | struct snd_hwdep *hw; | ||
3399 | snd_hwdep_new(card, "My HWDEP", 0, &hw); | ||
3400 | |||
3401 | where the third argument is the index number. | ||
3402 | |||
3403 | You can then pass any pointer value to the ``private_data``. If you | ||
3404 | assign a private data, you should define the destructor, too. The | ||
3405 | destructor function is set in the ``private_free`` field. | ||
3406 | |||
3407 | :: | ||
3408 | |||
3409 | struct mydata *p = kmalloc(sizeof(*p), GFP_KERNEL); | ||
3410 | hw->private_data = p; | ||
3411 | hw->private_free = mydata_free; | ||
3412 | |||
3413 | and the implementation of the destructor would be: | ||
3414 | |||
3415 | :: | ||
3416 | |||
3417 | static void mydata_free(struct snd_hwdep *hw) | ||
3418 | { | ||
3419 | struct mydata *p = hw->private_data; | ||
3420 | kfree(p); | ||
3421 | } | ||
3422 | |||
3423 | The arbitrary file operations can be defined for this instance. The file | ||
3424 | operators are defined in the ``ops`` table. For example, assume that | ||
3425 | this chip needs an ioctl. | ||
3426 | |||
3427 | :: | ||
3428 | |||
3429 | hw->ops.open = mydata_open; | ||
3430 | hw->ops.ioctl = mydata_ioctl; | ||
3431 | hw->ops.release = mydata_release; | ||
3432 | |||
3433 | And implement the callback functions as you like. | ||
3434 | |||
3435 | IEC958 (S/PDIF) | ||
3436 | --------------- | ||
3437 | |||
3438 | Usually the controls for IEC958 devices are implemented via the control | ||
3439 | interface. There is a macro to compose a name string for IEC958 | ||
3440 | controls, :c:func:`SNDRV_CTL_NAME_IEC958()` defined in | ||
3441 | ``<include/asound.h>``. | ||
3442 | |||
3443 | There are some standard controls for IEC958 status bits. These controls | ||
3444 | use the type ``SNDRV_CTL_ELEM_TYPE_IEC958``, and the size of element is | ||
3445 | fixed as 4 bytes array (value.iec958.status[x]). For the ``info`` | ||
3446 | callback, you don't specify the value field for this type (the count | ||
3447 | field must be set, though). | ||
3448 | |||
3449 | “IEC958 Playback Con Mask” is used to return the bit-mask for the IEC958 | ||
3450 | status bits of consumer mode. Similarly, “IEC958 Playback Pro Mask” | ||
3451 | returns the bitmask for professional mode. They are read-only controls, | ||
3452 | and are defined as MIXER controls (iface = | ||
3453 | ``SNDRV_CTL_ELEM_IFACE_MIXER``). | ||
3454 | |||
3455 | Meanwhile, “IEC958 Playback Default” control is defined for getting and | ||
3456 | setting the current default IEC958 bits. Note that this one is usually | ||
3457 | defined as a PCM control (iface = ``SNDRV_CTL_ELEM_IFACE_PCM``), | ||
3458 | although in some places it's defined as a MIXER control. | ||
3459 | |||
3460 | In addition, you can define the control switches to enable/disable or to | ||
3461 | set the raw bit mode. The implementation will depend on the chip, but | ||
3462 | the control should be named as “IEC958 xxx”, preferably using the | ||
3463 | :c:func:`SNDRV_CTL_NAME_IEC958()` macro. | ||
3464 | |||
3465 | You can find several cases, for example, ``pci/emu10k1``, | ||
3466 | ``pci/ice1712``, or ``pci/cmipci.c``. | ||
3467 | |||
3468 | Buffer and Memory Management | ||
3469 | ============================ | ||
3470 | |||
3471 | Buffer Types | ||
3472 | ------------ | ||
3473 | |||
3474 | ALSA provides several different buffer allocation functions depending on | ||
3475 | the bus and the architecture. All these have a consistent API. The | ||
3476 | allocation of physically-contiguous pages is done via | ||
3477 | :c:func:`snd_malloc_xxx_pages()` function, where xxx is the bus | ||
3478 | type. | ||
3479 | |||
3480 | The allocation of pages with fallback is | ||
3481 | :c:func:`snd_malloc_xxx_pages_fallback()`. This function tries | ||
3482 | to allocate the specified pages but if the pages are not available, it | ||
3483 | tries to reduce the page sizes until enough space is found. | ||
3484 | |||
3485 | The release the pages, call :c:func:`snd_free_xxx_pages()` | ||
3486 | function. | ||
3487 | |||
3488 | Usually, ALSA drivers try to allocate and reserve a large contiguous | ||
3489 | physical space at the time the module is loaded for the later use. This | ||
3490 | is called “pre-allocation”. As already written, you can call the | ||
3491 | following function at pcm instance construction time (in the case of PCI | ||
3492 | bus). | ||
3493 | |||
3494 | :: | ||
3495 | |||
3496 | snd_pcm_lib_preallocate_pages_for_all(pcm, SNDRV_DMA_TYPE_DEV, | ||
3497 | snd_dma_pci_data(pci), size, max); | ||
3498 | |||
3499 | where ``size`` is the byte size to be pre-allocated and the ``max`` is | ||
3500 | the maximum size to be changed via the ``prealloc`` proc file. The | ||
3501 | allocator will try to get an area as large as possible within the | ||
3502 | given size. | ||
3503 | |||
3504 | The second argument (type) and the third argument (device pointer) are | ||
3505 | dependent on the bus. In the case of the ISA bus, pass | ||
3506 | :c:func:`snd_dma_isa_data()` as the third argument with | ||
3507 | ``SNDRV_DMA_TYPE_DEV`` type. For the continuous buffer unrelated to the | ||
3508 | bus can be pre-allocated with ``SNDRV_DMA_TYPE_CONTINUOUS`` type and the | ||
3509 | ``snd_dma_continuous_data(GFP_KERNEL)`` device pointer, where | ||
3510 | ``GFP_KERNEL`` is the kernel allocation flag to use. For the PCI | ||
3511 | scatter-gather buffers, use ``SNDRV_DMA_TYPE_DEV_SG`` with | ||
3512 | ``snd_dma_pci_data(pci)`` (see the `Non-Contiguous Buffers`_ | ||
3513 | section). | ||
3514 | |||
3515 | Once the buffer is pre-allocated, you can use the allocator in the | ||
3516 | ``hw_params`` callback: | ||
3517 | |||
3518 | :: | ||
3519 | |||
3520 | snd_pcm_lib_malloc_pages(substream, size); | ||
3521 | |||
3522 | Note that you have to pre-allocate to use this function. | ||
3523 | |||
3524 | External Hardware Buffers | ||
3525 | ------------------------- | ||
3526 | |||
3527 | Some chips have their own hardware buffers and the DMA transfer from the | ||
3528 | host memory is not available. In such a case, you need to either 1) | ||
3529 | copy/set the audio data directly to the external hardware buffer, or 2) | ||
3530 | make an intermediate buffer and copy/set the data from it to the | ||
3531 | external hardware buffer in interrupts (or in tasklets, preferably). | ||
3532 | |||
3533 | The first case works fine if the external hardware buffer is large | ||
3534 | enough. This method doesn't need any extra buffers and thus is more | ||
3535 | effective. You need to define the ``copy`` and ``silence`` callbacks | ||
3536 | for the data transfer. However, there is a drawback: it cannot be | ||
3537 | mmapped. The examples are GUS's GF1 PCM or emu8000's wavetable PCM. | ||
3538 | |||
3539 | The second case allows for mmap on the buffer, although you have to | ||
3540 | handle an interrupt or a tasklet to transfer the data from the | ||
3541 | intermediate buffer to the hardware buffer. You can find an example in | ||
3542 | the vxpocket driver. | ||
3543 | |||
3544 | Another case is when the chip uses a PCI memory-map region for the | ||
3545 | buffer instead of the host memory. In this case, mmap is available only | ||
3546 | on certain architectures like the Intel one. In non-mmap mode, the data | ||
3547 | cannot be transferred as in the normal way. Thus you need to define the | ||
3548 | ``copy`` and ``silence`` callbacks as well, as in the cases above. The | ||
3549 | examples are found in ``rme32.c`` and ``rme96.c``. | ||
3550 | |||
3551 | The implementation of the ``copy`` and ``silence`` callbacks depends | ||
3552 | upon whether the hardware supports interleaved or non-interleaved | ||
3553 | samples. The ``copy`` callback is defined like below, a bit | ||
3554 | differently depending whether the direction is playback or capture: | ||
3555 | |||
3556 | :: | ||
3557 | |||
3558 | static int playback_copy(struct snd_pcm_substream *substream, int channel, | ||
3559 | snd_pcm_uframes_t pos, void *src, snd_pcm_uframes_t count); | ||
3560 | static int capture_copy(struct snd_pcm_substream *substream, int channel, | ||
3561 | snd_pcm_uframes_t pos, void *dst, snd_pcm_uframes_t count); | ||
3562 | |||
3563 | In the case of interleaved samples, the second argument (``channel``) is | ||
3564 | not used. The third argument (``pos``) points the current position | ||
3565 | offset in frames. | ||
3566 | |||
3567 | The meaning of the fourth argument is different between playback and | ||
3568 | capture. For playback, it holds the source data pointer, and for | ||
3569 | capture, it's the destination data pointer. | ||
3570 | |||
3571 | The last argument is the number of frames to be copied. | ||
3572 | |||
3573 | What you have to do in this callback is again different between playback | ||
3574 | and capture directions. In the playback case, you copy the given amount | ||
3575 | of data (``count``) at the specified pointer (``src``) to the specified | ||
3576 | offset (``pos``) on the hardware buffer. When coded like memcpy-like | ||
3577 | way, the copy would be like: | ||
3578 | |||
3579 | :: | ||
3580 | |||
3581 | my_memcpy(my_buffer + frames_to_bytes(runtime, pos), src, | ||
3582 | frames_to_bytes(runtime, count)); | ||
3583 | |||
3584 | For the capture direction, you copy the given amount of data (``count``) | ||
3585 | at the specified offset (``pos``) on the hardware buffer to the | ||
3586 | specified pointer (``dst``). | ||
3587 | |||
3588 | :: | ||
3589 | |||
3590 | my_memcpy(dst, my_buffer + frames_to_bytes(runtime, pos), | ||
3591 | frames_to_bytes(runtime, count)); | ||
3592 | |||
3593 | Note that both the position and the amount of data are given in frames. | ||
3594 | |||
3595 | In the case of non-interleaved samples, the implementation will be a bit | ||
3596 | more complicated. | ||
3597 | |||
3598 | You need to check the channel argument, and if it's -1, copy the whole | ||
3599 | channels. Otherwise, you have to copy only the specified channel. Please | ||
3600 | check ``isa/gus/gus_pcm.c`` as an example. | ||
3601 | |||
3602 | The ``silence`` callback is also implemented in a similar way | ||
3603 | |||
3604 | :: | ||
3605 | |||
3606 | static int silence(struct snd_pcm_substream *substream, int channel, | ||
3607 | snd_pcm_uframes_t pos, snd_pcm_uframes_t count); | ||
3608 | |||
3609 | The meanings of arguments are the same as in the ``copy`` callback, | ||
3610 | although there is no ``src/dst`` argument. In the case of interleaved | ||
3611 | samples, the channel argument has no meaning, as well as on ``copy`` | ||
3612 | callback. | ||
3613 | |||
3614 | The role of ``silence`` callback is to set the given amount | ||
3615 | (``count``) of silence data at the specified offset (``pos``) on the | ||
3616 | hardware buffer. Suppose that the data format is signed (that is, the | ||
3617 | silent-data is 0), and the implementation using a memset-like function | ||
3618 | would be like: | ||
3619 | |||
3620 | :: | ||
3621 | |||
3622 | my_memcpy(my_buffer + frames_to_bytes(runtime, pos), 0, | ||
3623 | frames_to_bytes(runtime, count)); | ||
3624 | |||
3625 | In the case of non-interleaved samples, again, the implementation | ||
3626 | becomes a bit more complicated. See, for example, ``isa/gus/gus_pcm.c``. | ||
3627 | |||
3628 | Non-Contiguous Buffers | ||
3629 | ---------------------- | ||
3630 | |||
3631 | If your hardware supports the page table as in emu10k1 or the buffer | ||
3632 | descriptors as in via82xx, you can use the scatter-gather (SG) DMA. ALSA | ||
3633 | provides an interface for handling SG-buffers. The API is provided in | ||
3634 | ``<sound/pcm.h>``. | ||
3635 | |||
3636 | For creating the SG-buffer handler, call | ||
3637 | :c:func:`snd_pcm_lib_preallocate_pages()` or | ||
3638 | :c:func:`snd_pcm_lib_preallocate_pages_for_all()` with | ||
3639 | ``SNDRV_DMA_TYPE_DEV_SG`` in the PCM constructor like other PCI | ||
3640 | pre-allocator. You need to pass ``snd_dma_pci_data(pci)``, where pci is | ||
3641 | the :c:type:`struct pci_dev <pci_dev>` pointer of the chip as | ||
3642 | well. The ``struct snd_sg_buf`` instance is created as | ||
3643 | ``substream->dma_private``. You can cast the pointer like: | ||
3644 | |||
3645 | :: | ||
3646 | |||
3647 | struct snd_sg_buf *sgbuf = (struct snd_sg_buf *)substream->dma_private; | ||
3648 | |||
3649 | Then call :c:func:`snd_pcm_lib_malloc_pages()` in the ``hw_params`` | ||
3650 | callback as well as in the case of normal PCI buffer. The SG-buffer | ||
3651 | handler will allocate the non-contiguous kernel pages of the given size | ||
3652 | and map them onto the virtually contiguous memory. The virtual pointer | ||
3653 | is addressed in runtime->dma_area. The physical address | ||
3654 | (``runtime->dma_addr``) is set to zero, because the buffer is | ||
3655 | physically non-contiguous. The physical address table is set up in | ||
3656 | ``sgbuf->table``. You can get the physical address at a certain offset | ||
3657 | via :c:func:`snd_pcm_sgbuf_get_addr()`. | ||
3658 | |||
3659 | When a SG-handler is used, you need to set | ||
3660 | :c:func:`snd_pcm_sgbuf_ops_page()` as the ``page`` callback. (See | ||
3661 | `page callback`_ section.) | ||
3662 | |||
3663 | To release the data, call :c:func:`snd_pcm_lib_free_pages()` in | ||
3664 | the ``hw_free`` callback as usual. | ||
3665 | |||
3666 | Vmalloc'ed Buffers | ||
3667 | ------------------ | ||
3668 | |||
3669 | It's possible to use a buffer allocated via :c:func:`vmalloc()`, for | ||
3670 | example, for an intermediate buffer. Since the allocated pages are not | ||
3671 | contiguous, you need to set the ``page`` callback to obtain the physical | ||
3672 | address at every offset. | ||
3673 | |||
3674 | The implementation of ``page`` callback would be like this: | ||
3675 | |||
3676 | :: | ||
3677 | |||
3678 | #include <linux/vmalloc.h> | ||
3679 | |||
3680 | /* get the physical page pointer on the given offset */ | ||
3681 | static struct page *mychip_page(struct snd_pcm_substream *substream, | ||
3682 | unsigned long offset) | ||
3683 | { | ||
3684 | void *pageptr = substream->runtime->dma_area + offset; | ||
3685 | return vmalloc_to_page(pageptr); | ||
3686 | } | ||
3687 | |||
3688 | Proc Interface | ||
3689 | ============== | ||
3690 | |||
3691 | ALSA provides an easy interface for procfs. The proc files are very | ||
3692 | useful for debugging. I recommend you set up proc files if you write a | ||
3693 | driver and want to get a running status or register dumps. The API is | ||
3694 | found in ``<sound/info.h>``. | ||
3695 | |||
3696 | To create a proc file, call :c:func:`snd_card_proc_new()`. | ||
3697 | |||
3698 | :: | ||
3699 | |||
3700 | struct snd_info_entry *entry; | ||
3701 | int err = snd_card_proc_new(card, "my-file", &entry); | ||
3702 | |||
3703 | where the second argument specifies the name of the proc file to be | ||
3704 | created. The above example will create a file ``my-file`` under the | ||
3705 | card directory, e.g. ``/proc/asound/card0/my-file``. | ||
3706 | |||
3707 | Like other components, the proc entry created via | ||
3708 | :c:func:`snd_card_proc_new()` will be registered and released | ||
3709 | automatically in the card registration and release functions. | ||
3710 | |||
3711 | When the creation is successful, the function stores a new instance in | ||
3712 | the pointer given in the third argument. It is initialized as a text | ||
3713 | proc file for read only. To use this proc file as a read-only text file | ||
3714 | as it is, set the read callback with a private data via | ||
3715 | :c:func:`snd_info_set_text_ops()`. | ||
3716 | |||
3717 | :: | ||
3718 | |||
3719 | snd_info_set_text_ops(entry, chip, my_proc_read); | ||
3720 | |||
3721 | where the second argument (``chip``) is the private data to be used in | ||
3722 | the callbacks. The third parameter specifies the read buffer size and | ||
3723 | the fourth (``my_proc_read``) is the callback function, which is | ||
3724 | defined like | ||
3725 | |||
3726 | :: | ||
3727 | |||
3728 | static void my_proc_read(struct snd_info_entry *entry, | ||
3729 | struct snd_info_buffer *buffer); | ||
3730 | |||
3731 | In the read callback, use :c:func:`snd_iprintf()` for output | ||
3732 | strings, which works just like normal :c:func:`printf()`. For | ||
3733 | example, | ||
3734 | |||
3735 | :: | ||
3736 | |||
3737 | static void my_proc_read(struct snd_info_entry *entry, | ||
3738 | struct snd_info_buffer *buffer) | ||
3739 | { | ||
3740 | struct my_chip *chip = entry->private_data; | ||
3741 | |||
3742 | snd_iprintf(buffer, "This is my chip!\n"); | ||
3743 | snd_iprintf(buffer, "Port = %ld\n", chip->port); | ||
3744 | } | ||
3745 | |||
3746 | The file permissions can be changed afterwards. As default, it's set as | ||
3747 | read only for all users. If you want to add write permission for the | ||
3748 | user (root as default), do as follows: | ||
3749 | |||
3750 | :: | ||
3751 | |||
3752 | entry->mode = S_IFREG | S_IRUGO | S_IWUSR; | ||
3753 | |||
3754 | and set the write buffer size and the callback | ||
3755 | |||
3756 | :: | ||
3757 | |||
3758 | entry->c.text.write = my_proc_write; | ||
3759 | |||
3760 | For the write callback, you can use :c:func:`snd_info_get_line()` | ||
3761 | to get a text line, and :c:func:`snd_info_get_str()` to retrieve | ||
3762 | a string from the line. Some examples are found in | ||
3763 | ``core/oss/mixer_oss.c``, core/oss/and ``pcm_oss.c``. | ||
3764 | |||
3765 | For a raw-data proc-file, set the attributes as follows: | ||
3766 | |||
3767 | :: | ||
3768 | |||
3769 | static struct snd_info_entry_ops my_file_io_ops = { | ||
3770 | .read = my_file_io_read, | ||
3771 | }; | ||
3772 | |||
3773 | entry->content = SNDRV_INFO_CONTENT_DATA; | ||
3774 | entry->private_data = chip; | ||
3775 | entry->c.ops = &my_file_io_ops; | ||
3776 | entry->size = 4096; | ||
3777 | entry->mode = S_IFREG | S_IRUGO; | ||
3778 | |||
3779 | For the raw data, ``size`` field must be set properly. This specifies | ||
3780 | the maximum size of the proc file access. | ||
3781 | |||
3782 | The read/write callbacks of raw mode are more direct than the text mode. | ||
3783 | You need to use a low-level I/O functions such as | ||
3784 | :c:func:`copy_from/to_user()` to transfer the data. | ||
3785 | |||
3786 | :: | ||
3787 | |||
3788 | static ssize_t my_file_io_read(struct snd_info_entry *entry, | ||
3789 | void *file_private_data, | ||
3790 | struct file *file, | ||
3791 | char *buf, | ||
3792 | size_t count, | ||
3793 | loff_t pos) | ||
3794 | { | ||
3795 | if (copy_to_user(buf, local_data + pos, count)) | ||
3796 | return -EFAULT; | ||
3797 | return count; | ||
3798 | } | ||
3799 | |||
3800 | If the size of the info entry has been set up properly, ``count`` and | ||
3801 | ``pos`` are guaranteed to fit within 0 and the given size. You don't | ||
3802 | have to check the range in the callbacks unless any other condition is | ||
3803 | required. | ||
3804 | |||
3805 | Power Management | ||
3806 | ================ | ||
3807 | |||
3808 | If the chip is supposed to work with suspend/resume functions, you need | ||
3809 | to add power-management code to the driver. The additional code for | ||
3810 | power-management should be ifdef-ed with ``CONFIG_PM``. | ||
3811 | |||
3812 | If the driver *fully* supports suspend/resume that is, the device can be | ||
3813 | properly resumed to its state when suspend was called, you can set the | ||
3814 | ``SNDRV_PCM_INFO_RESUME`` flag in the pcm info field. Usually, this is | ||
3815 | possible when the registers of the chip can be safely saved and restored | ||
3816 | to RAM. If this is set, the trigger callback is called with | ||
3817 | ``SNDRV_PCM_TRIGGER_RESUME`` after the resume callback completes. | ||
3818 | |||
3819 | Even if the driver doesn't support PM fully but partial suspend/resume | ||
3820 | is still possible, it's still worthy to implement suspend/resume | ||
3821 | callbacks. In such a case, applications would reset the status by | ||
3822 | calling :c:func:`snd_pcm_prepare()` and restart the stream | ||
3823 | appropriately. Hence, you can define suspend/resume callbacks below but | ||
3824 | don't set ``SNDRV_PCM_INFO_RESUME`` info flag to the PCM. | ||
3825 | |||
3826 | Note that the trigger with SUSPEND can always be called when | ||
3827 | :c:func:`snd_pcm_suspend_all()` is called, regardless of the | ||
3828 | ``SNDRV_PCM_INFO_RESUME`` flag. The ``RESUME`` flag affects only the | ||
3829 | behavior of :c:func:`snd_pcm_resume()`. (Thus, in theory, | ||
3830 | ``SNDRV_PCM_TRIGGER_RESUME`` isn't needed to be handled in the trigger | ||
3831 | callback when no ``SNDRV_PCM_INFO_RESUME`` flag is set. But, it's better | ||
3832 | to keep it for compatibility reasons.) | ||
3833 | |||
3834 | In the earlier version of ALSA drivers, a common power-management layer | ||
3835 | was provided, but it has been removed. The driver needs to define the | ||
3836 | suspend/resume hooks according to the bus the device is connected to. In | ||
3837 | the case of PCI drivers, the callbacks look like below: | ||
3838 | |||
3839 | :: | ||
3840 | |||
3841 | #ifdef CONFIG_PM | ||
3842 | static int snd_my_suspend(struct pci_dev *pci, pm_message_t state) | ||
3843 | { | ||
3844 | .... /* do things for suspend */ | ||
3845 | return 0; | ||
3846 | } | ||
3847 | static int snd_my_resume(struct pci_dev *pci) | ||
3848 | { | ||
3849 | .... /* do things for suspend */ | ||
3850 | return 0; | ||
3851 | } | ||
3852 | #endif | ||
3853 | |||
3854 | The scheme of the real suspend job is as follows. | ||
3855 | |||
3856 | 1. Retrieve the card and the chip data. | ||
3857 | |||
3858 | 2. Call :c:func:`snd_power_change_state()` with | ||
3859 | ``SNDRV_CTL_POWER_D3hot`` to change the power status. | ||
3860 | |||
3861 | 3. Call :c:func:`snd_pcm_suspend_all()` to suspend the running | ||
3862 | PCM streams. | ||
3863 | |||
3864 | 4. If AC97 codecs are used, call :c:func:`snd_ac97_suspend()` for | ||
3865 | each codec. | ||
3866 | |||
3867 | 5. Save the register values if necessary. | ||
3868 | |||
3869 | 6. Stop the hardware if necessary. | ||
3870 | |||
3871 | 7. Disable the PCI device by calling | ||
3872 | :c:func:`pci_disable_device()`. Then, call | ||
3873 | :c:func:`pci_save_state()` at last. | ||
3874 | |||
3875 | A typical code would be like: | ||
3876 | |||
3877 | :: | ||
3878 | |||
3879 | static int mychip_suspend(struct pci_dev *pci, pm_message_t state) | ||
3880 | { | ||
3881 | /* (1) */ | ||
3882 | struct snd_card *card = pci_get_drvdata(pci); | ||
3883 | struct mychip *chip = card->private_data; | ||
3884 | /* (2) */ | ||
3885 | snd_power_change_state(card, SNDRV_CTL_POWER_D3hot); | ||
3886 | /* (3) */ | ||
3887 | snd_pcm_suspend_all(chip->pcm); | ||
3888 | /* (4) */ | ||
3889 | snd_ac97_suspend(chip->ac97); | ||
3890 | /* (5) */ | ||
3891 | snd_mychip_save_registers(chip); | ||
3892 | /* (6) */ | ||
3893 | snd_mychip_stop_hardware(chip); | ||
3894 | /* (7) */ | ||
3895 | pci_disable_device(pci); | ||
3896 | pci_save_state(pci); | ||
3897 | return 0; | ||
3898 | } | ||
3899 | |||
3900 | |||
3901 | The scheme of the real resume job is as follows. | ||
3902 | |||
3903 | 1. Retrieve the card and the chip data. | ||
3904 | |||
3905 | 2. Set up PCI. First, call :c:func:`pci_restore_state()`. Then | ||
3906 | enable the pci device again by calling | ||
3907 | :c:func:`pci_enable_device()`. Call | ||
3908 | :c:func:`pci_set_master()` if necessary, too. | ||
3909 | |||
3910 | 3. Re-initialize the chip. | ||
3911 | |||
3912 | 4. Restore the saved registers if necessary. | ||
3913 | |||
3914 | 5. Resume the mixer, e.g. calling :c:func:`snd_ac97_resume()`. | ||
3915 | |||
3916 | 6. Restart the hardware (if any). | ||
3917 | |||
3918 | 7. Call :c:func:`snd_power_change_state()` with | ||
3919 | ``SNDRV_CTL_POWER_D0`` to notify the processes. | ||
3920 | |||
3921 | A typical code would be like: | ||
3922 | |||
3923 | :: | ||
3924 | |||
3925 | static int mychip_resume(struct pci_dev *pci) | ||
3926 | { | ||
3927 | /* (1) */ | ||
3928 | struct snd_card *card = pci_get_drvdata(pci); | ||
3929 | struct mychip *chip = card->private_data; | ||
3930 | /* (2) */ | ||
3931 | pci_restore_state(pci); | ||
3932 | pci_enable_device(pci); | ||
3933 | pci_set_master(pci); | ||
3934 | /* (3) */ | ||
3935 | snd_mychip_reinit_chip(chip); | ||
3936 | /* (4) */ | ||
3937 | snd_mychip_restore_registers(chip); | ||
3938 | /* (5) */ | ||
3939 | snd_ac97_resume(chip->ac97); | ||
3940 | /* (6) */ | ||
3941 | snd_mychip_restart_chip(chip); | ||
3942 | /* (7) */ | ||
3943 | snd_power_change_state(card, SNDRV_CTL_POWER_D0); | ||
3944 | return 0; | ||
3945 | } | ||
3946 | |||
3947 | As shown in the above, it's better to save registers after suspending | ||
3948 | the PCM operations via :c:func:`snd_pcm_suspend_all()` or | ||
3949 | :c:func:`snd_pcm_suspend()`. It means that the PCM streams are | ||
3950 | already stopped when the register snapshot is taken. But, remember that | ||
3951 | you don't have to restart the PCM stream in the resume callback. It'll | ||
3952 | be restarted via trigger call with ``SNDRV_PCM_TRIGGER_RESUME`` when | ||
3953 | necessary. | ||
3954 | |||
3955 | OK, we have all callbacks now. Let's set them up. In the initialization | ||
3956 | of the card, make sure that you can get the chip data from the card | ||
3957 | instance, typically via ``private_data`` field, in case you created the | ||
3958 | chip data individually. | ||
3959 | |||
3960 | :: | ||
3961 | |||
3962 | static int snd_mychip_probe(struct pci_dev *pci, | ||
3963 | const struct pci_device_id *pci_id) | ||
3964 | { | ||
3965 | .... | ||
3966 | struct snd_card *card; | ||
3967 | struct mychip *chip; | ||
3968 | int err; | ||
3969 | .... | ||
3970 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, | ||
3971 | 0, &card); | ||
3972 | .... | ||
3973 | chip = kzalloc(sizeof(*chip), GFP_KERNEL); | ||
3974 | .... | ||
3975 | card->private_data = chip; | ||
3976 | .... | ||
3977 | } | ||
3978 | |||
3979 | When you created the chip data with :c:func:`snd_card_new()`, it's | ||
3980 | anyway accessible via ``private_data`` field. | ||
3981 | |||
3982 | :: | ||
3983 | |||
3984 | static int snd_mychip_probe(struct pci_dev *pci, | ||
3985 | const struct pci_device_id *pci_id) | ||
3986 | { | ||
3987 | .... | ||
3988 | struct snd_card *card; | ||
3989 | struct mychip *chip; | ||
3990 | int err; | ||
3991 | .... | ||
3992 | err = snd_card_new(&pci->dev, index[dev], id[dev], THIS_MODULE, | ||
3993 | sizeof(struct mychip), &card); | ||
3994 | .... | ||
3995 | chip = card->private_data; | ||
3996 | .... | ||
3997 | } | ||
3998 | |||
3999 | If you need a space to save the registers, allocate the buffer for it | ||
4000 | here, too, since it would be fatal if you cannot allocate a memory in | ||
4001 | the suspend phase. The allocated buffer should be released in the | ||
4002 | corresponding destructor. | ||
4003 | |||
4004 | And next, set suspend/resume callbacks to the pci_driver. | ||
4005 | |||
4006 | :: | ||
4007 | |||
4008 | static struct pci_driver driver = { | ||
4009 | .name = KBUILD_MODNAME, | ||
4010 | .id_table = snd_my_ids, | ||
4011 | .probe = snd_my_probe, | ||
4012 | .remove = snd_my_remove, | ||
4013 | #ifdef CONFIG_PM | ||
4014 | .suspend = snd_my_suspend, | ||
4015 | .resume = snd_my_resume, | ||
4016 | #endif | ||
4017 | }; | ||
4018 | |||
4019 | Module Parameters | ||
4020 | ================= | ||
4021 | |||
4022 | There are standard module options for ALSA. At least, each module should | ||
4023 | have the ``index``, ``id`` and ``enable`` options. | ||
4024 | |||
4025 | If the module supports multiple cards (usually up to 8 = ``SNDRV_CARDS`` | ||
4026 | cards), they should be arrays. The default initial values are defined | ||
4027 | already as constants for easier programming: | ||
4028 | |||
4029 | :: | ||
4030 | |||
4031 | static int index[SNDRV_CARDS] = SNDRV_DEFAULT_IDX; | ||
4032 | static char *id[SNDRV_CARDS] = SNDRV_DEFAULT_STR; | ||
4033 | static int enable[SNDRV_CARDS] = SNDRV_DEFAULT_ENABLE_PNP; | ||
4034 | |||
4035 | If the module supports only a single card, they could be single | ||
4036 | variables, instead. ``enable`` option is not always necessary in this | ||
4037 | case, but it would be better to have a dummy option for compatibility. | ||
4038 | |||
4039 | The module parameters must be declared with the standard | ||
4040 | ``module_param()()``, ``module_param_array()()`` and | ||
4041 | :c:func:`MODULE_PARM_DESC()` macros. | ||
4042 | |||
4043 | The typical coding would be like below: | ||
4044 | |||
4045 | :: | ||
4046 | |||
4047 | #define CARD_NAME "My Chip" | ||
4048 | |||
4049 | module_param_array(index, int, NULL, 0444); | ||
4050 | MODULE_PARM_DESC(index, "Index value for " CARD_NAME " soundcard."); | ||
4051 | module_param_array(id, charp, NULL, 0444); | ||
4052 | MODULE_PARM_DESC(id, "ID string for " CARD_NAME " soundcard."); | ||
4053 | module_param_array(enable, bool, NULL, 0444); | ||
4054 | MODULE_PARM_DESC(enable, "Enable " CARD_NAME " soundcard."); | ||
4055 | |||
4056 | Also, don't forget to define the module description, classes, license | ||
4057 | and devices. Especially, the recent modprobe requires to define the | ||
4058 | module license as GPL, etc., otherwise the system is shown as “tainted”. | ||
4059 | |||
4060 | :: | ||
4061 | |||
4062 | MODULE_DESCRIPTION("My Chip"); | ||
4063 | MODULE_LICENSE("GPL"); | ||
4064 | MODULE_SUPPORTED_DEVICE("{{Vendor,My Chip Name}}"); | ||
4065 | |||
4066 | |||
4067 | How To Put Your Driver Into ALSA Tree | ||
4068 | ===================================== | ||
4069 | |||
4070 | General | ||
4071 | ------- | ||
4072 | |||
4073 | So far, you've learned how to write the driver codes. And you might have | ||
4074 | a question now: how to put my own driver into the ALSA driver tree? Here | ||
4075 | (finally :) the standard procedure is described briefly. | ||
4076 | |||
4077 | Suppose that you create a new PCI driver for the card “xyz”. The card | ||
4078 | module name would be snd-xyz. The new driver is usually put into the | ||
4079 | alsa-driver tree, ``alsa-driver/pci`` directory in the case of PCI | ||
4080 | cards. Then the driver is evaluated, audited and tested by developers | ||
4081 | and users. After a certain time, the driver will go to the alsa-kernel | ||
4082 | tree (to the corresponding directory, such as ``alsa-kernel/pci``) and | ||
4083 | eventually will be integrated into the Linux 2.6 tree (the directory | ||
4084 | would be ``linux/sound/pci``). | ||
4085 | |||
4086 | In the following sections, the driver code is supposed to be put into | ||
4087 | alsa-driver tree. The two cases are covered: a driver consisting of a | ||
4088 | single source file and one consisting of several source files. | ||
4089 | |||
4090 | Driver with A Single Source File | ||
4091 | -------------------------------- | ||
4092 | |||
4093 | 1. Modify alsa-driver/pci/Makefile | ||
4094 | |||
4095 | Suppose you have a file xyz.c. Add the following two lines | ||
4096 | |||
4097 | :: | ||
4098 | |||
4099 | snd-xyz-objs := xyz.o | ||
4100 | obj-$(CONFIG_SND_XYZ) += snd-xyz.o | ||
4101 | |||
4102 | 2. Create the Kconfig entry | ||
4103 | |||
4104 | Add the new entry of Kconfig for your xyz driver. config SND_XYZ | ||
4105 | tristate "Foobar XYZ" depends on SND select SND_PCM help Say Y here | ||
4106 | to include support for Foobar XYZ soundcard. To compile this driver | ||
4107 | as a module, choose M here: the module will be called snd-xyz. the | ||
4108 | line, select SND_PCM, specifies that the driver xyz supports PCM. In | ||
4109 | addition to SND_PCM, the following components are supported for | ||
4110 | select command: SND_RAWMIDI, SND_TIMER, SND_HWDEP, | ||
4111 | SND_MPU401_UART, SND_OPL3_LIB, SND_OPL4_LIB, SND_VX_LIB, | ||
4112 | SND_AC97_CODEC. Add the select command for each supported | ||
4113 | component. | ||
4114 | |||
4115 | Note that some selections imply the lowlevel selections. For example, | ||
4116 | PCM includes TIMER, MPU401_UART includes RAWMIDI, AC97_CODEC | ||
4117 | includes PCM, and OPL3_LIB includes HWDEP. You don't need to give | ||
4118 | the lowlevel selections again. | ||
4119 | |||
4120 | For the details of Kconfig script, refer to the kbuild documentation. | ||
4121 | |||
4122 | 3. Run cvscompile script to re-generate the configure script and build | ||
4123 | the whole stuff again. | ||
4124 | |||
4125 | Drivers with Several Source Files | ||
4126 | --------------------------------- | ||
4127 | |||
4128 | Suppose that the driver snd-xyz have several source files. They are | ||
4129 | located in the new subdirectory, pci/xyz. | ||
4130 | |||
4131 | 1. Add a new directory (``xyz``) in ``alsa-driver/pci/Makefile`` as | ||
4132 | below | ||
4133 | |||
4134 | :: | ||
4135 | |||
4136 | obj-$(CONFIG_SND) += xyz/ | ||
4137 | |||
4138 | |||
4139 | 2. Under the directory ``xyz``, create a Makefile | ||
4140 | |||
4141 | :: | ||
4142 | |||
4143 | ifndef SND_TOPDIR | ||
4144 | SND_TOPDIR=../.. | ||
4145 | endif | ||
4146 | |||
4147 | include $(SND_TOPDIR)/toplevel.config | ||
4148 | include $(SND_TOPDIR)/Makefile.conf | ||
4149 | |||
4150 | snd-xyz-objs := xyz.o abc.o def.o | ||
4151 | |||
4152 | obj-$(CONFIG_SND_XYZ) += snd-xyz.o | ||
4153 | |||
4154 | include $(SND_TOPDIR)/Rules.make | ||
4155 | |||
4156 | 3. Create the Kconfig entry | ||
4157 | |||
4158 | This procedure is as same as in the last section. | ||
4159 | |||
4160 | 4. Run cvscompile script to re-generate the configure script and build | ||
4161 | the whole stuff again. | ||
4162 | |||
4163 | Useful Functions | ||
4164 | ================ | ||
4165 | |||
4166 | :c:func:`snd_printk()` and friends | ||
4167 | --------------------------------------- | ||
4168 | |||
4169 | ALSA provides a verbose version of the :c:func:`printk()` function. | ||
4170 | If a kernel config ``CONFIG_SND_VERBOSE_PRINTK`` is set, this function | ||
4171 | prints the given message together with the file name and the line of the | ||
4172 | caller. The ``KERN_XXX`` prefix is processed as well as the original | ||
4173 | :c:func:`printk()` does, so it's recommended to add this prefix, | ||
4174 | e.g. snd_printk(KERN_ERR "Oh my, sorry, it's extremely bad!\\n"); | ||
4175 | |||
4176 | There are also :c:func:`printk()`'s for debugging. | ||
4177 | :c:func:`snd_printd()` can be used for general debugging purposes. | ||
4178 | If ``CONFIG_SND_DEBUG`` is set, this function is compiled, and works | ||
4179 | just like :c:func:`snd_printk()`. If the ALSA is compiled without | ||
4180 | the debugging flag, it's ignored. | ||
4181 | |||
4182 | :c:func:`snd_printdd()` is compiled in only when | ||
4183 | ``CONFIG_SND_DEBUG_VERBOSE`` is set. Please note that | ||
4184 | ``CONFIG_SND_DEBUG_VERBOSE`` is not set as default even if you configure | ||
4185 | the alsa-driver with ``--with-debug=full`` option. You need to give | ||
4186 | explicitly ``--with-debug=detect`` option instead. | ||
4187 | |||
4188 | :c:func:`snd_BUG()` | ||
4189 | ------------------------ | ||
4190 | |||
4191 | It shows the ``BUG?`` message and stack trace as well as | ||
4192 | :c:func:`snd_BUG_ON()` at the point. It's useful to show that a | ||
4193 | fatal error happens there. | ||
4194 | |||
4195 | When no debug flag is set, this macro is ignored. | ||
4196 | |||
4197 | :c:func:`snd_BUG_ON()` | ||
4198 | ---------------------------- | ||
4199 | |||
4200 | :c:func:`snd_BUG_ON()` macro is similar with | ||
4201 | :c:func:`WARN_ON()` macro. For example, snd_BUG_ON(!pointer); or | ||
4202 | it can be used as the condition, if (snd_BUG_ON(non_zero_is_bug)) | ||
4203 | return -EINVAL; | ||
4204 | |||
4205 | The macro takes an conditional expression to evaluate. When | ||
4206 | ``CONFIG_SND_DEBUG``, is set, if the expression is non-zero, it shows | ||
4207 | the warning message such as ``BUG? (xxx)`` normally followed by stack | ||
4208 | trace. In both cases it returns the evaluated value. | ||
4209 | |||
4210 | Acknowledgments | ||
4211 | =============== | ||
4212 | |||
4213 | I would like to thank Phil Kerr for his help for improvement and | ||
4214 | corrections of this document. | ||
4215 | |||
4216 | Kevin Conder reformatted the original plain-text to the DocBook format. | ||
4217 | |||
4218 | Giuliano Pochini corrected typos and contributed the example codes in | ||
4219 | the hardware constraints section. | ||
diff --git a/Documentation/sound/alsa/soc/clocking.txt b/Documentation/sound/soc/clocking.rst index b1300162e01c..32122d6877a3 100644 --- a/Documentation/sound/alsa/soc/clocking.txt +++ b/Documentation/sound/soc/clocking.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ============== | ||
1 | Audio Clocking | 2 | Audio Clocking |
2 | ============== | 3 | ============== |
3 | 4 | ||
@@ -30,15 +31,9 @@ runs at exactly the sample rate (LRC = Rate). | |||
30 | 31 | ||
31 | Bit Clock can be generated as follows:- | 32 | Bit Clock can be generated as follows:- |
32 | 33 | ||
33 | BCLK = MCLK / x | 34 | - BCLK = MCLK / x, or |
34 | 35 | - BCLK = LRC * x, or | |
35 | or | 36 | - BCLK = LRC * Channels * Word Size |
36 | |||
37 | BCLK = LRC * x | ||
38 | |||
39 | or | ||
40 | |||
41 | BCLK = LRC * Channels * Word Size | ||
42 | 37 | ||
43 | This relationship depends on the codec or SoC CPU in particular. In general | 38 | This relationship depends on the codec or SoC CPU in particular. In general |
44 | it is best to configure BCLK to the lowest possible speed (depending on your | 39 | it is best to configure BCLK to the lowest possible speed (depending on your |
diff --git a/Documentation/sound/soc/codec-to-codec.rst b/Documentation/sound/soc/codec-to-codec.rst new file mode 100644 index 000000000000..810109d7500d --- /dev/null +++ b/Documentation/sound/soc/codec-to-codec.rst | |||
@@ -0,0 +1,108 @@ | |||
1 | ============================================== | ||
2 | Creating codec to codec dai link for ALSA dapm | ||
3 | ============================================== | ||
4 | |||
5 | Mostly the flow of audio is always from CPU to codec so your system | ||
6 | will look as below: | ||
7 | :: | ||
8 | |||
9 | --------- --------- | ||
10 | | | dai | | | ||
11 | CPU -------> codec | ||
12 | | | | | | ||
13 | --------- --------- | ||
14 | |||
15 | In case your system looks as below: | ||
16 | :: | ||
17 | |||
18 | --------- | ||
19 | | | | ||
20 | codec-2 | ||
21 | | | | ||
22 | --------- | ||
23 | | | ||
24 | dai-2 | ||
25 | | | ||
26 | ---------- --------- | ||
27 | | | dai-1 | | | ||
28 | CPU -------> codec-1 | ||
29 | | | | | | ||
30 | ---------- --------- | ||
31 | | | ||
32 | dai-3 | ||
33 | | | ||
34 | --------- | ||
35 | | | | ||
36 | codec-3 | ||
37 | | | | ||
38 | --------- | ||
39 | |||
40 | Suppose codec-2 is a bluetooth chip and codec-3 is connected to | ||
41 | a speaker and you have a below scenario: | ||
42 | codec-2 will receive the audio data and the user wants to play that | ||
43 | audio through codec-3 without involving the CPU.This | ||
44 | aforementioned case is the ideal case when codec to codec | ||
45 | connection should be used. | ||
46 | |||
47 | Your dai_link should appear as below in your machine | ||
48 | file: | ||
49 | :: | ||
50 | |||
51 | /* | ||
52 | * this pcm stream only supports 24 bit, 2 channel and | ||
53 | * 48k sampling rate. | ||
54 | */ | ||
55 | static const struct snd_soc_pcm_stream dsp_codec_params = { | ||
56 | .formats = SNDRV_PCM_FMTBIT_S24_LE, | ||
57 | .rate_min = 48000, | ||
58 | .rate_max = 48000, | ||
59 | .channels_min = 2, | ||
60 | .channels_max = 2, | ||
61 | }; | ||
62 | |||
63 | { | ||
64 | .name = "CPU-DSP", | ||
65 | .stream_name = "CPU-DSP", | ||
66 | .cpu_dai_name = "samsung-i2s.0", | ||
67 | .codec_name = "codec-2, | ||
68 | .codec_dai_name = "codec-2-dai_name", | ||
69 | .platform_name = "samsung-i2s.0", | ||
70 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ||
71 | | SND_SOC_DAIFMT_CBM_CFM, | ||
72 | .ignore_suspend = 1, | ||
73 | .params = &dsp_codec_params, | ||
74 | }, | ||
75 | { | ||
76 | .name = "DSP-CODEC", | ||
77 | .stream_name = "DSP-CODEC", | ||
78 | .cpu_dai_name = "wm0010-sdi2", | ||
79 | .codec_name = "codec-3, | ||
80 | .codec_dai_name = "codec-3-dai_name", | ||
81 | .dai_fmt = SND_SOC_DAIFMT_I2S | SND_SOC_DAIFMT_NB_NF | ||
82 | | SND_SOC_DAIFMT_CBM_CFM, | ||
83 | .ignore_suspend = 1, | ||
84 | .params = &dsp_codec_params, | ||
85 | }, | ||
86 | |||
87 | Above code snippet is motivated from sound/soc/samsung/speyside.c. | ||
88 | |||
89 | Note the "params" callback which lets the dapm know that this | ||
90 | dai_link is a codec to codec connection. | ||
91 | |||
92 | In dapm core a route is created between cpu_dai playback widget | ||
93 | and codec_dai capture widget for playback path and vice-versa is | ||
94 | true for capture path. In order for this aforementioned route to get | ||
95 | triggered, DAPM needs to find a valid endpoint which could be either | ||
96 | a sink or source widget corresponding to playback and capture path | ||
97 | respectively. | ||
98 | |||
99 | In order to trigger this dai_link widget, a thin codec driver for | ||
100 | the speaker amp can be created as demonstrated in wm8727.c file, it | ||
101 | sets appropriate constraints for the device even if it needs no control. | ||
102 | |||
103 | Make sure to name your corresponding cpu and codec playback and capture | ||
104 | dai names ending with "Playback" and "Capture" respectively as dapm core | ||
105 | will link and power those dais based on the name. | ||
106 | |||
107 | Note that in current device tree there is no way to mark a dai_link | ||
108 | as codec to codec. However, it may change in future. | ||
diff --git a/Documentation/sound/alsa/soc/codec.txt b/Documentation/sound/soc/codec.rst index db5f9c9ae149..f87612b94812 100644 --- a/Documentation/sound/alsa/soc/codec.txt +++ b/Documentation/sound/soc/codec.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ======================= | ||
1 | ASoC Codec Class Driver | 2 | ASoC Codec Class Driver |
2 | ======================= | 3 | ======================= |
3 | 4 | ||
@@ -9,16 +10,16 @@ machine drivers respectively. | |||
9 | 10 | ||
10 | Each codec class driver *must* provide the following features:- | 11 | Each codec class driver *must* provide the following features:- |
11 | 12 | ||
12 | 1) Codec DAI and PCM configuration | 13 | 1. Codec DAI and PCM configuration |
13 | 2) Codec control IO - using RegMap API | 14 | 2. Codec control IO - using RegMap API |
14 | 3) Mixers and audio controls | 15 | 3. Mixers and audio controls |
15 | 4) Codec audio operations | 16 | 4. Codec audio operations |
16 | 5) DAPM description. | 17 | 5. DAPM description. |
17 | 6) DAPM event handler. | 18 | 6. DAPM event handler. |
18 | 19 | ||
19 | Optionally, codec drivers can also provide:- | 20 | Optionally, codec drivers can also provide:- |
20 | 21 | ||
21 | 7) DAC Digital mute control. | 22 | 7. DAC Digital mute control. |
22 | 23 | ||
23 | Its probably best to use this guide in conjunction with the existing codec | 24 | Its probably best to use this guide in conjunction with the existing codec |
24 | driver code in sound/soc/codecs/ | 25 | driver code in sound/soc/codecs/ |
@@ -26,24 +27,25 @@ driver code in sound/soc/codecs/ | |||
26 | ASoC Codec driver breakdown | 27 | ASoC Codec driver breakdown |
27 | =========================== | 28 | =========================== |
28 | 29 | ||
29 | 1 - Codec DAI and PCM configuration | 30 | Codec DAI and PCM configuration |
30 | ----------------------------------- | 31 | ------------------------------- |
31 | Each codec driver must have a struct snd_soc_dai_driver to define its DAI and | 32 | Each codec driver must have a struct snd_soc_dai_driver to define its DAI and |
32 | PCM capabilities and operations. This struct is exported so that it can be | 33 | PCM capabilities and operations. This struct is exported so that it can be |
33 | registered with the core by your machine driver. | 34 | registered with the core by your machine driver. |
34 | 35 | ||
35 | e.g. | 36 | e.g. |
37 | :: | ||
36 | 38 | ||
37 | static struct snd_soc_dai_ops wm8731_dai_ops = { | 39 | static struct snd_soc_dai_ops wm8731_dai_ops = { |
38 | .prepare = wm8731_pcm_prepare, | 40 | .prepare = wm8731_pcm_prepare, |
39 | .hw_params = wm8731_hw_params, | 41 | .hw_params = wm8731_hw_params, |
40 | .shutdown = wm8731_shutdown, | 42 | .shutdown = wm8731_shutdown, |
41 | .digital_mute = wm8731_mute, | 43 | .digital_mute = wm8731_mute, |
42 | .set_sysclk = wm8731_set_dai_sysclk, | 44 | .set_sysclk = wm8731_set_dai_sysclk, |
43 | .set_fmt = wm8731_set_dai_fmt, | 45 | .set_fmt = wm8731_set_dai_fmt, |
44 | }; | 46 | }; |
45 | 47 | ||
46 | struct snd_soc_dai_driver wm8731_dai = { | 48 | struct snd_soc_dai_driver wm8731_dai = { |
47 | .name = "wm8731-hifi", | 49 | .name = "wm8731-hifi", |
48 | .playback = { | 50 | .playback = { |
49 | .stream_name = "Playback", | 51 | .stream_name = "Playback", |
@@ -59,25 +61,27 @@ struct snd_soc_dai_driver wm8731_dai = { | |||
59 | .formats = WM8731_FORMATS,}, | 61 | .formats = WM8731_FORMATS,}, |
60 | .ops = &wm8731_dai_ops, | 62 | .ops = &wm8731_dai_ops, |
61 | .symmetric_rates = 1, | 63 | .symmetric_rates = 1, |
62 | }; | 64 | }; |
63 | 65 | ||
64 | 66 | ||
65 | 2 - Codec control IO | 67 | Codec control IO |
66 | -------------------- | 68 | ---------------- |
67 | The codec can usually be controlled via an I2C or SPI style interface | 69 | The codec can usually be controlled via an I2C or SPI style interface |
68 | (AC97 combines control with data in the DAI). The codec driver should use the | 70 | (AC97 combines control with data in the DAI). The codec driver should use the |
69 | Regmap API for all codec IO. Please see include/linux/regmap.h and existing | 71 | Regmap API for all codec IO. Please see include/linux/regmap.h and existing |
70 | codec drivers for example regmap usage. | 72 | codec drivers for example regmap usage. |
71 | 73 | ||
72 | 74 | ||
73 | 3 - Mixers and audio controls | 75 | Mixers and audio controls |
74 | ----------------------------- | 76 | ------------------------- |
75 | All the codec mixers and audio controls can be defined using the convenience | 77 | All the codec mixers and audio controls can be defined using the convenience |
76 | macros defined in soc.h. | 78 | macros defined in soc.h. |
79 | :: | ||
77 | 80 | ||
78 | #define SOC_SINGLE(xname, reg, shift, mask, invert) | 81 | #define SOC_SINGLE(xname, reg, shift, mask, invert) |
79 | 82 | ||
80 | Defines a single control as follows:- | 83 | Defines a single control as follows:- |
84 | :: | ||
81 | 85 | ||
82 | xname = Control name e.g. "Playback Volume" | 86 | xname = Control name e.g. "Playback Volume" |
83 | reg = codec register | 87 | reg = codec register |
@@ -86,18 +90,22 @@ Defines a single control as follows:- | |||
86 | invert = the control is inverted | 90 | invert = the control is inverted |
87 | 91 | ||
88 | Other macros include:- | 92 | Other macros include:- |
93 | :: | ||
89 | 94 | ||
90 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) | 95 | #define SOC_DOUBLE(xname, reg, shift_left, shift_right, mask, invert) |
91 | 96 | ||
92 | A stereo control | 97 | A stereo control |
98 | :: | ||
93 | 99 | ||
94 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, shift, mask, invert) | 100 | #define SOC_DOUBLE_R(xname, reg_left, reg_right, shift, mask, invert) |
95 | 101 | ||
96 | A stereo control spanning 2 registers | 102 | A stereo control spanning 2 registers |
103 | :: | ||
97 | 104 | ||
98 | #define SOC_ENUM_SINGLE(xreg, xshift, xmask, xtexts) | 105 | #define SOC_ENUM_SINGLE(xreg, xshift, xmask, xtexts) |
99 | 106 | ||
100 | Defines an single enumerated control as follows:- | 107 | Defines an single enumerated control as follows:- |
108 | :: | ||
101 | 109 | ||
102 | xreg = register | 110 | xreg = register |
103 | xshift = control bit(s) offset in register | 111 | xshift = control bit(s) offset in register |
@@ -109,25 +117,26 @@ Defines an single enumerated control as follows:- | |||
109 | Defines a stereo enumerated control | 117 | Defines a stereo enumerated control |
110 | 118 | ||
111 | 119 | ||
112 | 4 - Codec Audio Operations | 120 | Codec Audio Operations |
113 | -------------------------- | 121 | ---------------------- |
114 | The codec driver also supports the following ALSA PCM operations:- | 122 | The codec driver also supports the following ALSA PCM operations:- |
123 | :: | ||
115 | 124 | ||
116 | /* SoC audio ops */ | 125 | /* SoC audio ops */ |
117 | struct snd_soc_ops { | 126 | struct snd_soc_ops { |
118 | int (*startup)(struct snd_pcm_substream *); | 127 | int (*startup)(struct snd_pcm_substream *); |
119 | void (*shutdown)(struct snd_pcm_substream *); | 128 | void (*shutdown)(struct snd_pcm_substream *); |
120 | int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *); | 129 | int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *); |
121 | int (*hw_free)(struct snd_pcm_substream *); | 130 | int (*hw_free)(struct snd_pcm_substream *); |
122 | int (*prepare)(struct snd_pcm_substream *); | 131 | int (*prepare)(struct snd_pcm_substream *); |
123 | }; | 132 | }; |
124 | 133 | ||
125 | Please refer to the ALSA driver PCM documentation for details. | 134 | Please refer to the ALSA driver PCM documentation for details. |
126 | http://www.alsa-project.org/~iwai/writing-an-alsa-driver/ | 135 | http://www.alsa-project.org/~iwai/writing-an-alsa-driver/ |
127 | 136 | ||
128 | 137 | ||
129 | 5 - DAPM description. | 138 | DAPM description |
130 | --------------------- | 139 | ---------------- |
131 | The Dynamic Audio Power Management description describes the codec power | 140 | The Dynamic Audio Power Management description describes the codec power |
132 | components and their relationships and registers to the ASoC core. | 141 | components and their relationships and registers to the ASoC core. |
133 | Please read dapm.txt for details of building the description. | 142 | Please read dapm.txt for details of building the description. |
@@ -135,13 +144,14 @@ Please read dapm.txt for details of building the description. | |||
135 | Please also see the examples in other codec drivers. | 144 | Please also see the examples in other codec drivers. |
136 | 145 | ||
137 | 146 | ||
138 | 6 - DAPM event handler | 147 | DAPM event handler |
139 | ---------------------- | 148 | ------------------ |
140 | This function is a callback that handles codec domain PM calls and system | 149 | This function is a callback that handles codec domain PM calls and system |
141 | domain PM calls (e.g. suspend and resume). It is used to put the codec | 150 | domain PM calls (e.g. suspend and resume). It is used to put the codec |
142 | to sleep when not in use. | 151 | to sleep when not in use. |
143 | 152 | ||
144 | Power states:- | 153 | Power states:- |
154 | :: | ||
145 | 155 | ||
146 | SNDRV_CTL_POWER_D0: /* full On */ | 156 | SNDRV_CTL_POWER_D0: /* full On */ |
147 | /* vref/mid, clk and osc on, active */ | 157 | /* vref/mid, clk and osc on, active */ |
@@ -155,8 +165,8 @@ Power states:- | |||
155 | SNDRV_CTL_POWER_D3cold: /* Everything Off, without power */ | 165 | SNDRV_CTL_POWER_D3cold: /* Everything Off, without power */ |
156 | 166 | ||
157 | 167 | ||
158 | 7 - Codec DAC digital mute control | 168 | Codec DAC digital mute control |
159 | ---------------------------------- | 169 | ------------------------------ |
160 | Most codecs have a digital mute before the DACs that can be used to | 170 | Most codecs have a digital mute before the DACs that can be used to |
161 | minimise any system noise. The mute stops any digital data from | 171 | minimise any system noise. The mute stops any digital data from |
162 | entering the DAC. | 172 | entering the DAC. |
@@ -165,9 +175,10 @@ A callback can be created that is called by the core for each codec DAI | |||
165 | when the mute is applied or freed. | 175 | when the mute is applied or freed. |
166 | 176 | ||
167 | i.e. | 177 | i.e. |
178 | :: | ||
168 | 179 | ||
169 | static int wm8974_mute(struct snd_soc_dai *dai, int mute) | 180 | static int wm8974_mute(struct snd_soc_dai *dai, int mute) |
170 | { | 181 | { |
171 | struct snd_soc_codec *codec = dai->codec; | 182 | struct snd_soc_codec *codec = dai->codec; |
172 | u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf; | 183 | u16 mute_reg = snd_soc_read(codec, WM8974_DAC) & 0xffbf; |
173 | 184 | ||
@@ -176,4 +187,4 @@ static int wm8974_mute(struct snd_soc_dai *dai, int mute) | |||
176 | else | 187 | else |
177 | snd_soc_write(codec, WM8974_DAC, mute_reg); | 188 | snd_soc_write(codec, WM8974_DAC, mute_reg); |
178 | return 0; | 189 | return 0; |
179 | } | 190 | } |
diff --git a/Documentation/sound/alsa/soc/DAI.txt b/Documentation/sound/soc/dai.rst index c9679264c559..55820e51708f 100644 --- a/Documentation/sound/alsa/soc/DAI.txt +++ b/Documentation/sound/soc/dai.rst | |||
@@ -1,3 +1,7 @@ | |||
1 | ================================== | ||
2 | ASoC Digital Audio Interface (DAI) | ||
3 | ================================== | ||
4 | |||
1 | ASoC currently supports the three main Digital Audio Interfaces (DAI) found on | 5 | ASoC currently supports the three main Digital Audio Interfaces (DAI) found on |
2 | SoC controllers and portable audio CODECs today, namely AC97, I2S and PCM. | 6 | SoC controllers and portable audio CODECs today, namely AC97, I2S and PCM. |
3 | 7 | ||
@@ -5,21 +9,21 @@ SoC controllers and portable audio CODECs today, namely AC97, I2S and PCM. | |||
5 | AC97 | 9 | AC97 |
6 | ==== | 10 | ==== |
7 | 11 | ||
8 | AC97 is a five wire interface commonly found on many PC sound cards. It is | 12 | AC97 is a five wire interface commonly found on many PC sound cards. It is |
9 | now also popular in many portable devices. This DAI has a reset line and time | 13 | now also popular in many portable devices. This DAI has a reset line and time |
10 | multiplexes its data on its SDATA_OUT (playback) and SDATA_IN (capture) lines. | 14 | multiplexes its data on its SDATA_OUT (playback) and SDATA_IN (capture) lines. |
11 | The bit clock (BCLK) is always driven by the CODEC (usually 12.288MHz) and the | 15 | The bit clock (BCLK) is always driven by the CODEC (usually 12.288MHz) and the |
12 | frame (FRAME) (usually 48kHz) is always driven by the controller. Each AC97 | 16 | frame (FRAME) (usually 48kHz) is always driven by the controller. Each AC97 |
13 | frame is 21uS long and is divided into 13 time slots. | 17 | frame is 21uS long and is divided into 13 time slots. |
14 | 18 | ||
15 | The AC97 specification can be found at :- | 19 | The AC97 specification can be found at : |
16 | http://www.intel.com/p/en_US/business/design | 20 | http://www.intel.com/p/en_US/business/design |
17 | 21 | ||
18 | 22 | ||
19 | I2S | 23 | I2S |
20 | === | 24 | === |
21 | 25 | ||
22 | I2S is a common 4 wire DAI used in HiFi, STB and portable devices. The Tx and | 26 | I2S is a common 4 wire DAI used in HiFi, STB and portable devices. The Tx and |
23 | Rx lines are used for audio transmission, whilst the bit clock (BCLK) and | 27 | Rx lines are used for audio transmission, whilst the bit clock (BCLK) and |
24 | left/right clock (LRC) synchronise the link. I2S is flexible in that either the | 28 | left/right clock (LRC) synchronise the link. I2S is flexible in that either the |
25 | controller or CODEC can drive (master) the BCLK and LRC clock lines. Bit clock | 29 | controller or CODEC can drive (master) the BCLK and LRC clock lines. Bit clock |
@@ -30,13 +34,15 @@ different sample rates. | |||
30 | 34 | ||
31 | I2S has several different operating modes:- | 35 | I2S has several different operating modes:- |
32 | 36 | ||
33 | o I2S - MSB is transmitted on the falling edge of the first BCLK after LRC | 37 | I2S |
34 | transition. | 38 | MSB is transmitted on the falling edge of the first BCLK after LRC |
39 | transition. | ||
35 | 40 | ||
36 | o Left Justified - MSB is transmitted on transition of LRC. | 41 | Left Justified |
42 | MSB is transmitted on transition of LRC. | ||
37 | 43 | ||
38 | o Right Justified - MSB is transmitted sample size BCLKs before LRC | 44 | Right Justified |
39 | transition. | 45 | MSB is transmitted sample size BCLKs before LRC transition. |
40 | 46 | ||
41 | PCM | 47 | PCM |
42 | === | 48 | === |
@@ -51,6 +57,8 @@ is sometimes referred to as network mode). | |||
51 | 57 | ||
52 | Common PCM operating modes:- | 58 | Common PCM operating modes:- |
53 | 59 | ||
54 | o Mode A - MSB is transmitted on falling edge of first BCLK after FRAME/SYNC. | 60 | Mode A |
61 | MSB is transmitted on falling edge of first BCLK after FRAME/SYNC. | ||
55 | 62 | ||
56 | o Mode B - MSB is transmitted on rising edge of FRAME/SYNC. | 63 | Mode B |
64 | MSB is transmitted on rising edge of FRAME/SYNC. | ||
diff --git a/Documentation/sound/alsa/soc/dapm.txt b/Documentation/sound/soc/dapm.rst index c45bd79f291e..a27f42befa4d 100644 --- a/Documentation/sound/alsa/soc/dapm.txt +++ b/Documentation/sound/soc/dapm.rst | |||
@@ -1,8 +1,9 @@ | |||
1 | =================================================== | ||
1 | Dynamic Audio Power Management for Portable Devices | 2 | Dynamic Audio Power Management for Portable Devices |
2 | =================================================== | 3 | =================================================== |
3 | 4 | ||
4 | 1. Description | 5 | Description |
5 | ============== | 6 | =========== |
6 | 7 | ||
7 | Dynamic Audio Power Management (DAPM) is designed to allow portable | 8 | Dynamic Audio Power Management (DAPM) is designed to allow portable |
8 | Linux devices to use the minimum amount of power within the audio | 9 | Linux devices to use the minimum amount of power within the audio |
@@ -21,20 +22,28 @@ level power systems. | |||
21 | 22 | ||
22 | There are 4 power domains within DAPM | 23 | There are 4 power domains within DAPM |
23 | 24 | ||
24 | 1. Codec bias domain - VREF, VMID (core codec and audio power) | 25 | Codec bias domain |
26 | VREF, VMID (core codec and audio power) | ||
27 | |||
25 | Usually controlled at codec probe/remove and suspend/resume, although | 28 | Usually controlled at codec probe/remove and suspend/resume, although |
26 | can be set at stream time if power is not needed for sidetone, etc. | 29 | can be set at stream time if power is not needed for sidetone, etc. |
27 | 30 | ||
28 | 2. Platform/Machine domain - physically connected inputs and outputs | 31 | Platform/Machine domain |
32 | physically connected inputs and outputs | ||
33 | |||
29 | Is platform/machine and user action specific, is configured by the | 34 | Is platform/machine and user action specific, is configured by the |
30 | machine driver and responds to asynchronous events e.g when HP | 35 | machine driver and responds to asynchronous events e.g when HP |
31 | are inserted | 36 | are inserted |
32 | 37 | ||
33 | 3. Path domain - audio subsystem signal paths | 38 | Path domain |
39 | audio subsystem signal paths | ||
40 | |||
34 | Automatically set when mixer and mux settings are changed by the user. | 41 | Automatically set when mixer and mux settings are changed by the user. |
35 | e.g. alsamixer, amixer. | 42 | e.g. alsamixer, amixer. |
36 | 43 | ||
37 | 4. Stream domain - DACs and ADCs. | 44 | Stream domain |
45 | DACs and ADCs. | ||
46 | |||
38 | Enabled and disabled when stream playback/capture is started and | 47 | Enabled and disabled when stream playback/capture is started and |
39 | stopped respectively. e.g. aplay, arecord. | 48 | stopped respectively. e.g. aplay, arecord. |
40 | 49 | ||
@@ -45,34 +54,57 @@ internal codec components). All audio components that effect power are called | |||
45 | widgets hereafter. | 54 | widgets hereafter. |
46 | 55 | ||
47 | 56 | ||
48 | 2. DAPM Widgets | 57 | DAPM Widgets |
49 | =============== | 58 | ============ |
50 | 59 | ||
51 | Audio DAPM widgets fall into a number of types:- | 60 | Audio DAPM widgets fall into a number of types:- |
52 | 61 | ||
53 | o Mixer - Mixes several analog signals into a single analog signal. | 62 | Mixer |
54 | o Mux - An analog switch that outputs only one of many inputs. | 63 | Mixes several analog signals into a single analog signal. |
55 | o PGA - A programmable gain amplifier or attenuation widget. | 64 | Mux |
56 | o ADC - Analog to Digital Converter | 65 | An analog switch that outputs only one of many inputs. |
57 | o DAC - Digital to Analog Converter | 66 | PGA |
58 | o Switch - An analog switch | 67 | A programmable gain amplifier or attenuation widget. |
59 | o Input - A codec input pin | 68 | ADC |
60 | o Output - A codec output pin | 69 | Analog to Digital Converter |
61 | o Headphone - Headphone (and optional Jack) | 70 | DAC |
62 | o Mic - Mic (and optional Jack) | 71 | Digital to Analog Converter |
63 | o Line - Line Input/Output (and optional Jack) | 72 | Switch |
64 | o Speaker - Speaker | 73 | An analog switch |
65 | o Supply - Power or clock supply widget used by other widgets. | 74 | Input |
66 | o Regulator - External regulator that supplies power to audio components. | 75 | A codec input pin |
67 | o Clock - External clock that supplies clock to audio components. | 76 | Output |
68 | o AIF IN - Audio Interface Input (with TDM slot mask). | 77 | A codec output pin |
69 | o AIF OUT - Audio Interface Output (with TDM slot mask). | 78 | Headphone |
70 | o Siggen - Signal Generator. | 79 | Headphone (and optional Jack) |
71 | o DAI IN - Digital Audio Interface Input. | 80 | Mic |
72 | o DAI OUT - Digital Audio Interface Output. | 81 | Mic (and optional Jack) |
73 | o DAI Link - DAI Link between two DAI structures */ | 82 | Line |
74 | o Pre - Special PRE widget (exec before all others) | 83 | Line Input/Output (and optional Jack) |
75 | o Post - Special POST widget (exec after all others) | 84 | Speaker |
85 | Speaker | ||
86 | Supply | ||
87 | Power or clock supply widget used by other widgets. | ||
88 | Regulator | ||
89 | External regulator that supplies power to audio components. | ||
90 | Clock | ||
91 | External clock that supplies clock to audio components. | ||
92 | AIF IN | ||
93 | Audio Interface Input (with TDM slot mask). | ||
94 | AIF OUT | ||
95 | Audio Interface Output (with TDM slot mask). | ||
96 | Siggen | ||
97 | Signal Generator. | ||
98 | DAI IN | ||
99 | Digital Audio Interface Input. | ||
100 | DAI OUT | ||
101 | Digital Audio Interface Output. | ||
102 | DAI Link | ||
103 | DAI Link between two DAI structures | ||
104 | Pre | ||
105 | Special PRE widget (exec before all others) | ||
106 | Post | ||
107 | Special POST widget (exec after all others) | ||
76 | 108 | ||
77 | (Widgets are defined in include/sound/soc-dapm.h) | 109 | (Widgets are defined in include/sound/soc-dapm.h) |
78 | 110 | ||
@@ -84,52 +116,57 @@ Most widgets have a name, register, shift and invert. Some widgets have extra | |||
84 | parameters for stream name and kcontrols. | 116 | parameters for stream name and kcontrols. |
85 | 117 | ||
86 | 118 | ||
87 | 2.1 Stream Domain Widgets | 119 | Stream Domain Widgets |
88 | ------------------------- | 120 | --------------------- |
89 | 121 | ||
90 | Stream Widgets relate to the stream power domain and only consist of ADCs | 122 | Stream Widgets relate to the stream power domain and only consist of ADCs |
91 | (analog to digital converters), DACs (digital to analog converters), | 123 | (analog to digital converters), DACs (digital to analog converters), |
92 | AIF IN and AIF OUT. | 124 | AIF IN and AIF OUT. |
93 | 125 | ||
94 | Stream widgets have the following format:- | 126 | Stream widgets have the following format:- |
127 | :: | ||
95 | 128 | ||
96 | SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), | 129 | SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), |
97 | SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert) | 130 | SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert) |
98 | 131 | ||
99 | NOTE: the stream name must match the corresponding stream name in your codec | 132 | NOTE: the stream name must match the corresponding stream name in your codec |
100 | snd_soc_codec_dai. | 133 | snd_soc_codec_dai. |
101 | 134 | ||
102 | e.g. stream widgets for HiFi playback and capture | 135 | e.g. stream widgets for HiFi playback and capture |
136 | :: | ||
103 | 137 | ||
104 | SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1), | 138 | SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1), |
105 | SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), | 139 | SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), |
106 | 140 | ||
107 | e.g. stream widgets for AIF | 141 | e.g. stream widgets for AIF |
142 | :: | ||
108 | 143 | ||
109 | SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), | 144 | SND_SOC_DAPM_AIF_IN("AIF1RX", "AIF1 Playback", 0, SND_SOC_NOPM, 0, 0), |
110 | SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0), | 145 | SND_SOC_DAPM_AIF_OUT("AIF1TX", "AIF1 Capture", 0, SND_SOC_NOPM, 0, 0), |
111 | 146 | ||
112 | 147 | ||
113 | 2.2 Path Domain Widgets | 148 | Path Domain Widgets |
114 | ----------------------- | 149 | ------------------- |
115 | 150 | ||
116 | Path domain widgets have a ability to control or affect the audio signal or | 151 | Path domain widgets have a ability to control or affect the audio signal or |
117 | audio paths within the audio subsystem. They have the following form:- | 152 | audio paths within the audio subsystem. They have the following form:- |
153 | :: | ||
118 | 154 | ||
119 | SND_SOC_DAPM_PGA(name, reg, shift, invert, controls, num_controls) | 155 | SND_SOC_DAPM_PGA(name, reg, shift, invert, controls, num_controls) |
120 | 156 | ||
121 | Any widget kcontrols can be set using the controls and num_controls members. | 157 | Any widget kcontrols can be set using the controls and num_controls members. |
122 | 158 | ||
123 | e.g. Mixer widget (the kcontrols are declared first) | 159 | e.g. Mixer widget (the kcontrols are declared first) |
160 | :: | ||
124 | 161 | ||
125 | /* Output Mixer */ | 162 | /* Output Mixer */ |
126 | static const snd_kcontrol_new_t wm8731_output_mixer_controls[] = { | 163 | static const snd_kcontrol_new_t wm8731_output_mixer_controls[] = { |
127 | SOC_DAPM_SINGLE("Line Bypass Switch", WM8731_APANA, 3, 1, 0), | 164 | SOC_DAPM_SINGLE("Line Bypass Switch", WM8731_APANA, 3, 1, 0), |
128 | SOC_DAPM_SINGLE("Mic Sidetone Switch", WM8731_APANA, 5, 1, 0), | 165 | SOC_DAPM_SINGLE("Mic Sidetone Switch", WM8731_APANA, 5, 1, 0), |
129 | SOC_DAPM_SINGLE("HiFi Playback Switch", WM8731_APANA, 4, 1, 0), | 166 | SOC_DAPM_SINGLE("HiFi Playback Switch", WM8731_APANA, 4, 1, 0), |
130 | }; | 167 | }; |
131 | 168 | ||
132 | SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, wm8731_output_mixer_controls, | 169 | SND_SOC_DAPM_MIXER("Output Mixer", WM8731_PWR, 4, 1, wm8731_output_mixer_controls, |
133 | ARRAY_SIZE(wm8731_output_mixer_controls)), | 170 | ARRAY_SIZE(wm8731_output_mixer_controls)), |
134 | 171 | ||
135 | If you don't want the mixer elements prefixed with the name of the mixer widget, | 172 | If you don't want the mixer elements prefixed with the name of the mixer widget, |
@@ -137,48 +174,49 @@ you can use SND_SOC_DAPM_MIXER_NAMED_CTL instead. the parameters are the same | |||
137 | as for SND_SOC_DAPM_MIXER. | 174 | as for SND_SOC_DAPM_MIXER. |
138 | 175 | ||
139 | 176 | ||
140 | 2.3 Machine domain Widgets | 177 | Machine domain Widgets |
141 | -------------------------- | 178 | ---------------------- |
142 | 179 | ||
143 | Machine widgets are different from codec widgets in that they don't have a | 180 | Machine widgets are different from codec widgets in that they don't have a |
144 | codec register bit associated with them. A machine widget is assigned to each | 181 | codec register bit associated with them. A machine widget is assigned to each |
145 | machine audio component (non codec or DSP) that can be independently | 182 | machine audio component (non codec or DSP) that can be independently |
146 | powered. e.g. | 183 | powered. e.g. |
147 | 184 | ||
148 | o Speaker Amp | 185 | * Speaker Amp |
149 | o Microphone Bias | 186 | * Microphone Bias |
150 | o Jack connectors | 187 | * Jack connectors |
151 | 188 | ||
152 | A machine widget can have an optional call back. | 189 | A machine widget can have an optional call back. |
153 | 190 | ||
154 | e.g. Jack connector widget for an external Mic that enables Mic Bias | 191 | e.g. Jack connector widget for an external Mic that enables Mic Bias |
155 | when the Mic is inserted:- | 192 | when the Mic is inserted:-:: |
156 | 193 | ||
157 | static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event) | 194 | static int spitz_mic_bias(struct snd_soc_dapm_widget* w, int event) |
158 | { | 195 | { |
159 | gpio_set_value(SPITZ_GPIO_MIC_BIAS, SND_SOC_DAPM_EVENT_ON(event)); | 196 | gpio_set_value(SPITZ_GPIO_MIC_BIAS, SND_SOC_DAPM_EVENT_ON(event)); |
160 | return 0; | 197 | return 0; |
161 | } | 198 | } |
162 | 199 | ||
163 | SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), | 200 | SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), |
164 | 201 | ||
165 | 202 | ||
166 | 2.4 Codec (BIAS) Domain | 203 | Codec (BIAS) Domain |
167 | ----------------------- | 204 | ------------------- |
168 | 205 | ||
169 | The codec bias power domain has no widgets and is handled by the codecs DAPM | 206 | The codec bias power domain has no widgets and is handled by the codecs DAPM |
170 | event handler. This handler is called when the codec powerstate is changed wrt | 207 | event handler. This handler is called when the codec powerstate is changed wrt |
171 | to any stream event or by kernel PM events. | 208 | to any stream event or by kernel PM events. |
172 | 209 | ||
173 | 210 | ||
174 | 2.5 Virtual Widgets | 211 | Virtual Widgets |
175 | ------------------- | 212 | --------------- |
176 | 213 | ||
177 | Sometimes widgets exist in the codec or machine audio map that don't have any | 214 | Sometimes widgets exist in the codec or machine audio map that don't have any |
178 | corresponding soft power control. In this case it is necessary to create | 215 | corresponding soft power control. In this case it is necessary to create |
179 | a virtual widget - a widget with no control bits e.g. | 216 | a virtual widget - a widget with no control bits e.g. |
217 | :: | ||
180 | 218 | ||
181 | SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_DAPM_NOPM, 0, 0, NULL, 0), | 219 | SND_SOC_DAPM_MIXER("AC97 Mixer", SND_SOC_DAPM_NOPM, 0, 0, NULL, 0), |
182 | 220 | ||
183 | This can be used to merge to signal paths together in software. | 221 | This can be used to merge to signal paths together in software. |
184 | 222 | ||
@@ -186,8 +224,8 @@ After all the widgets have been defined, they can then be added to the DAPM | |||
186 | subsystem individually with a call to snd_soc_dapm_new_control(). | 224 | subsystem individually with a call to snd_soc_dapm_new_control(). |
187 | 225 | ||
188 | 226 | ||
189 | 3. Codec/DSP Widget Interconnections | 227 | Codec/DSP Widget Interconnections |
190 | ==================================== | 228 | ================================= |
191 | 229 | ||
192 | Widgets are connected to each other within the codec, platform and machine by | 230 | Widgets are connected to each other within the codec, platform and machine by |
193 | audio paths (called interconnections). Each interconnection must be defined in | 231 | audio paths (called interconnections). Each interconnection must be defined in |
@@ -201,13 +239,14 @@ e.g., from the WM8731 output mixer (wm8731.c) | |||
201 | 239 | ||
202 | The WM8731 output mixer has 3 inputs (sources) | 240 | The WM8731 output mixer has 3 inputs (sources) |
203 | 241 | ||
204 | 1. Line Bypass Input | 242 | 1. Line Bypass Input |
205 | 2. DAC (HiFi playback) | 243 | 2. DAC (HiFi playback) |
206 | 3. Mic Sidetone Input | 244 | 3. Mic Sidetone Input |
207 | 245 | ||
208 | Each input in this example has a kcontrol associated with it (defined in example | 246 | Each input in this example has a kcontrol associated with it (defined in example |
209 | above) and is connected to the output mixer via its kcontrol name. We can now | 247 | above) and is connected to the output mixer via its kcontrol name. We can now |
210 | connect the destination widget (wrt audio signal) with its source widgets. | 248 | connect the destination widget (wrt audio signal) with its source widgets. |
249 | :: | ||
211 | 250 | ||
212 | /* output mixer */ | 251 | /* output mixer */ |
213 | {"Output Mixer", "Line Bypass Switch", "Line Input"}, | 252 | {"Output Mixer", "Line Bypass Switch", "Line Input"}, |
@@ -216,22 +255,17 @@ connect the destination widget (wrt audio signal) with its source widgets. | |||
216 | 255 | ||
217 | So we have :- | 256 | So we have :- |
218 | 257 | ||
219 | Destination Widget <=== Path Name <=== Source Widget | 258 | * Destination Widget <=== Path Name <=== Source Widget, or |
220 | 259 | * Sink, Path, Source, or | |
221 | Or:- | 260 | * ``Output Mixer`` is connected to the ``DAC`` via the ``HiFi Playback Switch``. |
222 | |||
223 | Sink, Path, Source | ||
224 | |||
225 | Or :- | ||
226 | |||
227 | "Output Mixer" is connected to the "DAC" via the "HiFi Playback Switch". | ||
228 | 261 | ||
229 | When there is no path name connecting widgets (e.g. a direct connection) we | 262 | When there is no path name connecting widgets (e.g. a direct connection) we |
230 | pass NULL for the path name. | 263 | pass NULL for the path name. |
231 | 264 | ||
232 | Interconnections are created with a call to:- | 265 | Interconnections are created with a call to:- |
266 | :: | ||
233 | 267 | ||
234 | snd_soc_dapm_connect_input(codec, sink, path, source); | 268 | snd_soc_dapm_connect_input(codec, sink, path, source); |
235 | 269 | ||
236 | Finally, snd_soc_dapm_new_widgets(codec) must be called after all widgets and | 270 | Finally, snd_soc_dapm_new_widgets(codec) must be called after all widgets and |
237 | interconnections have been registered with the core. This causes the core to | 271 | interconnections have been registered with the core. This causes the core to |
@@ -239,12 +273,13 @@ scan the codec and machine so that the internal DAPM state matches the | |||
239 | physical state of the machine. | 273 | physical state of the machine. |
240 | 274 | ||
241 | 275 | ||
242 | 3.1 Machine Widget Interconnections | 276 | Machine Widget Interconnections |
243 | ----------------------------------- | 277 | ------------------------------- |
244 | Machine widget interconnections are created in the same way as codec ones and | 278 | Machine widget interconnections are created in the same way as codec ones and |
245 | directly connect the codec pins to machine level widgets. | 279 | directly connect the codec pins to machine level widgets. |
246 | 280 | ||
247 | e.g. connects the speaker out codec pins to the internal speaker. | 281 | e.g. connects the speaker out codec pins to the internal speaker. |
282 | :: | ||
248 | 283 | ||
249 | /* ext speaker connected to codec pins LOUT2, ROUT2 */ | 284 | /* ext speaker connected to codec pins LOUT2, ROUT2 */ |
250 | {"Ext Spk", NULL , "ROUT2"}, | 285 | {"Ext Spk", NULL , "ROUT2"}, |
@@ -254,52 +289,54 @@ This allows the DAPM to power on and off pins that are connected (and in use) | |||
254 | and pins that are NC respectively. | 289 | and pins that are NC respectively. |
255 | 290 | ||
256 | 291 | ||
257 | 4 Endpoint Widgets | 292 | Endpoint Widgets |
258 | =================== | 293 | ================ |
259 | An endpoint is a start or end point (widget) of an audio signal within the | 294 | An endpoint is a start or end point (widget) of an audio signal within the |
260 | machine and includes the codec. e.g. | 295 | machine and includes the codec. e.g. |
261 | 296 | ||
262 | o Headphone Jack | 297 | * Headphone Jack |
263 | o Internal Speaker | 298 | * Internal Speaker |
264 | o Internal Mic | 299 | * Internal Mic |
265 | o Mic Jack | 300 | * Mic Jack |
266 | o Codec Pins | 301 | * Codec Pins |
267 | 302 | ||
268 | Endpoints are added to the DAPM graph so that their usage can be determined in | 303 | Endpoints are added to the DAPM graph so that their usage can be determined in |
269 | order to save power. e.g. NC codecs pins will be switched OFF, unconnected | 304 | order to save power. e.g. NC codecs pins will be switched OFF, unconnected |
270 | jacks can also be switched OFF. | 305 | jacks can also be switched OFF. |
271 | 306 | ||
272 | 307 | ||
273 | 5 DAPM Widget Events | 308 | DAPM Widget Events |
274 | ==================== | 309 | ================== |
275 | 310 | ||
276 | Some widgets can register their interest with the DAPM core in PM events. | 311 | Some widgets can register their interest with the DAPM core in PM events. |
277 | e.g. A Speaker with an amplifier registers a widget so the amplifier can be | 312 | e.g. A Speaker with an amplifier registers a widget so the amplifier can be |
278 | powered only when the spk is in use. | 313 | powered only when the spk is in use. |
314 | :: | ||
279 | 315 | ||
280 | /* turn speaker amplifier on/off depending on use */ | 316 | /* turn speaker amplifier on/off depending on use */ |
281 | static int corgi_amp_event(struct snd_soc_dapm_widget *w, int event) | 317 | static int corgi_amp_event(struct snd_soc_dapm_widget *w, int event) |
282 | { | 318 | { |
283 | gpio_set_value(CORGI_GPIO_APM_ON, SND_SOC_DAPM_EVENT_ON(event)); | 319 | gpio_set_value(CORGI_GPIO_APM_ON, SND_SOC_DAPM_EVENT_ON(event)); |
284 | return 0; | 320 | return 0; |
285 | } | 321 | } |
286 | 322 | ||
287 | /* corgi machine dapm widgets */ | 323 | /* corgi machine dapm widgets */ |
288 | static const struct snd_soc_dapm_widget wm8731_dapm_widgets = | 324 | static const struct snd_soc_dapm_widget wm8731_dapm_widgets = |
289 | SND_SOC_DAPM_SPK("Ext Spk", corgi_amp_event); | 325 | SND_SOC_DAPM_SPK("Ext Spk", corgi_amp_event); |
290 | 326 | ||
291 | Please see soc-dapm.h for all other widgets that support events. | 327 | Please see soc-dapm.h for all other widgets that support events. |
292 | 328 | ||
293 | 329 | ||
294 | 5.1 Event types | 330 | Event types |
295 | --------------- | 331 | ----------- |
296 | 332 | ||
297 | The following event types are supported by event widgets. | 333 | The following event types are supported by event widgets. |
298 | 334 | :: | |
299 | /* dapm event types */ | 335 | |
300 | #define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ | 336 | /* dapm event types */ |
301 | #define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ | 337 | #define SND_SOC_DAPM_PRE_PMU 0x1 /* before widget power up */ |
302 | #define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ | 338 | #define SND_SOC_DAPM_POST_PMU 0x2 /* after widget power up */ |
303 | #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ | 339 | #define SND_SOC_DAPM_PRE_PMD 0x4 /* before widget power down */ |
304 | #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ | 340 | #define SND_SOC_DAPM_POST_PMD 0x8 /* after widget power down */ |
305 | #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ | 341 | #define SND_SOC_DAPM_PRE_REG 0x10 /* before audio path setup */ |
342 | #define SND_SOC_DAPM_POST_REG 0x20 /* after audio path setup */ | ||
diff --git a/Documentation/sound/alsa/soc/DPCM.txt b/Documentation/sound/soc/dpcm.rst index 0110180b7ac6..395e5a516282 100644 --- a/Documentation/sound/alsa/soc/DPCM.txt +++ b/Documentation/sound/soc/dpcm.rst | |||
@@ -1,8 +1,9 @@ | |||
1 | =========== | ||
1 | Dynamic PCM | 2 | Dynamic PCM |
2 | =========== | 3 | =========== |
3 | 4 | ||
4 | 1. Description | 5 | Description |
5 | ============== | 6 | =========== |
6 | 7 | ||
7 | Dynamic PCM allows an ALSA PCM device to digitally route its PCM audio to | 8 | Dynamic PCM allows an ALSA PCM device to digitally route its PCM audio to |
8 | various digital endpoints during the PCM stream runtime. e.g. PCM0 can route | 9 | various digital endpoints during the PCM stream runtime. e.g. PCM0 can route |
@@ -23,22 +24,23 @@ Phone Audio System with SoC based DSP | |||
23 | 24 | ||
24 | Consider the following phone audio subsystem. This will be used in this | 25 | Consider the following phone audio subsystem. This will be used in this |
25 | document for all examples :- | 26 | document for all examples :- |
26 | 27 | :: | |
27 | | Front End PCMs | SoC DSP | Back End DAIs | Audio devices | | 28 | |
28 | 29 | | Front End PCMs | SoC DSP | Back End DAIs | Audio devices | | |
29 | ************* | 30 | |
30 | PCM0 <------------> * * <----DAI0-----> Codec Headset | 31 | ************* |
31 | * * | 32 | PCM0 <------------> * * <----DAI0-----> Codec Headset |
32 | PCM1 <------------> * * <----DAI1-----> Codec Speakers | 33 | * * |
33 | * DSP * | 34 | PCM1 <------------> * * <----DAI1-----> Codec Speakers |
34 | PCM2 <------------> * * <----DAI2-----> MODEM | 35 | * DSP * |
35 | * * | 36 | PCM2 <------------> * * <----DAI2-----> MODEM |
36 | PCM3 <------------> * * <----DAI3-----> BT | 37 | * * |
37 | * * | 38 | PCM3 <------------> * * <----DAI3-----> BT |
38 | * * <----DAI4-----> DMIC | 39 | * * |
39 | * * | 40 | * * <----DAI4-----> DMIC |
40 | * * <----DAI5-----> FM | 41 | * * |
41 | ************* | 42 | * * <----DAI5-----> FM |
43 | ************* | ||
42 | 44 | ||
43 | This diagram shows a simple smart phone audio subsystem. It supports Bluetooth, | 45 | This diagram shows a simple smart phone audio subsystem. It supports Bluetooth, |
44 | FM digital radio, Speakers, Headset Jack, digital microphones and cellular | 46 | FM digital radio, Speakers, Headset Jack, digital microphones and cellular |
@@ -55,50 +57,52 @@ Audio is being played to the Headset. After a while the user removes the headset | |||
55 | and audio continues playing on the speakers. | 57 | and audio continues playing on the speakers. |
56 | 58 | ||
57 | Playback on PCM0 to Headset would look like :- | 59 | Playback on PCM0 to Headset would look like :- |
58 | 60 | :: | |
59 | ************* | 61 | |
60 | PCM0 <============> * * <====DAI0=====> Codec Headset | 62 | ************* |
61 | * * | 63 | PCM0 <============> * * <====DAI0=====> Codec Headset |
62 | PCM1 <------------> * * <----DAI1-----> Codec Speakers | 64 | * * |
63 | * DSP * | 65 | PCM1 <------------> * * <----DAI1-----> Codec Speakers |
64 | PCM2 <------------> * * <----DAI2-----> MODEM | 66 | * DSP * |
65 | * * | 67 | PCM2 <------------> * * <----DAI2-----> MODEM |
66 | PCM3 <------------> * * <----DAI3-----> BT | 68 | * * |
67 | * * | 69 | PCM3 <------------> * * <----DAI3-----> BT |
68 | * * <----DAI4-----> DMIC | 70 | * * |
69 | * * | 71 | * * <----DAI4-----> DMIC |
70 | * * <----DAI5-----> FM | 72 | * * |
71 | ************* | 73 | * * <----DAI5-----> FM |
74 | ************* | ||
72 | 75 | ||
73 | The headset is removed from the jack by user so the speakers must now be used :- | 76 | The headset is removed from the jack by user so the speakers must now be used :- |
74 | 77 | :: | |
75 | ************* | 78 | |
76 | PCM0 <============> * * <----DAI0-----> Codec Headset | 79 | ************* |
77 | * * | 80 | PCM0 <============> * * <----DAI0-----> Codec Headset |
78 | PCM1 <------------> * * <====DAI1=====> Codec Speakers | 81 | * * |
79 | * DSP * | 82 | PCM1 <------------> * * <====DAI1=====> Codec Speakers |
80 | PCM2 <------------> * * <----DAI2-----> MODEM | 83 | * DSP * |
81 | * * | 84 | PCM2 <------------> * * <----DAI2-----> MODEM |
82 | PCM3 <------------> * * <----DAI3-----> BT | 85 | * * |
83 | * * | 86 | PCM3 <------------> * * <----DAI3-----> BT |
84 | * * <----DAI4-----> DMIC | 87 | * * |
85 | * * | 88 | * * <----DAI4-----> DMIC |
86 | * * <----DAI5-----> FM | 89 | * * |
87 | ************* | 90 | * * <----DAI5-----> FM |
91 | ************* | ||
88 | 92 | ||
89 | The audio driver processes this as follows :- | 93 | The audio driver processes this as follows :- |
90 | 94 | ||
91 | 1) Machine driver receives Jack removal event. | 95 | 1. Machine driver receives Jack removal event. |
92 | 96 | ||
93 | 2) Machine driver OR audio HAL disables the Headset path. | 97 | 2. Machine driver OR audio HAL disables the Headset path. |
94 | 98 | ||
95 | 3) DPCM runs the PCM trigger(stop), hw_free(), shutdown() operations on DAI0 | 99 | 3. DPCM runs the PCM trigger(stop), hw_free(), shutdown() operations on DAI0 |
96 | for headset since the path is now disabled. | 100 | for headset since the path is now disabled. |
97 | 101 | ||
98 | 4) Machine driver or audio HAL enables the speaker path. | 102 | 4. Machine driver or audio HAL enables the speaker path. |
99 | 103 | ||
100 | 5) DPCM runs the PCM ops for startup(), hw_params(), prepapre() and | 104 | 5. DPCM runs the PCM ops for startup(), hw_params(), prepapre() and |
101 | trigger(start) for DAI1 Speakers since the path is enabled. | 105 | trigger(start) for DAI1 Speakers since the path is enabled. |
102 | 106 | ||
103 | In this example, the machine driver or userspace audio HAL can alter the routing | 107 | In this example, the machine driver or userspace audio HAL can alter the routing |
104 | and then DPCM will take care of managing the DAI PCM operations to either bring | 108 | and then DPCM will take care of managing the DAI PCM operations to either bring |
@@ -112,36 +116,38 @@ DPCM machine driver | |||
112 | The DPCM enabled ASoC machine driver is similar to normal machine drivers | 116 | The DPCM enabled ASoC machine driver is similar to normal machine drivers |
113 | except that we also have to :- | 117 | except that we also have to :- |
114 | 118 | ||
115 | 1) Define the FE and BE DAI links. | 119 | 1. Define the FE and BE DAI links. |
116 | 120 | ||
117 | 2) Define any FE/BE PCM operations. | 121 | 2. Define any FE/BE PCM operations. |
118 | 122 | ||
119 | 3) Define widget graph connections. | 123 | 3. Define widget graph connections. |
120 | 124 | ||
121 | 125 | ||
122 | 1 FE and BE DAI links | 126 | FE and BE DAI links |
123 | --------------------- | 127 | ------------------- |
128 | :: | ||
124 | 129 | ||
125 | | Front End PCMs | SoC DSP | Back End DAIs | Audio devices | | 130 | | Front End PCMs | SoC DSP | Back End DAIs | Audio devices | |
126 | 131 | ||
127 | ************* | 132 | ************* |
128 | PCM0 <------------> * * <----DAI0-----> Codec Headset | 133 | PCM0 <------------> * * <----DAI0-----> Codec Headset |
129 | * * | 134 | * * |
130 | PCM1 <------------> * * <----DAI1-----> Codec Speakers | 135 | PCM1 <------------> * * <----DAI1-----> Codec Speakers |
131 | * DSP * | 136 | * DSP * |
132 | PCM2 <------------> * * <----DAI2-----> MODEM | 137 | PCM2 <------------> * * <----DAI2-----> MODEM |
133 | * * | 138 | * * |
134 | PCM3 <------------> * * <----DAI3-----> BT | 139 | PCM3 <------------> * * <----DAI3-----> BT |
135 | * * | 140 | * * |
136 | * * <----DAI4-----> DMIC | 141 | * * <----DAI4-----> DMIC |
137 | * * | 142 | * * |
138 | * * <----DAI5-----> FM | 143 | * * <----DAI5-----> FM |
139 | ************* | 144 | ************* |
140 | 145 | ||
141 | For the example above we have to define 4 FE DAI links and 6 BE DAI links. The | 146 | For the example above we have to define 4 FE DAI links and 6 BE DAI links. The |
142 | FE DAI links are defined as follows :- | 147 | FE DAI links are defined as follows :- |
148 | :: | ||
143 | 149 | ||
144 | static struct snd_soc_dai_link machine_dais[] = { | 150 | static struct snd_soc_dai_link machine_dais[] = { |
145 | { | 151 | { |
146 | .name = "PCM0 System", | 152 | .name = "PCM0 System", |
147 | .stream_name = "System Playback", | 153 | .stream_name = "System Playback", |
@@ -154,11 +160,11 @@ static struct snd_soc_dai_link machine_dais[] = { | |||
154 | .dpcm_playback = 1, | 160 | .dpcm_playback = 1, |
155 | }, | 161 | }, |
156 | .....< other FE and BE DAI links here > | 162 | .....< other FE and BE DAI links here > |
157 | }; | 163 | }; |
158 | 164 | ||
159 | This FE DAI link is pretty similar to a regular DAI link except that we also | 165 | This FE DAI link is pretty similar to a regular DAI link except that we also |
160 | set the DAI link to a DPCM FE with the "dynamic = 1". The supported FE stream | 166 | set the DAI link to a DPCM FE with the ``dynamic = 1``. The supported FE stream |
161 | directions should also be set with the "dpcm_playback" and "dpcm_capture" | 167 | directions should also be set with the ``dpcm_playback`` and ``dpcm_capture`` |
162 | flags. There is also an option to specify the ordering of the trigger call for | 168 | flags. There is also an option to specify the ordering of the trigger call for |
163 | each FE. This allows the ASoC core to trigger the DSP before or after the other | 169 | each FE. This allows the ASoC core to trigger the DSP before or after the other |
164 | components (as some DSPs have strong requirements for the ordering DAI/DSP | 170 | components (as some DSPs have strong requirements for the ordering DAI/DSP |
@@ -168,8 +174,9 @@ The FE DAI above sets the codec and code DAIs to dummy devices since the BE is | |||
168 | dynamic and will change depending on runtime config. | 174 | dynamic and will change depending on runtime config. |
169 | 175 | ||
170 | The BE DAIs are configured as follows :- | 176 | The BE DAIs are configured as follows :- |
177 | :: | ||
171 | 178 | ||
172 | static struct snd_soc_dai_link machine_dais[] = { | 179 | static struct snd_soc_dai_link machine_dais[] = { |
173 | .....< FE DAI links here > | 180 | .....< FE DAI links here > |
174 | { | 181 | { |
175 | .name = "Codec Headset", | 182 | .name = "Codec Headset", |
@@ -186,29 +193,30 @@ static struct snd_soc_dai_link machine_dais[] = { | |||
186 | .dpcm_capture = 1, | 193 | .dpcm_capture = 1, |
187 | }, | 194 | }, |
188 | .....< other BE DAI links here > | 195 | .....< other BE DAI links here > |
189 | }; | 196 | }; |
190 | 197 | ||
191 | This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets | 198 | This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets |
192 | the "no_pcm" flag to mark it has a BE and sets flags for supported stream | 199 | the ``no_pcm`` flag to mark it has a BE and sets flags for supported stream |
193 | directions using "dpcm_playback" and "dpcm_capture" above. | 200 | directions using ``dpcm_playback`` and ``dpcm_capture`` above. |
194 | 201 | ||
195 | The BE has also flags set for ignoring suspend and PM down time. This allows | 202 | The BE has also flags set for ignoring suspend and PM down time. This allows |
196 | the BE to work in a hostless mode where the host CPU is not transferring data | 203 | the BE to work in a hostless mode where the host CPU is not transferring data |
197 | like a BT phone call :- | 204 | like a BT phone call :- |
198 | 205 | :: | |
199 | ************* | 206 | |
200 | PCM0 <------------> * * <----DAI0-----> Codec Headset | 207 | ************* |
201 | * * | 208 | PCM0 <------------> * * <----DAI0-----> Codec Headset |
202 | PCM1 <------------> * * <----DAI1-----> Codec Speakers | 209 | * * |
203 | * DSP * | 210 | PCM1 <------------> * * <----DAI1-----> Codec Speakers |
204 | PCM2 <------------> * * <====DAI2=====> MODEM | 211 | * DSP * |
205 | * * | 212 | PCM2 <------------> * * <====DAI2=====> MODEM |
206 | PCM3 <------------> * * <====DAI3=====> BT | 213 | * * |
207 | * * | 214 | PCM3 <------------> * * <====DAI3=====> BT |
208 | * * <----DAI4-----> DMIC | 215 | * * |
209 | * * | 216 | * * <----DAI4-----> DMIC |
210 | * * <----DAI5-----> FM | 217 | * * |
211 | ************* | 218 | * * <----DAI5-----> FM |
219 | ************* | ||
212 | 220 | ||
213 | This allows the host CPU to sleep whilst the DSP, MODEM DAI and the BT DAI are | 221 | This allows the host CPU to sleep whilst the DSP, MODEM DAI and the BT DAI are |
214 | still in operation. | 222 | still in operation. |
@@ -220,10 +228,10 @@ Likewise a BE DAI can also set a dummy cpu DAI if the CPU DAI is managed by the | |||
220 | DSP firmware. | 228 | DSP firmware. |
221 | 229 | ||
222 | 230 | ||
223 | 2 FE/BE PCM operations | 231 | FE/BE PCM operations |
224 | ---------------------- | 232 | -------------------- |
225 | 233 | ||
226 | The BE above also exports some PCM operations and a "fixup" callback. The fixup | 234 | The BE above also exports some PCM operations and a ``fixup`` callback. The fixup |
227 | callback is used by the machine driver to (re)configure the DAI based upon the | 235 | callback is used by the machine driver to (re)configure the DAI based upon the |
228 | FE hw params. i.e. the DSP may perform SRC or ASRC from the FE to BE. | 236 | FE hw params. i.e. the DSP may perform SRC or ASRC from the FE to BE. |
229 | 237 | ||
@@ -231,10 +239,11 @@ e.g. DSP converts all FE hw params to run at fixed rate of 48k, 16bit, stereo fo | |||
231 | DAI0. This means all FE hw_params have to be fixed in the machine driver for | 239 | DAI0. This means all FE hw_params have to be fixed in the machine driver for |
232 | DAI0 so that the DAI is running at desired configuration regardless of the FE | 240 | DAI0 so that the DAI is running at desired configuration regardless of the FE |
233 | configuration. | 241 | configuration. |
242 | :: | ||
234 | 243 | ||
235 | static int dai0_fixup(struct snd_soc_pcm_runtime *rtd, | 244 | static int dai0_fixup(struct snd_soc_pcm_runtime *rtd, |
236 | struct snd_pcm_hw_params *params) | 245 | struct snd_pcm_hw_params *params) |
237 | { | 246 | { |
238 | struct snd_interval *rate = hw_param_interval(params, | 247 | struct snd_interval *rate = hw_param_interval(params, |
239 | SNDRV_PCM_HW_PARAM_RATE); | 248 | SNDRV_PCM_HW_PARAM_RATE); |
240 | struct snd_interval *channels = hw_param_interval(params, | 249 | struct snd_interval *channels = hw_param_interval(params, |
@@ -249,21 +258,22 @@ static int dai0_fixup(struct snd_soc_pcm_runtime *rtd, | |||
249 | SNDRV_PCM_HW_PARAM_FIRST_MASK], | 258 | SNDRV_PCM_HW_PARAM_FIRST_MASK], |
250 | SNDRV_PCM_FORMAT_S16_LE); | 259 | SNDRV_PCM_FORMAT_S16_LE); |
251 | return 0; | 260 | return 0; |
252 | } | 261 | } |
253 | 262 | ||
254 | The other PCM operation are the same as for regular DAI links. Use as necessary. | 263 | The other PCM operation are the same as for regular DAI links. Use as necessary. |
255 | 264 | ||
256 | 265 | ||
257 | 3 Widget graph connections | 266 | Widget graph connections |
258 | -------------------------- | 267 | ------------------------ |
259 | 268 | ||
260 | The BE DAI links will normally be connected to the graph at initialisation time | 269 | The BE DAI links will normally be connected to the graph at initialisation time |
261 | by the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this | 270 | by the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this |
262 | has to be set explicitly in the driver :- | 271 | has to be set explicitly in the driver :- |
272 | :: | ||
263 | 273 | ||
264 | /* BE for codec Headset - DAI0 is dummy and managed by DSP FW */ | 274 | /* BE for codec Headset - DAI0 is dummy and managed by DSP FW */ |
265 | {"DAI0 CODEC IN", NULL, "AIF1 Capture"}, | 275 | {"DAI0 CODEC IN", NULL, "AIF1 Capture"}, |
266 | {"AIF1 Playback", NULL, "DAI0 CODEC OUT"}, | 276 | {"AIF1 Playback", NULL, "DAI0 CODEC OUT"}, |
267 | 277 | ||
268 | 278 | ||
269 | Writing a DPCM DSP driver | 279 | Writing a DPCM DSP driver |
@@ -273,24 +283,25 @@ The DPCM DSP driver looks much like a standard platform class ASoC driver | |||
273 | combined with elements from a codec class driver. A DSP platform driver must | 283 | combined with elements from a codec class driver. A DSP platform driver must |
274 | implement :- | 284 | implement :- |
275 | 285 | ||
276 | 1) Front End PCM DAIs - i.e. struct snd_soc_dai_driver. | 286 | 1. Front End PCM DAIs - i.e. struct snd_soc_dai_driver. |
277 | 287 | ||
278 | 2) DAPM graph showing DSP audio routing from FE DAIs to BEs. | 288 | 2. DAPM graph showing DSP audio routing from FE DAIs to BEs. |
279 | 289 | ||
280 | 3) DAPM widgets from DSP graph. | 290 | 3. DAPM widgets from DSP graph. |
281 | 291 | ||
282 | 4) Mixers for gains, routing, etc. | 292 | 4. Mixers for gains, routing, etc. |
283 | 293 | ||
284 | 5) DMA configuration. | 294 | 5. DMA configuration. |
285 | 295 | ||
286 | 6) BE AIF widgets. | 296 | 6. BE AIF widgets. |
287 | 297 | ||
288 | Items 6 is important for routing the audio outside of the DSP. AIF need to be | 298 | Items 6 is important for routing the audio outside of the DSP. AIF need to be |
289 | defined for each BE and each stream direction. e.g for BE DAI0 above we would | 299 | defined for each BE and each stream direction. e.g for BE DAI0 above we would |
290 | have :- | 300 | have :- |
301 | :: | ||
291 | 302 | ||
292 | SND_SOC_DAPM_AIF_IN("DAI0 RX", NULL, 0, SND_SOC_NOPM, 0, 0), | 303 | SND_SOC_DAPM_AIF_IN("DAI0 RX", NULL, 0, SND_SOC_NOPM, 0, 0), |
293 | SND_SOC_DAPM_AIF_OUT("DAI0 TX", NULL, 0, SND_SOC_NOPM, 0, 0), | 304 | SND_SOC_DAPM_AIF_OUT("DAI0 TX", NULL, 0, SND_SOC_NOPM, 0, 0), |
294 | 305 | ||
295 | The BE AIF are used to connect the DSP graph to the graphs for the other | 306 | The BE AIF are used to connect the DSP graph to the graphs for the other |
296 | component drivers (e.g. codec graph). | 307 | component drivers (e.g. codec graph). |
@@ -301,33 +312,33 @@ Hostless PCM streams | |||
301 | 312 | ||
302 | A hostless PCM stream is a stream that is not routed through the host CPU. An | 313 | A hostless PCM stream is a stream that is not routed through the host CPU. An |
303 | example of this would be a phone call from handset to modem. | 314 | example of this would be a phone call from handset to modem. |
304 | 315 | :: | |
305 | 316 | ||
306 | ************* | 317 | ************* |
307 | PCM0 <------------> * * <----DAI0-----> Codec Headset | 318 | PCM0 <------------> * * <----DAI0-----> Codec Headset |
308 | * * | 319 | * * |
309 | PCM1 <------------> * * <====DAI1=====> Codec Speakers/Mic | 320 | PCM1 <------------> * * <====DAI1=====> Codec Speakers/Mic |
310 | * DSP * | 321 | * DSP * |
311 | PCM2 <------------> * * <====DAI2=====> MODEM | 322 | PCM2 <------------> * * <====DAI2=====> MODEM |
312 | * * | 323 | * * |
313 | PCM3 <------------> * * <----DAI3-----> BT | 324 | PCM3 <------------> * * <----DAI3-----> BT |
314 | * * | 325 | * * |
315 | * * <----DAI4-----> DMIC | 326 | * * <----DAI4-----> DMIC |
316 | * * | 327 | * * |
317 | * * <----DAI5-----> FM | 328 | * * <----DAI5-----> FM |
318 | ************* | 329 | ************* |
319 | 330 | ||
320 | In this case the PCM data is routed via the DSP. The host CPU in this use case | 331 | In this case the PCM data is routed via the DSP. The host CPU in this use case |
321 | is only used for control and can sleep during the runtime of the stream. | 332 | is only used for control and can sleep during the runtime of the stream. |
322 | 333 | ||
323 | The host can control the hostless link either by :- | 334 | The host can control the hostless link either by :- |
324 | 335 | ||
325 | 1) Configuring the link as a CODEC <-> CODEC style link. In this case the link | 336 | 1. Configuring the link as a CODEC <-> CODEC style link. In this case the link |
326 | is enabled or disabled by the state of the DAPM graph. This usually means | 337 | is enabled or disabled by the state of the DAPM graph. This usually means |
327 | there is a mixer control that can be used to connect or disconnect the path | 338 | there is a mixer control that can be used to connect or disconnect the path |
328 | between both DAIs. | 339 | between both DAIs. |
329 | 340 | ||
330 | 2) Hostless FE. This FE has a virtual connection to the BE DAI links on the DAPM | 341 | 2. Hostless FE. This FE has a virtual connection to the BE DAI links on the DAPM |
331 | graph. Control is then carried out by the FE as regular PCM operations. | 342 | graph. Control is then carried out by the FE as regular PCM operations. |
332 | This method gives more control over the DAI links, but requires much more | 343 | This method gives more control over the DAI links, but requires much more |
333 | userspace code to control the link. Its recommended to use CODEC<->CODEC | 344 | userspace code to control the link. Its recommended to use CODEC<->CODEC |
@@ -339,16 +350,17 @@ CODEC <-> CODEC link | |||
339 | 350 | ||
340 | This DAI link is enabled when DAPM detects a valid path within the DAPM graph. | 351 | This DAI link is enabled when DAPM detects a valid path within the DAPM graph. |
341 | The machine driver sets some additional parameters to the DAI link i.e. | 352 | The machine driver sets some additional parameters to the DAI link i.e. |
353 | :: | ||
342 | 354 | ||
343 | static const struct snd_soc_pcm_stream dai_params = { | 355 | static const struct snd_soc_pcm_stream dai_params = { |
344 | .formats = SNDRV_PCM_FMTBIT_S32_LE, | 356 | .formats = SNDRV_PCM_FMTBIT_S32_LE, |
345 | .rate_min = 8000, | 357 | .rate_min = 8000, |
346 | .rate_max = 8000, | 358 | .rate_max = 8000, |
347 | .channels_min = 2, | 359 | .channels_min = 2, |
348 | .channels_max = 2, | 360 | .channels_max = 2, |
349 | }; | 361 | }; |
350 | 362 | ||
351 | static struct snd_soc_dai_link dais[] = { | 363 | static struct snd_soc_dai_link dais[] = { |
352 | < ... more DAI links above ... > | 364 | < ... more DAI links above ... > |
353 | { | 365 | { |
354 | .name = "MODEM", | 366 | .name = "MODEM", |
diff --git a/Documentation/sound/soc/index.rst b/Documentation/sound/soc/index.rst new file mode 100644 index 000000000000..e57df2dab2fd --- /dev/null +++ b/Documentation/sound/soc/index.rst | |||
@@ -0,0 +1,20 @@ | |||
1 | ============== | ||
2 | ALSA SoC Layer | ||
3 | ============== | ||
4 | |||
5 | The documentation is spilt into the following sections:- | ||
6 | |||
7 | .. toctree:: | ||
8 | :maxdepth: 2 | ||
9 | |||
10 | overview | ||
11 | codec | ||
12 | dai | ||
13 | dapm | ||
14 | platform | ||
15 | machine | ||
16 | pops-clicks | ||
17 | clocking | ||
18 | jack | ||
19 | dpcm | ||
20 | codec-to-codec | ||
diff --git a/Documentation/sound/alsa/soc/jack.txt b/Documentation/sound/soc/jack.rst index fcf82a417293..644b99ecba35 100644 --- a/Documentation/sound/alsa/soc/jack.txt +++ b/Documentation/sound/soc/jack.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | =================== | ||
1 | ASoC jack detection | 2 | ASoC jack detection |
2 | =================== | 3 | =================== |
3 | 4 | ||
diff --git a/Documentation/sound/alsa/soc/machine.txt b/Documentation/sound/soc/machine.rst index 6bf2d2063b52..515c9444deaf 100644 --- a/Documentation/sound/alsa/soc/machine.txt +++ b/Documentation/sound/soc/machine.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | =================== | ||
1 | ASoC Machine Driver | 2 | ASoC Machine Driver |
2 | =================== | 3 | =================== |
3 | 4 | ||
@@ -9,9 +10,10 @@ interrupts, clocking, jacks and voltage regulators. | |||
9 | The machine driver can contain codec and platform specific code. It registers | 10 | The machine driver can contain codec and platform specific code. It registers |
10 | the audio subsystem with the kernel as a platform device and is represented by | 11 | the audio subsystem with the kernel as a platform device and is represented by |
11 | the following struct:- | 12 | the following struct:- |
13 | :: | ||
12 | 14 | ||
13 | /* SoC machine */ | 15 | /* SoC machine */ |
14 | struct snd_soc_card { | 16 | struct snd_soc_card { |
15 | char *name; | 17 | char *name; |
16 | 18 | ||
17 | ... | 19 | ... |
@@ -33,7 +35,7 @@ struct snd_soc_card { | |||
33 | int num_links; | 35 | int num_links; |
34 | 36 | ||
35 | ... | 37 | ... |
36 | }; | 38 | }; |
37 | 39 | ||
38 | probe()/remove() | 40 | probe()/remove() |
39 | ---------------- | 41 | ---------------- |
@@ -55,9 +57,10 @@ initialisation e.g. the machine audio map can be connected to the codec audio | |||
55 | map, unconnected codec pins can be set as such. | 57 | map, unconnected codec pins can be set as such. |
56 | 58 | ||
57 | struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. | 59 | struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. |
60 | :: | ||
58 | 61 | ||
59 | /* corgi digital audio interface glue - connects codec <--> CPU */ | 62 | /* corgi digital audio interface glue - connects codec <--> CPU */ |
60 | static struct snd_soc_dai_link corgi_dai = { | 63 | static struct snd_soc_dai_link corgi_dai = { |
61 | .name = "WM8731", | 64 | .name = "WM8731", |
62 | .stream_name = "WM8731", | 65 | .stream_name = "WM8731", |
63 | .cpu_dai_name = "pxa-is2-dai", | 66 | .cpu_dai_name = "pxa-is2-dai", |
@@ -66,16 +69,17 @@ static struct snd_soc_dai_link corgi_dai = { | |||
66 | .codec_name = "wm8713-codec.0-001a", | 69 | .codec_name = "wm8713-codec.0-001a", |
67 | .init = corgi_wm8731_init, | 70 | .init = corgi_wm8731_init, |
68 | .ops = &corgi_ops, | 71 | .ops = &corgi_ops, |
69 | }; | 72 | }; |
70 | 73 | ||
71 | struct snd_soc_card then sets up the machine with its DAIs. e.g. | 74 | struct snd_soc_card then sets up the machine with its DAIs. e.g. |
75 | :: | ||
72 | 76 | ||
73 | /* corgi audio machine driver */ | 77 | /* corgi audio machine driver */ |
74 | static struct snd_soc_card snd_soc_corgi = { | 78 | static struct snd_soc_card snd_soc_corgi = { |
75 | .name = "Corgi", | 79 | .name = "Corgi", |
76 | .dai_link = &corgi_dai, | 80 | .dai_link = &corgi_dai, |
77 | .num_links = 1, | 81 | .num_links = 1, |
78 | }; | 82 | }; |
79 | 83 | ||
80 | 84 | ||
81 | Machine Power Map | 85 | Machine Power Map |
diff --git a/Documentation/sound/alsa/soc/overview.txt b/Documentation/sound/soc/overview.rst index f3f28b7ae242..dc8370bbfff6 100644 --- a/Documentation/sound/alsa/soc/overview.txt +++ b/Documentation/sound/soc/overview.rst | |||
@@ -1,5 +1,6 @@ | |||
1 | ALSA SoC Layer | 1 | ======================= |
2 | ============== | 2 | ALSA SoC Layer Overview |
3 | ======================= | ||
3 | 4 | ||
4 | The overall project goal of the ALSA System on Chip (ASoC) layer is to | 5 | The overall project goal of the ALSA System on Chip (ASoC) layer is to |
5 | provide better ALSA support for embedded system-on-chip processors (e.g. | 6 | provide better ALSA support for embedded system-on-chip processors (e.g. |
@@ -66,30 +67,3 @@ multiple re-usable component drivers :- | |||
66 | describes and binds the other component drivers together to form an ALSA | 67 | describes and binds the other component drivers together to form an ALSA |
67 | "sound card device". It handles any machine specific controls and | 68 | "sound card device". It handles any machine specific controls and |
68 | machine level audio events (e.g. turning on an amp at start of playback). | 69 | machine level audio events (e.g. turning on an amp at start of playback). |
69 | |||
70 | |||
71 | Documentation | ||
72 | ============= | ||
73 | |||
74 | The documentation is spilt into the following sections:- | ||
75 | |||
76 | overview.txt: This file. | ||
77 | |||
78 | codec.txt: Codec driver internals. | ||
79 | |||
80 | DAI.txt: Description of Digital Audio Interface standards and how to configure | ||
81 | a DAI within your codec and CPU DAI drivers. | ||
82 | |||
83 | dapm.txt: Dynamic Audio Power Management | ||
84 | |||
85 | platform.txt: Platform audio DMA and DAI. | ||
86 | |||
87 | machine.txt: Machine driver internals. | ||
88 | |||
89 | pop_clicks.txt: How to minimise audio artifacts. | ||
90 | |||
91 | clocking.txt: ASoC clocking for best power performance. | ||
92 | |||
93 | jack.txt: ASoC jack detection. | ||
94 | |||
95 | DPCM.txt: Dynamic PCM - Describes DPCM with DSP examples. | ||
diff --git a/Documentation/sound/alsa/soc/platform.txt b/Documentation/sound/soc/platform.rst index 3a08a2c9150c..d5574904d981 100644 --- a/Documentation/sound/alsa/soc/platform.txt +++ b/Documentation/sound/soc/platform.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ==================== | ||
1 | ASoC Platform Driver | 2 | ASoC Platform Driver |
2 | ==================== | 3 | ==================== |
3 | 4 | ||
@@ -9,21 +10,23 @@ Audio DMA | |||
9 | ========= | 10 | ========= |
10 | 11 | ||
11 | The platform DMA driver optionally supports the following ALSA operations:- | 12 | The platform DMA driver optionally supports the following ALSA operations:- |
13 | :: | ||
12 | 14 | ||
13 | /* SoC audio ops */ | 15 | /* SoC audio ops */ |
14 | struct snd_soc_ops { | 16 | struct snd_soc_ops { |
15 | int (*startup)(struct snd_pcm_substream *); | 17 | int (*startup)(struct snd_pcm_substream *); |
16 | void (*shutdown)(struct snd_pcm_substream *); | 18 | void (*shutdown)(struct snd_pcm_substream *); |
17 | int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *); | 19 | int (*hw_params)(struct snd_pcm_substream *, struct snd_pcm_hw_params *); |
18 | int (*hw_free)(struct snd_pcm_substream *); | 20 | int (*hw_free)(struct snd_pcm_substream *); |
19 | int (*prepare)(struct snd_pcm_substream *); | 21 | int (*prepare)(struct snd_pcm_substream *); |
20 | int (*trigger)(struct snd_pcm_substream *, int); | 22 | int (*trigger)(struct snd_pcm_substream *, int); |
21 | }; | 23 | }; |
22 | 24 | ||
23 | The platform driver exports its DMA functionality via struct | 25 | The platform driver exports its DMA functionality via struct |
24 | snd_soc_platform_driver:- | 26 | snd_soc_platform_driver:- |
27 | :: | ||
25 | 28 | ||
26 | struct snd_soc_platform_driver { | 29 | struct snd_soc_platform_driver { |
27 | char *name; | 30 | char *name; |
28 | 31 | ||
29 | int (*probe)(struct platform_device *pdev); | 32 | int (*probe)(struct platform_device *pdev); |
@@ -44,7 +47,7 @@ struct snd_soc_platform_driver { | |||
44 | 47 | ||
45 | /* platform stream ops */ | 48 | /* platform stream ops */ |
46 | struct snd_pcm_ops *pcm_ops; | 49 | struct snd_pcm_ops *pcm_ops; |
47 | }; | 50 | }; |
48 | 51 | ||
49 | Please refer to the ALSA driver documentation for details of audio DMA. | 52 | Please refer to the ALSA driver documentation for details of audio DMA. |
50 | http://www.alsa-project.org/~iwai/writing-an-alsa-driver/ | 53 | http://www.alsa-project.org/~iwai/writing-an-alsa-driver/ |
@@ -57,11 +60,11 @@ SoC DAI Drivers | |||
57 | 60 | ||
58 | Each SoC DAI driver must provide the following features:- | 61 | Each SoC DAI driver must provide the following features:- |
59 | 62 | ||
60 | 1) Digital audio interface (DAI) description | 63 | 1. Digital audio interface (DAI) description |
61 | 2) Digital audio interface configuration | 64 | 2. Digital audio interface configuration |
62 | 3) PCM's description | 65 | 3. PCM's description |
63 | 4) SYSCLK configuration | 66 | 4. SYSCLK configuration |
64 | 5) Suspend and resume (optional) | 67 | 5. Suspend and resume (optional) |
65 | 68 | ||
66 | Please see codec.txt for a description of items 1 - 4. | 69 | Please see codec.txt for a description of items 1 - 4. |
67 | 70 | ||
@@ -71,9 +74,9 @@ SoC DSP Drivers | |||
71 | 74 | ||
72 | Each SoC DSP driver usually supplies the following features :- | 75 | Each SoC DSP driver usually supplies the following features :- |
73 | 76 | ||
74 | 1) DAPM graph | 77 | 1. DAPM graph |
75 | 2) Mixer controls | 78 | 2. Mixer controls |
76 | 3) DMA IO to/from DSP buffers (if applicable) | 79 | 3. DMA IO to/from DSP buffers (if applicable) |
77 | 4) Definition of DSP front end (FE) PCM devices. | 80 | 4. Definition of DSP front end (FE) PCM devices. |
78 | 81 | ||
79 | Please see DPCM.txt for a description of item 4. | 82 | Please see DPCM.txt for a description of item 4. |
diff --git a/Documentation/sound/alsa/soc/pops_clicks.txt b/Documentation/sound/soc/pops-clicks.rst index e1e74daa4497..de7eb2a6604a 100644 --- a/Documentation/sound/alsa/soc/pops_clicks.txt +++ b/Documentation/sound/soc/pops-clicks.rst | |||
@@ -1,3 +1,4 @@ | |||
1 | ===================== | ||
1 | Audio Pops and Clicks | 2 | Audio Pops and Clicks |
2 | ===================== | 3 | ===================== |
3 | 4 | ||
@@ -20,10 +21,11 @@ currently, however future audio codec hardware will have better pop and click | |||
20 | suppression. Pops can be reduced within playback by powering the audio | 21 | suppression. Pops can be reduced within playback by powering the audio |
21 | components in a specific order. This order is different for startup and | 22 | components in a specific order. This order is different for startup and |
22 | shutdown and follows some basic rules:- | 23 | shutdown and follows some basic rules:- |
24 | :: | ||
23 | 25 | ||
24 | Startup Order :- DAC --> Mixers --> Output PGA --> Digital Unmute | 26 | Startup Order :- DAC --> Mixers --> Output PGA --> Digital Unmute |
25 | 27 | ||
26 | Shutdown Order :- Digital Mute --> Output PGA --> Mixers --> DAC | 28 | Shutdown Order :- Digital Mute --> Output PGA --> Mixers --> DAC |
27 | 29 | ||
28 | This assumes that the codec PCM output path from the DAC is via a mixer and then | 30 | This assumes that the codec PCM output path from the DAC is via a mixer and then |
29 | a PGA (programmable gain amplifier) before being output to the speakers. | 31 | a PGA (programmable gain amplifier) before being output to the speakers. |
@@ -36,10 +38,11 @@ Capture artifacts are somewhat easier to get rid as we can delay activating the | |||
36 | ADC until all the pops have occurred. This follows similar power rules to | 38 | ADC until all the pops have occurred. This follows similar power rules to |
37 | playback in that components are powered in a sequence depending upon stream | 39 | playback in that components are powered in a sequence depending upon stream |
38 | startup or shutdown. | 40 | startup or shutdown. |
41 | :: | ||
39 | 42 | ||
40 | Startup Order - Input PGA --> Mixers --> ADC | 43 | Startup Order - Input PGA --> Mixers --> ADC |
41 | 44 | ||
42 | Shutdown Order - ADC --> Mixers --> Input PGA | 45 | Shutdown Order - ADC --> Mixers --> Input PGA |
43 | 46 | ||
44 | 47 | ||
45 | Zipper Noise | 48 | Zipper Noise |