summaryrefslogtreecommitdiffstats
path: root/Documentation/sound
diff options
context:
space:
mode:
authorJonathan Corbet <corbet@lwn.net>2016-11-18 18:19:28 -0500
committerJonathan Corbet <corbet@lwn.net>2016-11-18 18:19:28 -0500
commit726d661fea3e3f76d36515c74e4ce58e7789418e (patch)
tree0f996a1d5c0cca796b135378beb66e9829fae854 /Documentation/sound
parent917fef6f7ee8b2fe852692ac49771342bfef9433 (diff)
parentc6ab9e57e84ee015bb9c5de213d9f85e5fd4e085 (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.rst2683
-rw-r--r--Documentation/sound/alsa/ALSA-Configuration.txt2330
-rw-r--r--Documentation/sound/alsa/ControlNames.txt107
-rw-r--r--Documentation/sound/alsa/HD-Audio-Models.txt324
-rw-r--r--Documentation/sound/alsa/VIA82xx-mixer.txt8
-rw-r--r--Documentation/sound/alsa/alsa-parameters.txt135
-rw-r--r--Documentation/sound/alsa/seq_oss.html409
-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.rst19
-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.rst8
-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.rst142
-rw-r--r--Documentation/sound/designs/index.rst15
-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.rst371
-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.rst10
-rw-r--r--Documentation/sound/hd-audio/models.rst518
-rw-r--r--Documentation/sound/hd-audio/notes.rst (renamed from Documentation/sound/alsa/HD-Audio.txt)635
-rw-r--r--Documentation/sound/index.rst20
-rw-r--r--Documentation/sound/kernel-api/alsa-driver-api.rst134
-rw-r--r--Documentation/sound/kernel-api/index.rst8
-rw-r--r--Documentation/sound/kernel-api/writing-an-alsa-driver.rst4219
-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.rst108
-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.rst20
-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==============================================================
2Advanced Linux Sound Architecture - Driver Configuration guide
3==============================================================
4
5
6Kernel Configuration
7====================
8
9To enable ALSA support you need at least to build the kernel with
10primary sound card support (``CONFIG_SOUND``). Since ALSA can emulate
11OSS, you don't have to choose any of the OSS modules.
12
13Enable "OSS API emulation" (``CONFIG_SND_OSSEMUL``) and both OSS mixer
14and PCM supports if you want to run OSS applications with ALSA.
15
16If you want to support the WaveTable functionality on cards such as
17SB Live! then you need to enable "Sequencer support"
18(``CONFIG_SND_SEQUENCER``).
19
20To make ALSA debug messages more verbose, enable the "Verbose printk"
21and "Debug" options. To check for memory leaks, turn on "Debug memory"
22too. "Debug detection" will add checks for the detection of cards.
23
24Please 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
26using isapnptools.
27
28
29Module parameters
30=================
31
32The user can load modules with options. If the module supports more than
33one card and you have more than one card of the same type then you can
34specify multiple values for the option separated by commas.
35
36
37Module snd
38----------
39
40The core ALSA module. It is used by all ALSA card drivers.
41It takes the following options which have global effects.
42
43major
44 major number for sound driver;
45 Default: 116
46cards_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.
51slots
52 Reserve the slot index for the given driver;
53 This option takes multiple strings.
54 See `Module Autoloading Support`_ section for details.
55debug
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
63Module snd-pcm-oss
64------------------
65
66The PCM OSS emulation module.
67This module takes options which change the mapping of devices.
68
69dsp_map
70 PCM device number maps assigned to the 1st OSS device;
71 Default: 0
72adsp_map
73 PCM device number maps assigned to the 2st OSS device;
74 Default: 1
75nonblock_open
76 Don't block opening busy PCM devices;
77 Default: 1
78
79For example, when ``dsp_map=2``, /dev/dsp will be mapped to PCM #2 of
80the card #0. Similarly, when ``adsp_map=0``, /dev/adsp will be mapped
81to PCM #0 of the card #0.
82For changing the second or later card, specify the option with
83commas, such like ``dsp_map=0,1``.
84
85``nonblock_open`` option is used to change the behavior of the PCM
86regarding opening the device. When this option is non-zero,
87opening a busy OSS PCM device won't be blocked but return
88immediately with EAGAIN (just like O_NONBLOCK flag).
89
90Module snd-rawmidi
91------------------
92
93This module takes options which change the mapping of devices.
94similar to those of the snd-pcm-oss module.
95
96midi_map
97 MIDI device number maps assigned to the 1st OSS device;
98 Default: 0
99amidi_map
100 MIDI device number maps assigned to the 2st OSS device;
101 Default: 1
102
103Common parameters for top sound card modules
104--------------------------------------------
105
106Each of top level sound card module takes the following options.
107
108index
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
115id
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
123enable
124 enable card;
125 Default: enabled, for PCI and ISA PnP cards
126
127Module snd-adlib
128----------------
129
130Module for AdLib FM cards.
131
132port
133 port # for OPL chip
134
135This module supports multiple cards. It does not support autoprobe, so
136the port must be specified. For actual AdLib FM cards it will be 0x388.
137Note that this card does not have PCM support and no mixer; only FM
138synthesis.
139
140Make sure you have ``sbiload`` from the alsa-tools package available and,
141after loading the module, find out the assigned ALSA sequencer port
142number through ``sbiload -l``.
143
144Example output:
145::
146
147 Port Client name Port name
148 64:0 OPL2 FM synth OPL2 FM Port
149
150Load the ``std.sb`` and ``drums.sb`` patches also supplied by ``sbiload``:
151::
152
153 sbiload -p 64:0 std.sb drums.sb
154
155If you use this driver to drive an OPL3, you can use ``std.o3`` and ``drums.o3``
156instead. To have the card produce sound, use ``aplaymidi`` from alsa-utils:
157::
158
159 aplaymidi -p 64:0 foo.mid
160
161Module snd-ad1816a
162------------------
163
164Module for sound cards based on Analog Devices AD1816A/AD1815 ISA chips.
165
166clockfreq
167 Clock frequency for AD1816A chip (default = 0, 33000Hz)
168
169This module supports multiple cards, autoprobe and PnP.
170
171Module snd-ad1848
172-----------------
173
174Module for sound cards based on AD1848/AD1847/CS4248 ISA chips.
175
176port
177 port # for AD1848 chip
178irq
179 IRQ # for AD1848 chip
180dma1
181 DMA # for AD1848 chip (0,1,3)
182
183This module supports multiple cards. It does not support autoprobe
184thus main port must be specified!!! Other ports are optional.
185
186The power-management is supported.
187
188Module snd-ad1889
189-----------------
190
191Module for Analog Devices AD1889 chips.
192
193ac97_quirk
194 AC'97 workaround for strange hardware;
195 See the description of intel8x0 module for details.
196
197This module supports multiple cards.
198
199Module snd-ali5451
200------------------
201
202Module for ALi M5451 PCI chip.
203
204pcm_channels
205 Number of hardware channels assigned for PCM
206spdif
207 Support SPDIF I/O;
208 Default: disabled
209
210This module supports one chip and autoprobe.
211
212The power-management is supported.
213
214Module snd-als100
215-----------------
216
217Module for sound cards based on Avance Logic ALS100/ALS120 ISA chips.
218
219This module supports multiple cards, autoprobe and PnP.
220
221The power-management is supported.
222
223Module snd-als300
224-----------------
225
226Module for Avance Logic ALS300 and ALS300+
227
228This module supports multiple cards.
229
230The power-management is supported.
231
232Module snd-als4000
233------------------
234
235Module for sound cards based on Avance Logic ALS4000 PCI chip.
236
237joystick_port
238 port # for legacy joystick support;
239 0 = disabled (default), 1 = auto-detect
240
241This module supports multiple cards, autoprobe and PnP.
242
243The power-management is supported.
244
245Module snd-asihpi
246-----------------
247
248Module for AudioScience ASI soundcards
249
250enable_hpi_hwdep
251 enable HPI hwdep for AudioScience soundcard
252
253This module supports multiple cards.
254The driver requires the firmware loader support on kernel.
255
256Module snd-atiixp
257-----------------
258
259Module for ATI IXP 150/200/250/400 AC97 controllers.
260
261ac97_clock
262 AC'97 clock (default = 48000)
263ac97_quirk
264 AC'97 workaround for strange hardware;
265 See `AC97 Quirk Option`_ section below.
266ac97_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.)
271spdif_aclink
272 S/PDIF transfer over AC-link (default = 1)
273
274This module supports one card and autoprobe.
275
276ATI IXP has two different methods to control SPDIF output. One is
277over AC-link and another is over the "direct" SPDIF output. The
278implementation depends on the motherboard, and you'll need to
279choose the correct one via spdif_aclink module option.
280
281The power-management is supported.
282
283Module snd-atiixp-modem
284-----------------------
285
286Module for ATI IXP 150/200/250 AC97 modem controllers.
287
288This module supports one card and autoprobe.
289
290Note: The default index value of this module is -2, i.e. the first
291slot is excluded.
292
293The power-management is supported.
294
295Module snd-au8810, snd-au8820, snd-au8830
296-----------------------------------------
297
298Module for Aureal Vortex, Vortex2 and Advantage device.
299
300pcifix
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
309This module supports all ADB PCM channels, ac97 mixer, SPDIF, hardware
310EQ, mpu401, gameport. A3D and wavetable support are still in development.
311Development and reverse engineering work is being coordinated at
312http://savannah.nongnu.org/projects/openvortex/
313SPDIF output has a copy of the AC97 codec output, unless you use the
314``spdif`` pcm device, which allows raw data passthru.
315The hardware EQ hardware and SPDIF is only present in the Vortex2 and
316Advantage.
317
318Note: Some ALSA mixer applications don't handle the SPDIF sample rate
319control correctly. If you have problems regarding this, try
320another ALSA compliant mixer (alsamixer works).
321
322Module snd-azt1605
323------------------
324
325Module for Aztech Sound Galaxy soundcards based on the Aztech AZT1605
326chipset.
327
328port
329 port # for BASE (0x220,0x240,0x260,0x280)
330wss_port
331 port # for WSS (0x530,0x604,0xe80,0xf40)
332irq
333 IRQ # for WSS (7,9,10,11)
334dma1
335 DMA # for WSS playback (0,1,3)
336dma2
337 DMA # for WSS capture (0,1), -1 = disabled (default)
338mpu_port
339 port # for MPU-401 UART (0x300,0x330), -1 = disabled (default)
340mpu_irq
341 IRQ # for MPU-401 UART (3,5,7,9), -1 = disabled (default)
342fm_port
343 port # for OPL3 (0x388), -1 = disabled (default)
344
345This module supports multiple cards. It does not support autoprobe:
346``port``, ``wss_port``, ``irq`` and ``dma1`` have to be specified.
347The other values are optional.
348
349``port`` needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240)
350or the value stored in the card's EEPROM for cards that have an EEPROM and
351their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can
352be chosen freely from the options enumerated above.
353
354If ``dma2`` is specified and different from ``dma1``, the card will operate in
355full-duplex mode. When ``dma1=3``, only ``dma2=0`` is valid and the only way to
356enable capture since only channels 0 and 1 are available for capture.
357
358Generic settings are ``port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0
359mpu_port=0x330 mpu_irq=9 fm_port=0x388``.
360
361Whatever IRQ and DMA channels you pick, be sure to reserve them for
362legacy ISA in your BIOS.
363
364Module snd-azt2316
365------------------
366
367Module for Aztech Sound Galaxy soundcards based on the Aztech AZT2316
368chipset.
369
370port
371 port # for BASE (0x220,0x240,0x260,0x280)
372wss_port
373 port # for WSS (0x530,0x604,0xe80,0xf40)
374irq
375 IRQ # for WSS (7,9,10,11)
376dma1
377 DMA # for WSS playback (0,1,3)
378dma2
379 DMA # for WSS capture (0,1), -1 = disabled (default)
380mpu_port
381 port # for MPU-401 UART (0x300,0x330), -1 = disabled (default)
382mpu_irq
383 IRQ # for MPU-401 UART (5,7,9,10), -1 = disabled (default)
384fm_port
385 port # for OPL3 (0x388), -1 = disabled (default)
386
387This module supports multiple cards. It does not support autoprobe:
388``port``, ``wss_port``, ``irq`` and ``dma1`` have to be specified.
389The other values are optional.
390
391``port`` needs to match the BASE ADDRESS jumper on the card (0x220 or 0x240)
392or the value stored in the card's EEPROM for cards that have an EEPROM and
393their "CONFIG MODE" jumper set to "EEPROM SETTING". The other values can
394be chosen freely from the options enumerated above.
395
396If ``dma2`` is specified and different from ``dma1``, the card will operate in
397full-duplex mode. When ``dma1=3``, only ``dma2=0`` is valid and the only way to
398enable capture since only channels 0 and 1 are available for capture.
399
400Generic settings are ``port=0x220 wss_port=0x530 irq=10 dma1=1 dma2=0
401mpu_port=0x330 mpu_irq=9 fm_port=0x388``.
402
403Whatever IRQ and DMA channels you pick, be sure to reserve them for
404legacy ISA in your BIOS.
405
406Module snd-aw2
407--------------
408
409Module for Audiowerk2 sound card
410
411This module supports multiple cards.
412
413Module snd-azt2320
414------------------
415
416Module for sound cards based on Aztech System AZT2320 ISA chip (PnP only).
417
418This module supports multiple cards, PnP and autoprobe.
419
420The power-management is supported.
421
422Module snd-azt3328
423------------------
424
425Module for sound cards based on Aztech AZF3328 PCI chip.
426
427joystick
428 Enable joystick (default off)
429
430This module supports multiple cards.
431
432Module snd-bt87x
433----------------
434
435Module for video cards based on Bt87x chips.
436
437digital_rate
438 Override the default digital rate (Hz)
439load_all
440 Load the driver even if the card model isn't known
441
442This module supports multiple cards.
443
444Note: The default index value of this module is -2, i.e. the first
445slot is excluded.
446
447Module snd-ca0106
448-----------------
449
450Module for Creative Audigy LS and SB Live 24bit
451
452This module supports multiple cards.
453
454
455Module snd-cmi8330
456------------------
457
458Module for sound cards based on C-Media CMI8330 ISA chips.
459
460isapnp
461 ISA PnP detection - 0 = disable, 1 = enable (default)
462
463with ``isapnp=0``, the following options are available:
464
465wssport
466 port # for CMI8330 chip (WSS)
467wssirq
468 IRQ # for CMI8330 chip (WSS)
469wssdma
470 first DMA # for CMI8330 chip (WSS)
471sbport
472 port # for CMI8330 chip (SB16)
473sbirq
474 IRQ # for CMI8330 chip (SB16)
475sbdma8
476 8bit DMA # for CMI8330 chip (SB16)
477sbdma16
478 16bit DMA # for CMI8330 chip (SB16)
479fmport
480 (optional) OPL3 I/O port
481mpuport
482 (optional) MPU401 I/O port
483mpuirq
484 (optional) MPU401 irq #
485
486This module supports multiple cards and autoprobe.
487
488The power-management is supported.
489
490Module snd-cmipci
491-----------------
492
493Module for C-Media CMI8338/8738/8768/8770 PCI sound cards.
494
495mpu_port
496 port address of MIDI interface (8338 only):
497 0x300,0x310,0x320,0x330 = legacy port,
498 0 = disable (default)
499fm_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
504soft_ac3
505 Software-conversion of raw SPDIF packets (model 033 only) (default = 1)
506joystick_port
507 Joystick port address (0 = disable, 1 = auto-detect)
508
509This module supports autoprobe and multiple cards.
510
511The power-management is supported.
512
513Module snd-cs4231
514-----------------
515
516Module for sound cards based on CS4231 ISA chips.
517
518port
519 port # for CS4231 chip
520mpu_port
521 port # for MPU-401 UART (optional), -1 = disable
522irq
523 IRQ # for CS4231 chip
524mpu_irq
525 IRQ # for MPU-401 UART
526dma1
527 first DMA # for CS4231 chip
528dma2
529 second DMA # for CS4231 chip
530
531This module supports multiple cards. This module does not support autoprobe
532thus main port must be specified!!! Other ports are optional.
533
534The power-management is supported.
535
536Module snd-cs4236
537-----------------
538
539Module for sound cards based on CS4232/CS4232A,
540CS4235/CS4236/CS4236B/CS4237B/CS4238B/CS4239 ISA chips.
541
542isapnp
543 ISA PnP detection - 0 = disable, 1 = enable (default)
544
545with ``isapnp=0``, the following options are available:
546
547port
548 port # for CS4236 chip (PnP setup - 0x534)
549cport
550 control port # for CS4236 chip (PnP setup - 0x120,0x210,0xf00)
551mpu_port
552 port # for MPU-401 UART (PnP setup - 0x300), -1 = disable
553fm_port
554 FM port # for CS4236 chip (PnP setup - 0x388), -1 = disable
555irq
556 IRQ # for CS4236 chip (5,7,9,11,12,15)
557mpu_irq
558 IRQ # for MPU-401 UART (9,11,12,15)
559dma1
560 first DMA # for CS4236 chip (0,1,3)
561dma2
562 second DMA # for CS4236 chip (0,1,3), -1 = disable
563
564This 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
566specified!!! Other ports are optional.
567
568The power-management is supported.
569
570This module is aliased as snd-cs4232 since it provides the old
571snd-cs4232 functionality, too.
572
573Module snd-cs4281
574-----------------
575
576Module for Cirrus Logic CS4281 soundchip.
577
578dual_codec
579 Secondary codec ID (0 = disable, default)
580
581This module supports multiple cards.
582
583The power-management is supported.
584
585Module snd-cs46xx
586-----------------
587
588Module for PCI sound cards based on CS4610/CS4612/CS4614/CS4615/CS4622/
589CS4624/CS4630/CS4280 PCI chips.
590
591external_amp
592 Force to enable external amplifier.
593thinkpad
594 Force to enable Thinkpad's CLKRUN control.
595mmap_valid
596 Support OSS mmap mode (default = 0).
597
598This module supports multiple cards and autoprobe.
599Usually external amp and CLKRUN controls are detected automatically
600from PCI sub vendor/device ids. If they don't work, give the options
601above explicitly.
602
603The power-management is supported.
604
605Module snd-cs5530
606-----------------
607
608Module for Cyrix/NatSemi Geode 5530 chip.
609
610Module snd-cs5535audio
611----------------------
612
613Module for multifunction CS5535 companion PCI device
614
615The power-management is supported.
616
617Module snd-ctxfi
618----------------
619
620Module 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
632reference_rate
633 reference sample rate, 44100 or 48000 (default)
634multiple
635 multiple to ref. sample rate, 1 or 2 (default)
636subsystem
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
641This module supports multiple cards.
642
643Module snd-darla20
644------------------
645
646Module for Echoaudio Darla20
647
648This module supports multiple cards.
649The driver requires the firmware loader support on kernel.
650
651Module snd-darla24
652------------------
653
654Module for Echoaudio Darla24
655
656This module supports multiple cards.
657The driver requires the firmware loader support on kernel.
658
659Module snd-dt019x
660-----------------
661
662Module for Diamond Technologies DT-019X / Avance Logic ALS-007 (PnP
663only)
664
665This module supports multiple cards. This module is enabled only with
666ISA PnP support.
667
668The power-management is supported.
669
670Module snd-dummy
671----------------
672
673Module for the dummy sound card. This "card" doesn't do any output
674or input, but you may use this module for any application which
675requires a sound card (like RealPlayer).
676
677pcm_devs
678 Number of PCM devices assigned to each card (default = 1, up to 4)
679pcm_substreams
680 Number of PCM substreams assigned to each PCM (default = 8, up to 128)
681hrtimer
682 Use hrtimer (=1, default) or system timer (=0)
683fake_buffer
684 Fake buffer allocations (default = 1)
685
686When multiple PCM devices are created, snd-dummy gives different
687behavior 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
693As default, snd-dummy drivers doesn't allocate the real buffers
694but either ignores read/write or mmap a single dummy page to all
695buffer pages, in order to save the resources. If your apps need
696the read/ written buffer data to be consistent, pass fake_buffer=0
697option.
698
699The power-management is supported.
700
701Module snd-echo3g
702-----------------
703
704Module for Echoaudio 3G cards (Gina3G/Layla3G)
705
706This module supports multiple cards.
707The driver requires the firmware loader support on kernel.
708
709Module snd-emu10k1
710------------------
711
712Module 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
719extin
720 bitmap of available external inputs for FX8010 (see bellow)
721extout
722 bitmap of available external outputs for FX8010 (see bellow)
723seq_ports
724 allocated sequencer ports (4 by default)
725max_synth_voices
726 limit of voices used for wavetable (64 by default)
727max_buffer_size
728 specifies the maximum size of wavetable/pcm buffers given in MB
729 unit. Default value is 128.
730enable_ir
731 enable IR
732
733This module supports multiple cards and autoprobe.
734
735Input & 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
749The power-management is supported.
750
751Module snd-emu10k1x
752-------------------
753
754Module for Creative Emu10k1X (SB Live Dell OEM version)
755
756This module supports multiple cards.
757
758Module snd-ens1370
759------------------
760
761Module for Ensoniq AudioPCI ES1370 PCI sound cards.
762
763* SoundBlaster PCI 64
764* SoundBlaster PCI 128
765
766joystick
767 Enable joystick (default off)
768
769This module supports multiple cards and autoprobe.
770
771The power-management is supported.
772
773Module snd-ens1371
774------------------
775
776Module for Ensoniq AudioPCI ES1371 PCI sound cards.
777
778* SoundBlaster PCI 64
779* SoundBlaster PCI 128
780* SoundBlaster Vibra PCI
781
782joystick_port
783 port # for joystick (0x200,0x208,0x210,0x218), 0 = disable
784 (default), 1 = auto-detect
785
786This module supports multiple cards and autoprobe.
787
788The power-management is supported.
789
790Module snd-es1688
791-----------------
792
793Module for ESS AudioDrive ES-1688 and ES-688 sound cards.
794
795isapnp
796 ISA PnP detection - 0 = disable, 1 = enable (default)
797mpu_port
798 port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default)
799mpu_irq
800 IRQ # for MPU-401 port (5,7,9,10)
801fm_port
802 port # for OPL3 (option; share the same port as default)
803
804with ``isapnp=0``, the following additional options are available:
805
806port
807 port # for ES-1688 chip (0x220,0x240,0x260)
808irq
809 IRQ # for ES-1688 chip (5,7,9,10)
810dma8
811 DMA # for ES-1688 chip (0,1,3)
812
813This module supports multiple cards and autoprobe (without MPU-401 port)
814and PnP with the ES968 chip.
815
816Module snd-es18xx
817-----------------
818
819Module for ESS AudioDrive ES-18xx sound cards.
820
821isapnp
822 ISA PnP detection - 0 = disable, 1 = enable (default)
823
824with ``isapnp=0``, the following options are available:
825
826port
827 port # for ES-18xx chip (0x220,0x240,0x260)
828mpu_port
829 port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable (default)
830fm_port
831 port # for FM (optional, not used)
832irq
833 IRQ # for ES-18xx chip (5,7,9,10)
834dma1
835 first DMA # for ES-18xx chip (0,1,3)
836dma2
837 first DMA # for ES-18xx chip (0,1,3)
838
839This module supports multiple cards, ISA PnP and autoprobe (without MPU-401
840port if native ISA PnP routines are not used).
841When ``dma2`` is equal with ``dma1``, the driver works as half-duplex.
842
843The power-management is supported.
844
845Module snd-es1938
846-----------------
847
848Module for sound cards based on ESS Solo-1 (ES1938,ES1946) chips.
849
850This module supports multiple cards and autoprobe.
851
852The power-management is supported.
853
854Module snd-es1968
855-----------------
856
857Module for sound cards based on ESS Maestro-1/2/2E (ES1968/ES1978) chips.
858
859total_bufsize
860 total buffer size in kB (1-4096kB)
861pcm_substreams_p
862 playback channels (1-8, default=2)
863pcm_substreams_c
864 capture channels (1-8, default=0)
865clock
866 clock (0 = auto-detection)
867use_pm
868 support the power-management (0 = off, 1 = on, 2 = auto (default))
869enable_mpu
870 enable MPU401 (0 = off, 1 = on, 2 = auto (default))
871joystick
872 enable joystick (default off)
873
874This module supports multiple cards and autoprobe.
875
876The power-management is supported.
877
878Module snd-fm801
879----------------
880
881Module for ForteMedia FM801 based PCI sound cards.
882
883tea575x_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
891This module supports multiple cards and autoprobe.
892
893The power-management is supported.
894
895Module snd-gina20
896-----------------
897
898Module for Echoaudio Gina20
899
900This module supports multiple cards.
901The driver requires the firmware loader support on kernel.
902
903Module snd-gina24
904-----------------
905
906Module for Echoaudio Gina24
907
908This module supports multiple cards.
909The driver requires the firmware loader support on kernel.
910
911Module snd-gusclassic
912---------------------
913
914Module for Gravis UltraSound Classic sound card.
915
916port
917 port # for GF1 chip (0x220,0x230,0x240,0x250,0x260)
918irq
919 IRQ # for GF1 chip (3,5,9,11,12,15)
920dma1
921 DMA # for GF1 chip (1,3,5,6,7)
922dma2
923 DMA # for GF1 chip (1,3,5,6,7,-1=disable)
924joystick_dac
925 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
926voices
927 GF1 voices limit (14-32)
928pcm_voices
929 reserved PCM voices
930
931This module supports multiple cards and autoprobe.
932
933Module snd-gusextreme
934---------------------
935
936Module for Gravis UltraSound Extreme (Synergy ViperMax) sound card.
937
938port
939 port # for ES-1688 chip (0x220,0x230,0x240,0x250,0x260)
940gf1_port
941 port # for GF1 chip (0x210,0x220,0x230,0x240,0x250,0x260,0x270)
942mpu_port
943 port # for MPU-401 port (0x300,0x310,0x320,0x330), -1 = disable
944irq
945 IRQ # for ES-1688 chip (5,7,9,10)
946gf1_irq
947 IRQ # for GF1 chip (3,5,9,11,12,15)
948mpu_irq
949 IRQ # for MPU-401 port (5,7,9,10)
950dma8
951 DMA # for ES-1688 chip (0,1,3)
952dma1
953 DMA # for GF1 chip (1,3,5,6,7)
954joystick_dac
955 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
956voices
957 GF1 voices limit (14-32)
958pcm_voices
959 reserved PCM voices
960
961This module supports multiple cards and autoprobe (without MPU-401 port).
962
963Module snd-gusmax
964-----------------
965
966Module for Gravis UltraSound MAX sound card.
967
968port
969 port # for GF1 chip (0x220,0x230,0x240,0x250,0x260)
970irq
971 IRQ # for GF1 chip (3,5,9,11,12,15)
972dma1
973 DMA # for GF1 chip (1,3,5,6,7)
974dma2
975 DMA # for GF1 chip (1,3,5,6,7,-1=disable)
976joystick_dac
977 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
978voices
979 GF1 voices limit (14-32)
980pcm_voices
981 reserved PCM voices
982
983This module supports multiple cards and autoprobe.
984
985Module snd-hda-intel
986--------------------
987
988Module for Intel HD Audio (ICH6, ICH6M, ESB2, ICH7, ICH8, ICH9, ICH10,
989PCH, SCH), ATI SB450, SB600, R600, RS600, RS690, RS780, RV610, RV620,
990RV630, RV635, RV670, RV770, VIA VT8251/VT8237A, SIS966, ULI M5461
991
992[Multiple options for each card instance]
993
994model
995 force the model name
996position_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
1004probe_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
1009probe_only
1010 Only probing and no codec initialization (default=off);
1011 Useful to check the initial codec status for debugging
1012bdl_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.
1016patch
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.
1021beep_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
1027single_cmd
1028 Use single immediate commands to communicate with codecs
1029 (for debugging only)
1030enable_msi
1031 Enable Message Signaled Interrupt (MSI) (default = off)
1032power_save
1033 Automatic power-saving timeout (in second, 0 = disable)
1034power_save_controller
1035 Reset HD-audio controller in power-saving mode (default = on)
1036align_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)
1041snoop
1042 Enable/disable snooping (default = on)
1043
1044This module supports multiple cards and autoprobe.
1045
1046See hd-audio/notes.rst for more details about HD-audio driver.
1047
1048Each codec may have a model table for different configurations.
1049If your machine isn't listed there, the default (usually minimal)
1050configuration is set up. You can pass ``model=<name>`` option to
1051specify a certain model in such a case. There are different
1052models depending on the codec chip. The list of available models
1053is found in hd-audio/models.rst.
1054
1055The model name ``generic`` is treated as a special case. When this
1056model is given, the driver uses the generic codec parser without
1057"codec-patch". It's sometimes good for testing and debugging.
1058
1059If the default configuration doesn't work and one of the above
1060matches with your device, report it together with alsa-info.sh
1061output (with ``--no-upload`` option) to kernel bugzilla or alsa-devel
1062ML (see the section `Links and Addresses`_).
1063
1064``power_save`` and ``power_save_controller`` options are for power-saving
1065mode. See powersave.txt for details.
1066
1067Note 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
1069register value without FIFO size correction as the current
1070DMA pointer. ``position_fix=2`` will make the driver to use
1071the position buffer instead of reading SD_LPIB register.
1072(Usually SD_LPIB register is more accurate than the
1073position buffer.)
1074
1075``position_fix=3`` is specific to VIA devices. The position
1076of the capture stream is checked from both LPIB and POSBUF
1077values. ``position_fix=4`` is a combination mode, using LPIB
1078for playback and POSBUF for capture.
1079
1080NB: If you get many ``azx_get_response timeout`` messages at
1081loading, it's likely a problem of interrupts (e.g. ACPI irq
1082routing). Try to boot with options like ``pci=noacpi``. Also, you
1083can try ``single_cmd=1`` module option. This will switch the
1084communication method between HDA controller and codecs to the
1085single immediate commands instead of CORB/RIRB. Basically, the
1086single command mode is provided only for BIOS, and you won't get
1087unsolicited events, too. But, at least, this works independently
1088from the irq. Remember this is a last resort, and should be
1089avoided as much as possible...
1090
1091MORE NOTES ON ``azx_get_response timeout`` PROBLEMS:
1092On some hardware, you may need to add a proper probe_mask option
1093to avoid the ``azx_get_response timeout`` problem above, instead.
1094This 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
1096bus. You can see which codec slots are probed by enabling
1097``CONFIG_SND_DEBUG_VERBOSE``, or simply from the file name of the codec
1098proc files. Then limit the slots to probe by probe_mask option.
1099For example, ``probe_mask=1`` means to probe only the first slot, and
1100``probe_mask=4`` means only the third slot.
1101
1102The power-management is supported.
1103
1104Module snd-hdsp
1105---------------
1106
1107Module for RME Hammerfall DSP audio interface(s)
1108
1109This module supports multiple cards.
1110
1111Note: The firmware data can be automatically loaded via hotplug
1112when ``CONFIG_FW_LOADER`` is set. Otherwise, you need to load
1113the firmware via hdsploader utility included in alsa-tools
1114package.
1115The firmware data is found in alsa-firmware package.
1116
1117Note: snd-page-alloc module does the job which snd-hammerfall-mem
1118module did formerly. It will allocate the buffers in advance
1119when any HDSP cards are found. To make the buffer
1120allocation sure, load snd-page-alloc module in the early
1121stage of boot sequence. See `Early Buffer Allocation`_
1122section.
1123
1124Module snd-hdspm
1125----------------
1126
1127Module for RME HDSP MADI board.
1128
1129precise_ptr
1130 Enable precise pointer, or disable.
1131line_outs_monitor
1132 Send playback streams to analog outs by default.
1133enable_monitor
1134 Enable Analog Out on Channel 63/64 by default.
1135
1136See hdspm.txt for details.
1137
1138Module snd-ice1712
1139------------------
1140
1141Module 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
1163model
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
1169omni
1170 Omni I/O support for MidiMan M-Audio Delta44/66
1171cs8427_timeout
1172 reset timeout for the CS8427 chip (S/PDIF transceiver) in msec
1173 resolution, default value is 500 (0.5 sec)
1174
1175This module supports multiple cards and autoprobe.
1176Note: The consumer part is not used with all Envy24 based cards (for
1177example in the MidiMan Delta siree).
1178
1179Note: The supported board is detected by reading EEPROM or PCI
1180SSID (if EEPROM isn't available). You can override the
1181model by passing ``model`` module option in case that the
1182driver isn't configured properly or you want to try another
1183type for testing.
1184
1185Module snd-ice1724
1186------------------
1187
1188Module 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
1219model
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
1227This module supports multiple cards and autoprobe.
1228
1229Note: The supported board is detected by reading EEPROM or PCI
1230SSID (if EEPROM isn't available). You can override the
1231model by passing ``model`` module option in case that the
1232driver isn't configured properly or you want to try another
1233type for testing.
1234
1235Module snd-indigo
1236-----------------
1237
1238Module for Echoaudio Indigo
1239
1240This module supports multiple cards.
1241The driver requires the firmware loader support on kernel.
1242
1243Module snd-indigodj
1244-------------------
1245
1246Module for Echoaudio Indigo DJ
1247
1248This module supports multiple cards.
1249The driver requires the firmware loader support on kernel.
1250
1251Module snd-indigoio
1252-------------------
1253
1254Module for Echoaudio Indigo IO
1255
1256This module supports multiple cards.
1257The driver requires the firmware loader support on kernel.
1258
1259Module snd-intel8x0
1260-------------------
1261
1262Module 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
1271ac97_clock
1272 AC'97 codec clock base (0 = auto-detect)
1273ac97_quirk
1274 AC'97 workaround for strange hardware;
1275 See `AC97 Quirk Option`_ section below.
1276buggy_irq
1277 Enable workaround for buggy interrupts on some motherboards
1278 (default yes on nForce chips, otherwise off)
1279buggy_semaphore
1280 Enable workaround for hardware with buggy semaphores (e.g. on some
1281 ASUS laptops) (default off)
1282spdif_aclink
1283 Use S/PDIF over AC-link instead of direct connection from the
1284 controller chip (0 = off, 1 = on, -1 = default)
1285
1286This module supports one chip and autoprobe.
1287
1288Note: the latest driver supports auto-detection of chip clock.
1289if you still encounter too fast playback, specify the clock
1290explicitly via the module option ``ac97_clock=41194``.
1291
1292Joystick/MIDI ports are not supported by this driver. If your
1293motherboard has these devices, use the ns558 or snd-mpu401
1294modules, respectively.
1295
1296The power-management is supported.
1297
1298Module snd-intel8x0m
1299--------------------
1300
1301Module 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
1309ac97_clock
1310 AC'97 codec clock base (0 = auto-detect)
1311
1312This module supports one card and autoprobe.
1313
1314Note: The default index value of this module is -2, i.e. the first
1315slot is excluded.
1316
1317The power-management is supported.
1318
1319Module snd-interwave
1320--------------------
1321
1322Module for Gravis UltraSound PnP, Dynasonic 3-D/Pro, STB Sound Rage 32
1323and other sound cards based on AMD InterWave (tm) chip.
1324
1325joystick_dac
1326 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
1327midi
1328 1 = MIDI UART enable, 0 = MIDI UART disable (default)
1329pcm_voices
1330 reserved PCM voices for the synthesizer (default 2)
1331effect
1332 1 = InterWave effects enable (default 0); requires 8 voices
1333isapnp
1334 ISA PnP detection - 0 = disable, 1 = enable (default)
1335
1336with ``isapnp=0``, the following options are available:
1337
1338port
1339 port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260)
1340irq
1341 IRQ # for InterWave chip (3,5,9,11,12,15)
1342dma1
1343 DMA # for InterWave chip (0,1,3,5,6,7)
1344dma2
1345 DMA # for InterWave chip (0,1,3,5,6,7,-1=disable)
1346
1347This module supports multiple cards, autoprobe and ISA PnP.
1348
1349Module snd-interwave-stb
1350------------------------
1351
1352Module for UltraSound 32-Pro (sound card from STB used by Compaq)
1353and other sound cards based on AMD InterWave (tm) chip with TEA6330T
1354circuit for extended control of bass, treble and master volume.
1355
1356joystick_dac
1357 0 to 31, (0.59V-4.52V or 0.389V-2.98V)
1358midi
1359 1 = MIDI UART enable, 0 = MIDI UART disable (default)
1360pcm_voices
1361 reserved PCM voices for the synthesizer (default 2)
1362effect
1363 1 = InterWave effects enable (default 0); requires 8 voices
1364isapnp
1365 ISA PnP detection - 0 = disable, 1 = enable (default)
1366
1367with ``isapnp=0``, the following options are available:
1368
1369port
1370 port # for InterWave chip (0x210,0x220,0x230,0x240,0x250,0x260)
1371port_tc
1372 tone control (i2c bus) port # for TEA6330T chip (0x350,0x360,0x370,0x380)
1373irq
1374 IRQ # for InterWave chip (3,5,9,11,12,15)
1375dma1
1376 DMA # for InterWave chip (0,1,3,5,6,7)
1377dma2
1378 DMA # for InterWave chip (0,1,3,5,6,7,-1=disable)
1379
1380This module supports multiple cards, autoprobe and ISA PnP.
1381
1382Module snd-jazz16
1383-------------------
1384
1385Module for Media Vision Jazz16 chipset. The chipset consists of 3 chips:
1386MVD1216 + MVA416 + MVA514.
1387
1388port
1389 port # for SB DSP chip (0x210,0x220,0x230,0x240,0x250,0x260)
1390irq
1391 IRQ # for SB DSP chip (3,5,7,9,10,15)
1392dma8
1393 DMA # for SB DSP chip (1,3)
1394dma16
1395 DMA # for SB DSP chip (5,7)
1396mpu_port
1397 MPU-401 port # (0x300,0x310,0x320,0x330)
1398mpu_irq
1399 MPU-401 irq # (2,3,5,7)
1400
1401This module supports multiple cards.
1402
1403Module snd-korg1212
1404-------------------
1405
1406Module for Korg 1212 IO PCI card
1407
1408This module supports multiple cards.
1409
1410Module snd-layla20
1411------------------
1412
1413Module for Echoaudio Layla20
1414
1415This module supports multiple cards.
1416The driver requires the firmware loader support on kernel.
1417
1418Module snd-layla24
1419------------------
1420
1421Module for Echoaudio Layla24
1422
1423This module supports multiple cards.
1424The driver requires the firmware loader support on kernel.
1425
1426Module snd-lola
1427---------------
1428
1429Module for Digigram Lola PCI-e boards
1430
1431This module supports multiple cards.
1432
1433Module snd-lx6464es
1434-------------------
1435
1436Module for Digigram LX6464ES boards
1437
1438This module supports multiple cards.
1439
1440Module snd-maestro3
1441-------------------
1442
1443Module for Allegro/Maestro3 chips
1444
1445external_amp
1446 enable external amp (enabled by default)
1447amp_gpio
1448 GPIO pin number for external amp (0-15) or -1 for default pin (8
1449 for allegro, 1 for others)
1450
1451This module supports autoprobe and multiple chips.
1452
1453Note: the binding of amplifier is dependent on hardware.
1454If there is no sound even though all channels are unmuted, try to
1455specify other gpio connection via amp_gpio option.
1456For example, a Panasonic notebook might need ``amp_gpio=0x0d``
1457option.
1458
1459The power-management is supported.
1460
1461Module snd-mia
1462---------------
1463
1464Module for Echoaudio Mia
1465
1466This module supports multiple cards.
1467The driver requires the firmware loader support on kernel.
1468
1469Module snd-miro
1470---------------
1471
1472Module for Miro soundcards: miroSOUND PCM 1 pro, miroSOUND PCM 12,
1473miroSOUND PCM 20 Radio.
1474
1475port
1476 Port # (0x530,0x604,0xe80,0xf40)
1477irq
1478 IRQ # (5,7,9,10,11)
1479dma1
1480 1st dma # (0,1,3)
1481dma2
1482 2nd dma # (0,1)
1483mpu_port
1484 MPU-401 port # (0x300,0x310,0x320,0x330)
1485mpu_irq
1486 MPU-401 irq # (5,7,9,10)
1487fm_port
1488 FM Port # (0x388)
1489wss
1490 enable WSS mode
1491ide
1492 enable onboard ide support
1493
1494Module snd-mixart
1495-----------------
1496
1497Module for Digigram miXart8 sound cards.
1498
1499This module supports multiple cards.
1500Note: One miXart8 board will be represented as 4 alsa cards.
1501See MIXART.txt for details.
1502
1503When the driver is compiled as a module and the hotplug firmware
1504is supported, the firmware data is loaded via hotplug automatically.
1505Install the necessary firmware files in alsa-firmware package.
1506When no hotplug fw loader is available, you need to load the
1507firmware via mixartloader utility in alsa-tools package.
1508
1509Module snd-mona
1510---------------
1511
1512Module for Echoaudio Mona
1513
1514This module supports multiple cards.
1515The driver requires the firmware loader support on kernel.
1516
1517Module snd-mpu401
1518-----------------
1519
1520Module for MPU-401 UART devices.
1521
1522port
1523 port number or -1 (disable)
1524irq
1525 IRQ number or -1 (disable)
1526pnp
1527 PnP detection - 0 = disable, 1 = enable (default)
1528
1529This module supports multiple devices and PnP.
1530
1531Module snd-msnd-classic
1532-----------------------
1533
1534Module for Turtle Beach MultiSound Classic, Tahiti or Monterey
1535soundcards.
1536
1537io
1538 Port # for msnd-classic card
1539irq
1540 IRQ # for msnd-classic card
1541mem
1542 Memory address (0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000)
1543write_ndelay
1544 enable write ndelay (default = 1)
1545calibrate_signal
1546 calibrate signal (default = 0)
1547isapnp
1548 ISA PnP detection - 0 = disable, 1 = enable (default)
1549digital
1550 Digital daughterboard present (default = 0)
1551cfg
1552 Config port (0x250, 0x260 or 0x270) default = PnP
1553reset
1554 Reset all devices
1555mpu_io
1556 MPU401 I/O port
1557mpu_irq
1558 MPU401 irq#
1559ide_io0
1560 IDE port #0
1561ide_io1
1562 IDE port #1
1563ide_irq
1564 IDE irq#
1565joystick_io
1566 Joystick I/O port
1567
1568The driver requires firmware files ``turtlebeach/msndinit.bin`` and
1569``turtlebeach/msndperm.bin`` in the proper firmware directory.
1570
1571See Documentation/sound/oss/MultiSound for important information
1572about this driver. Note that it has been discontinued, but the
1573Voyetra Turtle Beach knowledge base entry for it is still available
1574at
1575http://www.turtlebeach.com
1576
1577Module snd-msnd-pinnacle
1578------------------------
1579
1580Module for Turtle Beach MultiSound Pinnacle/Fiji soundcards.
1581
1582io
1583 Port # for pinnacle/fiji card
1584irq
1585 IRQ # for pinnalce/fiji card
1586mem
1587 Memory address (0xb0000, 0xc8000, 0xd0000, 0xd8000, 0xe0000 or 0xe8000)
1588write_ndelay
1589 enable write ndelay (default = 1)
1590calibrate_signal
1591 calibrate signal (default = 0)
1592isapnp
1593 ISA PnP detection - 0 = disable, 1 = enable (default)
1594
1595The driver requires firmware files ``turtlebeach/pndspini.bin`` and
1596``turtlebeach/pndsperm.bin`` in the proper firmware directory.
1597
1598Module snd-mtpav
1599----------------
1600
1601Module for MOTU MidiTimePiece AV multiport MIDI (on the parallel
1602port).
1603
1604port
1605 I/O port # for MTPAV (0x378,0x278, default=0x378)
1606irq
1607 IRQ # for MTPAV (7,5, default=7)
1608hwports
1609 number of supported hardware ports, default=8.
1610
1611Module supports only 1 card. This module has no enable option.
1612
1613Module snd-mts64
1614----------------
1615
1616Module for Ego Systems (ESI) Miditerminal 4140
1617
1618This module supports multiple devices.
1619Requires parport (``CONFIG_PARPORT``).
1620
1621Module snd-nm256
1622----------------
1623
1624Module for NeoMagic NM256AV/ZX chips
1625
1626playback_bufsize
1627 max playback frame size in kB (4-128kB)
1628capture_bufsize
1629 max capture frame size in kB (4-128kB)
1630force_ac97
1631 0 or 1 (disabled by default)
1632buffer_top
1633 specify buffer top address
1634use_cache
1635 0 or 1 (disabled by default)
1636vaio_hack
1637 alias buffer_top=0x25a800
1638reset_workaround
1639 enable AC97 RESET workaround for some laptops
1640reset_workaround2
1641 enable extended AC97 RESET workaround for some other laptops
1642
1643This module supports one chip and autoprobe.
1644
1645The power-management is supported.
1646
1647Note: on some notebooks the buffer address cannot be detected
1648automatically, or causes hang-up during initialization.
1649In such a case, specify the buffer top address explicitly via
1650the buffer_top option.
1651For example,
1652Sony F250: buffer_top=0x25a800
1653Sony F270: buffer_top=0x272800
1654The driver supports only ac97 codec. It's possible to force
1655to initialize/use ac97 although it's not detected. In such a
1656case, use ``force_ac97=1`` option - but *NO* guarantee whether it
1657works!
1658
1659Note: The NM256 chip can be linked internally with non-AC97
1660codecs. This driver supports only the AC97 codec, and won't work
1661with machines with other (most likely CS423x or OPL3SAx) chips,
1662even though the device is detected in lspci. In such a case, try
1663other drivers, e.g. snd-cs4232 or snd-opl3sa2. Some has ISA-PnP
1664but some doesn't have ISA PnP. You'll need to specify ``isapnp=0``
1665and proper hardware parameters in the case without ISA PnP.
1666
1667Note: some laptops need a workaround for AC97 RESET. For the
1668known hardware like Dell Latitude LS and Sony PCG-F305, this
1669workaround is enabled automatically. For other laptops with a
1670hard freeze, you can try ``reset_workaround=1`` option.
1671
1672Note: Dell Latitude CSx laptops have another problem regarding
1673AC97 RESET. On these laptops, reset_workaround2 option is
1674turned on as default. This option is worth to try if the
1675previous reset_workaround option doesn't help.
1676
1677Note: This driver is really crappy. It's a porting from the
1678OSS driver, which is a result of black-magic reverse engineering.
1679The detection of codec will fail if the driver is loaded *after*
1680X-server as described above. You might be able to force to load
1681the module, but it may result in hang-up. Hence, make sure that
1682you load this module *before* X if you encounter this kind of
1683problem.
1684
1685Module snd-opl3sa2
1686------------------
1687
1688Module for Yamaha OPL3-SA2/SA3 sound cards.
1689
1690isapnp
1691 ISA PnP detection - 0 = disable, 1 = enable (default)
1692
1693with ``isapnp=0``, the following options are available:
1694
1695port
1696 control port # for OPL3-SA chip (0x370)
1697sb_port
1698 SB port # for OPL3-SA chip (0x220,0x240)
1699wss_port
1700 WSS port # for OPL3-SA chip (0x530,0xe80,0xf40,0x604)
1701midi_port
1702 port # for MPU-401 UART (0x300,0x330), -1 = disable
1703fm_port
1704 FM port # for OPL3-SA chip (0x388), -1 = disable
1705irq
1706 IRQ # for OPL3-SA chip (5,7,9,10)
1707dma1
1708 first DMA # for Yamaha OPL3-SA chip (0,1,3)
1709dma2
1710 second DMA # for Yamaha OPL3-SA chip (0,1,3), -1 = disable
1711
1712This module supports multiple cards and ISA PnP. It does not support
1713autoprobe (if ISA PnP is not used) thus all ports must be specified!!!
1714
1715The power-management is supported.
1716
1717Module snd-opti92x-ad1848
1718-------------------------
1719
1720Module for sound cards based on OPTi 82c92x and Analog Devices AD1848 chips.
1721Module works with OAK Mozart cards as well.
1722
1723isapnp
1724 ISA PnP detection - 0 = disable, 1 = enable (default)
1725
1726with ``isapnp=0``, the following options are available:
1727
1728port
1729 port # for WSS chip (0x530,0xe80,0xf40,0x604)
1730mpu_port
1731 port # for MPU-401 UART (0x300,0x310,0x320,0x330)
1732fm_port
1733 port # for OPL3 device (0x388)
1734irq
1735 IRQ # for WSS chip (5,7,9,10,11)
1736mpu_irq
1737 IRQ # for MPU-401 UART (5,7,9,10)
1738dma1
1739 first DMA # for WSS chip (0,1,3)
1740
1741This module supports only one card, autoprobe and PnP.
1742
1743Module snd-opti92x-cs4231
1744-------------------------
1745
1746Module for sound cards based on OPTi 82c92x and Crystal CS4231 chips.
1747
1748isapnp
1749 ISA PnP detection - 0 = disable, 1 = enable (default)
1750
1751with ``isapnp=0``, the following options are available:
1752
1753port
1754 port # for WSS chip (0x530,0xe80,0xf40,0x604)
1755mpu_port
1756 port # for MPU-401 UART (0x300,0x310,0x320,0x330)
1757fm_port
1758 port # for OPL3 device (0x388)
1759irq
1760 IRQ # for WSS chip (5,7,9,10,11)
1761mpu_irq
1762 IRQ # for MPU-401 UART (5,7,9,10)
1763dma1
1764 first DMA # for WSS chip (0,1,3)
1765dma2
1766 second DMA # for WSS chip (0,1,3)
1767
1768This module supports only one card, autoprobe and PnP.
1769
1770Module snd-opti93x
1771------------------
1772
1773Module for sound cards based on OPTi 82c93x chips.
1774
1775isapnp
1776 ISA PnP detection - 0 = disable, 1 = enable (default)
1777
1778with ``isapnp=0``, the following options are available:
1779
1780port
1781 port # for WSS chip (0x530,0xe80,0xf40,0x604)
1782mpu_port
1783 port # for MPU-401 UART (0x300,0x310,0x320,0x330)
1784fm_port
1785 port # for OPL3 device (0x388)
1786irq
1787 IRQ # for WSS chip (5,7,9,10,11)
1788mpu_irq
1789 IRQ # for MPU-401 UART (5,7,9,10)
1790dma1
1791 first DMA # for WSS chip (0,1,3)
1792dma2
1793 second DMA # for WSS chip (0,1,3)
1794
1795This module supports only one card, autoprobe and PnP.
1796
1797Module snd-oxygen
1798-----------------
1799
1800Module 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
1816This module supports autoprobe and multiple cards.
1817
1818Module snd-pcsp
1819---------------
1820
1821Module for internal PC-Speaker.
1822
1823nopcm
1824 Disable PC-Speaker PCM sound. Only beeps remain.
1825nforce_wa
1826 enable NForce chipset workaround. Expect bad sound.
1827
1828This module supports system beeps, some kind of PCM playback and
1829even a few mixer controls.
1830
1831Module snd-pcxhr
1832----------------
1833
1834Module for Digigram PCXHR boards
1835
1836This module supports multiple cards.
1837
1838Module snd-portman2x4
1839---------------------
1840
1841Module for Midiman Portman 2x4 parallel port MIDI interface
1842
1843This module supports multiple cards.
1844
1845Module snd-powermac (on ppc only)
1846---------------------------------
1847
1848Module for PowerMac, iMac and iBook on-board soundchips
1849
1850enable_beep
1851 enable beep using PCM (enabled as default)
1852
1853Module supports autoprobe a chip.
1854
1855Note: the driver may have problems regarding endianness.
1856
1857The power-management is supported.
1858
1859Module snd-pxa2xx-ac97 (on arm only)
1860------------------------------------
1861
1862Module for AC97 driver for the Intel PXA2xx chip
1863
1864For ARM architecture only.
1865
1866The power-management is supported.
1867
1868Module snd-riptide
1869------------------
1870
1871Module for Conexant Riptide chip
1872
1873joystick_port
1874 Joystick port # (default: 0x200)
1875mpu_port
1876 MPU401 port # (default: 0x330)
1877opl3_port
1878 OPL3 port # (default: 0x388)
1879
1880This module supports multiple cards.
1881The driver requires the firmware loader support on kernel.
1882You need to install the firmware file ``riptide.hex`` to the standard
1883firmware path (e.g. /lib/firmware).
1884
1885Module snd-rme32
1886----------------
1887
1888Module for RME Digi32, Digi32 Pro and Digi32/8 (Sek'd Prodif32,
1889Prodif96 and Prodif Gold) sound cards.
1890
1891This module supports multiple cards.
1892
1893Module snd-rme96
1894----------------
1895
1896Module for RME Digi96, Digi96/8 and Digi96/8 PRO/PAD/PST sound cards.
1897
1898This module supports multiple cards.
1899
1900Module snd-rme9652
1901------------------
1902
1903Module for RME Digi9652 (Hammerfall, Hammerfall-Light) sound cards.
1904
1905precise_ptr
1906 Enable precise pointer (doesn't work reliably). (default = 0)
1907
1908This module supports multiple cards.
1909
1910Note: snd-page-alloc module does the job which snd-hammerfall-mem
1911module did formerly. It will allocate the buffers in advance
1912when any RME9652 cards are found. To make the buffer
1913allocation sure, load snd-page-alloc module in the early
1914stage of boot sequence. See `Early Buffer Allocation`_
1915section.
1916
1917Module snd-sa11xx-uda1341 (on arm only)
1918---------------------------------------
1919
1920Module for Philips UDA1341TS on Compaq iPAQ H3600 sound card.
1921
1922Module supports only one card.
1923Module has no enable and index options.
1924
1925The power-management is supported.
1926
1927Module snd-sb8
1928--------------
1929
1930Module for 8-bit SoundBlaster cards: SoundBlaster 1.0, SoundBlaster 2.0,
1931SoundBlaster Pro
1932
1933port
1934 port # for SB DSP chip (0x220,0x240,0x260)
1935irq
1936 IRQ # for SB DSP chip (5,7,9,10)
1937dma8
1938 DMA # for SB DSP chip (1,3)
1939
1940This module supports multiple cards and autoprobe.
1941
1942The power-management is supported.
1943
1944Module snd-sb16 and snd-sbawe
1945-----------------------------
1946
1947Module for 16-bit SoundBlaster cards: SoundBlaster 16 (PnP),
1948SoundBlaster AWE 32 (PnP), SoundBlaster AWE 64 PnP
1949
1950mic_agc
1951 Mic Auto-Gain-Control - 0 = disable, 1 = enable (default)
1952csp
1953 ASP/CSP chip support - 0 = disable (default), 1 = enable
1954isapnp
1955 ISA PnP detection - 0 = disable, 1 = enable (default)
1956
1957with isapnp=0, the following options are available:
1958
1959port
1960 port # for SB DSP 4.x chip (0x220,0x240,0x260)
1961mpu_port
1962 port # for MPU-401 UART (0x300,0x330), -1 = disable
1963awe_port
1964 base port # for EMU8000 synthesizer (0x620,0x640,0x660) (snd-sbawe
1965 module only)
1966irq
1967 IRQ # for SB DSP 4.x chip (5,7,9,10)
1968dma8
1969 8-bit DMA # for SB DSP 4.x chip (0,1,3)
1970dma16
1971 16-bit DMA # for SB DSP 4.x chip (5,6,7)
1972
1973This module supports multiple cards, autoprobe and ISA PnP.
1974
1975Note: To use Vibra16X cards in 16-bit half duplex mode, you must
1976disable 16bit DMA with dma16 = -1 module parameter.
1977Also, all Sound Blaster 16 type cards can operate in 16-bit
1978half duplex mode through 8-bit DMA channel by disabling their
197916-bit DMA channel.
1980
1981The power-management is supported.
1982
1983Module snd-sc6000
1984-----------------
1985
1986Module for Gallant SC-6000 soundcard and later models: SC-6600 and
1987SC-7000.
1988
1989port
1990 Port # (0x220 or 0x240)
1991mss_port
1992 MSS Port # (0x530 or 0xe80)
1993irq
1994 IRQ # (5,7,9,10,11)
1995mpu_irq
1996 MPU-401 IRQ # (5,7,9,10) ,0 - no MPU-401 irq
1997dma
1998 DMA # (1,3,0)
1999joystick
2000 Enable gameport - 0 = disable (default), 1 = enable
2001
2002This module supports multiple cards.
2003
2004This card is also known as Audio Excel DSP 16 or Zoltrix AV302.
2005
2006Module snd-sscape
2007-----------------
2008
2009Module for ENSONIQ SoundScape cards.
2010
2011port
2012 Port # (PnP setup)
2013wss_port
2014 WSS Port # (PnP setup)
2015irq
2016 IRQ # (PnP setup)
2017mpu_irq
2018 MPU-401 IRQ # (PnP setup)
2019dma
2020 DMA # (PnP setup)
2021dma2
2022 2nd DMA # (PnP setup, -1 to disable)
2023joystick
2024 Enable gameport - 0 = disable (default), 1 = enable
2025
2026This module supports multiple cards.
2027
2028The driver requires the firmware loader support on kernel.
2029
2030Module snd-sun-amd7930 (on sparc only)
2031--------------------------------------
2032
2033Module for AMD7930 sound chips found on Sparcs.
2034
2035This module supports multiple cards.
2036
2037Module snd-sun-cs4231 (on sparc only)
2038-------------------------------------
2039
2040Module for CS4231 sound chips found on Sparcs.
2041
2042This module supports multiple cards.
2043
2044Module snd-sun-dbri (on sparc only)
2045-----------------------------------
2046
2047Module for DBRI sound chips found on Sparcs.
2048
2049This module supports multiple cards.
2050
2051Module snd-wavefront
2052--------------------
2053
2054Module for Turtle Beach Maui, Tropez and Tropez+ sound cards.
2055
2056use_cs4232_midi
2057 Use CS4232 MPU-401 interface
2058 (inaccessibly located inside your computer)
2059isapnp
2060 ISA PnP detection - 0 = disable, 1 = enable (default)
2061
2062with isapnp=0, the following options are available:
2063
2064cs4232_pcm_port
2065 Port # for CS4232 PCM interface.
2066cs4232_pcm_irq
2067 IRQ # for CS4232 PCM interface (5,7,9,11,12,15).
2068cs4232_mpu_port
2069 Port # for CS4232 MPU-401 interface.
2070cs4232_mpu_irq
2071 IRQ # for CS4232 MPU-401 interface (9,11,12,15).
2072ics2115_port
2073 Port # for ICS2115
2074ics2115_irq
2075 IRQ # for ICS2115
2076fm_port
2077 FM OPL-3 Port #
2078dma1
2079 DMA1 # for CS4232 PCM interface.
2080dma2
2081 DMA2 # for CS4232 PCM interface.
2082
2083The below are options for wavefront_synth features:
2084
2085wf_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.
2089fx_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.
2095debug_default
2096 Debug parameters for card initialization
2097wait_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.
2108sleep_interval
2109 How long to sleep when waiting for reply (default: 100)
2110sleep_tries
2111 How many times to try sleeping during a wait (default: 50)
2112ospath
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.
2118reset_time
2119 How long to wait for a reset to take effect (default:2)
2120ramcheck_time
2121 How many seconds to wait for the RAM test (default:20)
2122osrun_time
2123 How many seconds to wait for the ICS2115 OS (default:10)
2124
2125This module supports multiple cards and ISA PnP.
2126
2127Note: the firmware file ``wavefront.os`` was located in the earlier
2128version in /etc. Now it's loaded via firmware loader, and
2129must be in the proper firmware path, such as /lib/firmware.
2130Copy (or symlink) the file appropriately if you get an error
2131regarding firmware downloading after upgrading the kernel.
2132
2133Module snd-sonicvibes
2134---------------------
2135
2136Module for S3 SonicVibes PCI sound cards.
2137* PINE Schubert 32 PCI
2138
2139reverb
2140 Reverb Enable - 1 = enable, 0 = disable (default);
2141 SoundCard must have onboard SRAM for this.
2142mge
2143 Mic Gain Enable - 1 = enable, 0 = disable (default)
2144
2145This module supports multiple cards and autoprobe.
2146
2147Module snd-serial-u16550
2148------------------------
2149
2150Module for UART16550A serial MIDI ports.
2151
2152port
2153 port # for UART16550A chip
2154irq
2155 IRQ # for UART16550A chip, -1 = poll mode
2156speed
2157 speed in bauds (9600,19200,38400,57600,115200)
2158 38400 = default
2159base
2160 base for divisor in bauds (57600,115200,230400,460800)
2161 115200 = default
2162outs
2163 number of MIDI ports in a serial port (1-4)
2164 1 = default
2165adaptor
2166 Type of adaptor.
2167 0 = Soundcanvas, 1 = MS-124T, 2 = MS-124W S/A,
2168 3 = MS-124W M/B, 4 = Generic
2169
2170This module supports multiple cards. This module does not support autoprobe
2171thus the main port must be specified!!! Other options are optional.
2172
2173Module snd-trident
2174------------------
2175
2176Module 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
2188pcm_channels
2189 max channels (voices) reserved for PCM
2190wavetable_size
2191 max wavetable size in kB (4-?kb)
2192
2193This module supports multiple cards and autoprobe.
2194
2195The power-management is supported.
2196
2197Module snd-ua101
2198----------------
2199
2200Module for the Edirol UA-101/UA-1000 audio/MIDI interfaces.
2201
2202This module supports multiple devices, autoprobe and hotplugging.
2203
2204Module snd-usb-audio
2205--------------------
2206
2207Module for USB audio and USB MIDI devices.
2208
2209vid
2210 Vendor ID for the device (optional)
2211pid
2212 Product ID for the device (optional)
2213nrpacks
2214 Max. number of packets per URB (default: 8)
2215device_setup
2216 Device specific magic number (optional);
2217 Influence depends on the device
2218 Default: 0x0000
2219ignore_ctl_error
2220 Ignore any USB-controller regarding mixer interface (default: no)
2221autoclock
2222 Enable auto-clock selection for UAC2 devices (default: yes)
2223quirk_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
2228This module supports multiple devices, autoprobe and hotplugging.
2229
2230NB: ``nrpacks`` parameter can be modified dynamically via sysfs.
2231Don't put the value over 20. Changing via sysfs has no sanity
2232check.
2233
2234NB: ``ignore_ctl_error=1`` may help when you get an error at accessing
2235the mixer element such as URB error -22. This happens on some
2236buggy USB device or the controller.
2237
2238NB: quirk_alias option is provided only for testing / development.
2239If you want to have a proper support, contact to upstream for
2240adding the matching quirk in the driver code statically.
2241
2242Module snd-usb-caiaq
2243--------------------
2244
2245Module 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
2252This module supports multiple devices, autoprobe and hotplugging.
2253
2254Module snd-usb-usx2y
2255--------------------
2256
2257Module for Tascam USB US-122, US-224 and US-428 devices.
2258
2259This module supports multiple devices, autoprobe and hotplugging.
2260
2261Note: you need to load the firmware via ``usx2yloader`` utility included
2262in alsa-tools and alsa-firmware packages.
2263
2264Module snd-via82xx
2265------------------
2266
2267Module for AC'97 motherboards based on VIA 82C686A/686B, 8233, 8233A,
22688233C, 8235, 8237 (south) bridge.
2269
2270mpu_port
2271 0x300,0x310,0x320,0x330, otherwise obtain BIOS setup
2272 [VIA686A/686B only]
2273joystick
2274 Enable joystick (default off) [VIA686A/686B only]
2275ac97_clock
2276 AC'97 codec clock base (default 48000Hz)
2277dxs_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]
2281ac97_quirk
2282 AC'97 workaround for strange hardware;
2283 See `AC97 Quirk Option`_ section below.
2284
2285This module supports one chip and autoprobe.
2286
2287Note: on some SMP motherboards like MSI 694D the interrupts might
2288not be generated properly. In such a case, please try to
2289set the SMP (or MPS) version on BIOS to 1.1 instead of
2290default value 1.4. Then the interrupt number will be
2291assigned under 15. You might also upgrade your BIOS.
2292
2293Note: VIA8233/5/7 (not VIA8233A) can support DXS (direct sound)
2294channels as the first PCM. On these channels, up to 4
2295streams can be played at the same time, and the controller
2296can perform sample rate conversion with separate rates for
2297each channel.
2298As default (``dxs_support = 0``), 48k fixed rate is chosen
2299except for the known devices since the output is often
2300noisy except for 48k on some mother boards due to the
2301bug of BIOS.
2302Please try once ``dxs_support=5`` and if it works on other
2303sample rates (e.g. 44.1kHz of mp3 playback), please let us
2304know the PCI subsystem vendor/device id's (output of
2305``lspci -nv``).
2306If ``dxs_support=5`` does not work, try ``dxs_support=4``; if it
2307doesn't work too, try dxs_support=1. (dxs_support=1 is
2308usually for old motherboards. The correct implemented
2309board should work with 4 or 5.) If it still doesn't
2310work and the default setting is ok, ``dxs_support=3`` is the
2311right choice. If the default setting doesn't work at all,
2312try ``dxs_support=2`` to disable the DXS channels.
2313In any cases, please let us know the result and the
2314subsystem vendor/device ids. See `Links and Addresses`_
2315below.
2316
2317Note: for the MPU401 on VIA823x, use snd-mpu401 driver
2318additionally. The mpu_port option is for VIA686 chips only.
2319
2320The power-management is supported.
2321
2322Module snd-via82xx-modem
2323------------------------
2324
2325Module for VIA82xx AC97 modem
2326
2327ac97_clock
2328 AC'97 codec clock base (default 48000Hz)
2329
2330This module supports one card and autoprobe.
2331
2332Note: The default index value of this module is -2, i.e. the first
2333slot is excluded.
2334
2335The power-management is supported.
2336
2337Module snd-virmidi
2338------------------
2339
2340Module for virtual rawmidi devices.
2341This module creates virtual rawmidi devices which communicate
2342to the corresponding ALSA sequencer ports.
2343
2344midi_devs
2345 MIDI devices # (1-4, default=4)
2346
2347This module supports multiple cards.
2348
2349Module snd-virtuoso
2350-------------------
2351
2352Module for sound cards based on the Asus AV66/AV100/AV200 chips,
2353i.e., Xonar D1, DX, D2, D2X, DS, DSX, Essence ST (Deluxe),
2354Essence STX (II), HDAV1.3 (Deluxe), and HDAV1.3 Slim.
2355
2356This module supports autoprobe and multiple cards.
2357
2358Module snd-vx222
2359----------------
2360
2361Module for Digigram VX-Pocket VX222, V222 v2 and Mic cards.
2362
2363mic
2364 Enable Microphone on V222 Mic (NYI)
2365ibl
2366 Capture IBL size. (default = 0, minimum size)
2367
2368This module supports multiple cards.
2369
2370When the driver is compiled as a module and the hotplug firmware
2371is supported, the firmware data is loaded via hotplug automatically.
2372Install the necessary firmware files in alsa-firmware package.
2373When no hotplug fw loader is available, you need to load the
2374firmware via vxloader utility in alsa-tools package. To invoke
2375vxloader 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.)
2384IBL size defines the interrupts period for PCM. The smaller size
2385gives smaller latency but leads to more CPU consumption, too.
2386The size is usually aligned to 126. As default (=0), the smallest
2387size is chosen. The possible IBL values can be found in
2388/proc/asound/cardX/vx-status proc file.
2389
2390The power-management is supported.
2391
2392Module snd-vxpocket
2393-------------------
2394
2395Module for Digigram VX-Pocket VX2 and 440 PCMCIA cards.
2396
2397ibl
2398 Capture IBL size. (default = 0, minimum size)
2399
2400This module supports multiple cards. The module is compiled only when
2401PCMCIA is supported on kernel.
2402
2403With the older 2.6.x kernel, to activate the driver via the card
2404manager, you'll need to set up /etc/pcmcia/vxpocket.conf. See the
2405sound/pcmcia/vx/vxpocket.c. 2.6.13 or later kernel requires no
2406longer require a config file.
2407
2408When the driver is compiled as a module and the hotplug firmware
2409is supported, the firmware data is loaded via hotplug automatically.
2410Install the necessary firmware files in alsa-firmware package.
2411When no hotplug fw loader is available, you need to load the
2412firmware via vxloader utility in alsa-tools package.
2413
2414About capture IBL, see the description of snd-vx222 module.
2415
2416Note: snd-vxp440 driver is merged to snd-vxpocket driver since
2417ALSA 1.0.10.
2418
2419The power-management is supported.
2420
2421Module snd-ymfpci
2422-----------------
2423
2424Module for Yamaha PCI chips (YMF72x, YMF74x & YMF75x).
2425
2426mpu_port
2427 0x300,0x330,0x332,0x334, 0 (disable) by default,
2428 1 (auto-detect for YMF744/754 only)
2429fm_port
2430 0x388,0x398,0x3a0,0x3a8, 0 (disable) by default
2431 1 (auto-detect for YMF744/754 only)
2432joystick_port
2433 0x201,0x202,0x204,0x205, 0 (disable) by default,
2434 1 (auto-detect)
2435rear_switch
2436 enable shared rear/line-in switch (bool)
2437
2438This module supports autoprobe and multiple chips.
2439
2440The power-management is supported.
2441
2442Module snd-pdaudiocf
2443--------------------
2444
2445Module for Sound Core PDAudioCF sound card.
2446
2447The power-management is supported.
2448
2449
2450AC97 Quirk Option
2451=================
2452
2453The ac97_quirk option is used to enable/override the workaround for
2454specific devices on drivers for on-board AC'97 controllers like
2455snd-intel8x0. Some hardware have swapped output pins between Master
2456and Headphone, or Surround (thanks to confusion of AC'97
2457specifications from version to version :-)
2458
2459The driver provides the auto-detection of known problematic devices,
2460but some might be unknown or wrongly detected. In such a case, pass
2461the proper value with this option.
2462
2463The following strings are accepted:
2464
2465default
2466 Don't override the default setting
2467none
2468 Disable the quirk
2469hp_only
2470 Bind Master and Headphone controls as a single control
2471swap_hp
2472 Swap headphone and master controls
2473swap_surround
2474 Swap master and surround controls
2475ad_sharing
2476 For AD1985, turn on OMS bit and use headphone
2477alc_jack
2478 For ALC65x, turn on the jack sense mode
2479inv_eapd
2480 Inverted EAPD implementation
2481mute_led
2482 Bind EAPD bit for turning on/off mute LED
2483
2484For backward compatibility, the corresponding integer value -1, 0, ...
2485are accepted, too.
2486
2487For example, if ``Master`` volume control has no effect on your device
2488but only ``Headphone`` does, pass ac97_quirk=hp_only module option.
2489
2490
2491Configuring Non-ISAPNP Cards
2492============================
2493
2494When the kernel is configured with ISA-PnP support, the modules
2495supporting the isapnp cards will have module options ``isapnp``.
2496If this option is set, *only* the ISA-PnP devices will be probed.
2497For probing the non ISA-PnP cards, you have to pass ``isapnp=0`` option
2498together with the proper i/o and irq configuration.
2499
2500When the kernel is configured without ISA-PnP support, isapnp option
2501will be not built in.
2502
2503
2504Module Autoloading Support
2505==========================
2506
2507The ALSA drivers can be loaded automatically on demand by defining
2508module aliases. The string ``snd-card-%1`` is requested for ALSA native
2509devices where ``%i`` is sound card number from zero to seven.
2510
2511To auto-load an ALSA driver for OSS services, define the string
2512``sound-slot-%i`` where ``%i`` means the slot number for OSS, which
2513corresponds to the card index of ALSA. Usually, define this
2514as the same card module.
2515
2516An 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
2524The available number of auto-loaded sound cards depends on the module
2525option ``cards_limit`` of snd module. As default it's set to 1.
2526To enable the auto-loading of multiple cards, specify the number of
2527sound cards in that option.
2528
2529When multiple cards are available, it'd better to specify the index
2530number for each card via module option, too, so that the order of
2531cards is kept consistent.
2532
2533An 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
2548In this example, the interwave card is always loaded as the first card
2549(index 0) and ens1371 as the second (index 1).
2550
2551Alternative (and new) way to fixate the slot assignment is to use
2552``slots`` option of snd module. In the case above, specify like the
2553following:
2554::
2555
2556 options snd slots=snd-interwave,snd-ens1371
2557
2558Then, the first slot (#0) is reserved for snd-interwave driver, and
2559the second (#1) for snd-ens1371. You can omit index option in each
2560driver if slots option is used (although you can still have them at
2561the same time as long as they don't conflict).
2562
2563The slots option is especially useful for avoiding the possible
2564hot-plugging and the resultant slot conflict. For example, in the
2565case above again, the first two slots are already reserved. If any
2566other driver (e.g. snd-usb-audio) is loaded before snd-interwave or
2567snd-ens1371, it will be assigned to the third or later slot.
2568
2569When a module name is given with '!', the slot will be given for any
2570modules but that name. For example, ``slots=!snd-pcsp`` will reserve
2571the first slot for any modules but snd-pcsp.
2572
2573
2574ALSA 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
2588The first number from ``/dev/snd/pcmC{X}D{Y}[c|p]`` expression means
2589sound card number and second means device number. The ALSA devices
2590have either ``c`` or ``p`` suffix indicating the direction, capture and
2591playback, respectively.
2592
2593Please note that the device mapping above may be varied via the module
2594options of snd-pcm-oss module.
2595
2596
2597Proc interfaces (/proc/asound)
2598==============================
2599
2600/proc/asound/card#/pcm#[cp]/oss
2601-------------------------------
2602erase
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
2635Example:
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
2643Early Buffer Allocation
2644=======================
2645
2646Some drivers (e.g. hdsp) require the large contiguous buffers, and
2647sometimes it's too late to find such spaces when the driver module is
2648actually loaded due to memory fragmentation. You can pre-allocate the
2649PCM buffers by loading snd-page-alloc module and write commands to its
2650proc file in prior, for example, in the early boot stage like
2651``/etc/init.d/*.local`` scripts.
2652
2653Reading the proc file /proc/drivers/snd-page-alloc shows the current
2654usage of page allocation. In writing, you can send the following
2655commands to the snd-page-alloc driver:
2656
2657* add VENDOR DEVICE MASK SIZE BUFFERS
2658
2659VENDOR and DEVICE are PCI vendor and device IDs. They take
2660integer numbers (0x prefix is needed for the hex).
2661MASK is the PCI DMA mask. Pass 0 if not restricted.
2662SIZE is the size of each buffer to allocate. You can pass
2663k and m suffix for KB and MB. The max number is 16MB.
2664BUFFERS is the number of buffers to allocate. It must be greater
2665than 0. The max number is 4.
2666
2667* erase
2668
2669This will erase the all pre-allocated buffers which are not in
2670use.
2671
2672
2673Links and Addresses
2674===================
2675
2676ALSA project homepage
2677 http://www.alsa-project.org
2678Kernel Bugzilla
2679 http://bugzilla.kernel.org/
2680ALSA Developers ML
2681 mailto:alsa-devel@alsa-project.org
2682alsa-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
7Kernel Configuration
8====================
9
10To enable ALSA support you need at least to build the kernel with
11primary sound card support (CONFIG_SOUND). Since ALSA can emulate OSS,
12you don't have to choose any of the OSS modules.
13
14Enable "OSS API emulation" (CONFIG_SND_OSSEMUL) and both OSS mixer and
15PCM supports if you want to run OSS applications with ALSA.
16
17If you want to support the WaveTable functionality on cards such as
18SB Live! then you need to enable "Sequencer support"
19(CONFIG_SND_SEQUENCER).
20
21To make ALSA debug messages more verbose, enable the "Verbose printk"
22and "Debug" options. To check for memory leaks, turn on "Debug memory"
23too. "Debug detection" will add checks for the detection of cards.
24
25Please 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
27using isapnptools.
28
29
30Creating ALSA devices
31=====================
32
33This depends on your distribution, but normally you use the /dev/MAKEDEV
34script to create the necessary device nodes. On some systems you use a
35script named 'snddevices'.
36
37
38Module parameters
39=================
40
41The user can load modules with options. If the module supports more than
42one card and you have more than one card of the same type then you can
43specify multiple values for the option separated by commas.
44
45Prior 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
2125AC97 Quirk Option
2126=================
2127
2128The ac97_quirk option is used to enable/override the workaround for
2129specific devices on drivers for on-board AC'97 controllers like
2130snd-intel8x0. Some hardware have swapped output pins between Master
2131and Headphone, or Surround (thanks to confusion of AC'97
2132specifications from version to version :-)
2133
2134The driver provides the auto-detection of known problematic devices,
2135but some might be unknown or wrongly detected. In such a case, pass
2136the proper value with this option.
2137
2138The 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
2149For backward compatibility, the corresponding integer value -1, 0,
2150... are accepted, too.
2151
2152For example, if "Master" volume control has no effect on your device
2153but only "Headphone" does, pass ac97_quirk=hp_only module option.
2154
2155
2156Configuring Non-ISAPNP Cards
2157============================
2158
2159When the kernel is configured with ISA-PnP support, the modules
2160supporting the isapnp cards will have module options "isapnp".
2161If this option is set, *only* the ISA-PnP devices will be probed.
2162For probing the non ISA-PnP cards, you have to pass "isapnp=0" option
2163together with the proper i/o and irq configuration.
2164
2165When the kernel is configured without ISA-PnP support, isapnp option
2166will be not built in.
2167
2168
2169Module Autoloading Support
2170==========================
2171
2172The ALSA drivers can be loaded automatically on demand by defining
2173module aliases. The string 'snd-card-%1' is requested for ALSA native
2174devices where %i is sound card number from zero to seven.
2175
2176To auto-load an ALSA driver for OSS services, define the string
2177'sound-slot-%i' where %i means the slot number for OSS, which
2178corresponds to the card index of ALSA. Usually, define this
2179as the same card module.
2180
2181An example configuration for a single emu10k1 card is like below:
2182----- /etc/modprobe.d/alsa.conf
2183alias snd-card-0 snd-emu10k1
2184alias sound-slot-0 snd-emu10k1
2185----- /etc/modprobe.d/alsa.conf
2186
2187The available number of auto-loaded sound cards depends on the module
2188option "cards_limit" of snd module. As default it's set to 1.
2189To enable the auto-loading of multiple cards, specify the number of
2190sound cards in that option.
2191
2192When multiple cards are available, it'd better to specify the index
2193number for each card via module option, too, so that the order of
2194cards is kept consistent.
2195
2196An example configuration for two sound cards is like below:
2197
2198----- /etc/modprobe.d/alsa.conf
2199# ALSA portion
2200options snd cards_limit=2
2201alias snd-card-0 snd-interwave
2202alias snd-card-1 snd-ens1371
2203options snd-interwave index=0
2204options snd-ens1371 index=1
2205# OSS/Free portion
2206alias sound-slot-0 snd-interwave
2207alias sound-slot-1 snd-ens1371
2208----- /etc/modprobe.d/alsa.conf
2209
2210In this example, the interwave card is always loaded as the first card
2211(index 0) and ens1371 as the second (index 1).
2212
2213Alternative (and new) way to fixate the slot assignment is to use
2214"slots" option of snd module. In the case above, specify like the
2215following:
2216
2217options snd slots=snd-interwave,snd-ens1371
2218
2219Then, the first slot (#0) is reserved for snd-interwave driver, and
2220the second (#1) for snd-ens1371. You can omit index option in each
2221driver if slots option is used (although you can still have them at
2222the same time as long as they don't conflict).
2223
2224The slots option is especially useful for avoiding the possible
2225hot-plugging and the resultant slot conflict. For example, in the
2226case above again, the first two slots are already reserved. If any
2227other driver (e.g. snd-usb-audio) is loaded before snd-interwave or
2228snd-ens1371, it will be assigned to the third or later slot.
2229
2230When a module name is given with '!', the slot will be given for any
2231modules but that name. For example, "slots=!snd-pcsp" will reserve
2232the first slot for any modules but snd-pcsp.
2233
2234
2235ALSA 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
2248The first number from /dev/snd/pcmC{X}D{Y}[c|p] expression means
2249sound card number and second means device number. The ALSA devices
2250have either 'c' or 'p' suffix indicating the direction, capture and
2251playback, respectively.
2252
2253Please note that the device mapping above may be varied via the module
2254options of snd-pcm-oss module.
2255
2256
2257Proc 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
2287Early Buffer Allocation
2288=======================
2289
2290Some drivers (e.g. hdsp) require the large contiguous buffers, and
2291sometimes it's too late to find such spaces when the driver module is
2292actually loaded due to memory fragmentation. You can pre-allocate the
2293PCM buffers by loading snd-page-alloc module and write commands to its
2294proc file in prior, for example, in the early boot stage like
2295/etc/init.d/*.local scripts.
2296
2297Reading the proc file /proc/drivers/snd-page-alloc shows the current
2298usage of page allocation. In writing, you can send the following
2299commands 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
2317Links 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 @@
1This document describes standard names of mixer controls.
2
3Syntax: [LOCATION] SOURCE [CHANNEL] [DIRECTION] FUNCTION
4
5DIRECTION:
6 <nothing> (both directions)
7 Playback
8 Capture
9 Bypass Playback
10 Bypass Capture
11
12FUNCTION:
13 Switch (on/off switch)
14 Volume
15 Route (route control, hardware specific)
16
17CHANNEL:
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
26LOCATION: (physical location of source)
27 Front
28 Rear
29 Dock (docking station)
30 Internal
31
32SOURCE:
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
73Exceptions (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
90PCM 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
97IEC958 (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 ---------- -----------
3ALC880
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
12ALC260
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
19ALC262
20======
21 inv-dmic Inverted internal mic workaround
22
23ALC267/268
24==========
25 inv-dmic Inverted internal mic workaround
26 hp-eapd Disable HP EAPD on NID 0x15
27
28ALC22x/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
46ALC66x/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
60ALC680
61======
62 N/A
63
64ALC88x/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
72ALC861/660
73==========
74 N/A
75
76ALC861VD/660VD
77==============
78 N/A
79
80CMI9880
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
89AD1882 / AD1882A
90================
91 3stack 3-stack mode
92 3stack-automute 3-stack with automute front HP (default)
93 6stack 6-stack mode
94
95AD1884A / 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
103AD1884
104======
105 N/A
106
107AD1981
108======
109 basic 3-jack (default)
110 hp HP nx6320
111 thinkpad Lenovo Thinkpad T60/X60/Z60
112 toshiba Toshiba U205
113
114AD1983
115======
116 N/A
117
118AD1984
119======
120 basic default configuration
121 thinkpad Lenovo Thinkpad T61/X61
122 dell_desktop Dell T3400
123
124AD1986A
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
131AD1988/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
141Conexant 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
152Conexant 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
161Conexant 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
170Conexant 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
181STAC9200
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
200STAC9205/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
209STAC9220/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
233STAC9202/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
245STAC9227/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
258STAC92HD71B*
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
270STAC92HD73*
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
282STAC92HD83*
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
300STAC92HD95
301==========
302 hp-led LED support for HP laptops
303 hp-bass Bass HPF setup for HP Spectre 13
304
305STAC9872
306========
307 vaio VAIO laptop without SPDIF
308 auto BIOS setup (default)
309
310Cirrus Logic CS4206/4207
311========================
312 mbp55 MacBook Pro 5,5
313 imac27 IMac 27 Inch
314 auto BIOS setup (default)
315
316Cirrus Logic CS4208
317===================
318 mba6 MacBook Air 6,1 and 6,2
319 gpio0 Enable GPIO 0 amp
320 auto BIOS setup (default)
321
322VIA 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
5On many VIA82xx boards, the 'Input Source Select' mixer control does not work.
6Setting it to 'Input2' on such boards will cause recording to hang, or fail
7with EIO (input/output error) via OSS emulation. This control should be left
8at '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
4See Documentation/admin-guide/kernel-parameters.rst for general information on
5specifying module parameters.
6
7This 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
9module. Loadable modules, after being loaded into the running kernel, also
10reveal their parameters in /sys/module/${modulename}/parameters/. Some of these
11parameters 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>
15OSS 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">&lt;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>
261. Description</H2>
27This directory contains the OSS sequencer emulation driver on ALSA. Note
28that this program is still in the development state.
29<P>What this does - it provides the emulation of the OSS sequencer, access
30via
31<TT>/dev/sequencer</TT> and <TT>/dev/music</TT> devices.
32The most of applications using OSS can run if the appropriate ALSA
33sequencer is prepared.
34<P>The following features are emulated by this driver:
35<UL>
36<LI>
37Normal sequencer and MIDI events:</LI>
38
39<BR>They are converted to the ALSA sequencer events, and sent to the corresponding
40port.
41<LI>
42Timer events:</LI>
43
44<BR>The timer is not selectable by ioctl. The control rate is fixed to
45100 regardless of HZ. That is, even on Alpha system, a tick is always
461/100 second. The base rate and tempo can be changed in <TT>/dev/music</TT>.
47
48<LI>
49Patch loading:</LI>
50
51<BR>It purely depends on the synth drivers whether it's supported since
52the patch loading is realized by callback to the synth driver.
53<LI>
54I/O controls:</LI>
55
56<BR>Most of controls are accepted. Some controls
57are dependent on the synth driver, as well as even on original OSS.</UL>
58Furthermore, you can find the following advanced features:
59<UL>
60<LI>
61Better queue mechanism:</LI>
62
63<BR>The events are queued before processing them.
64<LI>
65Multiple applications:</LI>
66
67<BR>You can run two or more applications simultaneously (even for OSS sequencer)!
68However, each MIDI device is exclusive - that is, if a MIDI device is opened
69once by some application, other applications can't use it. No such a restriction
70in synth devices.
71<LI>
72Real-time event processing:</LI>
73
74<BR>The events can be processed in real time without using out of bound
75ioctl. To switch to real-time mode, send ABSTIME 0 event. The followed
76events will be processed in real-time without queued. To switch off the
77real-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>
82at any time. In the later version, configuration will be changed via <TT>/proc</TT>
83interface, too.</UL>
84
85<H2>
862. Installation</H2>
87Run configure script with both sequencer support (<TT>--with-sequencer=yes</TT>)
88and OSS emulation (<TT>--with-oss=yes</TT>) options. A module <TT>snd-seq-oss.o</TT>
89will be created. If the synth module of your sound card supports for OSS
90emulation (so far, only Emu8000 driver), this module will be loaded automatically.
91Otherwise, you need to load this module manually.
92<P>At beginning, this module probes all the MIDI ports which have been
93already connected to the sequencer. Once after that, the creation and deletion
94of ports are watched by announcement mechanism of ALSA sequencer.
95<P>The available synth and MIDI devices can be found in proc interface.
96Run "<TT>cat /proc/asound/seq/oss</TT>", and check the devices. For example,
97if you use an AWE64 card, you'll see like the following:
98<PRE>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; OSS sequencer emulation version 0.1.8
99&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ALSA client number 63
100&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; ALSA receiver port 0
101
102&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number of applications: 0
103
104&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number of synth devices: 1
105
106&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; synth 0: [EMU8000]
107&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; type 0x1 : subtype 0x20 : voices 32
108&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; capabilties : ioctl enabled / load_patch enabled
109
110&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Number of MIDI devices: 3
111
112&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; midi 0: [Emu8000 Port-0] ALSA port 65:0
113&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; capability write / opened none
114
115&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; midi 1: [Emu8000 Port-1] ALSA port 65:1
116&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; capability write / opened none
117
118&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; midi 2: [0: MPU-401 (UART)] ALSA port 64:0
119&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; capability read/write / opened none</PRE>
120Note that the device number may be different from the information of
121<TT>/proc/asound/oss-devices</TT>
122or ones of the original OSS driver. Use the device number listed in <TT>/proc/asound/seq/oss</TT>
123to play via OSS sequencer emulation.
124<H2>
1253. Using Synthesizer Devices</H2>
126Run your favorite program. I've tested playmidi-2.4, awemidi-0.4.3, gmod-3.1
127and xmp-1.1.5. You can load samples via <TT>/dev/sequencer</TT> like sfxload,
128too.
129<P>If the lowlevel driver supports multiple access to synth devices (like
130Emu8000 driver), two or more applications are allowed to run at the same
131time.
132<H2>
1334. Using MIDI Devices</H2>
134So far, only MIDI output was tested. MIDI input was not checked at all,
135but hopefully it will work. Use the device number listed in <TT>/proc/asound/seq/oss</TT>.
136Be aware that these numbers are mostly different from the list in
137<TT>/proc/asound/oss-devices</TT>.
138<H2>
1395. Module Options</H2>
140The 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
146for OSS sequencer, so that it is independent from the queue length of ALSA
147sequencer. 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
152positive integer. Default value is 0.</UL>
153
154<H2>
1556. Queue Mechanism</H2>
156OSS sequencer emulation uses an ALSA priority queue. The
157events from <TT>/dev/sequencer</TT> are processed and put onto the queue
158specified by module option.
159<P>All the events from <TT>/dev/sequencer</TT> are parsed at beginning.
160The timing events are also parsed at this moment, so that the events may
161be processed in real-time. Sending an event ABSTIME 0 switches the operation
162mode to real-time mode, and sending an event RELTIME 0 switches it off.
163In the real-time mode, all events are dispatched immediately.
164<P>The queued events are dispatched to the corresponding ALSA sequencer
165ports 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
168to write timing was implemented, too.
169<P>The input from MIDI devices or echo-back events are stored on read FIFO
170queue. If application reads <TT>/dev/sequencer</TT> in blocking mode, the
171process will be awaked.
172
173<H2>
1747. Interface to Synthesizer Device</H2>
175
176<H3>
1777.1. Registration</H3>
178To register an OSS synthesizer device, use <TT>snd_seq_oss_synth_register</TT>
179function.
180<PRE>int snd_seq_oss_synth_register(char *name, int type, int subtype, int nvoices,
181&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snd_seq_oss_callback_t *oper, void *private_data)</PRE>
182The arguments <TT>name</TT>, <TT>type</TT>, <TT>subtype</TT> and
183<TT>nvoices</TT>
184are used for making the appropriate synth_info structure for ioctl. The
185return value is an index number of this device. This index must be remembered
186for 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>
189where the <TT>index</TT> is the index number returned by register function.
190<H3>
1917.2. Callbacks</H3>
192OSS synthesizer devices have capability for sample downloading and ioctls
193like sample reset. In OSS emulation, these special features are realized
194by using callbacks. The registration argument oper is used to specify these
195callbacks. The following callback functions must be defined:
196<PRE>snd_seq_oss_callback_t:
197&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int (*open)(snd_seq_oss_arg_t *p, void *closure);
198&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int (*close)(snd_seq_oss_arg_t *p);
199&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int (*ioctl)(snd_seq_oss_arg_t *p, unsigned int cmd, unsigned long arg);
200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int (*load_patch)(snd_seq_oss_arg_t *p, int format, const char *buf, int offs, int count);
201&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int (*reset)(snd_seq_oss_arg_t *p);
202Except for <TT>open</TT> and <TT>close</TT> callbacks, they are allowed
203to be NULL.
204<P>Each callback function takes the argument type snd_seq_oss_arg_t as the
205first argument.
206<PRE>struct snd_seq_oss_arg_t {
207&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int app_index;
208&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int file_mode;
209&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int seq_mode;
210&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snd_seq_addr_t addr;
211&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; void *private_data;
212&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; int event_passing;
213};</PRE>
214The first three fields, <TT>app_index</TT>, <TT>file_mode</TT> and
215<TT>seq_mode</TT>
216are initialized by OSS sequencer. The <TT>app_index</TT> is the application
217index which is unique to each application opening OSS sequencer. The
218<TT>file_mode</TT>
219is bit-flags indicating the file operation mode. See
220<TT>seq_oss.h</TT>
221for its meaning. The <TT>seq_mode</TT> is sequencer operation mode. In
222the 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
224filled by the synth driver at open callback. The <TT>addr</TT> contains
225the address of ALSA sequencer port which is assigned to this device. If
226the driver allocates memory for <TT>private_data</TT>, it must be released
227in 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
230as velocity change, and key pressure event is passed to the port. In <TT>PASS_EVENTS</TT>
231mode, all note on/off events are passed to the port without modified. <TT>PROCESS_KEYPRESS</TT>
232mode checks the note above 128 and regards it as key pressure event (mainly
233for Emu8000 driver).
234<H4>
2357.2.1. Open Callback</H4>
236The <TT>open</TT> is called at each time this device is opened by an application
237using OSS sequencer. This must not be NULL. Typically, the open callback
238does the following procedure:
239<OL>
240<LI>
241Allocate private data record.</LI>
242
243<LI>
244Create an ALSA sequencer port.</LI>
245
246<LI>
247Set the new port address on arg->addr.</LI>
248
249<LI>
250Set the private data record pointer on arg->private_data.</LI>
251</OL>
252Note that the type bit-flags in port_info of this synth port must NOT contain
253<TT>TYPE_MIDI_GENERIC</TT>
254bit. Instead, <TT>TYPE_SPECIFIC</TT> should be used. Also, <TT>CAP_SUBSCRIPTION</TT>
255bit should NOT be included, too. This is necessary to tell it from other
256normal MIDI devices. If the open procedure succeeded, return zero. Otherwise,
257return -errno.
258<H4>
2597.2.2 Ioctl Callback</H4>
260The <TT>ioctl</TT> callback is called when the sequencer receives device-specific
261ioctls. 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>
275The other ioctls are processed inside the sequencer without passing to
276the lowlevel driver.
277<H4>
2787.2.3 Load_Patch Callback</H4>
279The <TT>load_patch</TT> callback is used for sample-downloading. This callback
280must read the data on user-space and transfer to each device. Return 0
281if succeeded, and -errno if failed. The format argument is the patch key
282in patch_info record. The buf is user-space pointer where patch_info record
283is stored. The offs can be ignored. The count is total data size of this
284sample data.
285<H4>
2867.2.4 Close Callback</H4>
287The <TT>close</TT> callback is called when this device is closed by the
288application. If any private data was allocated in open callback, it must
289be released in the close callback. The deletion of ALSA port should be
290done here, too. This callback must not be NULL.
291<H4>
2927.2.5 Reset Callback</H4>
293The <TT>reset</TT> callback is called when sequencer device is reset or
294closed by applications. The callback should turn off the sounds on the
295relevant port immediately, and initialize the status of the port. If this
296callback is undefined, OSS seq sends a <TT>HEARTBEAT</TT> event to the
297port.
298<H3>
2997.3 Events</H3>
300Most of the events are processed by sequencer and translated to the adequate
301ALSA sequencer events, so that each synth device can receive by input_event
302callback of ALSA sequencer port. The following ALSA events should be implemented
303by the driver:
304<BR>&nbsp;
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
380included in the Emu8000 lowlevel driver. In the future release, this module
381will be independent.
382<P>Some OSS events (<TT>SEQ_PRIVATE</TT> and <TT>SEQ_VOLUME</TT> events) are passed as event
383type SND_SEQ_OSS_PRIVATE. The OSS sequencer passes these event 8 byte
384packets without any modification. The lowlevel driver should process these
385events appropriately.
386<H2>
3878. Interface to MIDI Device</H2>
388Since the OSS emulation probes the creation and deletion of ALSA MIDI sequencer
389ports automatically by receiving announcement from ALSA sequencer, the
390MIDI devices don't need to be registered explicitly like synth devices.
391However, the MIDI port_info registered to ALSA sequencer must include a group
392name <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>,
394must be defined, too. If these conditions are not satisfied, the port is not
395registered as OSS sequencer MIDI device.
396<P>The events via MIDI devices are parsed in OSS sequencer and converted
397to the corresponding ALSA sequencer events. The input from MIDI sequencer
398is also converted to MIDI byte events by OSS sequencer. This works just
399a reverse way of seq_midi module.
400<H2>
4019. Known Problems / TODO's</H2>
402
403<UL>
404<LI>
405Patch 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=============================================
2Sound Blaster Audigy mixer / default DSP code
3=============================================
1 4
2 Sound Blaster Audigy mixer / default DSP code 5This is based on sb-live-mixer.rst.
3 ===========================================
4
5This is based on SB-Live-mixer.txt.
6 6
7The EMU10K2 chips have a DSP part which can be programmed to support 7The EMU10K2 chips have a DSP part which can be programmed to support
8various ways of sample processing, which is described here. 8various 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
161) Digital mixer controls 16Digital mixer controls
17------------------------- 17======================
18 18
19These controls are built using the DSP instructions. They offer extended 19These controls are built using the DSP instructions. They offer extended
20functionality. Only the default build-in code in the ALSA driver is described 20functionality. 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
27Explanation of used abbreviations: 27Explanation of used abbreviations:
28 28
29DAC - digital to analog converter 29DAC
30ADC - analog to digital converter 30 digital to analog converter
31I2S - one-way three wire serial bus for digital sound by Philips Semiconductors 31ADC
32 (this standard is used for connecting standalone DAC and ADC converters) 32 analog to digital converter
33LFE - low frequency effects (subwoofer signal) 33I2S
34AC97 - a chip containing an analog mixer, DAC and ADC converters 34 one-way three wire serial bus for digital sound by Philips Semiconductors
35IEC958 - S/PDIF 35 (this standard is used for connecting standalone DAC and ADC converters)
36FX-bus - the EMU10K2 chip has an effect bus containing 64 accumulators. 36LFE
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. 38AC97
39 a chip containing an analog mixer, DAC and ADC converters
40IEC958
41 S/PDIF
42FX-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
40name='PCM Front Playback Volume',index=0 47name='PCM Front Playback Volume',index=0
41 48----------------------------------------
42This control is used to attenuate samples for left and right front PCM FX-bus 49This control is used to attenuate samples for left and right front PCM FX-bus
43accumulators. ALSA uses accumulators 8 and 9 for left and right front PCM 50accumulators. ALSA uses accumulators 8 and 9 for left and right front PCM
44samples for 5.1 playback. The result samples are forwarded to the front DAC PCM 51samples for 5.1 playback. The result samples are forwarded to the front DAC PCM
45slots of the Philips DAC. 52slots of the Philips DAC.
46 53
47name='PCM Surround Playback Volume',index=0 54name='PCM Surround Playback Volume',index=0
48 55-------------------------------------------
49This control is used to attenuate samples for left and right surround PCM FX-bus 56This control is used to attenuate samples for left and right surround PCM FX-bus
50accumulators. ALSA uses accumulators 2 and 3 for left and right surround PCM 57accumulators. ALSA uses accumulators 2 and 3 for left and right surround PCM
51samples for 5.1 playback. The result samples are forwarded to the surround DAC PCM 58samples for 5.1 playback. The result samples are forwarded to the surround DAC PCM
52slots of the Philips DAC. 59slots of the Philips DAC.
53 60
54name='PCM Center Playback Volume',index=0 61name='PCM Center Playback Volume',index=0
55 62-----------------------------------------
56This control is used to attenuate samples for center PCM FX-bus accumulator. 63This control is used to attenuate samples for center PCM FX-bus accumulator.
57ALSA uses accumulator 6 for center PCM sample for 5.1 playback. The result sample 64ALSA uses accumulator 6 for center PCM sample for 5.1 playback. The result sample
58is forwarded to the center DAC PCM slot of the Philips DAC. 65is forwarded to the center DAC PCM slot of the Philips DAC.
59 66
60name='PCM LFE Playback Volume',index=0 67name='PCM LFE Playback Volume',index=0
61 68--------------------------------------
62This control is used to attenuate sample for LFE PCM FX-bus accumulator. 69This control is used to attenuate sample for LFE PCM FX-bus accumulator.
63ALSA uses accumulator 7 for LFE PCM sample for 5.1 playback. The result sample 70ALSA uses accumulator 7 for LFE PCM sample for 5.1 playback. The result sample
64is forwarded to the LFE DAC PCM slot of the Philips DAC. 71is forwarded to the LFE DAC PCM slot of the Philips DAC.
65 72
66name='PCM Playback Volume',index=0 73name='PCM Playback Volume',index=0
67 74----------------------------------
68This control is used to attenuate samples for left and right PCM FX-bus 75This control is used to attenuate samples for left and right PCM FX-bus
69accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples for 76accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples for
70stereo playback. The result samples are forwarded to the front DAC PCM slots 77stereo playback. The result samples are forwarded to the front DAC PCM slots
71of the Philips DAC. 78of the Philips DAC.
72 79
73name='PCM Capture Volume',index=0 80name='PCM Capture Volume',index=0
74 81---------------------------------
75This control is used to attenuate samples for left and right PCM FX-bus 82This control is used to attenuate samples for left and right PCM FX-bus
76accumulator. ALSA uses accumulators 0 and 1 for left and right PCM. 83accumulator. ALSA uses accumulators 0 and 1 for left and right PCM.
77The result is forwarded to the ADC capture FIFO (thus to the standard capture 84The result is forwarded to the ADC capture FIFO (thus to the standard capture
78PCM device). 85PCM device).
79 86
80name='Music Playback Volume',index=0 87name='Music Playback Volume',index=0
81 88------------------------------------
82This control is used to attenuate samples for left and right MIDI FX-bus 89This control is used to attenuate samples for left and right MIDI FX-bus
83accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples. 90accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples.
84The result samples are forwarded to the front DAC PCM slots of the AC97 codec. 91The result samples are forwarded to the front DAC PCM slots of the AC97 codec.
85 92
86name='Music Capture Volume',index=0 93name='Music Capture Volume',index=0
87 94-----------------------------------
88These controls are used to attenuate samples for left and right MIDI FX-bus 95These controls are used to attenuate samples for left and right MIDI FX-bus
89accumulator. ALSA uses accumulators 4 and 5 for left and right PCM. 96accumulator. ALSA uses accumulators 4 and 5 for left and right PCM.
90The result is forwarded to the ADC capture FIFO (thus to the standard capture 97The result is forwarded to the ADC capture FIFO (thus to the standard capture
91PCM device). 98PCM device).
92 99
93name='Mic Playback Volume',index=0 100name='Mic Playback Volume',index=0
94 101----------------------------------
95This control is used to attenuate samples for left and right Mic input. 102This control is used to attenuate samples for left and right Mic input.
96For Mic input is used AC97 codec. The result samples are forwarded to 103For Mic input is used AC97 codec. The result samples are forwarded to
97the front DAC PCM slots of the Philips DAC. Samples are forwarded to Mic 104the front DAC PCM slots of the Philips DAC. Samples are forwarded to Mic
98capture FIFO (device 1 - 16bit/8KHz mono) too without volume control. 105capture FIFO (device 1 - 16bit/8KHz mono) too without volume control.
99 106
100name='Mic Capture Volume',index=0 107name='Mic Capture Volume',index=0
101 108---------------------------------
102This control is used to attenuate samples for left and right Mic input. 109This control is used to attenuate samples for left and right Mic input.
103The result is forwarded to the ADC capture FIFO (thus to the standard capture 110The result is forwarded to the ADC capture FIFO (thus to the standard capture
104PCM device). 111PCM device).
105 112
106name='Audigy CD Playback Volume',index=0 113name='Audigy CD Playback Volume',index=0
107 114----------------------------------------
108This control is used to attenuate samples from left and right IEC958 TTL 115This control is used to attenuate samples from left and right IEC958 TTL
109digital inputs (usually used by a CDROM drive). The result samples are 116digital inputs (usually used by a CDROM drive). The result samples are
110forwarded to the front DAC PCM slots of the Philips DAC. 117forwarded to the front DAC PCM slots of the Philips DAC.
111 118
112name='Audigy CD Capture Volume',index=0 119name='Audigy CD Capture Volume',index=0
113 120---------------------------------------
114This control is used to attenuate samples from left and right IEC958 TTL 121This control is used to attenuate samples from left and right IEC958 TTL
115digital inputs (usually used by a CDROM drive). The result samples are 122digital inputs (usually used by a CDROM drive). The result samples are
116forwarded to the ADC capture FIFO (thus to the standard capture PCM device). 123forwarded to the ADC capture FIFO (thus to the standard capture PCM device).
117 124
118name='IEC958 Optical Playback Volume',index=0 125name='IEC958 Optical Playback Volume',index=0
119 126---------------------------------------------
120This control is used to attenuate samples from left and right IEC958 optical 127This control is used to attenuate samples from left and right IEC958 optical
121digital input. The result samples are forwarded to the front DAC PCM slots 128digital input. The result samples are forwarded to the front DAC PCM slots
122of the Philips DAC. 129of the Philips DAC.
123 130
124name='IEC958 Optical Capture Volume',index=0 131name='IEC958 Optical Capture Volume',index=0
125 132--------------------------------------------
126This control is used to attenuate samples from left and right IEC958 optical 133This control is used to attenuate samples from left and right IEC958 optical
127digital inputs. The result samples are forwarded to the ADC capture FIFO 134digital 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
130name='Line2 Playback Volume',index=0 137name='Line2 Playback Volume',index=0
131 138------------------------------------
132This control is used to attenuate samples from left and right I2S ADC 139This control is used to attenuate samples from left and right I2S ADC
133inputs (on the AudigyDrive). The result samples are forwarded to the front 140inputs (on the AudigyDrive). The result samples are forwarded to the front
134DAC PCM slots of the Philips DAC. 141DAC PCM slots of the Philips DAC.
135 142
136name='Line2 Capture Volume',index=1 143name='Line2 Capture Volume',index=1
137 144-----------------------------------
138This control is used to attenuate samples from left and right I2S ADC 145This control is used to attenuate samples from left and right I2S ADC
139inputs (on the AudigyDrive). The result samples are forwarded to the ADC 146inputs (on the AudigyDrive). The result samples are forwarded to the ADC
140capture FIFO (thus to the standard capture PCM device). 147capture FIFO (thus to the standard capture PCM device).
141 148
142name='Analog Mix Playback Volume',index=0 149name='Analog Mix Playback Volume',index=0
143 150-----------------------------------------
144This control is used to attenuate samples from left and right I2S ADC 151This control is used to attenuate samples from left and right I2S ADC
145inputs from Philips ADC. The result samples are forwarded to the front 152inputs from Philips ADC. The result samples are forwarded to the front
146DAC PCM slots of the Philips DAC. This contains mix from analog sources 153DAC PCM slots of the Philips DAC. This contains mix from analog sources
147like CD, Line In, Aux, .... 154like CD, Line In, Aux, ....
148 155
149name='Analog Mix Capture Volume',index=1 156name='Analog Mix Capture Volume',index=1
150 157----------------------------------------
151This control is used to attenuate samples from left and right I2S ADC 158This control is used to attenuate samples from left and right I2S ADC
152inputs Philips ADC. The result samples are forwarded to the ADC 159inputs Philips ADC. The result samples are forwarded to the ADC
153capture FIFO (thus to the standard capture PCM device). 160capture FIFO (thus to the standard capture PCM device).
154 161
155name='Aux2 Playback Volume',index=0 162name='Aux2 Playback Volume',index=0
156 163-----------------------------------
157This control is used to attenuate samples from left and right I2S ADC 164This control is used to attenuate samples from left and right I2S ADC
158inputs (on the AudigyDrive). The result samples are forwarded to the front 165inputs (on the AudigyDrive). The result samples are forwarded to the front
159DAC PCM slots of the Philips DAC. 166DAC PCM slots of the Philips DAC.
160 167
161name='Aux2 Capture Volume',index=1 168name='Aux2 Capture Volume',index=1
162 169----------------------------------
163This control is used to attenuate samples from left and right I2S ADC 170This control is used to attenuate samples from left and right I2S ADC
164inputs (on the AudigyDrive). The result samples are forwarded to the ADC 171inputs (on the AudigyDrive). The result samples are forwarded to the ADC
165capture FIFO (thus to the standard capture PCM device). 172capture FIFO (thus to the standard capture PCM device).
166 173
167name='Front Playback Volume',index=0 174name='Front Playback Volume',index=0
168 175------------------------------------
169All stereo signals are mixed together and mirrored to surround, center and LFE. 176All stereo signals are mixed together and mirrored to surround, center and LFE.
170This control is used to attenuate samples for left and right front speakers of 177This control is used to attenuate samples for left and right front speakers of
171this mix. 178this mix.
172 179
173name='Surround Playback Volume',index=0 180name='Surround Playback Volume',index=0
174 181---------------------------------------
175All stereo signals are mixed together and mirrored to surround, center and LFE. 182All stereo signals are mixed together and mirrored to surround, center and LFE.
176This control is used to attenuate samples for left and right surround speakers of 183This control is used to attenuate samples for left and right surround speakers of
177this mix. 184this mix.
178 185
179name='Center Playback Volume',index=0 186name='Center Playback Volume',index=0
180 187-------------------------------------
181All stereo signals are mixed together and mirrored to surround, center and LFE. 188All stereo signals are mixed together and mirrored to surround, center and LFE.
182This control is used to attenuate sample for center speaker of this mix. 189This control is used to attenuate sample for center speaker of this mix.
183 190
184name='LFE Playback Volume',index=0 191name='LFE Playback Volume',index=0
185 192----------------------------------
186All stereo signals are mixed together and mirrored to surround, center and LFE. 193All stereo signals are mixed together and mirrored to surround, center and LFE.
187This control is used to attenuate sample for LFE speaker of this mix. 194This control is used to attenuate sample for LFE speaker of this mix.
188 195
189name='Tone Control - Switch',index=0 196name='Tone Control - Switch',index=0
190 197------------------------------------
191This control turns the tone control on or off. The samples for front, rear 198This control turns the tone control on or off. The samples for front, rear
192and center / LFE outputs are affected. 199and center / LFE outputs are affected.
193 200
194name='Tone Control - Bass',index=0 201name='Tone Control - Bass',index=0
195 202----------------------------------
196This control sets the bass intensity. There is no neutral value!! 203This control sets the bass intensity. There is no neutral value!!
197When the tone control code is activated, the samples are always modified. 204When the tone control code is activated, the samples are always modified.
198The closest value to pure signal is 20. 205The closest value to pure signal is 20.
199 206
200name='Tone Control - Treble',index=0 207name='Tone Control - Treble',index=0
201 208------------------------------------
202This control sets the treble intensity. There is no neutral value!! 209This control sets the treble intensity. There is no neutral value!!
203When the tone control code is activated, the samples are always modified. 210When the tone control code is activated, the samples are always modified.
204The closest value to pure signal is 20. 211The closest value to pure signal is 20.
205 212
206name='Master Playback Volume',index=0 213name='Master Playback Volume',index=0
207 214-------------------------------------
208This control is used to attenuate samples for front, surround, center and 215This control is used to attenuate samples for front, surround, center and
209LFE outputs. 216LFE outputs.
210 217
211name='IEC958 Optical Raw Playback Switch',index=0 218name='IEC958 Optical Raw Playback Switch',index=0
212 219-------------------------------------------------
213If this switch is on, then the samples for the IEC958 (S/PDIF) digital 220If this switch is on, then the samples for the IEC958 (S/PDIF) digital
214output are taken only from the raw FX8010 PCM, otherwise standard front 221output are taken only from the raw FX8010 PCM, otherwise standard front
215PCM samples are taken. 222PCM samples are taken.
216 223
217 224
2182) PCM stream related controls 225PCM stream related controls
219------------------------------ 226===========================
220 227
221name='EMU10K1 PCM Volume',index 0-31 228name='EMU10K1 PCM Volume',index 0-31
222 229------------------------------------
223Channel volume attenuation in range 0-0xffff. The maximum value (no 230Channel volume attenuation in range 0-0xffff. The maximum value (no
224attenuation) is default. The channel mapping for three values is 231attenuation) is default. The channel mapping for three values is
225as follows: 232as 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
231name='EMU10K1 PCM Send Routing',index 0-31 238name='EMU10K1 PCM Send Routing',index 0-31
232 239------------------------------------------
233This control specifies the destination - FX-bus accumulators. There 24 240This control specifies the destination - FX-bus accumulators. There 24
234values with this mapping: 241values 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
261Don't forget that it's illegal to assign a channel to the same FX-bus accumulator 268Don't forget that it's illegal to assign a channel to the same FX-bus accumulator
262more than once (it means 0=0 && 1=0 is an invalid combination). 269more than once (it means 0=0 && 1=0 is an invalid combination).
263 270
264name='EMU10K1 PCM Send Volume',index 0-31 271name='EMU10K1 PCM Send Volume',index 0-31
265 272-----------------------------------------
266It specifies the attenuation (amount) for given destination in range 0-255. 273It specifies the attenuation (amount) for given destination in range 0-255.
267The channel mapping is following: 274The 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
2964) MANUALS/PATENTS: 303MANUALS/PATENTS
297------------------- 304===============
298 305
299ftp://opensource.creative.com/pub/doc 306ftp://opensource.creative.com/pub/doc
300------------------------------------- 307-------------------------------------
301 308
302 Files: 309LM4545.pdf
303 LM4545.pdf AC97 Codec 310 AC97 Codec
304 311
305 m2049.pdf The EMU10K1 Digital Audio Processor 312m2049.pdf
313 The EMU10K1 Digital Audio Processor
306 314
307 hog63.ps FX8010 - A DSP Chip Architecture for Audio Effects 315hog63.ps
316 FX8010 - A DSP Chip Architecture for Audio Effects
308 317
309 318
310WIPO Patents 319WIPO 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) 322WO 9901813 (A1)
323 Audio Effects Processor with multiple asynchronous streams
324 (Jan. 14, 1999)
325
326WO 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 329WO 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
322US Patents (http://www.uspto.gov/) 334US Patents (http://www.uspto.gov/)
323---------------------------------- 335----------------------------------
324 336
325 US 5925841 Digital Sampling Instrument employing cache memory (Jul. 20, 1999) 337US 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 340US 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 346US 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 349US 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 352US 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
358US 6151670
359 Method for conserving memory storage using a
360 pool of short term memory registers
361 (Nov. 21, 2000)
362
363US 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 ======================================================== 2Guide to using M-Audio Audiophile USB with ALSA and Jack
3========================================================
3 4
4 Thibault Le Meur <Thibault.LeMeur@supelec.fr> 5v1.5
6
7Thibault Le Meur <Thibault.LeMeur@supelec.fr>
5 8
6This document is a guide to using the M-Audio Audiophile USB (tm) device with 9This document is a guide to using the M-Audio Audiophile USB (tm) device with
7ALSA and JACK. 10ALSA and JACK.
8 11
9History 12History
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
191 - Audiophile USB Specs and correct usage 25Audiophile USB Specs and correct usage
20========================================== 26======================================
21 27
22This part is a reminder of important facts about the functions and limitations 28This part is a reminder of important facts about the functions and limitations
23of the device. 29of the device.
24 30
25The device has 4 audio interfaces, and 2 MIDI ports: 31The 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
36The internal DAC/ADC has the following characteristics: 45The 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
40Moreover, the Audiophile USB documentation gives the following Warning: 51Moreover, 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
43Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be 54Due to the USB 1.1 bandwidth limitation, a limited number of interfaces can be
44activated at the same time depending on the audio mode selected: 55activated 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
53Important facts about the Digital interface: 70Important 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,
56though 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
59to 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
61source 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
63synchronization 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
662 - Audiophile USB MIDI support in ALSA 87Audiophile USB MIDI support in ALSA
67======================================= 88===================================
68 89
69The Audiophile USB MIDI ports will be automatically supported once the 90The Audiophile USB MIDI ports will be automatically supported once the
70following modules have been loaded: 91following modules have been loaded:
92
71 * snd-usb-audio 93 * snd-usb-audio
72 * snd-seq-midi 94 * snd-seq-midi
73 95
74No additional setting is required. 96No additional setting is required.
75 97
76 98
773 - Audiophile USB Audio support in ALSA 99Audiophile USB Audio support in ALSA
78======================================== 100====================================
79 101
80Audio functions of the Audiophile USB device are handled by the snd-usb-audio 102Audio functions of the Audiophile USB device are handled by the snd-usb-audio
81module. This module can work in a default mode (without any device-specific 103module. This module can work in a default mode (without any device-specific
82parameter), or in an "advanced" mode with the device-specific parameter called 104parameter), or in an "advanced" mode with the device-specific parameter called
83"device_setup". 105``device_setup``.
84 106
853.1 - Default Alsa driver mode 107Default Alsa driver mode
86------------------------------ 108------------------------
87 109
88The default behavior of the snd-usb-audio driver is to list the device 110The default behavior of the snd-usb-audio driver is to list the device
89capabilities at startup and activate the required mode when required 111capabilities at startup and activate the required mode when required
@@ -101,6 +123,7 @@ Default Alsa driver mode can lead to device misconfigurations.
101Let's get back to the Default Alsa driver mode for now. In this case the 123Let's get back to the Default Alsa driver mode for now. In this case the
102Audiophile interfaces are mapped to alsa pcm devices in the following 124Audiophile interfaces are mapped to alsa pcm devices in the following
103way (I suppose the device's index is 1): 125way (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
115is reported to be big endian in this default driver mode. 138is reported to be big endian in this default driver mode.
116 139
117Examples: 140Examples:
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
127If you're happy with the default Alsa driver mode and don't experience any 158If you're happy with the default Alsa driver mode and don't experience any
128issue with this mode, then you can skip the following chapter. 159issue with this mode, then you can skip the following chapter.
129 160
1303.2 - Advanced module setup 161Advanced module setup
131--------------------------- 162---------------------
132 163
133Due to the hardware constraints described above, the device initialization made 164Due to the hardware constraints described above, the device initialization made
134by the Alsa driver in default mode may result in a corrupted state of the 165by 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
137volume gain). 168volume gain).
138 169
139For people having this problem, the snd-usb-audio module has a new module 170For people having this problem, the snd-usb-audio module has a new module
140parameter called "device_setup" (this parameter was introduced in kernel 171parameter called ``device_setup`` (this parameter was introduced in kernel
141release 2.6.17) 172release 2.6.17)
142 173
1433.2.1 - Initializing the working mode of the Audiophile USB 174Initializing the working mode of the Audiophile USB
175~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
144 176
145As far as the Audiophile USB device is concerned, this value let the user 177As far as the Audiophile USB device is concerned, this value let the user
146specify: 178specify:
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
151When initialized with "device_setup=0x00", the snd-usb-audio module has 184When initialized with ``device_setup=0x00``, the snd-usb-audio module has
152the same behaviour as when the parameter is omitted (see paragraph "Default 185the same behaviour as when the parameter is omitted (see paragraph "Default
153Alsa driver mode" above) 186Alsa driver mode" above)
154 187
155Others modes are described in the following subsections. 188Others modes are described in the following subsections.
156 189
1573.2.1.1 - 16-bit modes 19016-bit modes
191~~~~~~~~~~~~
158 192
159The two supported modes are: 193The 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:
173In this modes the device operates only at 16bits-modes. Before kernel 2.6.23, 209In this modes the device operates only at 16bits-modes. Before kernel 2.6.23,
174the devices where reported to be Big-Endian when in fact they were Little-Endian 210the devices where reported to be Big-Endian when in fact they were Little-Endian
175so that playing a file was a matter of using: 211so 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
177where "test_S16_LE.raw" was in fact a little-endian sample file. 216where "test_S16_LE.raw" was in fact a little-endian sample file.
178 217
179Thanks to Hakan Lennestal (who discovered the Little-Endiannes of the device in 218Thanks to Hakan Lennestal (who discovered the Little-Endiannes of the device in
180these modes) a fix has been committed (expected in kernel 2.6.23) and 219these modes) a fix has been committed (expected in kernel 2.6.23) and
181Alsa now reports Little-Endian interfaces. Thus playing a file now is as simple as 220Alsa now reports Little-Endian interfaces. Thus playing a file now is as simple as
182using: 221using:
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
1853.2.1.2 - 24-bit modes 226
22724-bit modes
228~~~~~~~~~~~~
186 229
187The three supported modes are: 230The 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:
210In these modes the device is only Big-Endian compliant (see "Default Alsa driver 256In these modes the device is only Big-Endian compliant (see "Default Alsa driver
211mode" above for an aplay command example) 257mode" above for an aplay command example)
212 258
2133.2.1.3 - AC3 w/ DTS passthru mode 259AC3 w/ DTS passthru mode
260~~~~~~~~~~~~~~~~~~~~~~~~
214 261
215Thanks to Hakan Lennestal, I now have a report saying that this mode works. 262Thanks 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
222The command line used to playback the AC3/DTS encoded .wav-files in this mode: 270The 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
2253.2.2 - How to use the device_setup parameter 275How to use the ``device_setup`` parameter
226---------------------------------------------- 276~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
227 277
228The parameter can be given: 278The 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
2613.2.3 - Technical details for hackers 315Technical details for hackers
262------------------------------------- 316-----------------------------
317
263This section is for hackers, wanting to understand details about the device 318This section is for hackers, wanting to understand details about the device
264internals and how Alsa supports it. 319internals and how Alsa supports it.
265 320
2663.2.3.1 - Audiophile USB's device_setup structure 321Audiophile USB's ``device_setup`` structure
322~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
267 323
268If you want to understand the device_setup magic numbers for the Audiophile 324If you want to understand the device_setup magic numbers for the Audiophile
269USB, you need some very basic understanding of binary computation. However, 325USB, you need some very basic understanding of binary computation. However,
270this is not required to use the parameter and you may skip this section. 326this is not required to use the parameter and you may skip this section.
271 327
272The device_setup is one byte long and its structure is the following: 328The 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
280Where: 337Where:
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
304Caution: 373Caution:
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
3123.2.3.2 - USB implementation details for this device 385USB implementation details for this device
386~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
313 387
314You may safely skip this section if you're not interested in driver 388You may safely skip this section if you're not interested in driver
315hacking. 389hacking.
@@ -319,46 +393,72 @@ data I got by usb-snooping the windows and Linux drivers.
319 393
320The M-Audio Audiophile USB has 7 USB Interfaces: 394The M-Audio Audiophile USB has 7 USB Interfaces:
321a "USB interface": 395a "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
336Each interface has 5 altsettings (AltSet 1,2,3,4,5) except: 422Each 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
340Here is a short description of the AltSettings capabilities: 427Here 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
360In order to ensure a correct initialization of the device, the driver 459In 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
372When device_setup is given as a parameter to the snd-usb-audio module, the 472When device_setup is given as a parameter to the snd-usb-audio module, the
373parse_audio_endpoints function uses a quirk called 473parse_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
375corresponding to device_setup from being registered in the driver. 475corresponding to device_setup from being registered in the driver.
376 476
3774 - Audiophile USB and Jack support 477Audiophile USB and Jack support
378=================================== 478===============================
379 479
380This section deals with support of the Audiophile USB device in Jack. 480This section deals with support of the Audiophile USB device in Jack.
381 481
382There are 2 main potential issues when using Jackd with the device: 482There 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
3864.1 - Direct support in Jackd 487Direct support in Jackd
387----------------------------- 488-----------------------
388 489
389Jack supports big endian devices only in recent versions (thanks to 490Jack supports big endian devices only in recent versions (thanks to
390Andreas Steinmetz for his first big-endian patch). I can't remember 491Andreas Steinmetz for his first big-endian patch). I can't remember
@@ -396,29 +497,35 @@ are now Little Endians ;-) ).
396 497
397You can run jackd with the following command for playback with Ao and 498You can run jackd with the following command for playback with Ao and
398record with Ai: 499record 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
4014.2 - Using Alsa plughw 504Using Alsa plughw
402----------------------- 505-----------------
506
403If you don't have a recent Jackd installed, you can downgrade to using 507If you don't have a recent Jackd installed, you can downgrade to using
404the Alsa "plug" converter. 508the Alsa ``plug`` converter.
405 509
406For instance here is one way to run Jack with 2 playback channels on Ao and 2 510For instance here is one way to run Jack with 2 playback channels on Ao and 2
407capture channels from Ai: 511capture 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
410However you may see the following warning message: 516However 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
412using 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.
413Consider 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
4154.3 - Getting 2 input and/or output interfaces in Jack 521Getting 2 input and/or output interfaces in Jack
416------------------------------------------------------ 522------------------------------------------------
417 523
418As you can see, starting the Jack server this way will only enable 1 stereo 524As you can see, starting the Jack server this way will only enable 1 stereo
419input (Di or Ai) and 1 stereo output (Ao or Do). 525input (Di or Ai) and 1 stereo output (Ao or Do).
420 526
421This is due to the following restrictions: 527This 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
432the Audiophile USB. 539the Audiophile USB.
433 540
434Enabling multiple Audiophile USB interfaces for Jackd will certainly require: 541Enabling 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=================
2ALSA BT87x Driver
3=================
4
1Intro 5Intro
2===== 6=====
3 7
4You might have noticed that the bt878 grabber cards have actually 8You 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 [ ... ]
900:0a.0 Multimedia video controller: Brooktree Corporation Bt878 (rev 02) 14 00:0a.0 Multimedia video controller: Brooktree Corporation Bt878 (rev 02)
1000:0a.1 Multimedia controller: Brooktree Corporation Bt878 (rev 02) 15 00:0a.1 Multimedia controller: Brooktree Corporation Bt878 (rev 02)
11[ ... ] 16 [ ... ]
12 17
13The first does video, it is backward compatible to the bt848. The second 18The first does video, it is backward compatible to the bt848. The second
14does audio. snd-bt87x is a driver for the second function. It's a sound 19does audio. snd-bt87x is a driver for the second function. It's a sound
15driver which can be used for recording sound (and _only_ recording, no 20driver which can be used for recording sound (and *only* recording, no
16playback). As most TV cards come with a short cable which can be plugged 21playback). As most TV cards come with a short cable which can be plugged
17into your sound card's line-in you probably don't need this driver if all 22into your sound card's line-in you probably don't need this driver if all
18you want to do is just watching TV... 23you 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,
30and it refuses to load for cards it doesn't know. 35and it refuses to load for cards it doesn't know.
31 36
32If the driver complains ("Unknown TV card found, the audio driver will 37If the driver complains ("Unknown TV card found, the audio driver will
33not load"), you can specify the load_all=1 option to force the driver to 38not load"), you can specify the ``load_all=1`` option to force the driver to
34try to use the audio capture function of your card. If the frequency of 39try to use the audio capture function of your card. If the frequency of
35recorded data is not right, try to specify the digital_rate option with 40recorded data is not right, try to specify the ``digital_rate`` option with
36other values than the default 32000 (often it's 44100 or 64000). 41other values than the default 32000 (often it's 44100 or 64000).
37 42
38If you have an unknown card, please mail the ID and board name to 43If 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 ================================================= 2Brief Notes on C-Media 8338/8738/8768/8770 Driver
3=================================================
3 4
4 Takashi Iwai <tiwai@suse.de> 5Takashi Iwai <tiwai@suse.de>
5 6
6 7
7Front/Rear Multi-channel Playback 8Front/Rear Multi-channel Playback
@@ -30,19 +31,20 @@ The rear output can be heard only when "Four Channel Mode" switch is
30disabled. Otherwise no signal will be routed to the rear speakers. 31disabled. Otherwise no signal will be routed to the rear speakers.
31As default it's turned on. 32As default it's turned on.
32 33
33*** WARNING *** 34.. WARNING::
34When "Four Channel Mode" switch is off, the output from rear speakers 35 When "Four Channel Mode" switch is off, the output from rear speakers
35will be FULL VOLUME regardless of Master and PCM volumes. 36 will be FULL VOLUME regardless of Master and PCM volumes [#]_.
36This might damage your audio equipment. Please disconnect speakers 37 This might damage your audio equipment. Please disconnect speakers
37before 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
47If your card has an extra output jack for the rear output, the rear 49If your card has an extra output jack for the rear output, the rear
48playback should be routed there as default. If not, there is a 50playback should be routed there as default. If not, there is a
@@ -73,12 +75,14 @@ cannot operate with full-duplex.
73 75
74The 4.0 and 5.1 modes are defined as the pcm "surround40" and "surround51" 76The 4.0 and 5.1 modes are defined as the pcm "surround40" and "surround51"
75in alsa-lib. For example, you can play a WAV file with 6 channels like 77in 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
79For programming the 4/6 channel playback, you need to specify the PCM 82For programming the 4/6 channel playback, you need to specify the PCM
80channels as you like and set the format S16LE. For example, for playback 83channels as you like and set the format S16LE. For example, for playback
81with 4 channels, 84with 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
90There are some control switches affecting to the speaker connections: 94There 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 96Line-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 103Mic-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".
112The available rates are 44100 and 48000 Hz. 118The available rates are 44100 and 48000 Hz.
113For playback with aplay, you can run like below: 119For 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
117or 124or
118 125
126::
127
119 % aplay -Dspdif foo.wav 128 % aplay -Dspdif foo.wav
120 129
12124bit format is also supported experimentally. 13024bit format is also supported experimentally.
@@ -140,31 +149,40 @@ off. (Also don't forget to turn on "IEC958 Output Switch", too.)
140 149
141Additionally there are relevant control switches: 150Additionally there are relevant control switches:
142 151
143"IEC958 Mix Analog" - Mix analog PCM playback and FM-OPL/3 streams and 152IEC958 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) 161IEC958 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 165IEC958 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. 169IEC958 Copyright
170 Set the copyright bit.
157 171
158"IEC958 5V" - Select 0.5V (coax) or 5V (optical) interface. 172IEC958 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. 177IEC958 In Monitor
178 SPDIF input is routed to DAC.
163 179
164"IEC958 In Phase Inverse" - Set SPDIF input format as inverse. 180IEC958 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. 184IEC958 In Valid
185 Set input validity flag detection.
168 186
169Note: When "PCM Playback Switch" is on, you'll hear the digital output 187Note: When "PCM Playback Switch" is on, you'll hear the digital output
170stream through analog line-out. 188stream through analog line-out.
@@ -217,7 +235,7 @@ to enable MIDI support. Valid I/O ports are 0x300, 0x310, 0x320 and
217With CMI8738 and newer chips, the MIDI interface is enabled by default 235With CMI8738 and newer chips, the MIDI interface is enabled by default
218and the driver automatically chooses a port address. 236and the driver automatically chooses a port address.
219 237
220There is _no_ hardware wavetable function on this chip (except for 238There is *no* hardware wavetable function on this chip (except for
221OPL3 synth below). 239OPL3 synth below).
222What's said as MIDI synth on Windows is a software synthesizer 240What's said as MIDI synth on Windows is a software synthesizer
223emulation. On Linux use TiMidity or other softsynth program for 241emulation. 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=================================================================
2Low latency, multichannel audio with JACK and the emu10k1/emu10k2
3=================================================================
4
1This document is a guide to using the emu10k1 based devices with JACK for low 5This document is a guide to using the emu10k1 based devices with JACK for low
2latency, multichannel recording functionality. All of my recent work to allow 6latency, multichannel recording functionality. All of my recent work to allow
3Linux users to use the full capabilities of their hardware has been inspired 7Linux 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
10Low latency, multichannel audio with JACK and the emu10k1/emu10k2
11-----------------------------------------------------------------
12 14
13Until recently, emu10k1 users on Linux did not have access to the same low 15Until recently, emu10k1 users on Linux did not have access to the same low
14latency, multichannel features offered by the "kX ASIO" feature of their 16latency, 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
23fairly self explanatory - select Duplex, then for capture and playback select 25fairly self explanatory - select Duplex, then for capture and playback select
24the multichannel devices, set the in and out channels to 16, and the sample 26the multichannel devices, set the in and out channels to 16, and the sample
25rate to 48000Hz. The command line looks like this: 27rate 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
29This will give you 16 input ports and 16 output ports. 32This will give you 16 input ports and 16 output ports.
30 33
31The 16 output ports map onto the 16 FX buses (or the first 16 of 64, for the 34The 16 output ports map onto the 16 FX buses (or the first 16 of 64, for the
32Audigy). The mapping from FX bus to physical output is described in 35Audigy). The mapping from FX bus to physical output is described in
33SB-Live-mixer.txt (or Audigy-mixer.txt). 36sb-live-mixer.rst (or audigy-mixer.rst).
34 37
35The 16 input ports are connected to the 16 physical inputs. Contrary to 38The 16 input ports are connected to the 16 physical inputs. Contrary to
36popular belief, all emu10k1 cards are multichannel cards. Which of these 39popular 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
49ports to FXBUS2 (multitrack recording input) and EXTOUT (physical output) 52ports to FXBUS2 (multitrack recording input) and EXTOUT (physical output)
50channels. 53channels.
51 54
52/*JACK (& ASIO) mappings on 10k1 5.1 SBLive cards: 55JACK (& ASIO) mappings on 10k1 5.1 SBLive cards:
53-------------------------------------------- 56
57============== ======== ============
54JACK Epilog FXBUS2(nr) 58JACK Epilog FXBUS2(nr)
55-------------------------------------------- 59============== ======== ============
56capture_1 asio14 FXBUS2(0xe) 60capture_1 asio14 FXBUS2(0xe)
57capture_2 asio15 FXBUS2(0xf) 61capture_2 asio15 FXBUS2(0xf)
58capture_3 asio0 FXBUS2(0x0) 62capture_3 asio0 FXBUS2(0x0)
@@ -69,6 +73,6 @@ capture_13 asio10 FXBUS2(0xa)
69capture_14 asio11 FXBUS2(0xb) 73capture_14 asio11 FXBUS2(0xb)
70capture_15 asio12 FXBUS2(0xc) 74capture_15 asio12 FXBUS2(0xc)
71capture_16 asio13 FXBUS2(0xd) 75capture_16 asio13 FXBUS2(0xd)
72*/ 76============== ======== ============
73 77
74TODO: describe use of ld10k1/qlo10k1 in conjunction with JACK 78TODO: 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=======================================
1Software Interface ALSA-DSP MADI Driver 2Software Interface ALSA-DSP MADI Driver
3=======================================
2 4
3(translated from German, so no good English ;-), 5(translated from German, so no good English ;-),
42004 - winfried ritsch
5
6 6
72004 - 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
10Full functionality has been added to the driver. Since some of
11the Controls and startup-options are ALSA-Standard and only the
12special Controls are described and discussed below.
12 13
13 hardware functionality:
14 14
15Hardware functionality
16======================
15 17
16 Audio transmission: 18Audio 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: 95Controller
90 96----------
91 97
92 Since DSP-MADI-Mixer has 8152 Fader, it does not make sense to 98Since DSP-MADI-Mixer has 8152 Fader, it does not make sense to
93 use the standard mixer-controls, since this would break most of 99use 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 101provided by a 2-dimensional controller using the
96 hwdep-interface. 102hwdep-interface.
97 103
98 Also all 128+256 Peak and RMS-Meter can be accessed via the 104Also all 128+256 Peak and RMS-Meter can be accessed via the
99 hwdep-interface. Since it could be a performance problem always 105hwdep-interface. Since it could be a performance problem always
100 copying and converting Peak and RMS-Levels even if you just need 106copying and converting Peak and RMS-Levels even if you just need
101 one, I decided to export the hardware structure, so that of 107one, I decided to export the hardware structure, so that of
102 needed some driver-guru can implement a memory-mapping of mixer 108needed some driver-guru can implement a memory-mapping of mixer
103 or peak-meters over ioctl, or also to do only copying and no 109or peak-meters over ioctl, or also to do only copying and no
104 conversion. A test-application shows the usage of the controller. 110conversion. 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 ---------------------- 228Mixer
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): 263Information (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
326Calling Parameter: 334Calling 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================================================
2Imagination Technologies SPDIF Input Controllers
3================================================
4
1The Imagination Technologies SPDIF Input controller contains the following 5The Imagination Technologies SPDIF Input controller contains the following
2controls: 6controls:
3 7
4name='IEC958 Capture Mask',index=0 8* name='IEC958 Capture Mask',index=0
5 9
6This control returns a mask that shows which of the IEC958 status bits 10This control returns a mask that shows which of the IEC958 status bits
7can be read using the 'IEC958 Capture Default' control. 11can be read using the 'IEC958 Capture Default' control.
8 12
9name='IEC958 Capture Default',index=0 13* name='IEC958 Capture Default',index=0
10 14
11This control returns the status bits contained within the SPDIF stream that 15This control returns the status bits contained within the SPDIF stream that
12is being received. The 'IEC958 Capture Mask' shows which bits can be read 16is being received. The 'IEC958 Capture Mask' shows which bits can be read
13from this control. 17from this control.
14 18
15name='SPDIF In Multi Frequency Acquire',index=0 19* name='SPDIF In Multi Frequency Acquire',index=0
16name='SPDIF In Multi Frequency Acquire',index=1 20* name='SPDIF In Multi Frequency Acquire',index=1
17name='SPDIF In Multi Frequency Acquire',index=2 21* name='SPDIF In Multi Frequency Acquire',index=2
18name='SPDIF In Multi Frequency Acquire',index=3 22* name='SPDIF In Multi Frequency Acquire',index=3
19 23
20This control is used to attempt acquisition of up to four different sample 24This control is used to attempt acquisition of up to four different sample
21rates. The active rate can be obtained by reading the 'SPDIF In Lock Frequency' 25rates. The active rate can be obtained by reading the 'SPDIF In Lock Frequency'
@@ -29,21 +33,21 @@ four sample rates set here.
29If less than four rates are required, the same rate can be specified more than 33If less than four rates are required, the same rate can be specified more than
30once 34once
31 35
32name='SPDIF In Lock Frequency',index=0 36* name='SPDIF In Lock Frequency',index=0
33 37
34This control returns the active capture rate, or 0 if a lock has not been 38This control returns the active capture rate, or 0 if a lock has not been
35acquired 39acquired
36 40
37name='SPDIF In Lock TRK',index=0 41* name='SPDIF In Lock TRK',index=0
38 42
39This control is used to modify the locking/jitter rejection characteristics 43This control is used to modify the locking/jitter rejection characteristics
40of the block. Larger values increase the locking range, but reduce jitter 44of the block. Larger values increase the locking range, but reduce jitter
41rejection. 45rejection.
42 46
43name='SPDIF In Lock Acquire Threshold',index=0 47* name='SPDIF In Lock Acquire Threshold',index=0
44 48
45This control is used to change the threshold at which a lock is acquired. 49This control is used to change the threshold at which a lock is acquired.
46 50
47name='SPDIF In Lock Release Threshold',index=0 51* name='SPDIF In Lock Release Threshold',index=0
48 52
49This control is used to change the threshold at which a lock is released. 53This 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 @@
1Card-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=======================================
1Analog Joystick Support on ALSA Drivers 2Analog Joystick Support on ALSA Drivers
2======================================= 3=======================================
3 Oct. 14, 2003 4
4 Takashi Iwai <tiwai@suse.de> 5Oct. 14, 2003
6
7Takashi Iwai <tiwai@suse.de>
5 8
6General 9General
7------- 10-------
@@ -34,44 +37,46 @@ stability and the resource management.
34 37
35The following PCI drivers support the joystick natively. 38The following PCI drivers support the joystick natively.
36 39
37 Driver Module Option Available Values 40============== ============= ============================================
38 --------------------------------------------------------------------------- 41Driver Module Option Available Values
39 als4000 joystick_port 0 = disable (default), 1 = auto-detect, 42============== ============= ============================================
40 manual: any address (e.g. 0x200) 43als4000 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) 45au88x0 N/A N/A
43 ens1370 joystick 0 = disable (default), 1 = enable 46azf3328 joystick 0 = disable, 1 = enable, -1 = auto (default)
44 ens1371 joystick_port 0 = disable (default), 1 = auto-detect, 47ens1370 joystick 0 = disable (default), 1 = enable
45 manual: 0x200, 0x208, 0x210, 0x218 48ens1371 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) 50cmipci 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 52cs4281 N/A N/A
50 es1938 N/A N/A 53cs46xx N/A N/A
51 es1968 joystick 0 = disable (default), 1 = enable 54es1938 N/A N/A
52 sonicvibes N/A N/A 55es1968 joystick 0 = disable (default), 1 = enable
53 trident N/A N/A 56sonicvibes N/A N/A
54 via82xx(*1) joystick 0 = disable (default), 1 = enable 57trident N/A N/A
55 ymfpci joystick_port 0 = disable (default), 1 = auto-detect, 58via82xx [#f1]_ joystick 0 = disable (default), 1 = enable
56 manual: 0x201, 0x202, 0x204, 0x205(*2) 59ymfpci 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
62The following drivers don't support gameport natively, but there are 66The following drivers don't support gameport natively, but there are
63additional modules. Load the corresponding module to add the gameport 67additional modules. Load the corresponding module to add the gameport
64support. 68support.
65 69
66 Driver Additional Module 70======= =================
67 ----------------------------- 71Driver Additional Module
68 emu10k1 emu10k1-gp 72======= =================
69 fm801 fm801-gp 73emu10k1 emu10k1-gp
70 ----------------------------- 74fm801 fm801-gp
75======= =================
71 76
72Note: the "pcigame" and "cs461x" modules are for the OSS drivers only. 77Note: the "pcigame" and "cs461x" modules are for the OSS drivers only.
73 These ALSA drivers (cs46xx, trident and au88x0) have the 78These ALSA drivers (cs46xx, trident and au88x0) have the
74 built-in gameport support. 79built-in gameport support.
75 80
76As mentioned above, ALSA PCI drivers have the built-in gameport 81As mentioned above, ALSA PCI drivers have the built-in gameport
77support, so you don't have to load ns558 module. Just load "joydev" 82support, 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 @@
1NOTE: The following is the original document of Rainer's patch that the 1=================================
2current maya44 code based on. Some contents might be obsoleted, but I 2Notes on Maya44 USB Audio Support
3keep 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
10Feb 14, 2008
11
12Rainer Zimmermann <mail@lightshed.de>
6 13
7STATE OF DEVELOPMENT: 14STATE OF DEVELOPMENT
15====================
8 16
9This driver is being developed on the initiative of Piotr Makowski (oponek@gmail.com) and financed by Lars Bergmann. 17This driver is being developed on the initiative of Piotr Makowski (oponek@gmail.com) and financed by Lars Bergmann.
10Development is carried out by Rainer Zimmermann (mail@lightshed.de). 18Development 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
47DRIVER DETAILS: 55DRIVER DETAILS
56==============
48 57
49the following files were added: 58the following files were added:
50 59
51pci/ice1724/maya44.c - Maya44 specific code 60* pci/ice1724/maya44.c - Maya44 specific code
52pci/ice1724/maya44.h 61* pci/ice1724/maya44.h
53pci/ice1724/ice1724.patch 62* pci/ice1724/ice1724.patch
54pci/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)
55i2c/other/wm8776.c - low-level access routines for Wolfson WM8776 codecs 64* i2c/other/wm8776.c - low-level access routines for Wolfson WM8776 codecs
56include/wm8776.h 65* include/wm8776.h
57 66
58 67
59Note that the wm8776.c code is meant to be card-independent and does not actually register the codec with the ALSA infrastructure. 68Note 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
63the following files were created in pci/ice1724, simply #including the corresponding file from the alsa-kernel tree: 72the following files were created in pci/ice1724, simply #including the corresponding file from the alsa-kernel tree:
64 73
65wtm.h 74* wtm.h
66vt1720_mobo.h 75* vt1720_mobo.h
67revo.h 76* revo.h
68prodigy192.h 77* prodigy192.h
69pontis.h 78* pontis.h
70phase.h 79* phase.h
71maya44.h 80* maya44.h
72juli.h 81* juli.h
73aureon.h 82* aureon.h
74amp.h 83* amp.h
75envy24ht.h 84* envy24ht.h
76se.h 85* se.h
77prodigy_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
83SAMPLING RATES: 92SAMPLING RATES
93==============
84 94
85The Maya44 card (or more exactly, the Wolfson WM8776 codecs) allow a maximum sampling rate of 192 kHz for playback and 92 kHz for capture. 95The 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
98The proposed code (currently deactivated) is in ice1712.h.patch, ice1724.c and maya44.c (in pci/ice1712). 108The proposed code (currently deactivated) is in ice1712.h.patch, ice1724.c and maya44.c (in pci/ice1712).
99 109
100 110
101SOUND DEVICES: 111SOUND DEVICES
112=============
102 113
103PCM devices correspond to inputs/outputs as follows (assuming Maya44 is card #0): 114PCM devices correspond to inputs/outputs as follows (assuming Maya44 is card #0):
104 115
105hw:0,0 input - stereo, analog input 1+2 116* hw:0,0 input - stereo, analog input 1+2
106hw:0,0 output - stereo, analog output 1+2 117* hw:0,0 output - stereo, analog output 1+2
107hw: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
108hw: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
111NAMING OF MIXER CONTROLS: 122NAMING 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
116PCM: (digital) output level for channel 1+2 128PCM
117PCM 1: same for channel 3+4 129 (digital) output level for channel 1+2
130PCM 1
131 same for channel 3+4
132
133Mic Phantom+48V
134 switch for +48V phantom power for electrostatic microphones on input 1/2.
118 135
119Mic 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
123Mic/Line input: if switch is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo). 139Mic/Line input
140 if switch is on, input jack 1/2 is microphone input (mono), otherwise line input (stereo).
141
142Bypass
143 analogue bypass from ADC input to output for channel 1+2. Same as "Monitor" in the windows driver.
144Bypass 1
145 same for channel 3+4.
124 146
125Bypass: analogue bypass from ADC input to output for channel 1+2. Same as "Monitor" in the windows driver. 147Crossmix
126Bypass 1: same for channel 3+4. 148 cross-mixer from channels 1+2 to channels 3+4
149Crossmix 1
150 cross-mixer from channels 3+4 to channels 1+2
127 151
128Crossmix: cross-mixer from channels 1+2 to channels 3+4 152IEC958 Output
129Crossmix 1: cross-mixer from channels 3+4 to channels 1+2 153 switch for S/PDIF output.
130 154
131IEC958 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
136Digitial output selectors: 159Digitial 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
143H/W: Output source channel 1 165H/W
144H/W 1: Output source channel 2 166 Output source channel 1
145H/W 2: Output source channel 3 167H/W 1
146H/W 3: Output source channel 4 168 Output source channel 2
169H/W 2
170 Output source channel 3
171H/W 3
172 Output source channel 4
173
174H/W 4 ... H/W 9
175 unknown function, left in to enable testing.
147 176
148H/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
152Selectable values for each of the digital output selectors are: 180Selectable 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-------- 182PCM out
159 183 DAC output of the corresponding channel (default setting)
160Feb 14, 2008 184Input 1 ... Input 4
161Rainer Zimmermann 185 direct routing from ADC output of the selected input channel
162mail@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> 2Alsa driver for Digigram miXart8 and miXart8AES/EBU soundcards
3==============================================================
4
5Digigram <alsa@digigram.com>
3 6
4 7
5GENERAL 8GENERAL
@@ -48,11 +51,15 @@ formats are supported.
48 51
49Mixer 52Mixer
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.
55and 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
57Rem : for best audio quality try to keep a 0 attenuation on the PCM 64Rem : for best audio quality try to keep a 0 attenuation on the PCM
58and AES volume controls which is set by 219 in the range from 0 to 255 65and AES volume controls which is set by 219 in the range from 0 to 255
@@ -79,11 +86,14 @@ FIRMWARE
79For loading the firmware automatically after the module is loaded, use a 86For loading the firmware automatically after the module is loaded, use a
80install command. For example, add the following entry to 87install 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
88The firmware binaries are installed on /usr/share/alsa/firmware 98The 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 2Sound Blaster Live mixer / default DSP code
3 =========================================== 3===========================================
4 4
5 5
6The EMU10K1 chips have a DSP part which can be programmed to support 6The 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
151) IEC958 (S/PDIF) raw PCM 15IEC958 (S/PDIF) raw PCM
16-------------------------- 16=======================
17 17
18This PCM device (it's the 4th PCM device (index 3!) and first subdevice 18This 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.
27Look to tram_poke routines in lowlevel/emu10k1/emufx.c for more details. 27Look to tram_poke routines in lowlevel/emu10k1/emufx.c for more details.
28 28
29 29
302) Digital mixer controls 30Digital mixer controls
31------------------------- 31======================
32 32
33These controls are built using the DSP instructions. They offer extended 33These controls are built using the DSP instructions. They offer extended
34functionality. Only the default build-in code in the ALSA driver is described 34functionality. 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
41Explanation of used abbreviations: 41Explanation of used abbreviations:
42 42
43DAC - digital to analog converter 43DAC
44ADC - analog to digital converter 44 digital to analog converter
45I2S - one-way three wire serial bus for digital sound by Philips Semiconductors 45ADC
46 (this standard is used for connecting standalone DAC and ADC converters) 46 analog to digital converter
47LFE - low frequency effects (subwoofer signal) 47I2S
48AC97 - a chip containing an analog mixer, DAC and ADC converters 48 one-way three wire serial bus for digital sound by Philips Semiconductors
49IEC958 - S/PDIF 49 (this standard is used for connecting standalone DAC and ADC converters)
50FX-bus - the EMU10K1 chip has an effect bus containing 16 accumulators. 50LFE
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. 52AC97
53 53 a chip containing an analog mixer, DAC and ADC converters
54 54IEC958
55name='Wave Playback Volume',index=0 55 S/PDIF
56 56FX-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---------------------------------------
57This control is used to attenuate samples for left and right PCM FX-bus 64This control is used to attenuate samples for left and right PCM FX-bus
58accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. 65accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples.
59The result samples are forwarded to the front DAC PCM slots of the AC97 codec. 66The result samples are forwarded to the front DAC PCM slots of the AC97 codec.
60 67
61name='Wave Surround Playback Volume',index=0 68``name='Wave Surround Playback Volume',index=0``
62 69------------------------------------------------
63This control is used to attenuate samples for left and right PCM FX-bus 70This control is used to attenuate samples for left and right PCM FX-bus
64accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. 71accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples.
65The result samples are forwarded to the rear I2S DACs. These DACs operates 72The result samples are forwarded to the rear I2S DACs. These DACs operates
66separately (they are not inside the AC97 codec). 73separately (they are not inside the AC97 codec).
67 74
68name='Wave Center Playback Volume',index=0 75``name='Wave Center Playback Volume',index=0``
69 76----------------------------------------------
70This control is used to attenuate samples for left and right PCM FX-bus 77This control is used to attenuate samples for left and right PCM FX-bus
71accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples. 78accumulators. ALSA uses accumulators 0 and 1 for left and right PCM samples.
72The result is mixed to mono signal (single channel) and forwarded to 79The result is mixed to mono signal (single channel) and forwarded to
73the ??rear?? right DAC PCM slot of the AC97 codec. 80the ??rear?? right DAC PCM slot of the AC97 codec.
74 81
75name='Wave LFE Playback Volume',index=0 82``name='Wave LFE Playback Volume',index=0``
76 83-------------------------------------------
77This control is used to attenuate samples for left and right PCM FX-bus 84This control is used to attenuate samples for left and right PCM FX-bus
78accumulators. ALSA uses accumulators 0 and 1 for left and right PCM. 85accumulators. ALSA uses accumulators 0 and 1 for left and right PCM.
79The result is mixed to mono signal (single channel) and forwarded to 86The result is mixed to mono signal (single channel) and forwarded to
80the ??rear?? left DAC PCM slot of the AC97 codec. 87the ??rear?? left DAC PCM slot of the AC97 codec.
81 88
82name='Wave Capture Volume',index=0 89``name='Wave Capture Volume',index=0``, ``name='Wave Capture Switch',index=0``
83name='Wave Capture Switch',index=0 90------------------------------------------------------------------------------
84
85These controls are used to attenuate samples for left and right PCM FX-bus 91These controls are used to attenuate samples for left and right PCM FX-bus
86accumulator. ALSA uses accumulators 0 and 1 for left and right PCM. 92accumulator. ALSA uses accumulators 0 and 1 for left and right PCM.
87The result is forwarded to the ADC capture FIFO (thus to the standard capture 93The result is forwarded to the ADC capture FIFO (thus to the standard capture
88PCM device). 94PCM device).
89 95
90name='Synth Playback Volume',index=0 96``name='Synth Playback Volume',index=0``
91 97----------------------------------------
92This control is used to attenuate samples for left and right MIDI FX-bus 98This control is used to attenuate samples for left and right MIDI FX-bus
93accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples. 99accumulators. ALSA uses accumulators 4 and 5 for left and right MIDI samples.
94The result samples are forwarded to the front DAC PCM slots of the AC97 codec. 100The result samples are forwarded to the front DAC PCM slots of the AC97 codec.
95 101
96name='Synth Capture Volume',index=0 102``name='Synth Capture Volume',index=0``, ``name='Synth Capture Switch',index=0``
97name='Synth Capture Switch',index=0 103--------------------------------------------------------------------------------
98
99These controls are used to attenuate samples for left and right MIDI FX-bus 104These controls are used to attenuate samples for left and right MIDI FX-bus
100accumulator. ALSA uses accumulators 4 and 5 for left and right PCM. 105accumulator. ALSA uses accumulators 4 and 5 for left and right PCM.
101The result is forwarded to the ADC capture FIFO (thus to the standard capture 106The result is forwarded to the ADC capture FIFO (thus to the standard capture
102PCM device). 107PCM device).
103 108
104name='Surround Playback Volume',index=0 109``name='Surround Playback Volume',index=0``
105 110-------------------------------------------
106This control is used to attenuate samples for left and right rear PCM FX-bus 111This control is used to attenuate samples for left and right rear PCM FX-bus
107accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples. 112accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples.
108The result samples are forwarded to the rear I2S DACs. These DACs operate 113The result samples are forwarded to the rear I2S DACs. These DACs operate
109separately (they are not inside the AC97 codec). 114separately (they are not inside the AC97 codec).
110 115
111name='Surround Capture Volume',index=0 116``name='Surround Capture Volume',index=0``, ``name='Surround Capture Switch',index=0``
112name='Surround Capture Switch',index=0 117--------------------------------------------------------------------------------------
113
114These controls are used to attenuate samples for left and right rear PCM FX-bus 118These controls are used to attenuate samples for left and right rear PCM FX-bus
115accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples. 119accumulators. ALSA uses accumulators 2 and 3 for left and right rear PCM samples.
116The result is forwarded to the ADC capture FIFO (thus to the standard capture 120The result is forwarded to the ADC capture FIFO (thus to the standard capture
117PCM device). 121PCM device).
118 122
119name='Center Playback Volume',index=0 123``name='Center Playback Volume',index=0``
120 124-----------------------------------------
121This control is used to attenuate sample for center PCM FX-bus accumulator. 125This control is used to attenuate sample for center PCM FX-bus accumulator.
122ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded 126ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded
123to the ??rear?? right DAC PCM slot of the AC97 codec. 127to the ??rear?? right DAC PCM slot of the AC97 codec.
124 128
125name='LFE Playback Volume',index=0 129``name='LFE Playback Volume',index=0``
126 130--------------------------------------
127This control is used to attenuate sample for center PCM FX-bus accumulator. 131This control is used to attenuate sample for center PCM FX-bus accumulator.
128ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded 132ALSA uses accumulator 6 for center PCM sample. The result sample is forwarded
129to the ??rear?? left DAC PCM slot of the AC97 codec. 133to the ??rear?? left DAC PCM slot of the AC97 codec.
130 134
131name='AC97 Playback Volume',index=0 135``name='AC97 Playback Volume',index=0``
132 136---------------------------------------
133This control is used to attenuate samples for left and right front ADC PCM slots 137This control is used to attenuate samples for left and right front ADC PCM slots
134of the AC97 codec. The result samples are forwarded to the front DAC PCM 138of the AC97 codec. The result samples are forwarded to the front DAC PCM
135slots of the AC97 codec. 139slots 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
141name='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--------------------------------------
143This control is used to attenuate samples for left and right front ADC PCM slots 148This control is used to attenuate samples for left and right front ADC PCM slots
144of the AC97 codec. The result is forwarded to the ADC capture FIFO (thus to 149of the AC97 codec. The result is forwarded to the ADC capture FIFO (thus to
145the standard capture PCM device). 150the 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
151name='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---------------------------------------------
153This control is used to attenuate samples from left and right IEC958 TTL 158This control is used to attenuate samples from left and right IEC958 TTL
154digital inputs (usually used by a CDROM drive). The result samples are 159digital inputs (usually used by a CDROM drive). The result samples are
155forwarded to the front DAC PCM slots of the AC97 codec. 160forwarded to the front DAC PCM slots of the AC97 codec.
156 161
157name='IEC958 TTL Capture Volume',index=0 162``name='IEC958 TTL Capture Volume',index=0``
158 163--------------------------------------------
159This control is used to attenuate samples from left and right IEC958 TTL 164This control is used to attenuate samples from left and right IEC958 TTL
160digital inputs (usually used by a CDROM drive). The result samples are 165digital inputs (usually used by a CDROM drive). The result samples are
161forwarded to the ADC capture FIFO (thus to the standard capture PCM device). 166forwarded to the ADC capture FIFO (thus to the standard capture PCM device).
162 167
163name='Zoom Video Playback Volume',index=0 168``name='Zoom Video Playback Volume',index=0``
164 169---------------------------------------------
165This control is used to attenuate samples from left and right zoom video 170This control is used to attenuate samples from left and right zoom video
166digital inputs (usually used by a CDROM drive). The result samples are 171digital inputs (usually used by a CDROM drive). The result samples are
167forwarded to the front DAC PCM slots of the AC97 codec. 172forwarded to the front DAC PCM slots of the AC97 codec.
168 173
169name='Zoom Video Capture Volume',index=0 174``name='Zoom Video Capture Volume',index=0``
170 175--------------------------------------------
171This control is used to attenuate samples from left and right zoom video 176This control is used to attenuate samples from left and right zoom video
172digital inputs (usually used by a CDROM drive). The result samples are 177digital inputs (usually used by a CDROM drive). The result samples are
173forwarded to the ADC capture FIFO (thus to the standard capture PCM device). 178forwarded to the ADC capture FIFO (thus to the standard capture PCM device).
174 179
175name='IEC958 LiveDrive Playback Volume',index=0 180``name='IEC958 LiveDrive Playback Volume',index=0``
176 181---------------------------------------------------
177This control is used to attenuate samples from left and right IEC958 optical 182This control is used to attenuate samples from left and right IEC958 optical
178digital input. The result samples are forwarded to the front DAC PCM slots 183digital input. The result samples are forwarded to the front DAC PCM slots
179of the AC97 codec. 184of the AC97 codec.
180 185
181name='IEC958 LiveDrive Capture Volume',index=0 186``name='IEC958 LiveDrive Capture Volume',index=0``
182 187--------------------------------------------------
183This control is used to attenuate samples from left and right IEC958 optical 188This control is used to attenuate samples from left and right IEC958 optical
184digital inputs. The result samples are forwarded to the ADC capture FIFO 189digital 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
187name='IEC958 Coaxial Playback Volume',index=0 192``name='IEC958 Coaxial Playback Volume',index=0``
188 193-------------------------------------------------
189This control is used to attenuate samples from left and right IEC958 coaxial 194This control is used to attenuate samples from left and right IEC958 coaxial
190digital inputs. The result samples are forwarded to the front DAC PCM slots 195digital inputs. The result samples are forwarded to the front DAC PCM slots
191of the AC97 codec. 196of the AC97 codec.
192 197
193name='IEC958 Coaxial Capture Volume',index=0 198``name='IEC958 Coaxial Capture Volume',index=0``
194 199------------------------------------------------
195This control is used to attenuate samples from left and right IEC958 coaxial 200This control is used to attenuate samples from left and right IEC958 coaxial
196digital inputs. The result samples are forwarded to the ADC capture FIFO 201digital 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
199name='Line LiveDrive Playback Volume',index=0 204``name='Line LiveDrive Playback Volume',index=0``, ``name='Line LiveDrive Playback Volume',index=1``
200name='Line LiveDrive Playback Volume',index=1 205----------------------------------------------------------------------------------------------------
201
202This control is used to attenuate samples from left and right I2S ADC 206This control is used to attenuate samples from left and right I2S ADC
203inputs (on the LiveDrive). The result samples are forwarded to the front 207inputs (on the LiveDrive). The result samples are forwarded to the front
204DAC PCM slots of the AC97 codec. 208DAC PCM slots of the AC97 codec.
205 209
206name='Line LiveDrive Capture Volume',index=1 210``name='Line LiveDrive Capture Volume',index=1``, ``name='Line LiveDrive Capture Volume',index=1``
207name='Line LiveDrive Capture Volume',index=1 211--------------------------------------------------------------------------------------------------
208
209This control is used to attenuate samples from left and right I2S ADC 212This control is used to attenuate samples from left and right I2S ADC
210inputs (on the LiveDrive). The result samples are forwarded to the ADC 213inputs (on the LiveDrive). The result samples are forwarded to the ADC
211capture FIFO (thus to the standard capture PCM device). 214capture FIFO (thus to the standard capture PCM device).
212 215
213name='Tone Control - Switch',index=0 216``name='Tone Control - Switch',index=0``
214 217----------------------------------------
215This control turns the tone control on or off. The samples for front, rear 218This control turns the tone control on or off. The samples for front, rear
216and center / LFE outputs are affected. 219and center / LFE outputs are affected.
217 220
218name='Tone Control - Bass',index=0 221``name='Tone Control - Bass',index=0``
219 222--------------------------------------
220This control sets the bass intensity. There is no neutral value!! 223This control sets the bass intensity. There is no neutral value!!
221When the tone control code is activated, the samples are always modified. 224When the tone control code is activated, the samples are always modified.
222The closest value to pure signal is 20. 225The closest value to pure signal is 20.
223 226
224name='Tone Control - Treble',index=0 227``name='Tone Control - Treble',index=0``
225 228----------------------------------------
226This control sets the treble intensity. There is no neutral value!! 229This control sets the treble intensity. There is no neutral value!!
227When the tone control code is activated, the samples are always modified. 230When the tone control code is activated, the samples are always modified.
228The closest value to pure signal is 20. 231The closest value to pure signal is 20.
229 232
230name='IEC958 Optical Raw Playback Switch',index=0 233``name='IEC958 Optical Raw Playback Switch',index=0``
231 234-----------------------------------------------------
232If this switch is on, then the samples for the IEC958 (S/PDIF) digital 235If this switch is on, then the samples for the IEC958 (S/PDIF) digital
233output are taken only from the raw FX8010 PCM, otherwise standard front 236output are taken only from the raw FX8010 PCM, otherwise standard front
234PCM samples are taken. 237PCM samples are taken.
235 238
236name='Headphone Playback Volume',index=1 239``name='Headphone Playback Volume',index=1``
237 240--------------------------------------------
238This control attenuates the samples for the headphone output. 241This control attenuates the samples for the headphone output.
239 242
240name='Headphone Center Playback Switch',index=1 243``name='Headphone Center Playback Switch',index=1``
241 244---------------------------------------------------
242If this switch is on, then the sample for the center PCM is put to the 245If this switch is on, then the sample for the center PCM is put to the
243left headphone output (useful for SB Live cards without separate center/LFE 246left headphone output (useful for SB Live cards without separate center/LFE
244output). 247output).
245 248
246name='Headphone LFE Playback Switch',index=1 249``name='Headphone LFE Playback Switch',index=1``
247 250------------------------------------------------
248If this switch is on, then the sample for the center PCM is put to the 251If this switch is on, then the sample for the center PCM is put to the
249right headphone output (useful for SB Live cards without separate center/LFE 252right headphone output (useful for SB Live cards without separate center/LFE
250output). 253output).
251 254
252 255
2533) PCM stream related controls 256PCM stream related controls
254------------------------------ 257===========================
255
256name='EMU10K1 PCM Volume',index 0-31
257 258
259``name='EMU10K1 PCM Volume',index 0-31``
260----------------------------------------
258Channel volume attenuation in range 0-0xffff. The maximum value (no 261Channel volume attenuation in range 0-0xffff. The maximum value (no
259attenuation) is default. The channel mapping for three values is 262attenuation) is default. The channel mapping for three values is
260as follows: 263as 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
266name='EMU10K1 PCM Send Routing',index 0-31
267 268
269``name='EMU10K1 PCM Send Routing',index 0-31``
270----------------------------------------------
268This control specifies the destination - FX-bus accumulators. There are 271This control specifies the destination - FX-bus accumulators. There are
269twelve values with this mapping: 272twelve 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
284Don't forget that it's illegal to assign a channel to the same FX-bus accumulator 287Don't forget that it's illegal to assign a channel to the same FX-bus accumulator
285more than once (it means 0=0 && 1=0 is an invalid combination). 288more than once (it means 0=0 && 1=0 is an invalid combination).
286 289
287name='EMU10K1 PCM Send Volume',index 0-31 290``name='EMU10K1 PCM Send Volume',index 0-31``
288 291---------------------------------------------
289It specifies the attenuation (amount) for given destination in range 0-255. 292It specifies the attenuation (amount) for given destination in range 0-255.
290The channel mapping is following: 293The 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
3074) MANUALS/PATENTS: 310MANUALS/PATENTS
308------------------- 311===============
309 312
310ftp://opensource.creative.com/pub/doc 313ftp://opensource.creative.com/pub/doc
311------------------------------------- 314-------------------------------------
312 315
313 Files: 316LM4545.pdf
314 LM4545.pdf AC97 Codec 317 AC97 Codec
315 318m2049.pdf
316 m2049.pdf The EMU10K1 Digital Audio Processor 319 The EMU10K1 Digital Audio Processor
317 320hog63.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
321WIPO Patents 324WIPO 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) 327WO 9901813 (A1)
328 Audio Effects Processor with multiple asynchronous streams
329 (Jan. 14, 1999)
330
331WO 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 334WO 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
333US Patents (http://www.uspto.gov/) 339US Patents (http://www.uspto.gov/)
334---------------------------------- 340----------------------------------
335 341
336 US 5925841 Digital Sampling Instrument employing cache memory (Jul. 20, 1999) 342US 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 345US 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 351US 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 354US 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 357US 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
363US 6151670
364 Method for conserving memory storage using a
365 pool of short term memory registers
366 (Nov. 21, 2000)
367
368US 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 2Serial UART 16450/16550 MIDI driver
3 =================================== 3===================================
4 4
5The adaptor module parameter allows you to select either: 5The 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
13For the Midiator MS-124W, you must set the physical M-S and A-B 13For the Midiator MS-124W, you must set the physical M-S and A-B
14switches on the Midiator to match the driver mode you select. 14switches 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
22send the F5 NN command sequence at all; perhaps it ought to. 22send the F5 NN command sequence at all; perhaps it ought to.
23 23
24Usage example for simple serial converter: 24Usage 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
29Usage example for Roland SoundCanvas with 4 MIDI ports: 30Usage 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
37parameter to match (A=19200, B=9600). 39parameter to match (A=19200, B=9600).
38 40
39Usage example for MS-124T, with A-B switch in A position: 41Usage 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
47the same data to all four MIDI Out connectors at full MIDI speed. 50the same data to all four MIDI Out connectors at full MIDI speed.
48 51
49Usage example for S/A mode: 52Usage 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
63one byte every 320 us per port. 67one byte every 320 us per port.
64 68
65Usage example for M/B mode: 69Usage 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=============
2VIA82xx mixer
3=============
4
5On many VIA82xx boards, the ``Input Source Select`` mixer control does not work.
6Setting it to ``Input2`` on such boards will cause recording to hang, or fail
7with EIO (input/output error) via OSS emulation. This control should be left
8at ``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============================
1ALSA PCM channel-mapping API 2ALSA PCM channel-mapping API
2============================ 3============================
3 Takashi Iwai <tiwai@suse.de>
4 4
5GENERAL 5Takashi Iwai <tiwai@suse.de>
6------- 6
7General
8=======
7 9
8The channel mapping API allows user to query the possible channel maps 10The channel mapping API allows user to query the possible channel maps
9and the current channel map, also optionally to modify the channel map 11and the current channel map, also optionally to modify the channel map
@@ -11,9 +13,9 @@ of the current stream.
11 13
12A channel map is an array of position for each PCM channel. 14A channel map is an array of position for each PCM channel.
13Typically, a stereo PCM stream has a channel map of 15Typically, a stereo PCM stream has a channel map of
14 { front_left, front_right } 16``{ front_left, front_right }``
15while a 4.0 surround PCM stream has a channel map of 17while 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
18The problem, so far, was that we had no standard channel map 20The problem, so far, was that we had no standard channel map
19explicitly, and applications had no way to know which channel 21explicitly, and applications had no way to know which channel
@@ -29,8 +31,8 @@ specification. These are the main motivations for the new channel
29mapping API. 31mapping API.
30 32
31 33
32DESIGN 34Design
33------ 35======
34 36
35Actually, "the channel mapping API" doesn't introduce anything new in 37Actually, "the channel mapping API" doesn't introduce anything new in
36the kernel/user-space ABI perspective. It uses only the existing 38the kernel/user-space ABI perspective. It uses only the existing
@@ -39,10 +41,11 @@ control element features.
39As a ground design, each PCM substream may contain a control element 41As a ground design, each PCM substream may contain a control element
40providing the channel mapping information and configuration. This 42providing the channel mapping information and configuration. This
41element is specified by: 43element 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
47Note the name is different depending on the PCM substream direction. 50Note 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
50read operation. Optionally, the write operation can be provided to 53read operation. Optionally, the write operation can be provided to
51allow user to change the channel map dynamically. 54allow user to change the channel map dynamically.
52 55
53* TLV 56TLV
57---
54 58
55The TLV operation gives the list of available channel 59The TLV operation gives the list of available channel
56maps. A list item of a channel map is usually a TLV of 60maps. 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...``
58where type is the TLV type value, the second argument is the total 62where type is the TLV type value, the second argument is the total
59bytes (not the numbers) of channel values, and the rest are the 63bytes (not the numbers) of channel values, and the rest are the
60position value for each channel. 64position value for each channel.
61 65
62As a TLV type, either SNDRV_CTL_TLVT_CHMAP_FIXED, 66As a TLV type, either ``SNDRV_CTL_TLVT_CHMAP_FIXED``,
63SNDRV_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.
64The _FIXED type is for a channel map with the fixed channel position 68The ``_FIXED`` type is for a channel map with the fixed channel position
65while the latter two are for flexible channel positions. _VAR type is 69while the latter two are for flexible channel positions. ``_VAR`` type is
66for a channel map where all channels are freely swappable and _PAIRED 70for a channel map where all channels are freely swappable and ``_PAIRED``
67type is where pair-wise channels are swappable. For example, when you 71type is where pair-wise channels are swappable. For example, when you
68have {FL/FR/RL/RR} channel map, _PAIRED type would allow you to swap 72have {FL/FR/RL/RR} channel map, ``_PAIRED`` type would allow you to swap
69only {RL/RR/FL/FR} while _VAR type would allow even swapping FL and 73only {RL/RR/FL/FR} while ``_VAR`` type would allow even swapping FL and
70RR. 74RR.
71 75
72These new TLV types are defined in sound/tlv.h. 76These new TLV types are defined in ``sound/tlv.h``.
73 77
74The available channel position values are defined in sound/asound.h, 78The available channel position values are defined in ``sound/asound.h``,
75here is a cut: 79here is a cut:
76 80
77/* channel positions */ 81::
78enum { 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
112When a PCM stream can provide more than one channel map, you can 118When a PCM stream can provide more than one channel map, you can
113provide multiple channel maps in a TLV container type. The TLV data 119provide multiple channel maps in a TLV container type. The TLV data
114to be returned will contain such as: 120to 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
121The channel position is provided in LSB 16bits. The upper bits are 129The channel position is provided in LSB 16bits. The upper bits are
122used for bit flags. 130used 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
128SNDRV_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).
130Some digital mic devices have this. 139Some digital mic devices have this.
131 140
132When SNDRV_CHMAP_DRIVER_SPEC is set, all the channel position values 141When ``SNDRV_CHMAP_DRIVER_SPEC`` is set, all the channel position values
133don't follow the standard definition above but driver-specific. 142don't follow the standard definition above but driver-specific.
134 143
135* READ OPERATION 144Read Operation
145--------------
136 146
137The control read operation is for providing the current channel map of 147The control read operation is for providing the current channel map of
138the given stream. The control element returns an integer array 148the given stream. The control element returns an integer array
@@ -140,9 +150,10 @@ containing the position of each channel.
140 150
141When this is performed before the number of the channel is specified 151When 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
143UNKNOWN. 153``UNKNOWN``.
144 154
145* WRITE OPERATION 155Write Operation
156---------------
146 157
147The control write operation is optional, and only for devices that can 158The control write operation is optional, and only for devices that can
148change the channel configuration on the fly, such as HDMI. User needs 159change 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 ===================== 2ALSA Compress-Offload API
3 Pierre-Louis.Bossart <pierre-louis.bossart@linux.intel.com> 3=========================
4 Vinod Koul <vinod.koul@linux.intel.com> 4
5Pierre-Louis.Bossart <pierre-louis.bossart@linux.intel.com>
6
7Vinod Koul <vinod.koul@linux.intel.com>
5 8
6Overview
7 9
10Overview
11========
8Since its early days, the ALSA API was defined with PCM support or 12Since its early days, the ALSA API was defined with PCM support or
9constant bitrates payloads such as IEC61937 in mind. Arguments and 13constant bitrates payloads such as IEC61937 in mind. Arguments and
10returned values in frames are the norm, making it a challenge to 14returned 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
27API in the mainline kernel instead of the staging tree and make it 31API in the mainline kernel instead of the staging tree and make it
28usable by others. 32usable by others.
29 33
30Requirements
31 34
35Requirements
36============
32The main requirements are: 37The 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
74Design 79Design
75 80======
76The new API shares a number of concepts with the PCM API for flow 81The new API shares a number of concepts with the PCM API for flow
77control. Start, pause, resume, drain and stop commands have the same 82control. Start, pause, resume, drain and stop commands have the same
78semantics no matter what the content is. 83semantics no matter what the content is.
@@ -95,43 +100,44 @@ mandatory routines and possibly make use of optional ones.
95 100
96The main additions are 101The main additions are
97 102
98- get_caps 103get_caps
99This routine returns the list of audio formats supported. Querying the 104 This routine returns the list of audio formats supported. Querying the
100codecs on a capture stream will return encoders, decoders will be 105 codecs on a capture stream will return encoders, decoders will be
101listed for playback streams. 106 listed for playback streams.
102 107
103- get_codec_caps For each codec, this routine returns a list of 108get_codec_caps
104capabilities. The intent is to make sure all the capabilities 109 For each codec, this routine returns a list of
105correspond to valid settings, and to minimize the risks of 110 capabilities. The intent is to make sure all the capabilities
106configuration failures. For example, for a complex codec such as AAC, 111 correspond to valid settings, and to minimize the risks of
107the number of channels supported may depend on a specific profile. If 112 configuration failures. For example, for a complex codec such as AAC,
108the capabilities were exposed with a single descriptor, it may happen 113 the number of channels supported may depend on a specific profile. If
109that a specific combination of profiles/channels/formats may not be 114 the capabilities were exposed with a single descriptor, it may happen
110supported. Likewise, embedded DSPs have limited memory and cpu cycles, 115 that a specific combination of profiles/channels/formats may not be
111it is likely that some implementations make the list of capabilities 116 supported. Likewise, embedded DSPs have limited memory and cpu cycles,
112dynamic and dependent on existing workloads. In addition to codec 117 it is likely that some implementations make the list of capabilities
113settings, this routine returns the minimum buffer size handled by the 118 dynamic and dependent on existing workloads. In addition to codec
114implementation. This information can be a function of the DMA buffer 119 settings, this routine returns the minimum buffer size handled by the
115sizes, the number of bytes required to synchronize, etc, and can be 120 implementation. This information can be a function of the DMA buffer
116used 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
117buffer 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
120This routine sets the configuration chosen for a specific codec. The 125set_params
121most important field in the parameters is the codec type; in most 126 This routine sets the configuration chosen for a specific codec. The
122cases decoders will ignore other fields, while encoders will strictly 127 most important field in the parameters is the codec type; in most
123comply to the settings 128 cases decoders will ignore other fields, while encoders will strictly
124 129 comply to the settings
125- get_params 130
126This routines returns the actual settings used by the DSP. Changes to 131get_params
127the 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
130The timestamp becomes a multiple field structure. It lists the number 135get_timestamp
131of bytes transferred, the number of samples processed and the number 136 The timestamp becomes a multiple field structure. It lists the number
132of samples rendered/grabbed. All these values can be used to determine 137 of bytes transferred, the number of samples processed and the number
133the average bitrate, figure out if the ring buffer needs to be 138 of samples rendered/grabbed. All these values can be used to determine
134refilled 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
136Note that the list of codecs/profiles/modes was derived from the 142Note that the list of codecs/profiles/modes was derived from the
137OpenMAX AL specification instead of reinventing the wheel. 143OpenMAX 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
148Gapless Playback 155Gapless Playback
149================ 156================
150When playing thru an album, the decoders have the ability to skip the encoder 157When 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
163The main additions are: 170The main additions are:
164 171
165- set_metadata 172set_metadata
166This 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
167decoder 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
168is written. 175 is written.
169 176
170- set_next_track 177set_next_track
171This 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
172correspond to subsequent track 179 correspond to subsequent track
173 180
174- partial drain 181partial drain
175This 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
176EOF 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
177data would belong to next track 184 data would belong to next track
178 185
179Sequence flow for gapless would be: 186Sequence 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
194Not supported:
195 202
203Not 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
228Credits: 237
238Credits
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===========================
2Standard ALSA Control Names
3===========================
4
5This document describes standard names of mixer controls.
6
7Standard Syntax
8---------------
9Syntax: [LOCATION] SOURCE [CHANNEL] [DIRECTION] FUNCTION
10
11
12DIRECTION
13~~~~~~~~~
14================ ===============
15<nothing> both directions
16Playback one direction
17Capture one direction
18Bypass Playback one direction
19Bypass Capture one direction
20================ ===============
21
22FUNCTION
23~~~~~~~~
24======== =================================
25Switch on/off switch
26Volume amplifier
27Route route control, hardware specific
28======== =================================
29
30CHANNEL
31~~~~~~~
32============ ==================================================
33<nothing> channel independent, or applies to all channels
34Front front left/right channels
35Surround rear left/right in 4.0/5.1 surround
36CLFE C/LFE channels
37Center center cannel
38LFE LFE channel
39Side side left/right for 7.1 surround
40============ ==================================================
41
42LOCATION (Physical location of source)
43~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
44============ =====================
45Front front position
46Rear rear position
47Dock on docking station
48Internal internal
49============ =====================
50
51SOURCE
52~~~~~~
53=================== =================================================
54Master
55Master Mono
56Hardware Master
57Speaker internal speaker
58Bass Speaker internal LFE speaker
59Headphone
60Line Out
61Beep beep generator
62Phone
63Phone Input
64Phone Output
65Synth
66FM
67Mic
68Headset Mic mic part of combined headset jack - 4-pin
69 headphone + mic
70Headphone Mic mic part of either/or - 3-pin headphone or mic
71Line input only, use "Line Out" for output
72CD
73Video
74Zoom Video
75Aux
76PCM
77PCM Pan
78Loopback
79Analog Loopback D/A -> A/D loopback
80Digital Loopback playback -> capture loopback -
81 without analog path
82Mono
83Mono Output
84Multi
85ADC
86Wave
87Music
88I2S
89IEC958
90HDMI
91SPDIF output only
92SPDIF In
93Digital In
94HDMI/DP either HDMI or DisplayPort
95=================== =================================================
96
97Exceptions (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
106Tone Control - Switch
107Tone Control - Bass
108Tone Control - Treble
1093D Control - Switch
1103D Control - Center
1113D Control - Depth
1123D Control - Wide
1133D Control - Space
1143D Control - Level
115Mic Boost [(?dB)]
116===================================== =======================
117
118PCM interface
119-------------
120
121=================== ========================================
122Sample Clock Source { "Word", "Internal", "AutoSync" }
123Clock Sync Status { "Lock", "Sync", "No Lock" }
124External Rate external capture rate
125Capture Rate capture rate taken from external source
126=================== ========================================
127
128IEC958 (S/PDIF) interface
129-------------------------
130
131============================================ ======================================
132IEC958 [...] [Playback|Capture] Switch turn on/off the IEC958 interface
133IEC958 [...] [Playback|Capture] Volume digital volume control
134IEC958 [...] [Playback|Capture] Default default or global value - read/write
135IEC958 [...] [Playback|Capture] Mask consumer and professional mask
136IEC958 [...] [Playback|Capture] Con Mask consumer mask
137IEC958 [...] [Playback|Capture] Pro Mask professional mask
138IEC958 [...] [Playback|Capture] PCM Stream the settings assigned to a PCM stream
139IEC958 Q-subcode [Playback|Capture] Default Q-subcode bits
140
141IEC958 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 @@
1Designs 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==================
2ALSA Jack Controls
3==================
4
1Why we need Jack kcontrols 5Why we need Jack kcontrols
2========================== 6==========================
3 7
@@ -29,11 +33,12 @@ How to use jack kcontrols
29========================= 33=========================
30 34
31In order to keep compatibility, snd_jack_new() has been modified by 35In order to keep compatibility, snd_jack_new() has been modified by
32adding two params :- 36adding two params:
33 37
34 - @initial_kctl: if true, create a kcontrol and add it to the jack 38initial_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. 40phantom_jack
41 Don't create a input device for phantom jacks.
37 42
38HDA jacks can set phantom_jack to true in order to create a phantom 43HDA jacks can set phantom_jack to true in order to create a phantom
39jack and set initial_kctl to true to create an initial kcontrol with 44jack 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 ============================= 2Notes on Kernel OSS-Emulation
3=============================
3 4
4 Jan. 22, 2004 Takashi Iwai <tiwai@suse.de> 5Jan. 22, 2004 Takashi Iwai <tiwai@suse.de>
5 6
6 7
7Modules 8Modules
@@ -14,18 +15,18 @@ When you need to access the OSS PCM, mixer or sequencer devices, the
14corresponding module has to be loaded. 15corresponding module has to be loaded.
15 16
16These modules are loaded automatically when the corresponding service 17These modules are loaded automatically when the corresponding service
17is called. The alias is defined sound-service-x-y, where x and y are 18is called. The alias is defined ``sound-service-x-y``, where x and y are
18the card number and the minor unit number. Usually you don't have to 19the card number and the minor unit number. Usually you don't have to
19define these aliases by yourself. 20define these aliases by yourself.
20 21
21Only necessary step for auto-loading of OSS modules is to define the 22Only necessary step for auto-loading of OSS modules is to define the
22card alias in /etc/modprobe.d/alsa.conf, such as 23card 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
26As the second card, define sound-slot-1 as well. 27As the second card, define ``sound-slot-1`` as well.
27Note that you can't use the aliased name as the target name (i.e. 28Note 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
29modutils). 30modutils).
30 31
31The currently available OSS configuration is shown in 32The currently available OSS configuration is shown in
@@ -42,6 +43,7 @@ Device Mapping
42============== 43==============
43 44
44ALSA supports the following OSS device files: 45ALSA 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:
61where X is the card number from 0 to 7. 63where 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.) 67a totally different thing.)
66 68
67Unlike the real OSS, ALSA cannot use the device files more than the 69Unlike the real OSS, ALSA cannot use the device files more than the
68assigned ones. For example, the first card cannot use /dev/dsp1 or 70assigned 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
71As seen above, PCM and MIDI may have two devices. Usually, the first 73As seen above, PCM and MIDI may have two devices. Usually, the first
72PCM device (hw:0,0 in ALSA) is mapped to /dev/dsp and the secondary 74PCM device (``hw:0,0`` in ALSA) is mapped to /dev/dsp and the secondary
73device (hw:0,1) to /dev/adsp (if available). For MIDI, /dev/midi and 75device (``hw:0,1``) to /dev/adsp (if available). For MIDI, /dev/midi and
74/dev/amidi, respectively. 76/dev/amidi, respectively.
75 77
76You can change this device mapping via the module options of 78You can change this device mapping via the module options of
77snd-pcm-oss and snd-rawmidi. In the case of PCM, the following 79snd-pcm-oss and snd-rawmidi. In the case of PCM, the following
78options are available for snd-pcm-oss: 80options are available for snd-pcm-oss:
79 81
80 dsp_map PCM device number assigned to /dev/dspX 82dsp_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) 85adsp_map
86 PCM device number assigned to /dev/adspX
87 (default = 1)
84 88
85For example, to map the third PCM device (hw:0,2) to /dev/adsp0, 89For example, to map the third PCM device (``hw:0,2``) to /dev/adsp0,
86define like this: 90define like this:
91::
87 92
88 options snd-pcm-oss adsp_map=2 93 options snd-pcm-oss adsp_map=2
89 94
90The options take arrays. For configuring the second card, specify 95The options take arrays. For configuring the second card, specify
91two entries separated by comma. For example, to map the third PCM 96two entries separated by comma. For example, to map the third PCM
92device on the second card to /dev/adsp1, define like below: 97device 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
96To change the mapping of MIDI devices, the following options are 102To change the mapping of MIDI devices, the following options are
97available for snd-rawmidi: 103available for snd-rawmidi:
98 104
99 midi_map MIDI device number assigned to /dev/midi0X 105midi_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) 108amidi_map
109 MIDI device number assigned to /dev/amidi0X
110 (default = 1)
103 111
104For example, to assign the third MIDI device on the first card to 112For 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
119In such a case, you can change the behavior of PCM per application by 128In such a case, you can change the behavior of PCM per application by
120writing a command to the proc file. There is a proc file for each PCM 129writing a command to the proc file. There is a proc file for each PCM
121stream, /proc/asound/cardX/pcmY[cp]/oss, where X is the card number 130stream, ``/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
123playback and 'c' for capture, respectively. Note that this proc file 132playback and ``c`` for capture, respectively. Note that this proc file
124exists only after snd-pcm-oss module is loaded. 133exists only after snd-pcm-oss module is loaded.
125 134
126The command sequence has the following syntax: 135The 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
130app_name is the name of application with (higher priority) or without 140``app_name`` is the name of application with (higher priority) or without
131path. 141path.
132fragments specifies the number of fragments or zero if no specific 142``fragments`` specifies the number of fragments or zero if no specific
133number is given. 143number is given.
134fragment_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.
135options is the optional parameters. The following options are 145``options`` is the optional parameters. The following options are
136available: 146available:
137 147
138 disable the application tries to open a pcm device for 148disable
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 151direct
142 non-block force non-block open mode 152 don't use plugins
143 partial-frag write also partial fragments (affects playback only) 153block
144 no-silence do not fill silence ahead to avoid clicks 154 force block open mode
145 155non-block
146The disable option is useful when one stream direction (playback or 156 force non-block open mode
157partial-frag
158 write also partial fragments (affects playback only)
159no-silence
160 do not fill silence ahead to avoid clicks
161
162The ``disable`` option is useful when one stream direction (playback or
147capture) is not handled correctly by the application although the 163capture) is not handled correctly by the application although the
148hardware itself does support both directions. 164hardware itself does support both directions.
149The direct option is used, as mentioned above, to bypass the automatic 165The ``direct`` option is used, as mentioned above, to bypass the automatic
150conversion and useful for MMAP-applications. 166conversion and useful for MMAP-applications.
151For example, to playback the first PCM device without plugins for 167For example, to playback the first PCM device without plugins for
152quake, send a command via echo like the following: 168quake, 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
156While quake wants only playback, you may append the second command 173While quake wants only playback, you may append the second command
157to notify driver that only this direction is about to be allocated: 174to 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.
171This blocking behavior can be changed globally via nonblock_open 189This blocking behavior can be changed globally via nonblock_open
172module option of snd-pcm-oss. For using the blocking mode as default 190module option of snd-pcm-oss. For using the blocking mode as default
173for OSS devices, define like the following: 191for 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
177The partial-frag and no-silence commands have been added recently. 196The ``partial-frag`` and ``no-silence`` commands have been added recently.
178Both commands are for optimization use only. The former command 197Both commands are for optimization use only. The former command
179specifies to invoke the write transfer only when the whole fragment is 198specifies to invoke the write transfer only when the whole fragment is
180filled. The latter stops writing the silence data ahead 199filled. The latter stops writing the silence data ahead
@@ -183,15 +202,18 @@ automatically. Both are disabled as default.
183You can check the currently defined configuration by reading the proc 202You can check the currently defined configuration by reading the proc
184file. The read image can be sent to the proc file again, hence you 203file. The read image can be sent to the proc file again, hence you
185can save the current configuration 204can 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
189and restore it like 209and 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
193Also, for clearing all the current configuration, send "erase" command 214Also, for clearing all the current configuration, send ``erase`` command
194as below: 215as 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
212As default, ALSA uses the following control for OSS volumes: 234As default, ALSA uses the following control for OSS volumes:
213 235
214 OSS volume ALSA control Index 236==================== ===================== =====
215 ----------------------------------------------------- 237OSS volume ALSA control Index
216 SOUND_MIXER_VOLUME Master 0 238==================== ===================== =====
217 SOUND_MIXER_BASS Tone Control - Bass 0 239SOUND_MIXER_VOLUME Master 0
218 SOUND_MIXER_TREBLE Tone Control - Treble 0 240SOUND_MIXER_BASS Tone Control - Bass 0
219 SOUND_MIXER_SYNTH Synth 0 241SOUND_MIXER_TREBLE Tone Control - Treble 0
220 SOUND_MIXER_PCM PCM 0 242SOUND_MIXER_SYNTH Synth 0
221 SOUND_MIXER_SPEAKER PC Speaker 0 243SOUND_MIXER_PCM PCM 0
222 SOUND_MIXER_LINE Line 0 244SOUND_MIXER_SPEAKER PC Speaker 0
223 SOUND_MIXER_MIC Mic 0 245SOUND_MIXER_LINE Line 0
224 SOUND_MIXER_CD CD 0 246SOUND_MIXER_MIC Mic 0
225 SOUND_MIXER_IMIX Monitor Mix 0 247SOUND_MIXER_CD CD 0
226 SOUND_MIXER_ALTPCM PCM 1 248SOUND_MIXER_IMIX Monitor Mix 0
227 SOUND_MIXER_RECLEV (not assigned) 249SOUND_MIXER_ALTPCM PCM 1
228 SOUND_MIXER_IGAIN Capture 0 250SOUND_MIXER_RECLEV (not assigned)
229 SOUND_MIXER_OGAIN Playback 0 251SOUND_MIXER_IGAIN Capture 0
230 SOUND_MIXER_LINE1 Aux 0 252SOUND_MIXER_OGAIN Playback 0
231 SOUND_MIXER_LINE2 Aux 1 253SOUND_MIXER_LINE1 Aux 0
232 SOUND_MIXER_LINE3 Aux 2 254SOUND_MIXER_LINE2 Aux 1
233 SOUND_MIXER_DIGITAL1 Digital 0 255SOUND_MIXER_LINE3 Aux 2
234 SOUND_MIXER_DIGITAL2 Digital 1 256SOUND_MIXER_DIGITAL1 Digital 0
235 SOUND_MIXER_DIGITAL3 Digital 2 257SOUND_MIXER_DIGITAL2 Digital 1
236 SOUND_MIXER_PHONEIN Phone 0 258SOUND_MIXER_DIGITAL3 Digital 2
237 SOUND_MIXER_PHONEOUT Phone 1 259SOUND_MIXER_PHONEIN Phone 0
238 SOUND_MIXER_VIDEO Video 0 260SOUND_MIXER_PHONEOUT Phone 1
239 SOUND_MIXER_RADIO Radio 0 261SOUND_MIXER_VIDEO Video 0
240 SOUND_MIXER_MONITOR Monitor 0 262SOUND_MIXER_RADIO Radio 0
263SOUND_MIXER_MONITOR Monitor 0
264==================== ===================== =====
241 265
242The second column is the base-string of the corresponding ALSA 266The second column is the base-string of the corresponding ALSA
243control. In fact, the controls with "XXX [Playback|Capture] 267control. 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
246The current assignment of these mixer elements is listed in the proc 270The current assignment of these mixer elements is listed in the proc
247file, /proc/asound/cardX/oss_mixer, which will be like the following 271file, /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.
261For changing the assignment, you can write the configuration to this 286For changing the assignment, you can write the configuration to this
262proc file. For example, to map "Wave Playback" to the PCM volume, 287proc file. For example, to map "Wave Playback" to the PCM volume,
263send the command like the following: 288send 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
284Note that when attempting to use a single device file for playback and 310Note that when attempting to use a single device file for playback and
285capture, the OSS API provides no way to set the format, sample rate or 311capture, the OSS API provides no way to set the format, sample rate or
286number of channels different in each direction. Thus 312number of channels different in each direction. Thus
313::
314
287 io_handle = open("device", O_RDWR) 315 io_handle = open("device", O_RDWR)
316
288will only function correctly if the values are the same in each direction. 317will only function correctly if the values are the same in each direction.
289 318
290To use different values in the two directions, use both 319To 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
293and set the values for the corresponding handle. 325and set the values for the corresponding handle.
294 326
295 327
@@ -302,4 +334,3 @@ ICE1712 supports only the unconventional format, interleaved
30210-channels 24bit (packed in 32bit) format. Therefore you cannot mmap 33410-channels 24bit (packed in 32bit) format. Therefore you cannot mmap
303the buffer as the conventional (mono or 2-channels, 8 or 16bit) format 335the buffer as the conventional (mono or 2-channels, 8 or 16bit) format
304on OSS. 336on 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==========================
1Notes on Power-Saving Mode 2Notes on Power-Saving Mode
2========================== 3==========================
3 4
4AC97 and HD-audio drivers have the automatic power-saving mode. 5AC97 and HD-audio drivers have the automatic power-saving mode.
5This feature is enabled via Kconfig CONFIG_SND_AC97_POWER_SAVE 6This feature is enabled via Kconfig ``CONFIG_SND_AC97_POWER_SAVE``
6and CONFIG_SND_HDA_POWER_SAVE options, respectively. 7and ``CONFIG_SND_HDA_POWER_SAVE`` options, respectively.
7 8
8With the automatic power-saving, the driver turns off the codec power 9With the automatic power-saving, the driver turns off the codec power
9appropriately when no operation is required. When no applications use 10appropriately 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
11done fully or partially. It'll save a certain power consumption, thus 12done fully or partially. It'll save a certain power consumption, thus
12good for laptops (even for desktops). 13good for laptops (even for desktops).
13 14
14The time-out for automatic power-off can be specified via power_save 15The time-out for automatic power-off can be specified via ``power_save``
15module option of snd-ac97-codec and snd-hda-intel modules. Specify 16module option of snd-ac97-codec and snd-hda-intel modules. Specify
16the time-out value in seconds. 0 means to disable the automatic 17the time-out value in seconds. 0 means to disable the automatic
17power-saving. The default value of timeout is given via 18power-saving. The default value of timeout is given via
18CONFIG_SND_AC97_POWER_SAVE_DEFAULT and 19``CONFIG_SND_AC97_POWER_SAVE_DEFAULT`` and
19CONFIG_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
21reopen the device frequently. 10 would be a good choice for normal 22reopen the device frequently. 10 would be a good choice for normal
22operations. 23operations.
23 24
24The power_save option is exported as writable. This means you can 25The ``power_save`` option is exported as writable. This means you can
25adjust the value via sysfs on the fly. For example, to turn on the 26adjust the value via sysfs on the fly. For example, to turn on the
26automatic power-save mode with 10 seconds, write to 27automatic 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 ========================== 2Proc Files of ALSA Drivers
3 Takashi Iwai <tiwai@suse.de> 3==========================
4
5Takashi Iwai <tiwai@suse.de>
4 6
5General 7General
6------- 8=======
7 9
8ALSA has its own proc tree, /proc/asound. Many useful information are 10ALSA has its own proc tree, /proc/asound. Many useful information are
9found in this tree. When you encounter a problem and need debugging, 11found in this tree. When you encounter a problem and need debugging,
10check the files listed in the following sections. 12check the files listed in the following sections.
11 13
12Each card has its subtree cardX, where X is from 0 to 7. The 14Each card has its subtree cardX, where X is from 0 to 7. The
13card-specific files are stored in the card* subdirectories. 15card-specific files are stored in the ``card*`` subdirectories.
14 16
15 17
16Global Information 18Global Information
17------------------ 19==================
18 20
19cards 21cards
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
32meminfo 34meminfo
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
36hwdep 38hwdep
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
40pcm 42pcm
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
44timer 46timer
45 Lists the currently available timer devices 47 Lists the currently available timer devices
@@ -54,23 +56,23 @@ oss/sndstat
54 56
55 57
56Card Specific Files 58Card Specific Files
57------------------- 59===================
58 60
59The card-specific files are found in /proc/asound/card* directories. 61The card-specific files are found in ``/proc/asound/card*`` directories.
60Some drivers (e.g. cmipci) have their own proc entries for the 62Some drivers (e.g. cmipci) have their own proc entries for the
61register dump, etc (e.g. /proc/asound/card*/cmipci shows the register 63register dump, etc (e.g. ``/proc/asound/card*/cmipci`` shows the register
62dump). These files would be really helpful for debugging. 64dump). These files would be really helpful for debugging.
63 65
64When PCM devices are available on this card, you can see directories 66When PCM devices are available on this card, you can see directories
65like pcm0p or pcm1c. They hold the PCM information for each PCM 67like pcm0p or pcm1c. They hold the PCM information for each PCM
66stream. The number after 'pcm' is the PCM device number from 0, and 68stream. The number after ``pcm`` is the PCM device number from 0, and
67the last 'p' or 'c' means playback or capture direction. The files in 69the last ``p`` or ``c`` means playback or capture direction. The files in
68this subtree is described later. 70this subtree is described later.
69 71
70The status of MIDI I/O is found in midi* files. It shows the device 72The status of MIDI I/O is found in ``midi*`` files. It shows the device
71name and the received/transmitted bytes through the MIDI device. 73name and the received/transmitted bytes through the MIDI device.
72 74
73When the card is equipped with AC97 codecs, there are codec97#* 75When the card is equipped with AC97 codecs, there are ``codec97#*``
74subdirectories (described later). 76subdirectories (described later).
75 77
76When the OSS mixer emulation is enabled (and the module is loaded), 78When the OSS mixer emulation is enabled (and the module is loaded),
@@ -81,26 +83,27 @@ details.
81 83
82 84
83PCM Proc Files 85PCM Proc Files
84-------------- 86==============
85 87
86card*/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
90card*/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
120card*/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
123card*/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
127card*/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
130card*/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
133card*/pcm*/sub*/prealloc 136``card*/pcm*/sub*/prealloc``
134 The buffer pre-allocation information. 137 The buffer pre-allocation information.
135 138
136card*/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
141AC97 Codec Information 144AC97 Codec Information
142---------------------- 145======================
143 146
144card*/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
148card*/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
158USB Audio Streams 163USB Audio Streams
159----------------- 164=================
160 165
161card*/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
166HD-Audio Codecs 171HD-Audio Codecs
167--------------- 172===============
168 173
169card*/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
173card*/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
184Sequencer Information 189Sequencer Information
185--------------------- 190=====================
186 191
187seq/drivers 192seq/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
205Help For Debugging? 210Help For Debugging?
206------------------- 211===================
207 212
208When the problem is related with PCM, first try to turn on xrun_debug 213When the problem is related with PCM, first try to turn on xrun_debug
209mode. This will give you the kernel messages when and where xrun 214mode. This will give you the kernel messages when and where xrun
@@ -211,24 +216,23 @@ happened.
211 216
212If it's really a bug, report it with the following information: 217If 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
217when it's a PCM problem, 222when 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
222when it's a mixer problem, 227when it's a mixer problem,
223 228
224 - AC97 proc files, codec97#*/* files 229- AC97 proc files, ``codec97#*/*`` files
225 230
226for USB audio/midi, 231for 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
232The ALSA bug-tracking system is found at: 237The ALSA bug-tracking system is found at:
233 238https://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===============================
2OSS Sequencer Emulation on ALSA
3===============================
4
5Copyright (c) 1998,1999 by Takashi Iwai
6
7ver.0.1.8; Nov. 16, 1999
8
9Description
10===========
11
12This directory contains the OSS sequencer emulation driver on ALSA. Note
13that this program is still in the development state.
14
15What this does - it provides the emulation of the OSS sequencer, access
16via ``/dev/sequencer`` and ``/dev/music`` devices.
17The most of applications using OSS can run if the appropriate ALSA
18sequencer is prepared.
19
20The 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
43Furthermore, 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
71Installation
72============
73
74Run configure script with both sequencer support (``--with-sequencer=yes``)
75and OSS emulation (``--with-oss=yes``) options. A module ``snd-seq-oss.o``
76will be created. If the synth module of your sound card supports for OSS
77emulation (so far, only Emu8000 driver), this module will be loaded
78automatically.
79Otherwise, you need to load this module manually.
80
81At beginning, this module probes all the MIDI ports which have been
82already connected to the sequencer. Once after that, the creation and deletion
83of ports are watched by announcement mechanism of ALSA sequencer.
84
85The available synth and MIDI devices can be found in proc interface.
86Run ``cat /proc/asound/seq/oss``, and check the devices. For example,
87if 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
111Note that the device number may be different from the information of
112``/proc/asound/oss-devices`` or ones of the original OSS driver.
113Use the device number listed in ``/proc/asound/seq/oss``
114to play via OSS sequencer emulation.
115
116Using Synthesizer Devices
117=========================
118
119Run your favorite program. I've tested playmidi-2.4, awemidi-0.4.3, gmod-3.1
120and xmp-1.1.5. You can load samples via ``/dev/sequencer`` like sfxload,
121too.
122
123If the lowlevel driver supports multiple access to synth devices (like
124Emu8000 driver), two or more applications are allowed to run at the same
125time.
126
127Using MIDI Devices
128==================
129
130So far, only MIDI output was tested. MIDI input was not checked at all,
131but hopefully it will work. Use the device number listed in
132``/proc/asound/seq/oss``.
133Be aware that these numbers are mostly different from the list in
134``/proc/asound/oss-devices``.
135
136Module Options
137==============
138
139The following module options are available:
140
141maxqlen
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
146seq_oss_debug
147 specifies the debug level and accepts zero (= no debug message) or
148 positive integer. Default value is 0.
149
150Queue Mechanism
151===============
152
153OSS sequencer emulation uses an ALSA priority queue. The
154events from ``/dev/sequencer`` are processed and put onto the queue
155specified by module option.
156
157All the events from ``/dev/sequencer`` are parsed at beginning.
158The timing events are also parsed at this moment, so that the events may
159be processed in real-time. Sending an event ABSTIME 0 switches the operation
160mode to real-time mode, and sending an event RELTIME 0 switches it off.
161In the real-time mode, all events are dispatched immediately.
162
163The queued events are dispatched to the corresponding ALSA sequencer
164ports after scheduled time by ALSA sequencer dispatcher.
165
166If the write-queue is full, the application sleeps until a certain amount
167(as default one half) becomes empty in blocking mode. The synchronization
168to write timing was implemented, too.
169
170The input from MIDI devices or echo-back events are stored on read FIFO
171queue. If application reads ``/dev/sequencer`` in blocking mode, the
172process will be awaked.
173
174Interface to Synthesizer Device
175===============================
176
177Registration
178------------
179
180To register an OSS synthesizer device, use snd_seq_oss_synth_register()
181function:
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
187The arguments ``name``, ``type``, ``subtype`` and ``nvoices``
188are used for making the appropriate synth_info structure for ioctl. The
189return value is an index number of this device. This index must be remembered
190for unregister. If registration is failed, -errno will be returned.
191
192To release this device, call snd_seq_oss_synth_unregister() function:
193::
194
195 int snd_seq_oss_synth_unregister(int index)
196
197where the ``index`` is the index number returned by register function.
198
199Callbacks
200---------
201
202OSS synthesizer devices have capability for sample downloading and ioctls
203like sample reset. In OSS emulation, these special features are realized
204by using callbacks. The registration argument oper is used to specify these
205callbacks. 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
215Except for ``open`` and ``close`` callbacks, they are allowed to be NULL.
216
217Each callback function takes the argument type ``snd_seq_oss_arg_t`` as the
218first 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
230The first three fields, ``app_index``, ``file_mode`` and ``seq_mode``
231are initialized by OSS sequencer. The ``app_index`` is the application
232index 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
235mode. In the current version, only ``SND_OSSSEQ_MODE_SYNTH`` is used.
236
237The next two fields, ``addr`` and ``private_data``, must be
238filled by the synth driver at open callback. The ``addr`` contains
239the address of ALSA sequencer port which is assigned to this device. If
240the driver allocates memory for ``private_data``, it must be released
241in close callback by itself.
242
243The last field, ``event_passing``, indicates how to translate note-on
244/ off events. In ``PROCESS_EVENTS`` mode, the note 255 is regarded
245as 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
247without modified. ``PROCESS_KEYPRESS`` mode checks the note above 128
248and regards it as key pressure event (mainly for Emu8000 driver).
249
250Open Callback
251-------------
252
253The ``open`` is called at each time this device is opened by an application
254using OSS sequencer. This must not be NULL. Typically, the open callback
255does 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
262Note that the type bit-flags in port_info of this synth port must NOT contain
263``TYPE_MIDI_GENERIC``
264bit. Instead, ``TYPE_SPECIFIC`` should be used. Also, ``CAP_SUBSCRIPTION``
265bit should NOT be included, too. This is necessary to tell it from other
266normal MIDI devices. If the open procedure succeeded, return zero. Otherwise,
267return -errno.
268
269Ioctl Callback
270--------------
271
272The ``ioctl`` callback is called when the sequencer receives device-specific
273ioctls. The following two ioctls should be processed by this callback:
274
275IOCTL_SEQ_RESET_SAMPLES
276 reset all samples on memory -- return 0
277
278IOCTL_SYNTH_MEMAVL
279 return the available memory size
280
281FM_4OP_ENABLE
282 can be ignored usually
283
284The other ioctls are processed inside the sequencer without passing to
285the lowlevel driver.
286
287Load_Patch Callback
288-------------------
289
290The ``load_patch`` callback is used for sample-downloading. This callback
291must read the data on user-space and transfer to each device. Return 0
292if succeeded, and -errno if failed. The format argument is the patch key
293in patch_info record. The buf is user-space pointer where patch_info record
294is stored. The offs can be ignored. The count is total data size of this
295sample data.
296
297Close Callback
298--------------
299
300The ``close`` callback is called when this device is closed by the
301application. If any private data was allocated in open callback, it must
302be released in the close callback. The deletion of ALSA port should be
303done here, too. This callback must not be NULL.
304
305Reset Callback
306--------------
307
308The ``reset`` callback is called when sequencer device is reset or
309closed by applications. The callback should turn off the sounds on the
310relevant port immediately, and initialize the status of the port. If this
311callback is undefined, OSS seq sends a ``HEARTBEAT`` event to the
312port.
313
314Events
315======
316
317Most of the events are processed by sequencer and translated to the adequate
318ALSA sequencer events, so that each synth device can receive by input_event
319callback of ALSA sequencer port. The following ALSA events should be
320implemented by the driver:
321
322============= ===================
323ALSA event Original OSS events
324============= ===================
325NOTEON SEQ_NOTEON, MIDI_NOTEON
326NOTE SEQ_NOTEOFF, MIDI_NOTEOFF
327KEYPRESS MIDI_KEY_PRESSURE
328CHANPRESS SEQ_AFTERTOUCH, MIDI_CHN_PRESSURE
329PGMCHANGE SEQ_PGMCHANGE, MIDI_PGM_CHANGE
330PITCHBEND SEQ_CONTROLLER(CTRL_PITCH_BENDER),
331 MIDI_PITCH_BEND
332CONTROLLER MIDI_CTL_CHANGE,
333 SEQ_BALANCE (with CTL_PAN)
334CONTROL14 SEQ_CONTROLLER
335REGPARAM SEQ_CONTROLLER(CTRL_PITCH_BENDER_RANGE)
336SYSEX SEQ_SYSEX
337============= ===================
338
339The most of these behavior can be realized by MIDI emulation driver
340included in the Emu8000 lowlevel driver. In the future release, this module
341will be independent.
342
343Some OSS events (``SEQ_PRIVATE`` and ``SEQ_VOLUME`` events) are passed as event
344type SND_SEQ_OSS_PRIVATE. The OSS sequencer passes these event 8 byte
345packets without any modification. The lowlevel driver should process these
346events appropriately.
347
348Interface to MIDI Device
349========================
350
351Since the OSS emulation probes the creation and deletion of ALSA MIDI
352sequencer ports automatically by receiving announcement from ALSA
353sequencer, the MIDI devices don't need to be registered explicitly
354like synth devices.
355However, the MIDI port_info registered to ALSA sequencer must include
356a 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
359these conditions are not satisfied, the port is not registered as OSS
360sequencer MIDI device.
361
362The events via MIDI devices are parsed in OSS sequencer and converted
363to the corresponding ALSA sequencer events. The input from MIDI sequencer
364is also converted to MIDI byte events by OSS sequencer. This works just
365a reverse way of seq_midi module.
366
367Known 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=====================
2ALSA PCM Timestamping
3=====================
4
1The ALSA API can provide two different system timestamps: 5The 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
4callback 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
5general case, but specific hardware may have synchronization 9 general case, but specific hardware may have synchronization
6capabilities or conversely may only be able to provide a correct 10 capabilities or conversely may only be able to provide a correct
7estimate 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
8is responsible for updating the trigger_tstamp at the most appropriate 12 is responsible for updating the trigger_tstamp at the most appropriate
9and precise moment. Applications should not rely solely on the first 13 and precise moment. Applications should not rely solely on the first
10trigger_tstamp but update their internal calculations if the driver 14 trigger_tstamp but update their internal calculations if the driver
11provides 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
14event or application query. 18 event or application query.
15The difference (tstamp - trigger_tstamp) defines the elapsed time. 19 The difference (tstamp - trigger_tstamp) defines the elapsed time.
16 20
17The ALSA API provides two basic pieces of information, avail 21The ALSA API provides two basic pieces of information, avail
18and delay, which combined with the trigger and current system 22and delay, which combined with the trigger and current system
@@ -22,15 +26,15 @@ the ring buffer and the amount of queued samples.
22The use of these different pointers and time information depends on 26The use of these different pointers and time information depends on
23the application needs: 27the 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
27queued samples have been played out. 31 queued samples have been played out.
28 32
29When timestamps are enabled, the avail/delay information is reported 33When timestamps are enabled, the avail/delay information is reported
30along with a snapshot of system time. Applications can select from 34along with a snapshot of system time. Applications can select from
31CLOCK_REALTIME (NTP corrections including going backwards), 35``CLOCK_REALTIME`` (NTP corrections including going backwards),
32CLOCK_MONOTONIC (NTP corrections but never going backwards), 36``CLOCK_MONOTONIC`` (NTP corrections but never going backwards),
33CLOCK_MONOTIC_RAW (without NTP corrections) and change the mode 37``CLOCK_MONOTIC_RAW`` (without NTP corrections) and change the mode
34dynamically with sw_params 38dynamically with sw_params
35 39
36 40
@@ -38,17 +42,18 @@ The ALSA API also provide an audio_tstamp which reflects the passage
38of time as measured by different components of audio hardware. In 42of time as measured by different components of audio hardware. In
39ascii-art, this could be represented as follows (for the playback 43ascii-art, this could be represented as follows (for the playback
40case): 44case):
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
53The analog time is taken at the last stage of the playback, as close 58The analog time is taken at the last stage of the playback, as close
54as possible to the actual transducer 59as possible to the actual transducer
@@ -113,11 +118,11 @@ audio applications...
113 118
114Due to the varied nature of timestamping needs, even for a single 119Due to the varied nature of timestamping needs, even for a single
115application, the audio_tstamp_config can be changed dynamically. In 120application, the audio_tstamp_config can be changed dynamically. In
116the STATUS ioctl, the parameters are read-only and do not allow for 121the ``STATUS`` ioctl, the parameters are read-only and do not allow for
117any application selection. To work around this limitation without 122any application selection. To work around this limitation without
118impacting legacy applications, a new STATUS_EXT ioctl is introduced 123impacting legacy applications, a new ``STATUS_EXT`` ioctl is introduced
119with read/write parameters. ALSA-lib will be modified to make use of 124with read/write parameters. ALSA-lib will be modified to make use of
120STATUS_EXT and effectively deprecate STATUS. 125``STATUS_EXT`` and effectively deprecate ``STATUS``.
121 126
122The ALSA API only allows for a single audio timestamp to be reported 127The ALSA API only allows for a single audio timestamp to be reported
123at a time. This is a conscious design decision, reading the audio 128at 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
135information. To make sure applications are not confused, a 140information. To make sure applications are not confused, a
136driver_timestamp field is added in the snd_pcm_status structure; this 141driver_timestamp field is added in the snd_pcm_status structure; this
137timestamp shows when the information is put together by the driver 142timestamp shows when the information is put together by the driver
138before returning from the STATUS and STATUS_EXT ioctl. in most cases 143before returning from the ``STATUS`` and ``STATUS_EXT`` ioctl. in most cases
139this driver_timestamp will be identical to the regular system tstamp. 144this driver_timestamp will be identical to the regular system tstamp.
140 145
141Examples of typestamping with HDaudio: 146Examples of typestamping with HDaudio:
142 147
1431. DMA timestamp, no compensation for DMA+analog delay 1481. DMA timestamp, no compensation for DMA+analog delay
144$ ./audio_time -p --ts_type=1 149::
145playback: systime: 341121338 nsec, audio time 342000000 nsec, systime delta -878662 150
146playback: systime: 426236663 nsec, audio time 427187500 nsec, systime delta -950837 151 $ ./audio_time -p --ts_type=1
147playback: systime: 597080580 nsec, audio time 598000000 nsec, systime delta -919420 152 playback: systime: 341121338 nsec, audio time 342000000 nsec, systime delta -878662
148playback: systime: 682059782 nsec, audio time 683020833 nsec, systime delta -961051 153 playback: systime: 426236663 nsec, audio time 427187500 nsec, systime delta -950837
149playback: systime: 852896415 nsec, audio time 853854166 nsec, systime delta -957751 154 playback: systime: 597080580 nsec, audio time 598000000 nsec, systime delta -919420
150playback: 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
1522. DMA timestamp, compensation for DMA+analog delay 1592. DMA timestamp, compensation for DMA+analog delay
153$ ./audio_time -p --ts_type=1 -d 160::
154playback: systime: 341053347 nsec, audio time 341062500 nsec, systime delta -9153 161
155playback: systime: 426072447 nsec, audio time 426062500 nsec, systime delta 9947 162 $ ./audio_time -p --ts_type=1 -d
156playback: systime: 596899518 nsec, audio time 596895833 nsec, systime delta 3685 163 playback: systime: 341053347 nsec, audio time 341062500 nsec, systime delta -9153
157playback: systime: 681915317 nsec, audio time 681916666 nsec, systime delta -1349 164 playback: systime: 426072447 nsec, audio time 426062500 nsec, systime delta 9947
158playback: 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
1603. link timestamp, compensation for DMA+analog delay 1693. link timestamp, compensation for DMA+analog delay
161$ ./audio_time -p --ts_type=2 -d 170::
162playback: systime: 341060004 nsec, audio time 341062791 nsec, systime delta -2787 171
163playback: systime: 426242074 nsec, audio time 426244875 nsec, systime delta -2801 172 $ ./audio_time -p --ts_type=2 -d
164playback: systime: 597080992 nsec, audio time 597084583 nsec, systime delta -3591 173 playback: systime: 341060004 nsec, audio time 341062791 nsec, systime delta -2787
165playback: systime: 682084512 nsec, audio time 682088291 nsec, systime delta -3779 174 playback: systime: 426242074 nsec, audio time 426244875 nsec, systime delta -2801
166playback: systime: 852936229 nsec, audio time 852940916 nsec, systime delta -4687 175 playback: systime: 597080992 nsec, audio time 597084583 nsec, systime delta -3591
167playback: 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
169Example 1 shows that the timestamp at the DMA level is close to 1ms 180Example 1 shows that the timestamp at the DMA level is close to 1ms
170ahead of the actual playback time (as a side time this sort of 181ahead 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
181the use of the frame counter by the driver) 192the use of the frame counter by the driver)
182 193
183Example 3: DMA timestamp, no compensation for delay, delta of ~5ms 194Example 3: DMA timestamp, no compensation for delay, delta of ~5ms
184$ ./audio_time -p -Dhw:1 -t1 195::
185playback: systime: 120174019 nsec, audio time 125000000 nsec, systime delta -4825981 196
186playback: systime: 245041136 nsec, audio time 250000000 nsec, systime delta -4958864 197 $ ./audio_time -p -Dhw:1 -t1
187playback: systime: 370106088 nsec, audio time 375000000 nsec, systime delta -4893912 198 playback: systime: 120174019 nsec, audio time 125000000 nsec, systime delta -4825981
188playback: systime: 495040065 nsec, audio time 500000000 nsec, systime delta -4959935 199 playback: systime: 245041136 nsec, audio time 250000000 nsec, systime delta -4958864
189playback: systime: 620038179 nsec, audio time 625000000 nsec, systime delta -4961821 200 playback: systime: 370106088 nsec, audio time 375000000 nsec, systime delta -4893912
190playback: systime: 745087741 nsec, audio time 750000000 nsec, systime delta -4912259 201 playback: systime: 495040065 nsec, audio time 500000000 nsec, systime delta -4959935
191playback: 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
193Example 4: DMA timestamp, compensation for delay, delay of ~1ms 206Example 4: DMA timestamp, compensation for delay, delay of ~1ms
194$ ./audio_time -p -Dhw:1 -t1 -d 207::
195playback: systime: 120190520 nsec, audio time 120000000 nsec, systime delta 190520 208
196playback: systime: 245036740 nsec, audio time 244000000 nsec, systime delta 1036740 209 $ ./audio_time -p -Dhw:1 -t1 -d
197playback: systime: 370034081 nsec, audio time 369000000 nsec, systime delta 1034081 210 playback: systime: 120190520 nsec, audio time 120000000 nsec, systime delta 190520
198playback: systime: 495159907 nsec, audio time 494000000 nsec, systime delta 1159907 211 playback: systime: 245036740 nsec, audio time 244000000 nsec, systime delta 1036740
199playback: systime: 620098824 nsec, audio time 619000000 nsec, systime delta 1098824 212 playback: systime: 370034081 nsec, audio time 369000000 nsec, systime delta 1034081
200playback: 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======================================
2HD-Audio Codec-Specific Mixer Controls
3======================================
4
5
1This file explains the codec-specific mixer controls. 6This file explains the codec-specific mixer controls.
2 7
3Realtek codecs 8Realtek codecs
4-------------- 9--------------
5 10
6* Channel Mode 11Channel 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 18Auto-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
30IDT/Sigmatel codecs 35IDT/Sigmatel codecs
31------------------- 36-------------------
32 37
33* Analog Loopback 38Analog 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 45Swap 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 50Headphone 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 55Mic 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
57VIA codecs 62VIA codecs
58---------- 63----------
59 64
60* Smart 5.1 65Smart 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 70Independent 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 77Loopback 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 86Dynamic 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 94Jack 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
96Conexant codecs 101Conexant codecs
97--------------- 102---------------
98 103
99* Auto-Mute Mode 104Auto-Mute Mode
100 See Reatek codecs. 105 See Reatek codecs.
101 106
102 107
103Analog codecs 108Analog codecs
104-------------- 109--------------
105 110
106* Channel Mode 111Channel 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 118Independent 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=======================
2HD-Audio DP-MST Support
3=======================
4
1To support DP MST audio, HD Audio hdmi codec driver introduces virtual pin 5To support DP MST audio, HD Audio hdmi codec driver introduces virtual pin
2and dynamic pcm assignment. 6and dynamic pcm assignment.
3 7
@@ -44,10 +48,12 @@ Build Jack
44---------- 48----------
45 49
46- dyn_pcm_assign 50- dyn_pcm_assign
47Will 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
50Use 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
53Unsolicited Event Enabling 59Unsolicited Event Enabling
@@ -58,16 +64,20 @@ Enable unsolicited event if !acomp.
58Monitor Hotplug Event Handling 64Monitor Hotplug Event Handling
59------------------------------ 65------------------------------
60- acomp 66- acomp
61pin_eld_notify() -> check_presence_and_report() -> hdmi_present_sense() -> 67
62sync_eld_via_acomp(). 68 pin_eld_notify() -> check_presence_and_report() -> hdmi_present_sense() ->
63Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for 69 sync_eld_via_acomp().
64both 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
67Hdmi_unsol_event() -> hdmi_intrinsic_event() -> check_presence_and_report() -> 75
68hdmi_present_sense() -> hdmi_prepsent_sense_via_verbs() 76 hdmi_unsol_event() -> hdmi_intrinsic_event() -> check_presence_and_report() ->
69Use directly snd_jack_report() on spec->pcm_rec[pcm_idx].jack for dyn_pcm_assign. 77 hdmi_present_sense() -> hdmi_prepsent_sense_via_verbs()
70Use 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
73Others to be added later 83Others 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 @@
1HD-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==============================
2HD-Audio Codec-Specific Models
3==============================
4
5ALC880
6======
73stack
8 3-jack in back and a headphone out
93stack-digout
10 3-jack in back, a HP out and a SPDIF out
115stack
12 5-jack in back, 2-jack in front
135stack-digout
14 5-jack in back, 2-jack in front, a SPDIF out
156stack
16 6-jack in back, 2-jack in front
176stack-digout
18 6-jack with a SPDIF out
19
20ALC260
21======
22gpio1
23 Enable GPIO1
24coef
25 Enable EAPD via COEF table
26fujitsu
27 Quirk for FSC S7020
28fujitsu-jwse
29 Quirk for FSC S7020 with jack modes and HP mic support
30
31ALC262
32======
33inv-dmic
34 Inverted internal mic workaround
35
36ALC267/268
37==========
38inv-dmic
39 Inverted internal mic workaround
40hp-eapd
41 Disable HP EAPD on NID 0x15
42
43ALC22x/23x/25x/269/27x/28x/29x (and vendor-specific ALC3xxx models)
44===================================================================
45laptop-amic
46 Laptops with analog-mic input
47laptop-dmic
48 Laptops with digital-mic input
49alc269-dmic
50 Enable ALC269(VA) digital mic workaround
51alc271-dmic
52 Enable ALC271X digital mic workaround
53inv-dmic
54 Inverted internal mic workaround
55headset-mic
56 Indicates a combined headset (headphone+mic) jack
57headset-mode
58 More comprehensive headset support for ALC269 & co
59headset-mode-no-hp-mic
60 Headset mode support without headphone mic
61lenovo-dock
62 Enables docking station I/O for some Lenovos
63hp-gpio-led
64 GPIO LED support on HP laptops
65dell-headset-multi
66 Headset jack, which can also be used as mic-in
67dell-headset-dock
68 Headset jack (without mic-in), and also dock I/O
69alc283-dac-wcaps
70 Fixups for Chromebook with ALC283
71alc283-sense-combo
72 Combo jack sensing on ALC283
73tpt440-dock
74 Pin configs for Lenovo Thinkpad Dock support
75
76ALC66x/67x/892
77==============
78mario
79 Chromebook mario model fixup
80asus-mode1
81 ASUS
82asus-mode2
83 ASUS
84asus-mode3
85 ASUS
86asus-mode4
87 ASUS
88asus-mode5
89 ASUS
90asus-mode6
91 ASUS
92asus-mode7
93 ASUS
94asus-mode8
95 ASUS
96inv-dmic
97 Inverted internal mic workaround
98dell-headset-multi
99 Headset jack, which can also be used as mic-in
100
101ALC680
102======
103N/A
104
105ALC88x/898/1150
106======================
107acer-aspire-4930g
108 Acer Aspire 4930G/5930G/6530G/6930G/7730G
109acer-aspire-8930g
110 Acer Aspire 8330G/6935G
111acer-aspire
112 Acer Aspire others
113inv-dmic
114 Inverted internal mic workaround
115no-primary-hp
116 VAIO Z/VGC-LN51JGB workaround (for fixed speaker DAC)
117
118ALC861/660
119==========
120N/A
121
122ALC861VD/660VD
123==============
124N/A
125
126CMI9880
127=======
128minimal
129 3-jack in back
130min_fp
131 3-jack in back, 2-jack in front
132full
133 6-jack in back, 2-jack in front
134full_dig
135 6-jack in back, 2-jack in front, SPDIF I/O
136allout
137 5-jack in back, 2-jack in front, SPDIF out
138auto
139 auto-config reading BIOS (default)
140
141AD1882 / AD1882A
142================
1433stack
144 3-stack mode
1453stack-automute
146 3-stack with automute front HP (default)
1476stack
148 6-stack mode
149
150AD1884A / AD1883 / AD1984A / AD1984B
151====================================
152desktop 3-stack desktop (default)
153laptop laptop with HP jack sensing
154mobile mobile devices with HP jack sensing
155thinkpad Lenovo Thinkpad X300
156touchsmart HP Touchsmart
157
158AD1884
159======
160N/A
161
162AD1981
163======
164basic 3-jack (default)
165hp HP nx6320
166thinkpad Lenovo Thinkpad T60/X60/Z60
167toshiba Toshiba U205
168
169AD1983
170======
171N/A
172
173AD1984
174======
175basic default configuration
176thinkpad Lenovo Thinkpad T61/X61
177dell_desktop Dell T3400
178
179AD1986A
180=======
1813stack
182 3-stack, shared surrounds
183laptop
184 2-channel only (FSC V2060, Samsung M50)
185laptop-imic
186 2-channel with built-in mic
187eapd
188 Turn on EAPD constantly
189
190AD1988/AD1988B/AD1989A/AD1989B
191==============================
1926stack
193 6-jack
1946stack-dig
195 ditto with SPDIF
1963stack
197 3-jack
1983stack-dig
199 ditto with SPDIF
200laptop
201 3-jack with hp-jack automute
202laptop-dig
203 ditto with SPDIF
204auto
205 auto-config reading BIOS (default)
206
207Conexant 5045
208=============
209laptop-hpsense
210 Laptop with HP sense (old model laptop)
211laptop-micsense
212 Laptop with Mic sense (old model fujitsu)
213laptop-hpmicsense
214 Laptop with HP and Mic senses
215benq
216 Benq R55E
217laptop-hp530
218 HP 530 laptop
219test
220 for testing/debugging purpose, almost all controls can be
221 adjusted. Appearing only when compiled with $CONFIG_SND_DEBUG=y
222
223Conexant 5047
224=============
225laptop
226 Basic Laptop config
227laptop-hp
228 Laptop config for some HP models (subdevice 30A5)
229laptop-eapd
230 Laptop config with EAPD support
231test
232 for testing/debugging purpose, almost all controls can be
233 adjusted. Appearing only when compiled with $CONFIG_SND_DEBUG=y
234
235Conexant 5051
236=============
237laptop
238 Basic Laptop config (default)
239hp
240 HP Spartan laptop
241hp-dv6736
242 HP dv6736
243hp-f700
244 HP Compaq Presario F700
245ideapad
246 Lenovo IdeaPad laptop
247toshiba
248 Toshiba Satellite M300
249
250Conexant 5066
251=============
252laptop
253 Basic Laptop config (default)
254hp-laptop
255 HP laptops, e g G60
256asus
257 Asus K52JU, Lenovo G560
258dell-laptop
259 Dell laptops
260dell-vostro
261 Dell Vostro
262olpc-xo-1_5
263 OLPC XO 1.5
264ideapad
265 Lenovo IdeaPad U150
266thinkpad
267 Lenovo Thinkpad
268
269STAC9200
270========
271ref
272 Reference board
273oqo
274 OQO Model 2
275dell-d21
276 Dell (unknown)
277dell-d22
278 Dell (unknown)
279dell-d23
280 Dell (unknown)
281dell-m21
282 Dell Inspiron 630m, Dell Inspiron 640m
283dell-m22
284 Dell Latitude D620, Dell Latitude D820
285dell-m23
286 Dell XPS M1710, Dell Precision M90
287dell-m24
288 Dell Latitude 120L
289dell-m25
290 Dell Inspiron E1505n
291dell-m26
292 Dell Inspiron 1501
293dell-m27
294 Dell Inspiron E1705/9400
295gateway-m4
296 Gateway laptops with EAPD control
297gateway-m4-2
298 Gateway laptops with EAPD control
299panasonic
300 Panasonic CF-74
301auto
302 BIOS setup (default)
303
304STAC9205/9254
305=============
306ref
307 Reference board
308dell-m42
309 Dell (unknown)
310dell-m43
311 Dell Precision
312dell-m44
313 Dell Inspiron
314eapd
315 Keep EAPD on (e.g. Gateway T1616)
316auto
317 BIOS setup (default)
318
319STAC9220/9221
320=============
321ref
322 Reference board
3233stack
324 D945 3stack
3255stack
326 D945 5stack + SPDIF
327intel-mac-v1
328 Intel Mac Type 1
329intel-mac-v2
330 Intel Mac Type 2
331intel-mac-v3
332 Intel Mac Type 3
333intel-mac-v4
334 Intel Mac Type 4
335intel-mac-v5
336 Intel Mac Type 5
337intel-mac-auto
338 Intel Mac (detect type according to subsystem id)
339macmini
340 Intel Mac Mini (equivalent with type 3)
341macbook
342 Intel Mac Book (eq. type 5)
343macbook-pro-v1
344 Intel Mac Book Pro 1st generation (eq. type 3)
345macbook-pro
346 Intel Mac Book Pro 2nd generation (eq. type 3)
347imac-intel
348 Intel iMac (eq. type 2)
349imac-intel-20
350 Intel iMac (newer version) (eq. type 3)
351ecs202
352 ECS/PC chips
353dell-d81
354 Dell (unknown)
355dell-d82
356 Dell (unknown)
357dell-m81
358 Dell (unknown)
359dell-m82
360 Dell XPS M1210
361auto
362 BIOS setup (default)
363
364STAC9202/9250/9251
365==================
366ref
367 Reference board, base config
368m1
369 Some Gateway MX series laptops (NX560XL)
370m1-2
371 Some Gateway MX series laptops (MX6453)
372m2
373 Some Gateway MX series laptops (M255)
374m2-2
375 Some Gateway MX series laptops
376m3
377 Some Gateway MX series laptops
378m5
379 Some Gateway MX series laptops (MP6954)
380m6
381 Some Gateway NX series laptops
382auto
383 BIOS setup (default)
384
385STAC9227/9228/9229/927x
386=======================
387ref
388 Reference board
389ref-no-jd
390 Reference board without HP/Mic jack detection
3913stack
392 D965 3stack
3935stack
394 D965 5stack + SPDIF
3955stack-no-fp
396 D965 5stack without front panel
397dell-3stack
398 Dell Dimension E520
399dell-bios
400 Fixes with Dell BIOS setup
401dell-bios-amic
402 Fixes with Dell BIOS setup including analog mic
403volknob
404 Fixes with volume-knob widget 0x24
405auto
406 BIOS setup (default)
407
408STAC92HD71B*
409============
410ref
411 Reference board
412dell-m4-1
413 Dell desktops
414dell-m4-2
415 Dell desktops
416dell-m4-3
417 Dell desktops
418hp-m4
419 HP mini 1000
420hp-dv5
421 HP dv series
422hp-hdx
423 HP HDX series
424hp-dv4-1222nr
425 HP dv4-1222nr (with LED support)
426auto
427 BIOS setup (default)
428
429STAC92HD73*
430===========
431ref
432 Reference board
433no-jd
434 BIOS setup but without jack-detection
435intel
436 Intel DG45* mobos
437dell-m6-amic
438 Dell desktops/laptops with analog mics
439dell-m6-dmic
440 Dell desktops/laptops with digital mics
441dell-m6
442 Dell desktops/laptops with both type of mics
443dell-eq
444 Dell desktops/laptops
445alienware
446 Alienware M17x
447auto
448 BIOS setup (default)
449
450STAC92HD83*
451===========
452ref
453 Reference board
454mic-ref
455 Reference board with power management for ports
456dell-s14
457 Dell laptop
458dell-vostro-3500
459 Dell Vostro 3500 laptop
460hp-dv7-4000
461 HP dv-7 4000
462hp_cNB11_intquad
463 HP CNB models with 4 speakers
464hp-zephyr
465 HP Zephyr
466hp-led
467 HP with broken BIOS for mute LED
468hp-inv-led
469 HP with broken BIOS for inverted mute LED
470hp-mic-led
471 HP with mic-mute LED
472headset-jack
473 Dell Latitude with a 4-pin headset jack
474hp-envy-bass
475 Pin fixup for HP Envy bass speaker (NID 0x0f)
476hp-envy-ts-bass
477 Pin fixup for HP Envy TS bass speaker (NID 0x10)
478hp-bnb13-eq
479 Hardware equalizer setup for HP laptops
480auto
481 BIOS setup (default)
482
483STAC92HD95
484==========
485hp-led
486 LED support for HP laptops
487hp-bass
488 Bass HPF setup for HP Spectre 13
489
490STAC9872
491========
492vaio
493 VAIO laptop without SPDIF
494auto
495 BIOS setup (default)
496
497Cirrus Logic CS4206/4207
498========================
499mbp55
500 MacBook Pro 5,5
501imac27
502 IMac 27 Inch
503auto
504 BIOS setup (default)
505
506Cirrus Logic CS4208
507===================
508mba6
509 MacBook Air 6,1 and 6,2
510gpio0
511 Enable GPIO 0 amp
512auto
513 BIOS setup (default)
514
515VIA VT17xx/VT18xx/VT20xx
516========================
517auto
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 @@
1MORE NOTES ON HD-AUDIO DRIVER
2============================= 1=============================
3 Takashi Iwai <tiwai@suse.de> 2More Notes on HD-Audio Driver
3=============================
4 4
5Takashi Iwai <tiwai@suse.de>
5 6
6GENERAL 7
7------- 8General
9=======
8 10
9HD-audio is the new standard on-board audio component on modern PCs 11HD-audio is the new standard on-board audio component on modern PCs
10after AC97. Although Linux has been supporting HD-audio since long 12after 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
40HD-audio specification at first. The specification is found on 42HD-audio specification at first. The specification is found on
41Intel's web page, for example: 43Intel'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
46HD-AUDIO CONTROLLER 48HD-Audio Controller
47------------------- 49===================
48 50
49DMA-Position Problem 51DMA-Position Problem
50~~~~~~~~~~~~~~~~~~~~ 52--------------------
51The most common problem of the controller is the inaccurate DMA 53The most common problem of the controller is the inaccurate DMA
52pointer reporting. The DMA pointer for playback and capture can be 54pointer reporting. The DMA pointer for playback and capture can be
53read in two ways, either via a LPIB register or via a position-buffer 55read in two ways, either via a LPIB register or via a position-buffer
54map. As default the driver tries to read from the io-mapped 56map. As default the driver tries to read from the io-mapped
55position-buffer, and falls back to LPIB if the position-buffer appears 57position-buffer, and falls back to LPIB if the position-buffer appears
56dead. However, this detection isn't perfect on some devices. In such 58dead. However, this detection isn't perfect on some devices. In such
57a case, you can change the default method via `position_fix` option. 59a 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
62for some VIA controllers. The capture stream position is corrected 64for some VIA controllers. The capture stream position is corrected
63by comparing both LPIB and position-buffer values. 65by 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,
65and uses LPIB for the playback and the position-buffer for the capture 67and uses LPIB for the playback and the position-buffer for the capture
66streams. 68streams.
670 is the default value for all other 690 is the default value for all other
@@ -74,9 +76,9 @@ the wake-up timing. It wakes up a few samples before actually
74processing the data on the buffer. This caused a lot of problems, for 76processing the data on the buffer. This caused a lot of problems, for
75example, with ALSA dmix or JACK. Since 2.6.27 kernel, the driver puts 77example, with ALSA dmix or JACK. Since 2.6.27 kernel, the driver puts
76an artificial delay to the wake up timing. This delay is controlled 78an artificial delay to the wake up timing. This delay is controlled
77via `bdl_pos_adj` option. 79via ``bdl_pos_adj`` option.
78 80
79When `bdl_pos_adj` is a negative value (as default), it's assigned to 81When ``bdl_pos_adj`` is a negative value (as default), it's assigned to
80an appropriate value depending on the controller chip. For Intel 82an appropriate value depending on the controller chip. For Intel
81chips, it'd be 1 while it'd be 32 for others. Usually this works. 83chips, it'd be 1 while it'd be 32 for others. Usually this works.
82Only in case it doesn't work and you get warning messages, you should 84Only 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
86Codec-Probing Problem 88Codec-Probing Problem
87~~~~~~~~~~~~~~~~~~~~~ 89---------------------
88A less often but a more severe problem is the codec probing. When 90A less often but a more severe problem is the codec probing. When
89BIOS reports the available codec slots wrongly, the driver gets 91BIOS reports the available codec slots wrongly, the driver gets
90confused and tries to access the non-existing codec slot. This often 92confused and tries to access the non-existing codec slot. This often
91results in the total screw-up, and destructs the further communication 93results in the total screw-up, and destructs the further communication
92with the codec chips. The symptom appears usually as error messages 94with the codec chips. The symptom appears usually as error messages
93like: 95like:
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
101The first line is a warning, and this is usually relatively harmless. 103The first line is a warning, and this is usually relatively harmless.
102It means that the codec response isn't notified via an IRQ. The 104It 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
108accessing a non-existing codec slot. 110accessing a non-existing codec slot.
109 111
110Thus, if the second error message appears, try to narrow the probed 112Thus, if the second error message appears, try to narrow the probed
111codec slots via `probe_mask` option. It's a bitmask, and each bit 113codec slots via ``probe_mask`` option. It's a bitmask, and each bit
112corresponds to the codec slot. For example, to probe only the first 114corresponds to the codec slot. For example, to probe only the first
113slot, pass `probe_mask=1`. For the first and the third slots, pass 115slot, 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
116Since 2.6.29 kernel, the driver has a more robust probing method, so 118Since 2.6.29 kernel, the driver has a more robust probing method, so
117this error might happen rarely, though. 119this error might happen rarely, though.
118 120
119On a machine with a broken BIOS, sometimes you need to force the 121On a machine with a broken BIOS, sometimes you need to force the
120driver to probe the codec slots the hardware doesn't report for use. 122driver to probe the codec slots the hardware doesn't report for use.
121In such a case, turn the bit 8 (0x100) of `probe_mask` option on. 123In such a case, turn the bit 8 (0x100) of ``probe_mask`` option on.
122Then the rest 8 bits are passed as the codec slots to probe 124Then the rest 8 bits are passed as the codec slots to probe
123unconditionally. For example, `probe_mask=0x103` will force to probe 125unconditionally. For example, ``probe_mask=0x103`` will force to probe
124the codec slots 0 and 1 no matter what the hardware reports. 126the codec slots 0 and 1 no matter what the hardware reports.
125 127
126 128
127Interrupt Handling 129Interrupt Handling
128~~~~~~~~~~~~~~~~~~ 130------------------
129HD-audio driver uses MSI as default (if available) since 2.6.33 131HD-audio driver uses MSI as default (if available) since 2.6.33
130kernel as MSI works better on some machines, and in general, it's 132kernel as MSI works better on some machines, and in general, it's
131better for performance. However, Nvidia controllers showed bad 133better for performance. However, Nvidia controllers showed bad
@@ -134,17 +136,17 @@ thus we disabled MSI for them.
134 136
135There seem also still other devices that don't work with MSI. If you 137There seem also still other devices that don't work with MSI. If you
136see a regression wrt the sound quality (stuttering, etc) or a lock-up 138see a regression wrt the sound quality (stuttering, etc) or a lock-up
137in the recent kernel, try to pass `enable_msi=0` option to disable 139in the recent kernel, try to pass ``enable_msi=0`` option to disable
138MSI. If it works, you can add the known bad device to the blacklist 140MSI. If it works, you can add the known bad device to the blacklist
139defined in hda_intel.c. In such a case, please report and give the 141defined in hda_intel.c. In such a case, please report and give the
140patch back to the upstream developer. 142patch back to the upstream developer.
141 143
142 144
143HD-AUDIO CODEC 145HD-Audio Codec
144-------------- 146==============
145 147
146Model Option 148Model Option
147~~~~~~~~~~~~ 149------------
148The most common problem regarding the HD-audio driver is the 150The most common problem regarding the HD-audio driver is the
149unsupported codec features or the mismatched device configuration. 151unsupported codec features or the mismatched device configuration.
150Most of codec-specific code has several preset models, either to 152Most of codec-specific code has several preset models, either to
@@ -153,13 +155,15 @@ override the BIOS setup or to provide more comprehensive features.
153The driver checks PCI SSID and looks through the static configuration 155The driver checks PCI SSID and looks through the static configuration
154table until any matching entry is found. If you have a new machine, 156table until any matching entry is found. If you have a new machine,
155you may see a message like below: 157you 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
159Meanwhile, in the earlier versions, you would see a message like: 162Meanwhile, 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
163Even if you see such a message, DON'T PANIC. Take a deep breath and 167Even if you see such a message, DON'T PANIC. Take a deep breath and
164keep your towel. First of all, it's an informational message, no 168keep your towel. First of all, it's an informational message, no
165warning, no error. This means that the PCI SSID of your device isn't 169warning, 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
182configuration of that preset with the correct pin setup, etc. 186configuration of that preset with the correct pin setup, etc.
183Thus, if you have a newer machine with a slightly different PCI SSID 187Thus, 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
185re-use the same model. You can pass the `model` option to specify the 189re-use the same model. You can pass the ``model`` option to specify the
186preset model instead of PCI (and codec-) SSID look-up. 190preset model instead of PCI (and codec-) SSID look-up.
187 191
188What `model` option values are available depends on the codec chip. 192What ``model`` option values are available depends on the codec chip.
189Check your codec chip from the codec proc file (see "Codec Proc-File" 193Check your codec chip from the codec proc file (see "Codec Proc-File"
190section below). It will show the vendor/product name of your codec 194section below). It will show the vendor/product name of your codec
191chip. Then, see Documentation/sound/alsa/HD-Audio-Models.txt file, 195chip. Then, see Documentation/sound/HD-Audio-Models.rst file,
192the section of HD-audio driver. You can find a list of codecs 196the section of HD-audio driver. You can find a list of codecs
193and `model` options belonging to each codec. For example, for Realtek 197and ``model`` options belonging to each codec. For example, for Realtek
194ALC262 codec chip, pass `model=ultra` for devices that are compatible 198ALC262 codec chip, pass ``model=ultra`` for devices that are compatible
195with Samsung Q1 Ultra. 199with Samsung Q1 Ultra.
196 200
197Thus, the first thing you can do for any brand-new, unsupported and 201Thus, the first thing you can do for any brand-new, unsupported and
198non-working HD-audio hardware is to check HD-audio codec and several 202non-working HD-audio hardware is to check HD-audio codec and several
199different `model` option values. If you have any luck, some of them 203different ``model`` option values. If you have any luck, some of them
200might suit with your device well. 204might suit with your device well.
201 205
202There are a few special model option values: 206There 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
209Speaker and Headphone Output 214Speaker and Headphone Output
210~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 215----------------------------
211One of the most frequent (and obvious) bugs with HD-audio is the 216One of the most frequent (and obvious) bugs with HD-audio is the
212silent output from either or both of a built-in speaker and a 217silent output from either or both of a built-in speaker and a
213headphone jack. In general, you should try a headphone output at 218headphone jack. In general, you should try a headphone output at
@@ -236,23 +241,23 @@ report. See the bug report section for details.
236If you are masochistic enough to debug the driver problem, note the 241If you are masochistic enough to debug the driver problem, note the
237following: 242following:
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
254Capture Problems 259Capture Problems
255~~~~~~~~~~~~~~~~ 260----------------
256The capture problems are often because of missing setups of mixers. 261The capture problems are often because of missing setups of mixers.
257Thus, before submitting a bug report, make sure that you set up the 262Thus, before submitting a bug report, make sure that you set up the
258mixer correctly. For example, both "Capture Volume" and "Capture 263mixer correctly. For example, both "Capture Volume" and "Capture
@@ -284,7 +289,7 @@ submit the improvement patch to the author.
284 289
285 290
286Direct Debugging 291Direct Debugging
287~~~~~~~~~~~~~~~~ 292----------------
288If no model option gives you a better result, and you are a tough guy 293If no model option gives you a better result, and you are a tough guy
289to fight against evil, try debugging via hitting the raw HD-audio 294to fight against evil, try debugging via hitting the raw HD-audio
290codec verbs to the device. Some tools are available: hda-emu and 295codec 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
293Configuration" section. 298Configuration" section.
294 299
295 300
296OTHER ISSUES 301Other Issues
297------------ 302============
298 303
299Kernel Configuration 304Kernel Configuration
300~~~~~~~~~~~~~~~~~~~~ 305--------------------
301In general, I recommend you to enable the sound debug option, 306In 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.
303This enables snd_printd() macro and others, and you'll get additional 308This enables snd_printd() macro and others, and you'll get additional
304kernel messages at probing. 309kernel messages at probing.
305 310
306In addition, you can enable `CONFIG_SND_DEBUG_VERBOSE=y`. But this 311In addition, you can enable ``CONFIG_SND_DEBUG_VERBOSE=y``. But this
307will give you far more messages. Thus turn this on only when you are 312will give you far more messages. Thus turn this on only when you are
308sure to want it. 313sure to want it.
309 314
310Don't forget to turn on the appropriate `CONFIG_SND_HDA_CODEC_*` 315Don't forget to turn on the appropriate ``CONFIG_SND_HDA_CODEC_*``
311options. Note that each of them corresponds to the codec chip, not 316options. Note that each of them corresponds to the codec chip, not
312the controller chip. Thus, even if lspci shows the Nvidia controller, 317the controller chip. Thus, even if lspci shows the Nvidia controller,
313you may need to choose the option for other vendors. If you are 318you may need to choose the option for other vendors. If you are
314unsure, just select all yes. 319unsure, 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.
317When this is enabled, the driver creates hardware-dependent devices 322When 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
319these device files. For example, `hwC0D2` will be created for the 324these device files. For example, ``hwC0D2`` will be created for the
320codec slot #2 of the first card (#0). For debug-tools such as 325codec slot #2 of the first card (#0). For debug-tools such as
321hda-verb and hda-analyzer, the hwdep device has to be enabled. 326hda-verb and hda-analyzer, the hwdep device has to be enabled.
322Thus, it'd be better to turn this on always. 327Thus, 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
325hwdep option above. When enabled, you'll have some sysfs files under 330hwdep option above. When enabled, you'll have some sysfs files under
326the corresponding hwdep directory. See "HD-audio reconfiguration" 331the corresponding hwdep directory. See "HD-audio reconfiguration"
327section below. 332section 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.
330See "Power-saving" section below. 335See "Power-saving" section below.
331 336
332 337
333Codec Proc-File 338Codec Proc-File
334~~~~~~~~~~~~~~~ 339---------------
335The codec proc-file is a treasure-chest for debugging HD-audio. 340The codec proc-file is a treasure-chest for debugging HD-audio.
336It shows most of useful information of each codec widget. 341It 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
353HD-Audio Reconfiguration 358HD-Audio Reconfiguration
354~~~~~~~~~~~~~~~~~~~~~~~~ 359------------------------
355This is an experimental feature to allow you re-configure the HD-audio 360This is an experimental feature to allow you re-configure the HD-audio
356codec dynamically without reloading the driver. The following sysfs 361codec dynamically without reloading the driver. The following sysfs
357files are available under each codec-hwdep device directory (e.g. 362files are available under each codec-hwdep device directory (e.g.
358/sys/class/sound/hwC0D0): 363/sys/class/sound/hwC0D0):
359 364
360vendor_id:: 365vendor_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.
363subsystem_id:: 368subsystem_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.
366revision_id:: 371revision_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.
369afg:: 374afg
370 Shows the AFG ID. This is read-only. 375 Shows the AFG ID. This is read-only.
371mfg:: 376mfg
372 Shows the MFG ID. This is read-only. 377 Shows the MFG ID. This is read-only.
373name:: 378name
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.
376modelname:: 381modelname
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.
379init_verbs:: 384init_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).
383hints:: 388hints
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.
387init_pin_configs:: 392init_pin_configs
388 Shows the initial pin default config values set by BIOS. 393 Shows the initial pin default config values set by BIOS.
389driver_pin_configs:: 394driver_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.
394user_pin_configs:: 399user_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.
400reconfig:: 405reconfig
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.
405clear:: 410clear
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
409For example, when you want to change the pin default configuration 414For example, when you want to change the pin default configuration
410value of the pin widget 0x14 to 0x9993013f, and let the driver 415value of the pin widget 0x14 to 0x9993013f, and let the driver
411re-configure based on that state, run like below: 416re-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
418Hint Strings 423Hint Strings
419~~~~~~~~~~~~ 424------------
420The codec parser have several switches and adjustment knobs for 425The codec parser have several switches and adjustment knobs for
421matching better with the actual codec or device behavior. Many of 426matching better with the actual codec or device behavior. Many of
422them can be adjusted dynamically via "hints" strings as mentioned in 427them can be adjusted dynamically via "hints" strings as mentioned in
423the section above. For example, by passing `jack_detect = no` string 428the section above. For example, by passing ``jack_detect = no`` string
424via sysfs or a patch file, you can disable the jack detection, thus 429via sysfs or a patch file, you can disable the jack detection, thus
425the codec parser will skip the features like auto-mute or mic 430the codec parser will skip the features like auto-mute or mic
426auto-switch. As a boolean value, either `yes`, `no`, `true`, `false`, 431auto-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
429The generic parser supports the following hints: 434The generic parser supports the following hints:
430 435
431- jack_detect (bool): specify whether the jack detection is available 436jack_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 439inv_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 441trigger_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 444inv_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 446pcm_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 448sticky_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 451spdif_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 454pin_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 456single_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 458auto_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; 460auto_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 462line_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 464need_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 466primary_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 468multi_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 471multi_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 473inv_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 476indep_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 479add_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 482add_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
485power_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
489power_down_unused (bool)
490 power down the unused widgets, a subset of power_save_node, and
491 will be dropped in future
492add_hp_mic (bool)
493 add the headphone to capture source if possible
494hp_mic_detect (bool)
495 enable/disable the hp/mic shared input for a single built-in mic
496 case; default true
497mixer_nid (int)
498 specifies the widget NID of the analog-loopback mixer
479 499
480 500
481Early Patching 501Early Patching
482~~~~~~~~~~~~~~ 502--------------
483When CONFIG_SND_HDA_PATCH_LOADER=y is set, you can pass a "patch" as a 503When ``CONFIG_SND_HDA_PATCH_LOADER=y`` is set, you can pass a "patch"
484firmware file for modifying the HD-audio setup before initializing the 504as a firmware file for modifying the HD-audio setup before
485codec. This can work basically like the reconfiguration via sysfs in 505initializing the codec. This can work basically like the
486the above, but it does it before the first codec configuration. 506reconfiguration via sysfs in the above, but it does it before the
507first codec configuration.
487 508
488A patch file is a plain text file which looks like below: 509A 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
508The file needs to have a line `[codec]`. The next line should contain 529
530The file needs to have a line ``[codec]``. The next line should contain
509three numbers indicating the codec vendor-id (0x12345678 in the 531three numbers indicating the codec vendor-id (0x12345678 in the
510example), the codec subsystem-id (0xabcd1234) and the address (2) of 532example), the codec subsystem-id (0xabcd1234) and the address (2) of
511the codec. The rest patch entries are applied to this specified codec 533the 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
514field be skipped. It'll be useful for really broken devices that don't 536field be skipped. It'll be useful for really broken devices that don't
515initialize SSID properly. 537initialize SSID properly.
516 538
517The `[model]` line allows to change the model name of the each codec. 539The ``[model]`` line allows to change the model name of the each codec.
518In the example above, it will be changed to model=auto. 540In the example above, it will be changed to model=auto.
519Note that this overrides the module option. 541Note that this overrides the module option.
520 542
521After the `[pincfg]` line, the contents are parsed as the initial 543After the ``[pincfg]`` line, the contents are parsed as the initial
522default pin-configurations just like `user_pin_configs` sysfs above. 544default pin-configurations just like ``user_pin_configs`` sysfs above.
523The values can be shown in user_pin_configs sysfs file, too. 545The values can be shown in user_pin_configs sysfs file, too.
524 546
525Similarly, the lines after `[verb]` are parsed as `init_verbs` 547Similarly, the lines after ``[verb]`` are parsed as ``init_verbs``
526sysfs entries, and the lines after `[hint]` are parsed as `hints` 548sysfs entries, and the lines after ``[hint]`` are parsed as ``hints``
527sysfs entries, respectively. 549sysfs entries, respectively.
528 550
529Another example to override the codec vendor id from 0x12345678 to 551Another example to override the codec vendor id from 0x12345678 to
5300xdeadbeef is like below: 5520xdeadbeef 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
539In the similar way, you can override the codec subsystem_id via 562In 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.
541Also, the codec chip name can be rewritten via `[chip_name]` line. 564Also, 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
556The hd-audio driver reads the file via request_firmware(). Thus, 580The hd-audio driver reads the file via request_firmware(). Thus,
557a patch file has to be located on the appropriate firmware path, 581a patch file has to be located on the appropriate firmware path,
558typically, /lib/firmware. For example, when you pass the option 582typically, /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
560present. 584present.
561 585
562The patch module option is specific to each card instance, and you 586The patch module option is specific to each card instance, and you
563need to give one file name for each instance, separated by commas. 587need to give one file name for each instance, separated by commas.
564For example, if you have two cards, one for an on-board analog and one 588For example, if you have two cards, one for an on-board analog and one
565for an HDMI video board, you may pass patch option like below: 589for 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
571Power-Saving 595Power-Saving
572~~~~~~~~~~~~ 596------------
573The power-saving is a kind of auto-suspend of the device. When the 597The power-saving is a kind of auto-suspend of the device. When the
574device is inactive for a certain time, the device is automatically 598device is inactive for a certain time, the device is automatically
575turned off to save the power. The time to go down is specified via 599turned 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
577via sysfs. 601via sysfs.
578 602
579The power-saving won't work when the analog loopback is enabled on 603The 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
592chip, too. It means that the HD-audio controller is also powered up / 616chip, too. It means that the HD-audio controller is also powered up /
593down dynamically. The feature is enabled only for certain controller 617down dynamically. The feature is enabled only for certain controller
594chips like Intel LynxPoint. You can enable/disable this feature 618chips like Intel LynxPoint. You can enable/disable this feature
595forcibly by setting `power_save_controller` option, which is also 619forcibly by setting ``power_save_controller`` option, which is also
596available at /sys/module/snd_hda_intel/parameters directory. 620available at /sys/module/snd_hda_intel/parameters directory.
597 621
598 622
599Tracepoints 623Tracepoints
600~~~~~~~~~~~ 624-----------
601The hd-audio driver gives a few basic tracepoints. 625The 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``
603traces the response from RIRB (only when read from the codec driver). 627traces 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
607via power-saving behavior. 631via power-saving behavior.
608 632
609Enabling all tracepoints can be done like 633Enabling 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
613then after some commands, you can traces from 638then 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
615trace what codec command is sent, enable the tracepoint like: 640trace 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
631Here `[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 657Here ``[0:0]`` indicates the card number and the codec address, and
658``val`` shows the value sent to the codec, respectively. The value is
633a packed value, and you can decode it via hda-decode-verb program 659a packed value, and you can decode it via hda-decode-verb program
634included in hda-emu package below. For example, the value e3a019 is 660included in hda-emu package below. For example, the value e3a019 is
635to set the left output-amp value to 25. 661to 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
647Development Tree 673Development Tree
648~~~~~~~~~~~~~~~~ 674----------------
649The latest development codes for HD-audio are found on sound git tree: 675The 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
653The master branch or for-next branches can be used as the main 679The master branch or for-next branches can be used as the main
654development branches in general while the development for the current 680development branches in general while the development for the current
@@ -657,14 +683,14 @@ respectively.
657 683
658 684
659Sending a Bug Report 685Sending a Bug Report
660~~~~~~~~~~~~~~~~~~~~ 686--------------------
661If any model or module options don't work for your device, it's time 687If any model or module options don't work for your device, it's time
662to send a bug report to the developers. Give the following in your 688to send a bug report to the developers. Give the following in your
663bug report: 689bug 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
670If it's a regression, at best, send alsa-info outputs of both working 696If it's a regression, at best, send alsa-info outputs of both working
@@ -673,60 +699,60 @@ compare the codec registers directly.
673 699
674Send a bug report either the followings: 700Send a bug report either the followings:
675 701
676kernel-bugzilla:: 702kernel-bugzilla
677 https://bugzilla.kernel.org/ 703 https://bugzilla.kernel.org/
678alsa-devel ML:: 704alsa-devel ML
679 alsa-devel@alsa-project.org 705 alsa-devel@alsa-project.org
680 706
681 707
682DEBUG TOOLS 708Debug Tools
683----------- 709===========
684 710
685This section describes some tools available for debugging HD-audio 711This section describes some tools available for debugging HD-audio
686problems. 712problems.
687 713
688alsa-info 714alsa-info
689~~~~~~~~~ 715---------
690The script `alsa-info.sh` is a very useful tool to gather the audio 716The script ``alsa-info.sh`` is a very useful tool to gather the audio
691device information. It's included in alsa-utils package. The latest 717device information. It's included in alsa-utils package. The latest
692version can be found on git repository: 718version 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
696The script can be fetched directly from the following URL, too: 722The 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
700Run this script as root, and it will gather the important information 726Run this script as root, and it will gather the important information
701such as the module lists, module parameters, proc file contents 727such as the module lists, module parameters, proc file contents
702including the codec proc files, mixer outputs and the control 728including the codec proc files, mixer outputs and the control
703elements. As default, it will store the information onto a web server 729elements. As default, it will store the information onto a web server
704on alsa-project.org. But, if you send a bug report, it'd be better to 730on alsa-project.org. But, if you send a bug report, it'd be better to
705run with `--no-upload` option, and attach the generated file. 731run with ``--no-upload`` option, and attach the generated file.
706 732
707There are some other useful options. See `--help` option output for 733There are some other useful options. See ``--help`` option output for
708details. 734details.
709 735
710When a probe error occurs or when the driver obviously assigns a 736When a probe error occurs or when the driver obviously assigns a
711mismatched model, it'd be helpful to load the driver with 737mismatched 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
713alsa-info at this state. With this option, the driver won't configure 739alsa-info at this state. With this option, the driver won't configure
714the mixer and PCM but just tries to probe the codec slot. After 740the mixer and PCM but just tries to probe the codec slot. After
715probing, the proc file is available, so you can get the raw codec 741probing, the proc file is available, so you can get the raw codec
716information before modified by the driver. Of course, the driver 742information before modified by the driver. Of course, the driver
717isn't usable with `probe_only=1`. But you can continue the 743isn't usable with ``probe_only=1``. But you can continue the
718configuration via hwdep sysfs file if hda-reconfig option is enabled. 744configuration via hwdep sysfs file if hda-reconfig option is enabled.
719Using `probe_only` mask 2 skips the reset of HDA codecs (use 745Using ``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
721to determine the BIOS codec initialization. 747to determine the BIOS codec initialization.
722 748
723 749
724hda-verb 750hda-verb
725~~~~~~~~ 751--------
726hda-verb is a tiny program that allows you to access the HD-audio 752hda-verb is a tiny program that allows you to access the HD-audio
727codec directly. You can execute a raw HD-audio codec verb with this. 753codec directly. You can execute a raw HD-audio codec verb with this.
728This program accesses the hwdep device, thus you need to enable the 754This program accesses the hwdep device, thus you need to enable the
729kernel config `CONFIG_SND_HDA_HWDEP=y` beforehand. 755kernel config ``CONFIG_SND_HDA_HWDEP=y`` beforehand.
730 756
731The hda-verb program takes four arguments: the hwdep device file, the 757The hda-verb program takes four arguments: the hwdep device file, the
732widget NID, the verb and the parameter. When you access to the codec 758widget 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
739to a verb. Similarly, the last parameter is the value to write, or 765to a verb. Similarly, the last parameter is the value to write, or
740can be a string for the parameter type. 766can 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
756Although you can issue any verbs with this program, the driver state 783Although you can issue any verbs with this program, the driver state
757won't be always updated. For example, the volume values are usually 784won'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
761The hda-verb program is included now in alsa-tools: 788The 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
765Also, the old stand-alone package is found in the ftp directory: 792Also, 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
769Also a git repository is available: 796Also 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
773See README file in the tarball for more details about hda-verb 800See README file in the tarball for more details about hda-verb
774program. 801program.
775 802
776 803
777hda-analyzer 804hda-analyzer
778~~~~~~~~~~~~ 805------------
779hda-analyzer provides a graphical interface to access the raw HD-audio 806hda-analyzer provides a graphical interface to access the raw HD-audio
780control, based on pyGTK2 binding. It's a more powerful version of 807control, based on pyGTK2 binding. It's a more powerful version of
781hda-verb. The program gives you an easy-to-use GUI stuff for showing 808hda-verb. The program gives you an easy-to-use GUI stuff for showing
@@ -784,14 +811,14 @@ proc-compatible output.
784 811
785The hda-analyzer: 812The 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
789is a part of alsa.git repository in alsa-project.org: 816is 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
793Codecgraph 820Codecgraph
794~~~~~~~~~~ 821----------
795Codecgraph is a utility program to generate a graph and visualizes the 822Codecgraph is a utility program to generate a graph and visualizes the
796codec-node connection of a codec chip. It's especially useful when 823codec-node connection of a codec chip. It's especially useful when
797you analyze or debug a codec without a proper datasheet. The program 824you analyze or debug a codec without a proper datasheet. The program
@@ -800,11 +827,11 @@ program.
800 827
801The tarball and GIT trees are found in the web page at: 828The 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
806hda-emu 833hda-emu
807~~~~~~~ 834-------
808hda-emu is an HD-audio emulator. The main purpose of this program is 835hda-emu is an HD-audio emulator. The main purpose of this program is
809to debug an HD-audio codec without the real hardware. Thus, it 836to debug an HD-audio codec without the real hardware. Thus, it
810doesn't emulate the behavior with the real audio I/O, but it just 837doesn'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
817proc file, and the hda-emu program will start parsing the codec file 844proc file, and the hda-emu program will start parsing the codec file
818and simulates the HD-audio driver: 845and 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
828The program gives you only a very dumb command-line interface. You 856The program gives you only a very dumb command-line interface. You
829can get a proc-file dump at the current state, get a list of control 857can 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
833The program is found in the git repository below: 861The 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
837See README file in the repository for more details about hda-emu 865See README file in the repository for more details about hda-emu
838program. 866program.
839 867
840 868
841hda-jack-retask 869hda-jack-retask
842~~~~~~~~~~~~~~~ 870---------------
843hda-jack-retask is a user-friendly GUI program to manipulate the 871hda-jack-retask is a user-friendly GUI program to manipulate the
844HD-audio pin control for jack retasking. If you have a problem about 872HD-audio pin control for jack retasking. If you have a problem about
845the jack assignment, try this program and check whether you can get 873the jack assignment, try this program and check whether you can get
@@ -849,5 +877,4 @@ firmware patch file (see "Early Patching" section).
849 877
850The program is included in alsa-tools now: 878The 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===================================
2Linux 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===================
2The ALSA Driver API
3===================
4
5Management of Cards and Devices
6===============================
7
8Card Management
9---------------
10.. kernel-doc:: sound/core/init.c
11
12Device Components
13-----------------
14.. kernel-doc:: sound/core/device.c
15
16Module requests and Device File Entries
17---------------------------------------
18.. kernel-doc:: sound/core/sound.c
19
20Memory Management Helpers
21-------------------------
22.. kernel-doc:: sound/core/memory.c
23.. kernel-doc:: sound/core/memalloc.c
24
25
26PCM API
27=======
28
29PCM 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
36PCM Format Helpers
37------------------
38.. kernel-doc:: sound/core/pcm_misc.c
39
40PCM Memory Management
41---------------------
42.. kernel-doc:: sound/core/pcm_memory.c
43
44PCM DMA Engine API
45------------------
46.. kernel-doc:: sound/core/pcm_dmaengine.c
47.. kernel-doc:: include/sound/dmaengine_pcm.h
48
49Control/Mixer API
50=================
51
52General Control Interface
53-------------------------
54.. kernel-doc:: sound/core/control.c
55
56AC97 Codec API
57--------------
58.. kernel-doc:: sound/pci/ac97/ac97_codec.c
59.. kernel-doc:: sound/pci/ac97/ac97_pcm.c
60
61Virtual Master Control API
62--------------------------
63.. kernel-doc:: sound/core/vmaster.c
64.. kernel-doc:: include/sound/control.h
65
66MIDI API
67========
68
69Raw MIDI API
70------------
71.. kernel-doc:: sound/core/rawmidi.c
72
73MPU401-UART API
74---------------
75.. kernel-doc:: sound/drivers/mpu401/mpu401_uart.c
76
77Proc Info API
78=============
79
80Proc Info Interface
81-------------------
82.. kernel-doc:: sound/core/info.c
83
84Compress Offload
85================
86
87Compress 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
94ASoC
95====
96
97ASoC 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
107ASoC DAPM API
108-------------
109.. kernel-doc:: sound/soc/soc-dapm.c
110
111ASoC DMA Engine API
112-------------------
113.. kernel-doc:: sound/soc/soc-generic-dmaengine-pcm.c
114
115Miscellaneous Functions
116=======================
117
118Hardware-Dependent Devices API
119------------------------------
120.. kernel-doc:: sound/core/hwdep.c
121
122Jack 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
128ISA DMA Helpers
129---------------
130.. kernel-doc:: sound/core/isadma.c
131
132Other 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 @@
1ALSA 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======================
2Writing an ALSA Driver
3======================
4
5:Author: Takashi Iwai <tiwai@suse.de>
6:Date: Oct 15, 2007
7:Edition: 0.3.7
8
9Preface
10=======
11
12This document describes how to write an `ALSA (Advanced Linux Sound
13Architecture) <http://www.alsa-project.org/>`__ driver. The document
14focuses mainly on PCI soundcards. In the case of other device types, the
15API might be different, too. However, at least the ALSA kernel API is
16consistent, and therefore it would be still a bit help for writing them.
17
18This document targets people who already have enough C language skills
19and have basic linux kernel programming knowledge. This document doesn't
20explain the general topic of linux kernel coding and doesn't cover
21low-level driver implementation details. It only describes the standard
22way to write a PCI sound driver on ALSA.
23
24If you are already familiar with the older ALSA ver.0.5.x API, you can
25check the drivers such as ``sound/pci/es1938.c`` or
26``sound/pci/maestro3.c`` which have also almost the same code-base in
27the ALSA 0.5.x tree, so you can compare the differences.
28
29This document is still a draft version. Any feedback and corrections,
30please!!
31
32File Tree Structure
33===================
34
35General
36-------
37
38The ALSA drivers are provided in two ways.
39
40One is the trees provided as a tarball or via cvs from the ALSA's ftp
41site, and another is the 2.6 (or later) Linux kernel tree. To
42synchronize both, the ALSA driver tree is split into two different
43trees: alsa-kernel and alsa-driver. The former contains purely the
44source code for the Linux 2.6 (or later) tree. This tree is designed
45only for compilation on 2.6 or later environment. The latter,
46alsa-driver, contains many subtle files for compiling ALSA drivers
47outside of the Linux kernel tree, wrapper functions for older 2.2 and
482.4 kernels, to adapt the latest kernel API, and additional drivers
49which are still in development or in tests. The drivers in alsa-driver
50tree will be moved to alsa-kernel (and eventually to the 2.6 kernel
51tree) when they are finished and confirmed to work fine.
52
53The file tree structure of ALSA driver is depicted below. Both
54alsa-kernel and alsa-driver have almost the same file structure, except
55for “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
86core directory
87--------------
88
89This directory contains the middle layer which is the heart of ALSA
90drivers. In this directory, the native ALSA modules are stored. The
91sub-directories contain different modules and are dependent upon the
92kernel config.
93
94core/oss
95~~~~~~~~
96
97The codes for PCM and mixer OSS emulation modules are stored in this
98directory. The rawmidi OSS emulation is included in the ALSA rawmidi
99code since it's quite small. The sequencer code is stored in
100``core/seq/oss`` directory (see `below <#core-seq-oss>`__).
101
102core/ioctl32
103~~~~~~~~~~~~
104
105This directory contains the 32bit-ioctl wrappers for 64bit architectures
106such like x86-64, ppc64 and sparc64. For 32bit and alpha architectures,
107these are not compiled.
108
109core/seq
110~~~~~~~~
111
112This directory and its sub-directories are for the ALSA sequencer. This
113directory contains the sequencer core and primary sequencer modules such
114like snd-seq-midi, snd-seq-virmidi, etc. They are compiled only when
115``CONFIG_SND_SEQUENCER`` is set in the kernel config.
116
117core/seq/oss
118~~~~~~~~~~~~
119
120This contains the OSS sequencer emulation codes.
121
122core/seq/instr
123~~~~~~~~~~~~~~
124
125This directory contains the modules for the sequencer instrument layer.
126
127include directory
128-----------------
129
130This is the place for the public header files of ALSA drivers, which are
131to be exported to user-space, or included by several files at different
132directories. Basically, the private header files should not be placed in
133this directory, but you may still find files there, due to historical
134reasons :)
135
136drivers directory
137-----------------
138
139This directory contains code shared among different drivers on different
140architectures. They are hence supposed not to be architecture-specific.
141For example, the dummy pcm driver and the serial MIDI driver are found
142in this directory. In the sub-directories, there is code for components
143which are independent from bus and cpu architectures.
144
145drivers/mpu401
146~~~~~~~~~~~~~~
147
148The MPU401 and MPU401-UART modules are stored here.
149
150drivers/opl3 and opl4
151~~~~~~~~~~~~~~~~~~~~~
152
153The OPL3 and OPL4 FM-synth stuff is found here.
154
155i2c directory
156-------------
157
158This contains the ALSA i2c components.
159
160Although there is a standard i2c layer on Linux, ALSA has its own i2c
161code for some cards, because the soundcard needs only a simple operation
162and the standard i2c API is too complicated for such a purpose.
163
164i2c/l3
165~~~~~~
166
167This is a sub-directory for ARM L3 i2c.
168
169synth directory
170---------------
171
172This contains the synth middle-level modules.
173
174So far, there is only Emu8000/Emu10k1 synth driver under the
175``synth/emux`` sub-directory.
176
177pci directory
178-------------
179
180This directory and its sub-directories hold the top-level card modules
181for PCI soundcards and the code specific to the PCI BUS.
182
183The drivers compiled from a single file are stored directly in the pci
184directory, while the drivers with several source files are stored on
185their own sub-directory (e.g. emu10k1, ice1712).
186
187isa directory
188-------------
189
190This directory and its sub-directories hold the top-level card modules
191for ISA soundcards.
192
193arm, ppc, and sparc directories
194-------------------------------
195
196They are used for top-level card modules which are specific to one of
197these architectures.
198
199usb directory
200-------------
201
202This directory contains the USB-audio driver. In the latest version, the
203USB MIDI driver is integrated in the usb-audio driver.
204
205pcmcia directory
206----------------
207
208The PCMCIA, especially PCCard drivers will go here. CardBus drivers will
209be in the pci directory, because their API is identical to that of
210standard PCI cards.
211
212oss directory
213-------------
214
215The OSS/Lite source files are stored here in Linux 2.6 (or later) tree.
216In the ALSA driver tarball, this directory is empty, of course :)
217
218Basic Flow for PCI Drivers
219==========================
220
221Outline
222-------
223
224The 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
242Full Code Example
243-----------------
244
245The code example is shown below. Some parts are kept unimplemented at
246this moment but will be filled in the next sections. The numbers in the
247comment lines of the :c:func:`snd_mychip_probe()` function refer
248to 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
391Driver Constructor
392------------------
393
394The real constructor of PCI drivers is the ``probe`` callback. The
395``probe`` callback and other component-constructors which are called
396from the ``probe`` callback cannot be used with the ``__init`` prefix
397because any PCI device could be a hotplug device.
398
399In the ``probe`` callback, the following scheme is often used.
400
4011) 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
416where ``enable[dev]`` is the module option.
417
418Each time the ``probe`` callback is called, check the availability of
419the device. If not available, simply increment the device index and
420returns. dev will be incremented also later (`step 7
421<#set-the-pci-driver-data-and-return-zero>`__).
422
4232) 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
435The details will be explained in the section `Management of Cards and
436Components`_.
437
4383) Create a main component
439~~~~~~~~~~~~~~~~~~~~~~~~~~
440
441In 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
453The details will be explained in the section `PCI Resource
454Management`_.
455
4564) 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
466The driver field holds the minimal ID string of the chip. This is used
467by alsa-lib's configurator, so keep it simple but unique. Even the
468same driver can have different driver IDs to distinguish the
469functionality of each chip type.
470
471The shortname field is a string shown as more verbose name. The longname
472field contains the information shown in ``/proc/asound/cards``.
473
4745) Create other components, such as mixer, MIDI, etc.
475~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
476
477Here you define the basic components such as `PCM <#PCM-Interface>`__,
478mixer (e.g. `AC97 <#API-for-AC97-Codec>`__), MIDI (e.g.
479`MPU-401 <#MIDI-MPU401-UART-Interface>`__), and other interfaces.
480Also, if you want a `proc file <#Proc-Interface>`__, define it here,
481too.
482
4836) 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
494Will be explained in the section `Management of Cards and
495Components`_, too.
496
4977) Set the PCI driver data and return zero.
498~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
499
500::
501
502 pci_set_drvdata(pci, card);
503 dev++;
504 return 0;
505
506In the above, the card record is stored. This pointer is used in the
507remove callback and power-management callbacks, too.
508
509Destructor
510----------
511
512The destructor, remove callback, simply releases the card instance. Then
513the ALSA middle layer will release all the attached components
514automatically.
515
516It 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
527The above code assumes that the card pointer is set to the PCI driver
528data.
529
530Header Files
531------------
532
533For the above example, at least the following include files are
534necessary.
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
544where the last one is necessary only when module options are defined
545in the source file. If the code is split into several files, the files
546without module options don't need them.
547
548In addition to these headers, you'll need ``<linux/interrupt.h>`` for
549interrupt 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
551to include ``<linux/delay.h>`` too.
552
553The 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
557Management of Cards and Components
558==================================
559
560Card Instance
561-------------
562
563For each soundcard, a “card” record must be allocated.
564
565A card record is the headquarters of the soundcard. It manages the whole
566list of devices (components) on the soundcard, such as PCM, mixers,
567MIDI, synthesizer, and so on. Also, the card record holds the ID and the
568name strings of the card, manages the root of proc files, and controls
569the power-management states and hotplug disconnections. The component
570list on the card record is used to manage the correct release of
571resources at destruction.
572
573As 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
583The function takes six arguments: the parent device pointer, the
584card-index number, the id string, the module pointer (usually
585``THIS_MODULE``), the size of extra-data space, and the pointer to
586return the card instance. The extra_size argument is used to allocate
587card->private_data for the chip-specific data. Note that these data are
588allocated by :c:func:`snd_card_new()`.
589
590The 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
594Components
595----------
596
597After the card is created, you can attach the components (devices) to
598the card instance. In an ALSA driver, a component is represented as a
599:c:type:`struct snd_device <snd_device>` object. A component
600can be a PCM instance, a control interface, a raw MIDI interface, etc.
601Each such instance has one component entry.
602
603A component can be created via :c:func:`snd_device_new()`
604function.
605
606::
607
608 snd_device_new(card, SNDRV_DEV_XXX, chip, &ops);
609
610This takes the card pointer, the device-level (``SNDRV_DEV_XXX``), the
611data pointer, and the callback pointers (``&ops``). The device-level
612defines the type of components and the order of registration and
613de-registration. For most components, the device-level is already
614defined. For a user-defined component, you can use
615``SNDRV_DEV_LOWLEVEL``.
616
617This function itself doesn't allocate the data space. The data must be
618allocated manually beforehand, and its pointer is passed as the
619argument. This pointer (``chip`` in the above example) is used as the
620identifier for the instance.
621
622Each pre-defined ALSA component such as ac97 and pcm calls
623:c:func:`snd_device_new()` inside its constructor. The destructor
624for each component is defined in the callback pointers. Hence, you don't
625need to take care of calling a destructor for such a component.
626
627If you wish to create your own component, you need to set the destructor
628function to the dev_free callback in the ``ops``, so that it can be
629released automatically via :c:func:`snd_card_free()`. The next
630example will show an implementation of chip-specific data.
631
632Chip-Specific Data
633------------------
634
635Chip-specific information, e.g. the I/O port address, its resource
636pointer, or the irq number, is stored in the chip-specific record.
637
638::
639
640 struct mychip {
641 ....
642 };
643
644
645In general, there are two ways of allocating the chip record.
646
6471. Allocating via :c:func:`snd_card_new()`.
648~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
649
650As mentioned above, you can pass the extra-data-length to the 5th
651argument 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
660In return, the allocated record can be accessed as
661
662::
663
664 struct mychip *chip = card->private_data;
665
666With this method, you don't have to allocate twice. The record is
667released together with the card instance.
668
6692. Allocating an extra device.
670~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
671
672After 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
684The 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
694Then, set the card pointer in the returned chip instance.
695
696::
697
698 chip->card = card;
699
700Next, initialize the fields, and register this chip record as a
701low-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
712function, 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
721where :c:func:`snd_mychip_free()` is the real destructor.
722
723Registration and Release
724------------------------
725
726After all components are assigned, register the card instance by calling
727:c:func:`snd_card_register()`. Access to the device files is
728enabled at this point. That is, before
729:c:func:`snd_card_register()` is called, the components are safely
730inaccessible from external side. If this call fails, exit the probe
731function after releasing the card via :c:func:`snd_card_free()`.
732
733For releasing the card instance, you can call simply
734:c:func:`snd_card_free()`. As mentioned earlier, all components
735are released automatically by this call.
736
737For a device which allows hotplugging, you can use
738:c:func:`snd_card_free_when_closed()`. This one will postpone
739the destruction until all devices are closed.
740
741PCI Resource Management
742=======================
743
744Full Code Example
745-----------------
746
747In this section, we'll complete the chip-specific constructor,
748destructor 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
876Some Hafta's
877------------
878
879The allocation of PCI resources is done in the ``probe`` function, and
880usually an extra :c:func:`xxx_create()` function is written for this
881purpose.
882
883In the case of PCI devices, you first have to call the
884:c:func:`pci_enable_device()` function before allocating
885resources. Also, you need to set the proper PCI DMA mask to limit the
886accessed I/O range. In some cases, you might need to call
887:c:func:`pci_set_master()` function, too.
888
889Suppose 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
904Resource Allocation
905-------------------
906
907The allocation of I/O ports and irqs is done via standard kernel
908functions. Unlike ALSA ver.0.5.x., there are no helpers for that. And
909these resources must be released in the destructor function (see below).
910Also, on ALSA 0.9.x, you don't need to allocate (pseudo-)DMA for PCI
911like in ALSA 0.5.x.
912
913Now assume that the PCI device has an I/O port with 8 bytes and an
914interrupt. Then :c:type:`struct mychip <mychip>` will have the
915following fields:
916
917::
918
919 struct mychip {
920 struct snd_card *card;
921
922 unsigned long port;
923 int irq;
924 };
925
926
927For an I/O port (and also a memory region), you need to have the
928resource pointer for the standard resource management. For an irq, you
929have to keep only the irq number (integer). But you need to initialize
930this number as -1 before actual allocation, since irq 0 is valid. The
931port 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
933resetting them.
934
935The 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
947It will reserve the I/O port region of 8 bytes of the given PCI device.
948The returned value, ``chip->res_port``, is allocated via
949:c:func:`kmalloc()` by :c:func:`request_region()`. The pointer
950must be released via :c:func:`kfree()`, but there is a problem with
951this. This issue will be explained later.
952
953The 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
965where :c:func:`snd_mychip_interrupt()` is the interrupt handler
966defined `later <#pcm-interface-interrupt-handler>`__. Note that
967``chip->irq`` should be defined only when :c:func:`request_irq()`
968succeeded.
969
970On the PCI bus, interrupts can be shared. Thus, ``IRQF_SHARED`` is used
971as the interrupt flag of :c:func:`request_irq()`.
972
973The last argument of :c:func:`request_irq()` is the data pointer
974passed to the interrupt handler. Usually, the chip-specific record is
975used for that, but you can use what you like, too.
976
977I won't give details about the interrupt handler at this point, but at
978least its appearance can be explained now. The interrupt handler looks
979usually 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
991Now let's write the corresponding destructor for the resources above.
992The role of destructor is simple: disable the hardware (if already
993activated) and release the resources. So far, we have no hardware part,
994so the disabling code is not written here.
995
996To release the resources, the “check-and-release” method is a safer way.
997For the interrupt, do like this:
998
999::
1000
1001 if (chip->irq >= 0)
1002 free_irq(chip->irq, chip);
1003
1004Since 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
1006the validity of the irq number as above.
1007
1008When 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
1011resource(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
1019When 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
1022pointer returned from :c:func:`request_region()` in
1023chip->res_port, the release procedure looks like:
1024
1025::
1026
1027 release_and_free_resource(chip->res_port);
1028
1029Don't forget to call :c:func:`pci_disable_device()` before the
1030end.
1031
1032And finally, release the chip-specific record.
1033
1034::
1035
1036 kfree(chip);
1037
1038We didn't implement the hardware disabling part in the above. If you
1039need to do this, please note that the destructor may be called even
1040before the initialization of the chip is completed. It would be better
1041to have a flag to skip hardware disabling if the hardware was not
1042initialized yet.
1043
1044When the chip-data is assigned to the card using
1045:c:func:`snd_device_new()` with ``SNDRV_DEV_LOWLELVEL`` , its
1046destructor is called at the last. That is, it is assured that all other
1047components like PCMs and controls have already been released. You don't
1048have to stop PCMs, etc. explicitly, but just call low-level hardware
1049stopping.
1050
1051The management of a memory-mapped region is almost as same as the
1052management of an I/O port. You'll need three fields like the
1053following:
1054
1055::
1056
1057 struct mychip {
1058 ....
1059 unsigned long iobase_phys;
1060 void __iomem *iobase_virt;
1061 };
1062
1063and 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
1075and 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
1089PCI Entries
1090-----------
1091
1092So 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
1094this chipset. It's a table of PCI vendor/device ID number, and some
1095masks.
1096
1097For 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
1109The 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
1111have no reason to filter the matching devices, you can leave the
1112remaining fields as above. The last field of the :c:type:`struct
1113pci_device_id <pci_device_id>` struct contains private data
1114for this entry. You can specify any value here, for example, to define
1115specific operations for supported device IDs. Such an example is found
1116in the intel8x0 driver.
1117
1118The last entry of this list is the terminator. You must specify this
1119all-zero entry.
1120
1121Then, prepare the :c:type:`struct pci_driver <pci_driver>`
1122record:
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
1133The ``probe`` and ``remove`` functions have already been defined in
1134the previous sections. The ``name`` field is the name string of this
1135device. Note that you must not use a slash “/” in this string.
1136
1137And 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
1154Note that these module entries are tagged with ``__init`` and ``__exit``
1155prefixes.
1156
1157Oh, one thing was forgotten. If you have no exported symbols, you need
1158to 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
1164That's all!
1165
1166PCM Interface
1167=============
1168
1169General
1170-------
1171
1172The PCM middle layer of ALSA is quite powerful and it is only necessary
1173for each driver to implement the low-level functions to access its
1174hardware.
1175
1176For accessing to the PCM layer, you need to include ``<sound/pcm.h>``
1177first. In addition, ``<sound/pcm_params.h>`` might be needed if you
1178access to some functions related with hw_param.
1179
1180Each card device can have up to four pcm instances. A pcm instance
1181corresponds to a pcm device file. The limitation of number of instances
1182comes only from the available bit size of the Linux's device numbers.
1183Once when 64bit device number is used, we'll have more pcm instances
1184available.
1185
1186A pcm instance consists of pcm playback and capture streams, and each
1187pcm stream consists of one or more pcm substreams. Some soundcards
1188support multiple playback functions. For example, emu10k1 has a PCM
1189playback of 32 stereo substreams. In this case, at each open, a free
1190substream is (usually) automatically chosen and opened. Meanwhile, when
1191only one substream exists and it was already opened, the successful open
1192will either block or error with ``EAGAIN`` according to the file open
1193mode. But you don't have to care about such details in your driver. The
1194PCM middle layer will take care of such work.
1195
1196Full Code Example
1197-----------------
1198
1199The example code below does not include any hardware access routines but
1200shows 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
1405PCM Constructor
1406---------------
1407
1408A pcm instance is allocated by the :c:func:`snd_pcm_new()`
1409function. 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
1428The :c:func:`snd_pcm_new()` function takes four arguments. The
1429first argument is the card pointer to which this pcm is assigned, and
1430the second is the ID string.
1431
1432The third argument (``index``, 0 in the above) is the index of this new
1433pcm. It begins from zero. If you create more than one pcm instances,
1434specify the different numbers in this argument. For example, ``index =
14351`` for the second PCM device.
1436
1437The fourth and fifth arguments are the number of substreams for playback
1438and capture, respectively. Here 1 is used for both arguments. When no
1439playback or capture substreams are available, pass 0 to the
1440corresponding argument.
1441
1442If a chip supports multiple playbacks or captures, you can specify more
1443numbers, but they must be handled properly in open/close, etc.
1444callbacks. When you need to know which substream you are referring to,
1445then 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
1454After 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
1463The 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
1478All the callbacks are described in the Operators_ subsection.
1479
1480After setting the operators, you probably will want to pre-allocate the
1481buffer. 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
1489It will allocate a buffer up to 64kB as default. Buffer management
1490details will be described in the later section `Buffer and Memory
1491Management`_.
1492
1493Additionally, 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
1496hardware definition (described later). When your soundchip supports only
1497half-duplex, specify like this:
1498
1499::
1500
1501 pcm->info_flags = SNDRV_PCM_INFO_HALF_DUPLEX;
1502
1503
1504... And the Destructor?
1505-----------------------
1506
1507The destructor for a pcm instance is not always necessary. Since the pcm
1508device will be released by the middle layer code automatically, you
1509don't have to call the destructor explicitly.
1510
1511The destructor would be necessary if you created special records
1512internally and needed to release them. In such a case, set the
1513destructor 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
1540Runtime Pointer - The Chest of PCM Information
1541----------------------------------------------
1542
1543When the PCM substream is opened, a PCM runtime instance is allocated
1544and assigned to the substream. This pointer is accessible via
1545``substream->runtime``. This runtime pointer holds most information you
1546need to control the PCM: the copy of hw_params and sw_params
1547configurations, the buffer pointers, mmap records, spinlocks, etc.
1548
1549The definition of runtime instance is found in ``<sound/pcm.h>``. Here
1550are 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
1633For the operators (callbacks) of each sound driver, most of these
1634records are supposed to be read-only. Only the PCM middle-layer changes
1635/ updates them. The exceptions are the hardware description (hw) DMA
1636buffer information and the private data. Besides, if you use the
1637standard buffer allocation method via
1638:c:func:`snd_pcm_lib_malloc_pages()`, you don't need to set the
1639DMA buffer information by yourself.
1640
1641In the sections below, important records are explained.
1642
1643Hardware Description
1644~~~~~~~~~~~~~~~~~~~~
1645
1646The hardware descriptor (:c:type:`struct snd_pcm_hardware
1647<snd_pcm_hardware>`) contains the definitions of the fundamental
1648hardware configuration. Above all, you'll need to define this in the
1649`PCM open callback`_. Note that the runtime instance holds the copy of
1650the descriptor, not the pointer to the existing descriptor. That is,
1651in the open callback, you can modify the copied descriptor
1652(``runtime->hw``) as you need. For example, if the maximum number of
1653channels is 1 only on some chip models, you can still use the same
1654hardware 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
1664Typically, 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
1754PCM Configurations
1755~~~~~~~~~~~~~~~~~~
1756
1757Ok, let's go back again to the PCM runtime records. The most
1758frequently referred records in the runtime instance are the PCM
1759configurations. The PCM configurations are stored in the runtime
1760instance after the application sends ``hw_params`` data via
1761alsa-lib. There are many fields copied from hw_params and sw_params
1762structs. For example, ``format`` holds the format type chosen by the
1763application. This field contains the enum value
1764``SNDRV_PCM_FORMAT_XXX``.
1765
1766One thing to be noted is that the configured buffer and period sizes
1767are stored in “frames” in the runtime. In the ALSA world, ``1 frame =
1768channels \* samples-size``. For conversion between frames and bytes,
1769you 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
1776Also, many software parameters (sw_params) are stored in frames, too.
1777Please check the type of the field. ``snd_pcm_uframes_t`` is for the
1778frames as unsigned integer while ``snd_pcm_sframes_t`` is for the
1779frames as signed integer.
1780
1781DMA Buffer Information
1782~~~~~~~~~~~~~~~~~~~~~~
1783
1784The DMA buffer is defined by the following four fields, ``dma_area``,
1785``dma_addr``, ``dma_bytes`` and ``dma_private``. The ``dma_area``
1786holds the buffer pointer (the logical address). You can call
1787:c:func:`memcpy()` from/to this pointer. Meanwhile, ``dma_addr`` holds
1788the physical address of the buffer. This field is specified only when
1789the buffer is a linear buffer. ``dma_bytes`` holds the size of buffer
1790in bytes. ``dma_private`` is used for the ALSA DMA allocator.
1791
1792If you use a standard ALSA function,
1793:c:func:`snd_pcm_lib_malloc_pages()`, for allocating the buffer,
1794these fields are set by the ALSA middle layer, and you should *not*
1795change them by yourself. You can read them but not write them. On the
1796other hand, if you want to allocate the buffer by yourself, you'll
1797need to manage it in hw_params callback. At least, ``dma_bytes`` is
1798mandatory. ``dma_area`` is necessary when the buffer is mmapped. If
1799your driver doesn't support mmap, this field is not
1800necessary. ``dma_addr`` is also optional. You can use dma_private as
1801you like, too.
1802
1803Running Status
1804~~~~~~~~~~~~~~
1805
1806The running status can be referred via ``runtime->status``. This is
1807the pointer to the :c:type:`struct snd_pcm_mmap_status
1808<snd_pcm_mmap_status>` record. For example, you can get the current
1809DMA hardware pointer via ``runtime->status->hw_ptr``.
1810
1811The DMA application pointer can be referred via ``runtime->control``,
1812which points to the :c:type:`struct snd_pcm_mmap_control
1813<snd_pcm_mmap_control>` record. However, accessing directly to
1814this value is not recommended.
1815
1816Private Data
1817~~~~~~~~~~~~
1818
1819You can allocate a record for the substream and store it in
1820``runtime->private_data``. Usually, this is done in the `PCM open
1821callback`_. Don't mix this with ``pcm->private_data``. The
1822``pcm->private_data`` usually points to the chip instance assigned
1823statically at the creation of PCM, while the ``runtime->private_data``
1824points to a dynamic data structure created at the PCM open
1825callback.
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
1839The allocated object must be released in the `close callback`_.
1840
1841Operators
1842---------
1843
1844OK, now let me give details about each pcm callback (``ops``). In
1845general, every callback must return 0 if successful, or a negative
1846error number such as ``-EINVAL``. To choose an appropriate error
1847number, it is advised to check what value other parts of the kernel
1848return when the same kind of request fails.
1849
1850The callback function takes at least the argument with :c:type:`struct
1851snd_pcm_substream <snd_pcm_substream>` pointer. To retrieve the chip
1852record from the given substream instance, you can use the following
1853macro.
1854
1855::
1856
1857 int xxx() {
1858 struct mychip *chip = snd_pcm_substream_chip(substream);
1859 ....
1860 }
1861
1862The macro reads ``substream->private_data``, which is a copy of
1863``pcm->private_data``. You can override the former if you need to
1864assign different data records per PCM substream. For example, the
1865cmi8330 driver assigns different ``private_data`` for playback and
1866capture directions, because it uses two different codecs (SB- and
1867AD-compatible) for different directions.
1868
1869PCM open callback
1870~~~~~~~~~~~~~~~~~
1871
1872::
1873
1874 static int snd_xxx_open(struct snd_pcm_substream *substream);
1875
1876This is called when a pcm substream is opened.
1877
1878At least, here you have to initialize the ``runtime->hw``
1879record. 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
1892where ``snd_mychip_playback_hw`` is the pre-defined hardware
1893description.
1894
1895You can allocate a private data in this callback, as described in
1896`Private Data`_ section.
1897
1898If the hardware configuration needs more constraints, set the hardware
1899constraints here, too. See Constraints_ for more details.
1900
1901close callback
1902~~~~~~~~~~~~~~
1903
1904::
1905
1906 static int snd_xxx_close(struct snd_pcm_substream *substream);
1907
1908
1909Obviously, this is called when a pcm substream is closed.
1910
1911Any private instance for a pcm substream allocated in the ``open``
1912callback 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
1923ioctl callback
1924~~~~~~~~~~~~~~
1925
1926This is used for any special call to pcm ioctls. But usually you can
1927pass a generic ioctl callback, :c:func:`snd_pcm_lib_ioctl()`.
1928
1929hw_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
1937This is called when the hardware parameter (``hw_params``) is set up
1938by the application, that is, once when the buffer size, the period
1939size, the format, etc. are defined for the pcm substream.
1940
1941Many hardware setups should be done in this callback, including the
1942allocation of buffers.
1943
1944Parameters to be initialized are retrieved by
1945:c:func:`params_xxx()` macros. To allocate buffer, you can call a
1946helper 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
1953DMA buffers have been pre-allocated. See the section `Buffer Types`_
1954for more details.
1955
1956Note that this and ``prepare`` callbacks may be called multiple times
1957per initialization. For example, the OSS emulation may call these
1958callbacks at each change via its ioctl.
1959
1960Thus, you need to be careful not to allocate the same buffers many
1961times, which will lead to memory leaks! Calling the helper function
1962above many times is OK. It will release the previous buffer
1963automatically when it was already allocated.
1964
1965Another note is that this callback is non-atomic (schedulable) as
1966default, i.e. when no ``nonatomic`` flag set. This is important,
1967because the ``trigger`` callback is atomic (non-schedulable). That is,
1968mutexes or any schedule-related functions are not available in
1969``trigger`` callback. Please see the subsection Atomicity_ for
1970details.
1971
1972hw_free callback
1973~~~~~~~~~~~~~~~~~
1974
1975::
1976
1977 static int snd_xxx_hw_free(struct snd_pcm_substream *substream);
1978
1979This 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
1982following:
1983
1984::
1985
1986 snd_pcm_lib_free_pages(substream);
1987
1988This function is always called before the close callback is called.
1989Also, the callback may be called multiple times, too. Keep track
1990whether the resource was already released.
1991
1992prepare callback
1993~~~~~~~~~~~~~~~~
1994
1995::
1996
1997 static int snd_xxx_prepare(struct snd_pcm_substream *substream);
1998
1999This callback is called when the pcm is “prepared”. You can set the
2000format type, sample rate, etc. here. The difference from ``hw_params``
2001is that the ``prepare`` callback will be called each time
2002:c:func:`snd_pcm_prepare()` is called, i.e. when recovering after
2003underruns, etc.
2004
2005Note that this callback is now non-atomic. You can use
2006schedule-related functions safely in this callback.
2007
2008In this and the following callbacks, you can refer to the values via
2009the runtime record, ``substream->runtime``. For example, to get the
2010current rate, format or channels, access to ``runtime->rate``,
2011``runtime->format`` or ``runtime->channels``, respectively. The
2012physical 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
2016Be careful that this callback will be called many times at each setup,
2017too.
2018
2019trigger callback
2020~~~~~~~~~~~~~~~~
2021
2022::
2023
2024 static int snd_xxx_trigger(struct snd_pcm_substream *substream, int cmd);
2025
2026This is called when the pcm is started, stopped or paused.
2027
2028Which action is specified in the second argument,
2029``SNDRV_PCM_TRIGGER_XXX`` in ``<sound/pcm.h>``. At least, the ``START``
2030and ``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
2045When the pcm supports the pause operation (given in the info field of
2046the hardware table), the ``PAUSE_PUSH`` and ``PAUSE_RELEASE`` commands
2047must be handled here, too. The former is the command to pause the pcm,
2048and the latter to restart the pcm again.
2049
2050When the pcm supports the suspend/resume operation, regardless of full
2051or partial suspend/resume support, the ``SUSPEND`` and ``RESUME``
2052commands must be handled, too. These commands are issued when the
2053power-management status is changed. Obviously, the ``SUSPEND`` and
2054``RESUME`` commands suspend and resume the pcm substream, and usually,
2055they are identical to the ``STOP`` and ``START`` commands, respectively.
2056See the `Power Management`_ section for details.
2057
2058As mentioned, this callback is atomic as default unless ``nonatomic``
2059flag set, and you cannot call functions which may sleep. The
2060``trigger`` callback should be as minimal as possible, just really
2061triggering the DMA. The other stuff should be initialized
2062``hw_params`` and ``prepare`` callbacks properly beforehand.
2063
2064pointer callback
2065~~~~~~~~~~~~~~~~
2066
2067::
2068
2069 static snd_pcm_uframes_t snd_xxx_pointer(struct snd_pcm_substream *substream)
2070
2071This callback is called when the PCM middle layer inquires the current
2072hardware position on the buffer. The position must be returned in
2073frames, ranging from 0 to ``buffer_size - 1``.
2074
2075This is called usually from the buffer-update routine in the pcm
2076middle layer, which is invoked when :c:func:`snd_pcm_period_elapsed()`
2077is called in the interrupt routine. Then the pcm middle layer updates
2078the position and calculates the available space, and wakes up the
2079sleeping poll threads, etc.
2080
2081This callback is also atomic as default.
2082
2083copy and silence callbacks
2084~~~~~~~~~~~~~~~~~~~~~~~~~~
2085
2086These callbacks are not mandatory, and can be omitted in most cases.
2087These callbacks are used when the hardware buffer cannot be in the
2088normal memory space. Some chips have their own buffer on the hardware
2089which is not mappable. In such a case, you have to transfer the data
2090manually from the memory buffer to the hardware buffer. Or, if the
2091buffer is non-contiguous on both physical and virtual memory spaces,
2092these callbacks must be defined, too.
2093
2094If these two callbacks are defined, copy and set-silence operations
2095are done by them. The detailed will be described in the later section
2096`Buffer and Memory Management`_.
2097
2098ack callback
2099~~~~~~~~~~~~
2100
2101This callback is also not mandatory. This callback is called when the
2102``appl_ptr`` is updated in read or write operations. Some drivers like
2103emu10k1-fx and cs46xx need to track the current ``appl_ptr`` for the
2104internal buffer, and this callback is useful only for such a purpose.
2105
2106This callback is atomic as default.
2107
2108page callback
2109~~~~~~~~~~~~~
2110
2111This callback is optional too. This callback is used mainly for
2112non-contiguous buffers. The mmap calls this callback to get the page
2113address. Some examples will be explained in the later section `Buffer
2114and Memory Management`_, too.
2115
2116PCM Interrupt Handler
2117---------------------
2118
2119The rest of pcm stuff is the PCM interrupt handler. The role of PCM
2120interrupt handler in the sound driver is to update the buffer position
2121and to tell the PCM middle layer when the buffer position goes across
2122the prescribed period size. To inform this, call the
2123:c:func:`snd_pcm_period_elapsed()` function.
2124
2125There are several types of sound chips to generate the interrupts.
2126
2127Interrupts at the period (fragment) boundary
2128~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2129
2130This is the most frequently found type: the hardware generates an
2131interrupt 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
2135its argument. Thus, you need to keep the substream pointer accessible
2136from the chip instance. For example, define ``substream`` field in the
2137chip record to hold the current running substream pointer, and set the
2138pointer value at ``open`` callback (and reset at ``close`` callback).
2139
2140If you acquire a spinlock in the interrupt handler, and the lock is used
2141in other pcm callbacks, too, then you have to release the lock before
2142calling :c:func:`snd_pcm_period_elapsed()`, because
2143:c:func:`snd_pcm_period_elapsed()` calls other pcm callbacks
2144inside.
2145
2146Typical 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
2170High frequency timer interrupts
2171~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2172
2173This happens when the hardware doesn't generate interrupts at the period
2174boundary but issues timer interrupts at a fixed timer rate (e.g. es1968
2175or ymfpci drivers). In this case, you need to check the current hardware
2176position and accumulate the processed sample length at each interrupt.
2177When the accumulated size exceeds the period size, call
2178:c:func:`snd_pcm_period_elapsed()` and reset the accumulator.
2179
2180Typical 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
2224On calling :c:func:`snd_pcm_period_elapsed()`
2225~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2226
2227In both cases, even if more than one period are elapsed, you don't have
2228to call :c:func:`snd_pcm_period_elapsed()` many times. Call only
2229once. And the pcm layer will check the current hardware pointer and
2230update to the latest status.
2231
2232Atomicity
2233---------
2234
2235One of the most important (and thus difficult to debug) problems in
2236kernel programming are race conditions. In the Linux kernel, they are
2237usually avoided via spin-locks, mutexes or semaphores. In general, if a
2238race condition can happen in an interrupt handler, it has to be managed
2239atomically, and you have to use a spinlock to protect the critical
2240session. If the critical section is not in interrupt handler code and if
2241taking a relatively long time to execute is acceptable, you should use
2242mutexes or semaphores instead.
2243
2244As already seen, some pcm callbacks are atomic and some are not. For
2245example, the ``hw_params`` callback is non-atomic, while ``trigger``
2246callback is atomic. This means, the latter is called already in a
2247spinlock held by the PCM middle layer. Please take this atomicity into
2248account when you choose a locking scheme in the callbacks.
2249
2250In the atomic callbacks, you cannot use functions which may call
2251:c:func:`schedule()` or go to :c:func:`sleep()`. Semaphores and
2252mutexes can sleep, and hence they cannot be used inside the atomic
2253callbacks (e.g. ``trigger`` callback). To implement some delay in such a
2254callback, please use :c:func:`udelay()` or :c:func:`mdelay()`.
2255
2256All three atomic callbacks (trigger, pointer, and ack) are called with
2257local interrupts disabled.
2258
2259The recent changes in PCM core code, however, allow all PCM operations
2260to be non-atomic. This assumes that the all caller sides are in
2261non-atomic contexts. For example, the function
2262:c:func:`snd_pcm_period_elapsed()` is called typically from the
2263interrupt handler. But, if you set up the driver to use a threaded
2264interrupt handler, this call can be in non-atomic context, too. In such
2265a 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
2267and rwsem are used internally in the PCM core instead of spin and
2268rwlocks, so that you can call all PCM functions safely in a non-atomic
2269context.
2270
2271Constraints
2272-----------
2273
2274If your chip supports unconventional sample rates, or only the limited
2275samples, you need to set a constraint for the condition.
2276
2277For example, in order to restrict the sample rates in the some supported
2278values, use :c:func:`snd_pcm_hw_constraint_list()`. You need to
2279call 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
2305There are many different constraints. Look at ``sound/pcm.h`` for a
2306complete list. You can even define your own constraint rules. For
2307example, let's suppose my_chip can manage a substream of 1 channel if
2308and only if the format is ``S16_LE``, otherwise it supports any format
2309specified in the :c:type:`struct snd_pcm_hardware
2310<snd_pcm_hardware>` structure (or in any other
2311constraint_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
2333Then 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
2341The rule function is called when an application sets the PCM format, and
2342it refines the number of channels accordingly. But an application may
2343set the number of channels before setting the format. Thus you also need
2344to 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
2373I won't give more details here, rather I would like to say, “Luke, use
2374the source.”
2375
2376Control Interface
2377=================
2378
2379General
2380-------
2381
2382The control interface is used widely for many switches, sliders, etc.
2383which are accessed from user-space. Its most important use is the mixer
2384interface. In other words, since ALSA 0.9.x, all the mixer stuff is
2385implemented on the control kernel API.
2386
2387ALSA has a well-defined AC97 control module. If your chip supports only
2388the AC97 and nothing else, you can skip this section.
2389
2390The control API is defined in ``<sound/control.h>``. Include this file
2391if you want to add your own controls.
2392
2393Definition of Controls
2394----------------------
2395
2396To create a new control, you need to define the following three
2397callbacks: ``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
2415The ``iface`` field specifies the control type,
2416``SNDRV_CTL_ELEM_IFACE_XXX``, which is usually ``MIXER``. Use ``CARD``
2417for global controls that are not logically part of the mixer. If the
2418control is closely associated with some specific device on the sound
2419card, use ``HWDEP``, ``PCM``, ``RAWMIDI``, ``TIMER``, or ``SEQUENCER``,
2420and specify the device number with the ``device`` and ``subdevice``
2421fields.
2422
2423The ``name`` is the name identifier string. Since ALSA 0.9.x, the
2424control name is very important, because its role is classified from
2425its name. There are pre-defined standard control names. The details
2426are described in the `Control Names`_ subsection.
2427
2428The ``index`` field holds the index number of this control. If there
2429are several different controls with the same name, they can be
2430distinguished by the index number. This is the case when several
2431codecs exist on the card. If the index is zero, you can omit the
2432definition above.
2433
2434The ``access`` field contains the access type of this control. Give
2435the combination of bit masks, ``SNDRV_CTL_ELEM_ACCESS_XXX``,
2436there. The details will be explained in the `Access Flags`_
2437subsection.
2438
2439The ``private_value`` field contains an arbitrary long integer value
2440for this record. When using the generic ``info``, ``get`` and ``put``
2441callbacks, you can pass a value through this field. If several small
2442numbers are necessary, you can combine them in bitwise. Or, it's
2443possible to give a pointer (casted to unsigned long) of some record to
2444this field, too.
2445
2446The ``tlv`` field can be used to provide metadata about the control;
2447see the `Metadata`_ subsection.
2448
2449The other three are `Control Callbacks`_.
2450
2451Control Names
2452-------------
2453
2454There are some standards to define the control names. A control is
2455usually defined from the three parts as “SOURCE DIRECTION FUNCTION”.
2456
2457The first, ``SOURCE``, specifies the source of the control, and is a
2458string such as “Master”, “PCM”, “CD” and “Line”. There are many
2459pre-defined sources.
2460
2461The second, ``DIRECTION``, is one of the following strings according to
2462the direction of the control: “Playback”, “Capture”, “Bypass Playback”
2463and “Bypass Capture”. Or, it can be omitted, meaning both playback and
2464capture directions.
2465
2466The third, ``FUNCTION``, is one of the following strings according to
2467the function of the control: “Switch”, “Volume” and “Route”.
2468
2469The example of control names are, thus, “Master Capture Switch” or “PCM
2470Playback Volume”.
2471
2472There are some exceptions:
2473
2474Global capture and playback
2475~~~~~~~~~~~~~~~~~~~~~~~~~~~
2476
2477“Capture Source”, “Capture Switch” and “Capture Volume” are used for the
2478global capture (input) source, switch and volume. Similarly, “Playback
2479Switch” and “Playback Volume” are used for the global output gain switch
2480and volume.
2481
2482Tone-controls
2483~~~~~~~~~~~~~
2484
2485tone-control switch and volumes are specified like “Tone Control - XXX”,
2486e.g. “Tone Control - Switch”, “Tone Control - Bass”, “Tone Control -
2487Center”.
2488
24893D controls
2490~~~~~~~~~~~
2491
24923D-control switches and volumes are specified like “3D Control - XXX”,
2493e.g. “3D Control - Switch”, “3D Control - Center”, “3D Control - Space”.
2494
2495Mic boost
2496~~~~~~~~~
2497
2498Mic-boost switch is set as “Mic Boost” or “Mic Boost (6dB)”.
2499
2500More precise information can be found in
2501``Documentation/sound/alsa/ControlNames.txt``.
2502
2503Access Flags
2504------------
2505
2506The access flag is the bitmask which specifies the access type of the
2507given control. The default access type is
2508``SNDRV_CTL_ELEM_ACCESS_READWRITE``, which means both read and write are
2509allowed to this control. When the access flag is omitted (i.e. = 0), it
2510is considered as ``READWRITE`` access as default.
2511
2512When the control is read-only, pass ``SNDRV_CTL_ELEM_ACCESS_READ``
2513instead. In this case, you don't have to define the ``put`` callback.
2514Similarly, when the control is write-only (although it's a rare case),
2515you can use the ``WRITE`` flag instead, and you don't need the ``get``
2516callback.
2517
2518If the control value changes frequently (e.g. the VU meter),
2519``VOLATILE`` flag should be given. This means that the control may be
2520changed without `Change notification`_. Applications should poll such
2521a control constantly.
2522
2523When the control is inactive, set the ``INACTIVE`` flag, too. There are
2524``LOCK`` and ``OWNER`` flags to change the write permissions.
2525
2526Control Callbacks
2527-----------------
2528
2529info callback
2530~~~~~~~~~~~~~
2531
2532The ``info`` callback is used to get detailed information on this
2533control. This must store the values of the given :c:type:`struct
2534snd_ctl_elem_info <snd_ctl_elem_info>` object. For example,
2535for 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
2552The ``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
2555this 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
2557type. The boolean and integer types are identical.
2558
2559The enumerated type is a bit different from others. You'll need to set
2560the 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
2580The 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;
2583it'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
2597Some 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
2600is 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
2602stereo channel boolean item.
2603
2604get callback
2605~~~~~~~~~~~~
2606
2607This callback is used to read the current value of the control and to
2608return to user-space.
2609
2610For 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
2625The ``value`` field depends on the type of control as well as on the
2626info callback. For example, the sb driver uses this field to store the
2627register offset, the bit-shift and the bit-mask. The ``private_value``
2628field is set as follows:
2629
2630::
2631
2632 .private_value = reg | (shift << 16) | (mask << 24)
2633
2634and 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
2647In the ``get`` callback, you have to fill all the elements if the
2648control has more than one elements, i.e. ``count > 1``. In the example
2649above, we filled only one element (``value.integer.value[0]``) since
2650it's assumed as ``count = 1``.
2651
2652put callback
2653~~~~~~~~~~~~
2654
2655This callback is used to write a value from user-space.
2656
2657For 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
2678As seen above, you have to return 1 if the value is changed. If the
2679value is not changed, return 0 instead. If any fatal error happens,
2680return a negative error code as usual.
2681
2682As in the ``get`` callback, when the control has more than one
2683elements, all elements must be evaluated in this callback, too.
2684
2685Callbacks are not atomic
2686~~~~~~~~~~~~~~~~~~~~~~~~
2687
2688All these three callbacks are basically not atomic.
2689
2690Control Constructor
2691-------------------
2692
2693When everything is ready, finally we can create a new control. To create
2694a control, there are two functions to be called,
2695:c:func:`snd_ctl_new1()` and :c:func:`snd_ctl_add()`.
2696
2697In 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
2705where ``my_control`` is the :c:type:`struct snd_kcontrol_new
2706<snd_kcontrol_new>` object defined above, and chip is the object
2707pointer to be passed to kcontrol->private_data which can be referred
2708to in callbacks.
2709
2710:c:func:`snd_ctl_new1()` allocates a new :c:type:`struct
2711snd_kcontrol <snd_kcontrol>` instance, and
2712:c:func:`snd_ctl_add()` assigns the given control component to the
2713card.
2714
2715Change Notification
2716-------------------
2717
2718If you need to change and update a control in the interrupt routine, you
2719can call :c:func:`snd_ctl_notify()`. For example,
2720
2721::
2722
2723 snd_ctl_notify(card, SNDRV_CTL_EVENT_MASK_VALUE, id_pointer);
2724
2725This function takes the card pointer, the event-mask, and the control id
2726pointer for the notification. The event-mask specifies the types of
2727notification, for example, in the above example, the change of control
2728values is notified. The id pointer is the pointer of :c:type:`struct
2729snd_ctl_elem_id <snd_ctl_elem_id>` to be notified. You can
2730find some examples in ``es1938.c`` or ``es1968.c`` for hardware volume
2731interrupts.
2732
2733Metadata
2734--------
2735
2736To provide information about the dB values of a mixer control, use on of
2737the ``DECLARE_TLV_xxx`` macros from ``<sound/tlv.h>`` to define a
2738variable containing this information, set the ``tlv.p`` field to point to
2739this variable, and include the ``SNDRV_CTL_ELEM_ACCESS_TLV_READ`` flag
2740in 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
2755The :c:func:`DECLARE_TLV_DB_SCALE()` macro defines information
2756about a mixer control where each step in the control's value changes the
2757dB value by a constant dB amount. The first parameter is the name of the
2758variable to be defined. The second parameter is the minimum value, in
2759units of 0.01 dB. The third parameter is the step size, in units of 0.01
2760dB. Set the fourth parameter to 1 if the minimum value actually mutes
2761the control.
2762
2763The :c:func:`DECLARE_TLV_DB_LINEAR()` macro defines information
2764about a mixer control where the control's value affects the output
2765linearly. The first parameter is the name of the variable to be defined.
2766The second parameter is the minimum value, in units of 0.01 dB. The
2767third parameter is the maximum value, in units of 0.01 dB. If the
2768minimum value mutes the control, set the second parameter to
2769``TLV_DB_GAIN_MUTE``.
2770
2771API for AC97 Codec
2772==================
2773
2774General
2775-------
2776
2777The ALSA AC97 codec layer is a well-defined one, and you don't have to
2778write much code to control it. Only low-level control routines are
2779necessary. The AC97 codec API is defined in ``<sound/ac97_codec.h>``.
2780
2781Full 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
2828AC97 Constructor
2829----------------
2830
2831To create an ac97 instance, first call :c:func:`snd_ac97_bus()`
2832with 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
2844The bus record is shared among all belonging ac97 instances.
2845
2846And then call :c:func:`snd_ac97_mixer()` with an :c:type:`struct
2847snd_ac97_template <snd_ac97_template>` record together with
2848the 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
2859where chip->ac97 is a pointer to a newly created ``ac97_t``
2860instance. In this case, the chip pointer is set as the private data,
2861so that the read/write callback functions can refer to this chip
2862instance. This instance is not necessarily stored in the chip
2863record. If you need to change the register values from the driver, or
2864need the suspend/resume of ac97 codecs, keep this pointer to pass to
2865the corresponding functions.
2866
2867AC97 Callbacks
2868--------------
2869
2870The standard callbacks are ``read`` and ``write``. Obviously they
2871correspond to the functions for read and write accesses to the
2872hardware low-level codes.
2873
2874The ``read`` callback returns the register value specified in the
2875argument.
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
2887Here, the chip can be cast from ``ac97->private_data``.
2888
2889Meanwhile, the ``write`` callback is used to set the register
2890value
2891
2892::
2893
2894 static void snd_mychip_ac97_write(struct snd_ac97 *ac97,
2895 unsigned short reg, unsigned short val)
2896
2897
2898These callbacks are non-atomic like the control API callbacks.
2899
2900There are also other callbacks: ``reset``, ``wait`` and ``init``.
2901
2902The ``reset`` callback is used to reset the codec. If the chip
2903requires a special kind of reset, you can define this callback.
2904
2905The ``wait`` callback is used to add some waiting time in the standard
2906initialization of the codec. If the chip requires the extra waiting
2907time, define this callback.
2908
2909The ``init`` callback is used for additional initialization of the
2910codec.
2911
2912Updating Registers in The Driver
2913--------------------------------
2914
2915If you need to access to the codec from the driver, you can call the
2916following 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
2920Both :c:func:`snd_ac97_write()` and
2921:c:func:`snd_ac97_update()` functions are used to set a value to
2922the given register (``AC97_XXX``). The difference between them is that
2923:c:func:`snd_ac97_update()` doesn't write a value if the given
2924value has been already set, while :c:func:`snd_ac97_write()`
2925always 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
2933register. 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
2940the given register.
2941
2942::
2943
2944 snd_ac97_update_bits(ac97, reg, mask, value);
2945
2946Also, there is a function to change the sample rate (of a given register
2947such as ``AC97_PCM_FRONT_DAC_RATE``) when VRA or DRA is supported by the
2948codec: :c:func:`snd_ac97_set_rate()`.
2949
2950::
2951
2952 snd_ac97_set_rate(ac97, AC97_PCM_FRONT_DAC_RATE, 44100);
2953
2954
2955The 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
2958specified, the register is not really changed but the corresponding
2959IEC958 status bits will be updated.
2960
2961Clock Adjustment
2962----------------
2963
2964In 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
2966the corresponding value. For example, intel8x0 and es1968 drivers have
2967their own function to read from the clock.
2968
2969Proc Files
2970----------
2971
2972The 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
2974can refer to these files to see the current status and registers of
2975the codec.
2976
2977Multiple Codecs
2978---------------
2979
2980When 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
2982greater. The ``num`` field specifies the codec number.
2983
2984If you set up multiple codecs, you either need to write different
2985callbacks for each codec or check ``ac97->num`` in the callback
2986routines.
2987
2988MIDI (MPU401-UART) Interface
2989============================
2990
2991General
2992-------
2993
2994Many soundcards have built-in MIDI (MPU401-UART) interfaces. When the
2995soundcard supports the standard MPU401-UART interface, most likely you
2996can use the ALSA MPU401-UART API. The MPU401-UART API is defined in
2997``<sound/mpu401.h>``.
2998
2999Some soundchips have a similar but slightly different implementation of
3000mpu401 stuff. For example, emu10k1 has its own mpu401 routines.
3001
3002MIDI Constructor
3003----------------
3004
3005To 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
3014The first argument is the card pointer, and the second is the index of
3015this component. You can create up to 8 rawmidi devices.
3016
3017The third argument is the type of the hardware, ``MPU401_HW_XXX``. If
3018it's not a special one, you can use ``MPU401_HW_MPU401``.
3019
3020The 4th argument is the I/O port address. Many backward-compatible
3021MPU401 have an I/O port such as 0x330. Or, it might be a part of its own
3022PCI I/O region. It depends on the chip design.
3023
3024The 5th argument is a bitflag for additional information. When the I/O
3025port address above is part of the PCI I/O region, the MPU401 I/O port
3026might have been already allocated (reserved) by the driver itself. In
3027such a case, pass a bit flag ``MPU401_INFO_INTEGRATED``, and the
3028mpu401-uart layer will allocate the I/O ports by itself.
3029
3030When the controller supports only the input or output MIDI stream, pass
3031the ``MPU401_INFO_INPUT`` or ``MPU401_INFO_OUTPUT`` bitflag,
3032respectively. 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
3036to pass the iomapped address to :c:func:`snd_mpu401_uart_new()`.
3037
3038When ``MPU401_INFO_TX_IRQ`` is set, the output stream isn't checked in
3039the default interrupt handler. The driver needs to call
3040:c:func:`snd_mpu401_uart_interrupt_tx()` by itself to start
3041processing the output stream in the irq handler.
3042
3043If the MPU-401 interface shares its interrupt with the other logical
3044devices on the card, set ``MPU401_INFO_IRQ_HOOK`` (see
3045`below <#MIDI-Interrupt-Handler>`__).
3046
3047Usually, the port address corresponds to the command port and port + 1
3048corresponds to the data port. If not, you may change the ``cport``
3049field of :c:type:`struct snd_mpu401 <snd_mpu401>` manually afterward.
3050However, :c:type:`struct snd_mpu401 <snd_mpu401>` pointer is
3051not returned explicitly by :c:func:`snd_mpu401_uart_new()`. You
3052need 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
3060and reset the ``cport`` as you like:
3061
3062::
3063
3064 mpu->cport = my_own_control_port;
3065
3066The 6th argument specifies the ISA irq number that will be allocated. If
3067no interrupt is to be allocated (because your code is already allocating
3068a 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
3070will be used instead.
3071
3072MIDI Interrupt Handler
3073----------------------
3074
3075When the interrupt is allocated in
3076:c:func:`snd_mpu401_uart_new()`, an exclusive ISA interrupt
3077handler is automatically used, hence you don't have anything else to do
3078than 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
3081interrupt handler when it has determined that a UART interrupt has
3082occurred.
3083
3084In this case, you need to pass the private_data of the returned rawmidi
3085object from :c:func:`snd_mpu401_uart_new()` as the second
3086argument of :c:func:`snd_mpu401_uart_interrupt()`.
3087
3088::
3089
3090 snd_mpu401_uart_interrupt(irq, rmidi->private_data, regs);
3091
3092
3093RawMIDI Interface
3094=================
3095
3096Overview
3097--------
3098
3099The raw MIDI interface is used for hardware MIDI ports that can be
3100accessed as a byte stream. It is not used for synthesizer chips that do
3101not directly understand MIDI.
3102
3103ALSA handles file and buffer management. All you have to do is to write
3104some code to move data between the buffer and the hardware.
3105
3106The rawmidi API is defined in ``<sound/rawmidi.h>``.
3107
3108RawMIDI Constructor
3109-------------------
3110
3111To create a rawmidi device, call the :c:func:`snd_rawmidi_new()`
3112function:
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
3126The first argument is the card pointer, the second argument is the ID
3127string.
3128
3129The third argument is the index of this component. You can create up to
31308 rawmidi devices.
3131
3132The fourth and fifth arguments are the number of output and input
3133substreams, respectively, of this device (a substream is the equivalent
3134of a MIDI port).
3135
3136Set the ``info_flags`` field to specify the capabilities of the
3137device. Set ``SNDRV_RAWMIDI_INFO_OUTPUT`` if there is at least one
3138output port, ``SNDRV_RAWMIDI_INFO_INPUT`` if there is at least one
3139input port, and ``SNDRV_RAWMIDI_INFO_DUPLEX`` if the device can handle
3140output and input at the same time.
3141
3142After the rawmidi device is created, you need to set the operators
3143(callbacks) for each substream. There are helper functions to set the
3144operators 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
3151The 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
3161These callbacks are explained in the `RawMIDI Callbacks`_ section.
3162
3163If there are more than one substream, you should give a unique name to
3164each 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
3176RawMIDI Callbacks
3177-----------------
3178
3179In all the callbacks, the private data that you've set for the rawmidi
3180device can be accessed as ``substream->rmidi->private_data``.
3181
3182If there is more than one port, your callbacks can determine the port
3183index from the struct snd_rawmidi_substream data passed to each
3184callback:
3185
3186::
3187
3188 struct snd_rawmidi_substream *substream;
3189 int index = substream->number;
3190
3191RawMIDI open callback
3192~~~~~~~~~~~~~~~~~~~~~
3193
3194::
3195
3196 static int snd_xxx_open(struct snd_rawmidi_substream *substream);
3197
3198
3199This is called when a substream is opened. You can initialize the
3200hardware here, but you shouldn't start transmitting/receiving data yet.
3201
3202RawMIDI close callback
3203~~~~~~~~~~~~~~~~~~~~~~
3204
3205::
3206
3207 static int snd_xxx_close(struct snd_rawmidi_substream *substream);
3208
3209Guess what.
3210
3211The ``open`` and ``close`` callbacks of a rawmidi device are
3212serialized with a mutex, and can sleep.
3213
3214Rawmidi 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
3222This is called with a nonzero ``up`` parameter when there is some data
3223in the substream buffer that must be transmitted.
3224
3225To read data from the buffer, call
3226:c:func:`snd_rawmidi_transmit_peek()`. It will return the number
3227of bytes that have been read; this will be less than the number of bytes
3228requested when there are no more data in the buffer. After the data have
3229been transmitted successfully, call
3230:c:func:`snd_rawmidi_transmit_ack()` to remove the data from the
3231substream 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
3243If you know beforehand that the hardware will accept data, you can use
3244the :c:func:`snd_rawmidi_transmit()` function which reads some
3245data 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
3256If you know beforehand how many bytes you can accept, you can use a
3257buffer size greater than one with the
3258:c:func:`snd_rawmidi_transmit\*()` functions.
3259
3260The ``trigger`` callback must not sleep. If the hardware FIFO is full
3261before the substream buffer has been emptied, you have to continue
3262transmitting data later, either in an interrupt handler, or with a
3263timer if the hardware doesn't have a MIDI transmit interrupt.
3264
3265The ``trigger`` callback is called with a zero ``up`` parameter when
3266the transmission of data should be aborted.
3267
3268RawMIDI 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
3276This is called with a nonzero ``up`` parameter to enable receiving data,
3277or with a zero ``up`` parameter do disable receiving data.
3278
3279The ``trigger`` callback must not sleep; the actual reading of data
3280from the device is usually done in an interrupt handler.
3281
3282When 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
3297drain callback
3298~~~~~~~~~~~~~~
3299
3300::
3301
3302 static void snd_xxx_drain(struct snd_rawmidi_substream *substream);
3303
3304
3305This is only used with output substreams. This function should wait
3306until all data read from the substream buffer have been transmitted.
3307This ensures that the device can be closed and the driver unloaded
3308without losing data.
3309
3310This callback is optional. If you do not set ``drain`` in the struct
3311snd_rawmidi_ops structure, ALSA will simply wait for 50 milliseconds
3312instead.
3313
3314Miscellaneous Devices
3315=====================
3316
3317FM OPL3
3318-------
3319
3320The FM OPL3 is still used in many chips (mainly for backward
3321compatibility). ALSA has a nice OPL3 FM control layer, too. The OPL3 API
3322is defined in ``<sound/opl3.h>``.
3323
3324FM registers can be directly accessed through the direct-FM API, defined
3325in ``<sound/asound_fm.h>``. In ALSA native mode, FM registers are
3326accessed through the Hardware-Dependent Device direct-FM extension API,
3327whereas in OSS compatible mode, FM registers can be accessed with the
3328OSS direct-FM compatible API in ``/dev/dmfmX`` device.
3329
3330To create the OPL3 component, you have two functions to call. The first
3331one 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
3339The first argument is the card pointer, the second one is the left port
3340address, and the third is the right port address. In most cases, the
3341right port is placed at the left port + 2.
3342
3343The fourth argument is the hardware type.
3344
3345When the left and right ports have been already allocated by the card
3346driver, pass non-zero to the fifth argument (``integrated``). Otherwise,
3347the opl3 module will allocate the specified ports by itself.
3348
3349When the accessing the hardware requires special method instead of the
3350standard 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
3358Then set ``command``, ``private_data`` and ``private_free`` for the
3359private access function, the private data and the destructor. The
3360``l_port`` and ``r_port`` are not necessarily set. Only the command
3361must be set properly. You can retrieve the data from the
3362``opl3->private_data`` field.
3363
3364After creating the opl3 instance via :c:func:`snd_opl3_new()`,
3365call :c:func:`snd_opl3_init()` to initialize the chip to the
3366proper state. Note that :c:func:`snd_opl3_create()` always calls
3367it internally.
3368
3369If the opl3 instance is created successfully, then create a hwdep device
3370for this opl3.
3371
3372::
3373
3374 struct snd_hwdep *opl3hwdep;
3375 snd_opl3_hwdep_new(opl3, 0, 1, &opl3hwdep);
3376
3377The first argument is the ``opl3_t`` instance you created, and the
3378second is the index number, usually 0.
3379
3380The third argument is the index-offset for the sequencer client assigned
3381to the OPL3 port. When there is an MPU401-UART, give 1 for here (UART
3382always takes 0).
3383
3384Hardware-Dependent Devices
3385--------------------------
3386
3387Some chips need user-space access for special controls or for loading
3388the 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
3393The 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
3401where the third argument is the index number.
3402
3403You can then pass any pointer value to the ``private_data``. If you
3404assign a private data, you should define the destructor, too. The
3405destructor 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
3413and 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
3423The arbitrary file operations can be defined for this instance. The file
3424operators are defined in the ``ops`` table. For example, assume that
3425this 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
3433And implement the callback functions as you like.
3434
3435IEC958 (S/PDIF)
3436---------------
3437
3438Usually the controls for IEC958 devices are implemented via the control
3439interface. There is a macro to compose a name string for IEC958
3440controls, :c:func:`SNDRV_CTL_NAME_IEC958()` defined in
3441``<include/asound.h>``.
3442
3443There are some standard controls for IEC958 status bits. These controls
3444use the type ``SNDRV_CTL_ELEM_TYPE_IEC958``, and the size of element is
3445fixed as 4 bytes array (value.iec958.status[x]). For the ``info``
3446callback, you don't specify the value field for this type (the count
3447field must be set, though).
3448
3449“IEC958 Playback Con Mask” is used to return the bit-mask for the IEC958
3450status bits of consumer mode. Similarly, “IEC958 Playback Pro Mask”
3451returns the bitmask for professional mode. They are read-only controls,
3452and are defined as MIXER controls (iface =
3453``SNDRV_CTL_ELEM_IFACE_MIXER``).
3454
3455Meanwhile, “IEC958 Playback Default” control is defined for getting and
3456setting the current default IEC958 bits. Note that this one is usually
3457defined as a PCM control (iface = ``SNDRV_CTL_ELEM_IFACE_PCM``),
3458although in some places it's defined as a MIXER control.
3459
3460In addition, you can define the control switches to enable/disable or to
3461set the raw bit mode. The implementation will depend on the chip, but
3462the control should be named as “IEC958 xxx”, preferably using the
3463:c:func:`SNDRV_CTL_NAME_IEC958()` macro.
3464
3465You can find several cases, for example, ``pci/emu10k1``,
3466``pci/ice1712``, or ``pci/cmipci.c``.
3467
3468Buffer and Memory Management
3469============================
3470
3471Buffer Types
3472------------
3473
3474ALSA provides several different buffer allocation functions depending on
3475the bus and the architecture. All these have a consistent API. The
3476allocation of physically-contiguous pages is done via
3477:c:func:`snd_malloc_xxx_pages()` function, where xxx is the bus
3478type.
3479
3480The allocation of pages with fallback is
3481:c:func:`snd_malloc_xxx_pages_fallback()`. This function tries
3482to allocate the specified pages but if the pages are not available, it
3483tries to reduce the page sizes until enough space is found.
3484
3485The release the pages, call :c:func:`snd_free_xxx_pages()`
3486function.
3487
3488Usually, ALSA drivers try to allocate and reserve a large contiguous
3489physical space at the time the module is loaded for the later use. This
3490is called “pre-allocation”. As already written, you can call the
3491following function at pcm instance construction time (in the case of PCI
3492bus).
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
3499where ``size`` is the byte size to be pre-allocated and the ``max`` is
3500the maximum size to be changed via the ``prealloc`` proc file. The
3501allocator will try to get an area as large as possible within the
3502given size.
3503
3504The second argument (type) and the third argument (device pointer) are
3505dependent 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
3508bus 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
3511scatter-gather buffers, use ``SNDRV_DMA_TYPE_DEV_SG`` with
3512``snd_dma_pci_data(pci)`` (see the `Non-Contiguous Buffers`_
3513section).
3514
3515Once 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
3522Note that you have to pre-allocate to use this function.
3523
3524External Hardware Buffers
3525-------------------------
3526
3527Some chips have their own hardware buffers and the DMA transfer from the
3528host memory is not available. In such a case, you need to either 1)
3529copy/set the audio data directly to the external hardware buffer, or 2)
3530make an intermediate buffer and copy/set the data from it to the
3531external hardware buffer in interrupts (or in tasklets, preferably).
3532
3533The first case works fine if the external hardware buffer is large
3534enough. This method doesn't need any extra buffers and thus is more
3535effective. You need to define the ``copy`` and ``silence`` callbacks
3536for the data transfer. However, there is a drawback: it cannot be
3537mmapped. The examples are GUS's GF1 PCM or emu8000's wavetable PCM.
3538
3539The second case allows for mmap on the buffer, although you have to
3540handle an interrupt or a tasklet to transfer the data from the
3541intermediate buffer to the hardware buffer. You can find an example in
3542the vxpocket driver.
3543
3544Another case is when the chip uses a PCI memory-map region for the
3545buffer instead of the host memory. In this case, mmap is available only
3546on certain architectures like the Intel one. In non-mmap mode, the data
3547cannot 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
3549examples are found in ``rme32.c`` and ``rme96.c``.
3550
3551The implementation of the ``copy`` and ``silence`` callbacks depends
3552upon whether the hardware supports interleaved or non-interleaved
3553samples. The ``copy`` callback is defined like below, a bit
3554differently 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
3563In the case of interleaved samples, the second argument (``channel``) is
3564not used. The third argument (``pos``) points the current position
3565offset in frames.
3566
3567The meaning of the fourth argument is different between playback and
3568capture. For playback, it holds the source data pointer, and for
3569capture, it's the destination data pointer.
3570
3571The last argument is the number of frames to be copied.
3572
3573What you have to do in this callback is again different between playback
3574and capture directions. In the playback case, you copy the given amount
3575of data (``count``) at the specified pointer (``src``) to the specified
3576offset (``pos``) on the hardware buffer. When coded like memcpy-like
3577way, 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
3584For the capture direction, you copy the given amount of data (``count``)
3585at the specified offset (``pos``) on the hardware buffer to the
3586specified pointer (``dst``).
3587
3588::
3589
3590 my_memcpy(dst, my_buffer + frames_to_bytes(runtime, pos),
3591 frames_to_bytes(runtime, count));
3592
3593Note that both the position and the amount of data are given in frames.
3594
3595In the case of non-interleaved samples, the implementation will be a bit
3596more complicated.
3597
3598You need to check the channel argument, and if it's -1, copy the whole
3599channels. Otherwise, you have to copy only the specified channel. Please
3600check ``isa/gus/gus_pcm.c`` as an example.
3601
3602The ``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
3609The meanings of arguments are the same as in the ``copy`` callback,
3610although there is no ``src/dst`` argument. In the case of interleaved
3611samples, the channel argument has no meaning, as well as on ``copy``
3612callback.
3613
3614The role of ``silence`` callback is to set the given amount
3615(``count``) of silence data at the specified offset (``pos``) on the
3616hardware buffer. Suppose that the data format is signed (that is, the
3617silent-data is 0), and the implementation using a memset-like function
3618would be like:
3619
3620::
3621
3622 my_memcpy(my_buffer + frames_to_bytes(runtime, pos), 0,
3623 frames_to_bytes(runtime, count));
3624
3625In the case of non-interleaved samples, again, the implementation
3626becomes a bit more complicated. See, for example, ``isa/gus/gus_pcm.c``.
3627
3628Non-Contiguous Buffers
3629----------------------
3630
3631If your hardware supports the page table as in emu10k1 or the buffer
3632descriptors as in via82xx, you can use the scatter-gather (SG) DMA. ALSA
3633provides an interface for handling SG-buffers. The API is provided in
3634``<sound/pcm.h>``.
3635
3636For 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
3640pre-allocator. You need to pass ``snd_dma_pci_data(pci)``, where pci is
3641the :c:type:`struct pci_dev <pci_dev>` pointer of the chip as
3642well. 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
3649Then call :c:func:`snd_pcm_lib_malloc_pages()` in the ``hw_params``
3650callback as well as in the case of normal PCI buffer. The SG-buffer
3651handler will allocate the non-contiguous kernel pages of the given size
3652and map them onto the virtually contiguous memory. The virtual pointer
3653is addressed in runtime->dma_area. The physical address
3654(``runtime->dma_addr``) is set to zero, because the buffer is
3655physically non-contiguous. The physical address table is set up in
3656``sgbuf->table``. You can get the physical address at a certain offset
3657via :c:func:`snd_pcm_sgbuf_get_addr()`.
3658
3659When 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
3663To release the data, call :c:func:`snd_pcm_lib_free_pages()` in
3664the ``hw_free`` callback as usual.
3665
3666Vmalloc'ed Buffers
3667------------------
3668
3669It's possible to use a buffer allocated via :c:func:`vmalloc()`, for
3670example, for an intermediate buffer. Since the allocated pages are not
3671contiguous, you need to set the ``page`` callback to obtain the physical
3672address at every offset.
3673
3674The 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
3688Proc Interface
3689==============
3690
3691ALSA provides an easy interface for procfs. The proc files are very
3692useful for debugging. I recommend you set up proc files if you write a
3693driver and want to get a running status or register dumps. The API is
3694found in ``<sound/info.h>``.
3695
3696To 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
3703where the second argument specifies the name of the proc file to be
3704created. The above example will create a file ``my-file`` under the
3705card directory, e.g. ``/proc/asound/card0/my-file``.
3706
3707Like other components, the proc entry created via
3708:c:func:`snd_card_proc_new()` will be registered and released
3709automatically in the card registration and release functions.
3710
3711When the creation is successful, the function stores a new instance in
3712the pointer given in the third argument. It is initialized as a text
3713proc file for read only. To use this proc file as a read-only text file
3714as 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
3721where the second argument (``chip``) is the private data to be used in
3722the callbacks. The third parameter specifies the read buffer size and
3723the fourth (``my_proc_read``) is the callback function, which is
3724defined like
3725
3726::
3727
3728 static void my_proc_read(struct snd_info_entry *entry,
3729 struct snd_info_buffer *buffer);
3730
3731In the read callback, use :c:func:`snd_iprintf()` for output
3732strings, which works just like normal :c:func:`printf()`. For
3733example,
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
3746The file permissions can be changed afterwards. As default, it's set as
3747read only for all users. If you want to add write permission for the
3748user (root as default), do as follows:
3749
3750::
3751
3752 entry->mode = S_IFREG | S_IRUGO | S_IWUSR;
3753
3754and set the write buffer size and the callback
3755
3756::
3757
3758 entry->c.text.write = my_proc_write;
3759
3760For the write callback, you can use :c:func:`snd_info_get_line()`
3761to get a text line, and :c:func:`snd_info_get_str()` to retrieve
3762a string from the line. Some examples are found in
3763``core/oss/mixer_oss.c``, core/oss/and ``pcm_oss.c``.
3764
3765For 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
3779For the raw data, ``size`` field must be set properly. This specifies
3780the maximum size of the proc file access.
3781
3782The read/write callbacks of raw mode are more direct than the text mode.
3783You 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
3800If 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
3802have to check the range in the callbacks unless any other condition is
3803required.
3804
3805Power Management
3806================
3807
3808If the chip is supposed to work with suspend/resume functions, you need
3809to add power-management code to the driver. The additional code for
3810power-management should be ifdef-ed with ``CONFIG_PM``.
3811
3812If the driver *fully* supports suspend/resume that is, the device can be
3813properly 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
3815possible when the registers of the chip can be safely saved and restored
3816to RAM. If this is set, the trigger callback is called with
3817``SNDRV_PCM_TRIGGER_RESUME`` after the resume callback completes.
3818
3819Even if the driver doesn't support PM fully but partial suspend/resume
3820is still possible, it's still worthy to implement suspend/resume
3821callbacks. In such a case, applications would reset the status by
3822calling :c:func:`snd_pcm_prepare()` and restart the stream
3823appropriately. Hence, you can define suspend/resume callbacks below but
3824don't set ``SNDRV_PCM_INFO_RESUME`` info flag to the PCM.
3825
3826Note 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
3829behavior of :c:func:`snd_pcm_resume()`. (Thus, in theory,
3830``SNDRV_PCM_TRIGGER_RESUME`` isn't needed to be handled in the trigger
3831callback when no ``SNDRV_PCM_INFO_RESUME`` flag is set. But, it's better
3832to keep it for compatibility reasons.)
3833
3834In the earlier version of ALSA drivers, a common power-management layer
3835was provided, but it has been removed. The driver needs to define the
3836suspend/resume hooks according to the bus the device is connected to. In
3837the 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
3854The scheme of the real suspend job is as follows.
3855
38561. Retrieve the card and the chip data.
3857
38582. Call :c:func:`snd_power_change_state()` with
3859 ``SNDRV_CTL_POWER_D3hot`` to change the power status.
3860
38613. Call :c:func:`snd_pcm_suspend_all()` to suspend the running
3862 PCM streams.
3863
38644. If AC97 codecs are used, call :c:func:`snd_ac97_suspend()` for
3865 each codec.
3866
38675. Save the register values if necessary.
3868
38696. Stop the hardware if necessary.
3870
38717. Disable the PCI device by calling
3872 :c:func:`pci_disable_device()`. Then, call
3873 :c:func:`pci_save_state()` at last.
3874
3875A 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
3901The scheme of the real resume job is as follows.
3902
39031. Retrieve the card and the chip data.
3904
39052. 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
39103. Re-initialize the chip.
3911
39124. Restore the saved registers if necessary.
3913
39145. Resume the mixer, e.g. calling :c:func:`snd_ac97_resume()`.
3915
39166. Restart the hardware (if any).
3917
39187. Call :c:func:`snd_power_change_state()` with
3919 ``SNDRV_CTL_POWER_D0`` to notify the processes.
3920
3921A 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
3947As shown in the above, it's better to save registers after suspending
3948the PCM operations via :c:func:`snd_pcm_suspend_all()` or
3949:c:func:`snd_pcm_suspend()`. It means that the PCM streams are
3950already stopped when the register snapshot is taken. But, remember that
3951you don't have to restart the PCM stream in the resume callback. It'll
3952be restarted via trigger call with ``SNDRV_PCM_TRIGGER_RESUME`` when
3953necessary.
3954
3955OK, we have all callbacks now. Let's set them up. In the initialization
3956of the card, make sure that you can get the chip data from the card
3957instance, typically via ``private_data`` field, in case you created the
3958chip 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
3979When you created the chip data with :c:func:`snd_card_new()`, it's
3980anyway 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
3999If you need a space to save the registers, allocate the buffer for it
4000here, too, since it would be fatal if you cannot allocate a memory in
4001the suspend phase. The allocated buffer should be released in the
4002corresponding destructor.
4003
4004And 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
4019Module Parameters
4020=================
4021
4022There are standard module options for ALSA. At least, each module should
4023have the ``index``, ``id`` and ``enable`` options.
4024
4025If the module supports multiple cards (usually up to 8 = ``SNDRV_CARDS``
4026cards), they should be arrays. The default initial values are defined
4027already 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
4035If the module supports only a single card, they could be single
4036variables, instead. ``enable`` option is not always necessary in this
4037case, but it would be better to have a dummy option for compatibility.
4038
4039The module parameters must be declared with the standard
4040``module_param()()``, ``module_param_array()()`` and
4041:c:func:`MODULE_PARM_DESC()` macros.
4042
4043The 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
4056Also, don't forget to define the module description, classes, license
4057and devices. Especially, the recent modprobe requires to define the
4058module 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
4067How To Put Your Driver Into ALSA Tree
4068=====================================
4069
4070General
4071-------
4072
4073So far, you've learned how to write the driver codes. And you might have
4074a question now: how to put my own driver into the ALSA driver tree? Here
4075(finally :) the standard procedure is described briefly.
4076
4077Suppose that you create a new PCI driver for the card “xyz”. The card
4078module name would be snd-xyz. The new driver is usually put into the
4079alsa-driver tree, ``alsa-driver/pci`` directory in the case of PCI
4080cards. Then the driver is evaluated, audited and tested by developers
4081and users. After a certain time, the driver will go to the alsa-kernel
4082tree (to the corresponding directory, such as ``alsa-kernel/pci``) and
4083eventually will be integrated into the Linux 2.6 tree (the directory
4084would be ``linux/sound/pci``).
4085
4086In the following sections, the driver code is supposed to be put into
4087alsa-driver tree. The two cases are covered: a driver consisting of a
4088single source file and one consisting of several source files.
4089
4090Driver with A Single Source File
4091--------------------------------
4092
40931. 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
41022. 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
41223. Run cvscompile script to re-generate the configure script and build
4123 the whole stuff again.
4124
4125Drivers with Several Source Files
4126---------------------------------
4127
4128Suppose that the driver snd-xyz have several source files. They are
4129located in the new subdirectory, pci/xyz.
4130
41311. Add a new directory (``xyz``) in ``alsa-driver/pci/Makefile`` as
4132 below
4133
4134::
4135
4136 obj-$(CONFIG_SND) += xyz/
4137
4138
41392. 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
41563. Create the Kconfig entry
4157
4158 This procedure is as same as in the last section.
4159
41604. Run cvscompile script to re-generate the configure script and build
4161 the whole stuff again.
4162
4163Useful Functions
4164================
4165
4166:c:func:`snd_printk()` and friends
4167---------------------------------------
4168
4169ALSA provides a verbose version of the :c:func:`printk()` function.
4170If a kernel config ``CONFIG_SND_VERBOSE_PRINTK`` is set, this function
4171prints the given message together with the file name and the line of the
4172caller. The ``KERN_XXX`` prefix is processed as well as the original
4173:c:func:`printk()` does, so it's recommended to add this prefix,
4174e.g. snd_printk(KERN_ERR "Oh my, sorry, it's extremely bad!\\n");
4175
4176There are also :c:func:`printk()`'s for debugging.
4177:c:func:`snd_printd()` can be used for general debugging purposes.
4178If ``CONFIG_SND_DEBUG`` is set, this function is compiled, and works
4179just like :c:func:`snd_printk()`. If the ALSA is compiled without
4180the 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
4185the alsa-driver with ``--with-debug=full`` option. You need to give
4186explicitly ``--with-debug=detect`` option instead.
4187
4188:c:func:`snd_BUG()`
4189------------------------
4190
4191It 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
4193fatal error happens there.
4194
4195When 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
4202it can be used as the condition, if (snd_BUG_ON(non_zero_is_bug))
4203return -EINVAL;
4204
4205The macro takes an conditional expression to evaluate. When
4206``CONFIG_SND_DEBUG``, is set, if the expression is non-zero, it shows
4207the warning message such as ``BUG? (xxx)`` normally followed by stack
4208trace. In both cases it returns the evaluated value.
4209
4210Acknowledgments
4211===============
4212
4213I would like to thank Phil Kerr for his help for improvement and
4214corrections of this document.
4215
4216Kevin Conder reformatted the original plain-text to the DocBook format.
4217
4218Giuliano Pochini corrected typos and contributed the example codes in
4219the 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==============
1Audio Clocking 2Audio Clocking
2============== 3==============
3 4
@@ -30,15 +31,9 @@ runs at exactly the sample rate (LRC = Rate).
30 31
31Bit Clock can be generated as follows:- 32Bit Clock can be generated as follows:-
32 33
33BCLK = MCLK / x 34- BCLK = MCLK / x, or
34 35- BCLK = LRC * x, or
35 or 36- BCLK = LRC * Channels * Word Size
36
37BCLK = LRC * x
38
39 or
40
41BCLK = LRC * Channels * Word Size
42 37
43This relationship depends on the codec or SoC CPU in particular. In general 38This relationship depends on the codec or SoC CPU in particular. In general
44it is best to configure BCLK to the lowest possible speed (depending on your 39it 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==============================================
2Creating codec to codec dai link for ALSA dapm
3==============================================
4
5Mostly the flow of audio is always from CPU to codec so your system
6will look as below:
7::
8
9 --------- ---------
10 | | dai | |
11 CPU -------> codec
12 | | | |
13 --------- ---------
14
15In 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
40Suppose codec-2 is a bluetooth chip and codec-3 is connected to
41a speaker and you have a below scenario:
42codec-2 will receive the audio data and the user wants to play that
43audio through codec-3 without involving the CPU.This
44aforementioned case is the ideal case when codec to codec
45connection should be used.
46
47Your dai_link should appear as below in your machine
48file:
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
87Above code snippet is motivated from sound/soc/samsung/speyside.c.
88
89Note the "params" callback which lets the dapm know that this
90dai_link is a codec to codec connection.
91
92In dapm core a route is created between cpu_dai playback widget
93and codec_dai capture widget for playback path and vice-versa is
94true for capture path. In order for this aforementioned route to get
95triggered, DAPM needs to find a valid endpoint which could be either
96a sink or source widget corresponding to playback and capture path
97respectively.
98
99In order to trigger this dai_link widget, a thin codec driver for
100the speaker amp can be created as demonstrated in wm8727.c file, it
101sets appropriate constraints for the device even if it needs no control.
102
103Make sure to name your corresponding cpu and codec playback and capture
104dai names ending with "Playback" and "Capture" respectively as dapm core
105will link and power those dais based on the name.
106
107Note that in current device tree there is no way to mark a dai_link
108as 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=======================
1ASoC Codec Class Driver 2ASoC Codec Class Driver
2======================= 3=======================
3 4
@@ -9,16 +10,16 @@ machine drivers respectively.
9 10
10Each codec class driver *must* provide the following features:- 11Each codec class driver *must* provide the following features:-
11 12
12 1) Codec DAI and PCM configuration 131. Codec DAI and PCM configuration
13 2) Codec control IO - using RegMap API 142. Codec control IO - using RegMap API
14 3) Mixers and audio controls 153. Mixers and audio controls
15 4) Codec audio operations 164. Codec audio operations
16 5) DAPM description. 175. DAPM description.
17 6) DAPM event handler. 186. DAPM event handler.
18 19
19Optionally, codec drivers can also provide:- 20Optionally, codec drivers can also provide:-
20 21
21 7) DAC Digital mute control. 227. DAC Digital mute control.
22 23
23Its probably best to use this guide in conjunction with the existing codec 24Its probably best to use this guide in conjunction with the existing codec
24driver code in sound/soc/codecs/ 25driver code in sound/soc/codecs/
@@ -26,24 +27,25 @@ driver code in sound/soc/codecs/
26ASoC Codec driver breakdown 27ASoC Codec driver breakdown
27=========================== 28===========================
28 29
291 - Codec DAI and PCM configuration 30Codec DAI and PCM configuration
30----------------------------------- 31-------------------------------
31Each codec driver must have a struct snd_soc_dai_driver to define its DAI and 32Each codec driver must have a struct snd_soc_dai_driver to define its DAI and
32PCM capabilities and operations. This struct is exported so that it can be 33PCM capabilities and operations. This struct is exported so that it can be
33registered with the core by your machine driver. 34registered with the core by your machine driver.
34 35
35e.g. 36e.g.
37::
36 38
37static 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
46struct 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
652 - Codec control IO 67Codec control IO
66-------------------- 68----------------
67The codec can usually be controlled via an I2C or SPI style interface 69The 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
69Regmap API for all codec IO. Please see include/linux/regmap.h and existing 71Regmap API for all codec IO. Please see include/linux/regmap.h and existing
70codec drivers for example regmap usage. 72codec drivers for example regmap usage.
71 73
72 74
733 - Mixers and audio controls 75Mixers and audio controls
74----------------------------- 76-------------------------
75All the codec mixers and audio controls can be defined using the convenience 77All the codec mixers and audio controls can be defined using the convenience
76macros defined in soc.h. 78macros 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
80Defines a single control as follows:- 83Defines 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
88Other macros include:- 92Other 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
92A stereo control 97A 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
96A stereo control spanning 2 registers 102A 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
100Defines an single enumerated control as follows:- 107Defines 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:-
109Defines a stereo enumerated control 117Defines a stereo enumerated control
110 118
111 119
1124 - Codec Audio Operations 120Codec Audio Operations
113-------------------------- 121----------------------
114The codec driver also supports the following ALSA PCM operations:- 122The codec driver also supports the following ALSA PCM operations:-
123::
115 124
116/* SoC audio ops */ 125 /* SoC audio ops */
117struct 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
125Please refer to the ALSA driver PCM documentation for details. 134Please refer to the ALSA driver PCM documentation for details.
126http://www.alsa-project.org/~iwai/writing-an-alsa-driver/ 135http://www.alsa-project.org/~iwai/writing-an-alsa-driver/
127 136
128 137
1295 - DAPM description. 138DAPM description
130--------------------- 139----------------
131The Dynamic Audio Power Management description describes the codec power 140The Dynamic Audio Power Management description describes the codec power
132components and their relationships and registers to the ASoC core. 141components and their relationships and registers to the ASoC core.
133Please read dapm.txt for details of building the description. 142Please read dapm.txt for details of building the description.
@@ -135,13 +144,14 @@ Please read dapm.txt for details of building the description.
135Please also see the examples in other codec drivers. 144Please also see the examples in other codec drivers.
136 145
137 146
1386 - DAPM event handler 147DAPM event handler
139---------------------- 148------------------
140This function is a callback that handles codec domain PM calls and system 149This function is a callback that handles codec domain PM calls and system
141domain PM calls (e.g. suspend and resume). It is used to put the codec 150domain PM calls (e.g. suspend and resume). It is used to put the codec
142to sleep when not in use. 151to sleep when not in use.
143 152
144Power states:- 153Power 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
1587 - Codec DAC digital mute control 168Codec DAC digital mute control
159---------------------------------- 169------------------------------
160Most codecs have a digital mute before the DACs that can be used to 170Most codecs have a digital mute before the DACs that can be used to
161minimise any system noise. The mute stops any digital data from 171minimise any system noise. The mute stops any digital data from
162entering the DAC. 172entering the DAC.
@@ -165,9 +175,10 @@ A callback can be created that is called by the core for each codec DAI
165when the mute is applied or freed. 175when the mute is applied or freed.
166 176
167i.e. 177i.e.
178::
168 179
169static 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==================================
2ASoC Digital Audio Interface (DAI)
3==================================
4
1ASoC currently supports the three main Digital Audio Interfaces (DAI) found on 5ASoC currently supports the three main Digital Audio Interfaces (DAI) found on
2SoC controllers and portable audio CODECs today, namely AC97, I2S and PCM. 6SoC 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.
5AC97 9AC97
6==== 10====
7 11
8 AC97 is a five wire interface commonly found on many PC sound cards. It is 12AC97 is a five wire interface commonly found on many PC sound cards. It is
9now also popular in many portable devices. This DAI has a reset line and time 13now also popular in many portable devices. This DAI has a reset line and time
10multiplexes its data on its SDATA_OUT (playback) and SDATA_IN (capture) lines. 14multiplexes its data on its SDATA_OUT (playback) and SDATA_IN (capture) lines.
11The bit clock (BCLK) is always driven by the CODEC (usually 12.288MHz) and the 15The bit clock (BCLK) is always driven by the CODEC (usually 12.288MHz) and the
12frame (FRAME) (usually 48kHz) is always driven by the controller. Each AC97 16frame (FRAME) (usually 48kHz) is always driven by the controller. Each AC97
13frame is 21uS long and is divided into 13 time slots. 17frame is 21uS long and is divided into 13 time slots.
14 18
15The AC97 specification can be found at :- 19The AC97 specification can be found at :
16http://www.intel.com/p/en_US/business/design 20http://www.intel.com/p/en_US/business/design
17 21
18 22
19I2S 23I2S
20=== 24===
21 25
22 I2S is a common 4 wire DAI used in HiFi, STB and portable devices. The Tx and 26I2S is a common 4 wire DAI used in HiFi, STB and portable devices. The Tx and
23Rx lines are used for audio transmission, whilst the bit clock (BCLK) and 27Rx lines are used for audio transmission, whilst the bit clock (BCLK) and
24left/right clock (LRC) synchronise the link. I2S is flexible in that either the 28left/right clock (LRC) synchronise the link. I2S is flexible in that either the
25controller or CODEC can drive (master) the BCLK and LRC clock lines. Bit clock 29controller or CODEC can drive (master) the BCLK and LRC clock lines. Bit clock
@@ -30,13 +34,15 @@ different sample rates.
30 34
31I2S has several different operating modes:- 35I2S has several different operating modes:-
32 36
33 o I2S - MSB is transmitted on the falling edge of the first BCLK after LRC 37I2S
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. 41Left Justified
42 MSB is transmitted on transition of LRC.
37 43
38 o Right Justified - MSB is transmitted sample size BCLKs before LRC 44Right Justified
39 transition. 45 MSB is transmitted sample size BCLKs before LRC transition.
40 46
41PCM 47PCM
42=== 48===
@@ -51,6 +57,8 @@ is sometimes referred to as network mode).
51 57
52Common PCM operating modes:- 58Common PCM operating modes:-
53 59
54 o Mode A - MSB is transmitted on falling edge of first BCLK after FRAME/SYNC. 60Mode 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. 63Mode 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===================================================
1Dynamic Audio Power Management for Portable Devices 2Dynamic Audio Power Management for Portable Devices
2=================================================== 3===================================================
3 4
41. Description 5Description
5============== 6===========
6 7
7Dynamic Audio Power Management (DAPM) is designed to allow portable 8Dynamic Audio Power Management (DAPM) is designed to allow portable
8Linux devices to use the minimum amount of power within the audio 9Linux devices to use the minimum amount of power within the audio
@@ -21,20 +22,28 @@ level power systems.
21 22
22There are 4 power domains within DAPM 23There are 4 power domains within DAPM
23 24
24 1. Codec bias domain - VREF, VMID (core codec and audio power) 25Codec 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 31Platform/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 38Path 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. 44Stream 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
45widgets hereafter. 54widgets hereafter.
46 55
47 56
482. DAPM Widgets 57DAPM Widgets
49=============== 58============
50 59
51Audio DAPM widgets fall into a number of types:- 60Audio DAPM widgets fall into a number of types:-
52 61
53 o Mixer - Mixes several analog signals into a single analog signal. 62Mixer
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. 64Mux
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 66PGA
58 o Switch - An analog switch 67 A programmable gain amplifier or attenuation widget.
59 o Input - A codec input pin 68ADC
60 o Output - A codec output pin 69 Analog to Digital Converter
61 o Headphone - Headphone (and optional Jack) 70DAC
62 o Mic - Mic (and optional Jack) 71 Digital to Analog Converter
63 o Line - Line Input/Output (and optional Jack) 72Switch
64 o Speaker - Speaker 73 An analog switch
65 o Supply - Power or clock supply widget used by other widgets. 74Input
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. 76Output
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). 78Headphone
70 o Siggen - Signal Generator. 79 Headphone (and optional Jack)
71 o DAI IN - Digital Audio Interface Input. 80Mic
72 o DAI OUT - Digital Audio Interface Output. 81 Mic (and optional Jack)
73 o DAI Link - DAI Link between two DAI structures */ 82Line
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) 84Speaker
85 Speaker
86Supply
87 Power or clock supply widget used by other widgets.
88Regulator
89 External regulator that supplies power to audio components.
90Clock
91 External clock that supplies clock to audio components.
92AIF IN
93 Audio Interface Input (with TDM slot mask).
94AIF OUT
95 Audio Interface Output (with TDM slot mask).
96Siggen
97 Signal Generator.
98DAI IN
99 Digital Audio Interface Input.
100DAI OUT
101 Digital Audio Interface Output.
102DAI Link
103 DAI Link between two DAI structures
104Pre
105 Special PRE widget (exec before all others)
106Post
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
84parameters for stream name and kcontrols. 116parameters for stream name and kcontrols.
85 117
86 118
872.1 Stream Domain Widgets 119Stream Domain Widgets
88------------------------- 120---------------------
89 121
90Stream Widgets relate to the stream power domain and only consist of ADCs 122Stream 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),
92AIF IN and AIF OUT. 124AIF IN and AIF OUT.
93 125
94Stream widgets have the following format:- 126Stream widgets have the following format:-
127::
95 128
96SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert), 129 SND_SOC_DAPM_DAC(name, stream name, reg, shift, invert),
97SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert) 130 SND_SOC_DAPM_AIF_IN(name, stream, slot, reg, shift, invert)
98 131
99NOTE: the stream name must match the corresponding stream name in your codec 132NOTE: the stream name must match the corresponding stream name in your codec
100snd_soc_codec_dai. 133snd_soc_codec_dai.
101 134
102e.g. stream widgets for HiFi playback and capture 135e.g. stream widgets for HiFi playback and capture
136::
103 137
104SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1), 138 SND_SOC_DAPM_DAC("HiFi DAC", "HiFi Playback", REG, 3, 1),
105SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1), 139 SND_SOC_DAPM_ADC("HiFi ADC", "HiFi Capture", REG, 2, 1),
106 140
107e.g. stream widgets for AIF 141e.g. stream widgets for AIF
142::
108 143
109SND_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),
110SND_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
1132.2 Path Domain Widgets 148Path Domain Widgets
114----------------------- 149-------------------
115 150
116Path domain widgets have a ability to control or affect the audio signal or 151Path domain widgets have a ability to control or affect the audio signal or
117audio paths within the audio subsystem. They have the following form:- 152audio paths within the audio subsystem. They have the following form:-
153::
118 154
119SND_SOC_DAPM_PGA(name, reg, shift, invert, controls, num_controls) 155 SND_SOC_DAPM_PGA(name, reg, shift, invert, controls, num_controls)
120 156
121Any widget kcontrols can be set using the controls and num_controls members. 157Any widget kcontrols can be set using the controls and num_controls members.
122 158
123e.g. Mixer widget (the kcontrols are declared first) 159e.g. Mixer widget (the kcontrols are declared first)
160::
124 161
125/* Output Mixer */ 162 /* Output Mixer */
126static const snd_kcontrol_new_t wm8731_output_mixer_controls[] = { 163 static const snd_kcontrol_new_t wm8731_output_mixer_controls[] = {
127SOC_DAPM_SINGLE("Line Bypass Switch", WM8731_APANA, 3, 1, 0), 164 SOC_DAPM_SINGLE("Line Bypass Switch", WM8731_APANA, 3, 1, 0),
128SOC_DAPM_SINGLE("Mic Sidetone Switch", WM8731_APANA, 5, 1, 0), 165 SOC_DAPM_SINGLE("Mic Sidetone Switch", WM8731_APANA, 5, 1, 0),
129SOC_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
132SND_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
135If you don't want the mixer elements prefixed with the name of the mixer widget, 172If 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
137as for SND_SOC_DAPM_MIXER. 174as for SND_SOC_DAPM_MIXER.
138 175
139 176
1402.3 Machine domain Widgets 177Machine domain Widgets
141-------------------------- 178----------------------
142 179
143Machine widgets are different from codec widgets in that they don't have a 180Machine widgets are different from codec widgets in that they don't have a
144codec register bit associated with them. A machine widget is assigned to each 181codec register bit associated with them. A machine widget is assigned to each
145machine audio component (non codec or DSP) that can be independently 182machine audio component (non codec or DSP) that can be independently
146powered. e.g. 183powered. 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
152A machine widget can have an optional call back. 189A machine widget can have an optional call back.
153 190
154e.g. Jack connector widget for an external Mic that enables Mic Bias 191e.g. Jack connector widget for an external Mic that enables Mic Bias
155when the Mic is inserted:- 192when the Mic is inserted:-::
156 193
157static 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
163SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias), 200 SND_SOC_DAPM_MIC("Mic Jack", spitz_mic_bias),
164 201
165 202
1662.4 Codec (BIAS) Domain 203Codec (BIAS) Domain
167----------------------- 204-------------------
168 205
169The codec bias power domain has no widgets and is handled by the codecs DAPM 206The codec bias power domain has no widgets and is handled by the codecs DAPM
170event handler. This handler is called when the codec powerstate is changed wrt 207event handler. This handler is called when the codec powerstate is changed wrt
171to any stream event or by kernel PM events. 208to any stream event or by kernel PM events.
172 209
173 210
1742.5 Virtual Widgets 211Virtual Widgets
175------------------- 212---------------
176 213
177Sometimes widgets exist in the codec or machine audio map that don't have any 214Sometimes widgets exist in the codec or machine audio map that don't have any
178corresponding soft power control. In this case it is necessary to create 215corresponding soft power control. In this case it is necessary to create
179a virtual widget - a widget with no control bits e.g. 216a virtual widget - a widget with no control bits e.g.
217::
180 218
181SND_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
183This can be used to merge to signal paths together in software. 221This 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
186subsystem individually with a call to snd_soc_dapm_new_control(). 224subsystem individually with a call to snd_soc_dapm_new_control().
187 225
188 226
1893. Codec/DSP Widget Interconnections 227Codec/DSP Widget Interconnections
190==================================== 228=================================
191 229
192Widgets are connected to each other within the codec, platform and machine by 230Widgets are connected to each other within the codec, platform and machine by
193audio paths (called interconnections). Each interconnection must be defined in 231audio paths (called interconnections). Each interconnection must be defined in
@@ -201,13 +239,14 @@ e.g., from the WM8731 output mixer (wm8731.c)
201 239
202The WM8731 output mixer has 3 inputs (sources) 240The WM8731 output mixer has 3 inputs (sources)
203 241
204 1. Line Bypass Input 2421. Line Bypass Input
205 2. DAC (HiFi playback) 2432. DAC (HiFi playback)
206 3. Mic Sidetone Input 2443. Mic Sidetone Input
207 245
208Each input in this example has a kcontrol associated with it (defined in example 246Each input in this example has a kcontrol associated with it (defined in example
209above) and is connected to the output mixer via its kcontrol name. We can now 247above) and is connected to the output mixer via its kcontrol name. We can now
210connect the destination widget (wrt audio signal) with its source widgets. 248connect 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
217So we have :- 256So 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
221Or:- 260* ``Output Mixer`` is connected to the ``DAC`` via the ``HiFi Playback Switch``.
222
223 Sink, Path, Source
224
225Or :-
226
227 "Output Mixer" is connected to the "DAC" via the "HiFi Playback Switch".
228 261
229When there is no path name connecting widgets (e.g. a direct connection) we 262When there is no path name connecting widgets (e.g. a direct connection) we
230pass NULL for the path name. 263pass NULL for the path name.
231 264
232Interconnections are created with a call to:- 265Interconnections are created with a call to:-
266::
233 267
234snd_soc_dapm_connect_input(codec, sink, path, source); 268 snd_soc_dapm_connect_input(codec, sink, path, source);
235 269
236Finally, snd_soc_dapm_new_widgets(codec) must be called after all widgets and 270Finally, snd_soc_dapm_new_widgets(codec) must be called after all widgets and
237interconnections have been registered with the core. This causes the core to 271interconnections 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
239physical state of the machine. 273physical state of the machine.
240 274
241 275
2423.1 Machine Widget Interconnections 276Machine Widget Interconnections
243----------------------------------- 277-------------------------------
244Machine widget interconnections are created in the same way as codec ones and 278Machine widget interconnections are created in the same way as codec ones and
245directly connect the codec pins to machine level widgets. 279directly connect the codec pins to machine level widgets.
246 280
247e.g. connects the speaker out codec pins to the internal speaker. 281e.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)
254and pins that are NC respectively. 289and pins that are NC respectively.
255 290
256 291
2574 Endpoint Widgets 292Endpoint Widgets
258=================== 293================
259An endpoint is a start or end point (widget) of an audio signal within the 294An endpoint is a start or end point (widget) of an audio signal within the
260machine and includes the codec. e.g. 295machine 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
268Endpoints are added to the DAPM graph so that their usage can be determined in 303Endpoints are added to the DAPM graph so that their usage can be determined in
269order to save power. e.g. NC codecs pins will be switched OFF, unconnected 304order to save power. e.g. NC codecs pins will be switched OFF, unconnected
270jacks can also be switched OFF. 305jacks can also be switched OFF.
271 306
272 307
2735 DAPM Widget Events 308DAPM Widget Events
274==================== 309==================
275 310
276Some widgets can register their interest with the DAPM core in PM events. 311Some widgets can register their interest with the DAPM core in PM events.
277e.g. A Speaker with an amplifier registers a widget so the amplifier can be 312e.g. A Speaker with an amplifier registers a widget so the amplifier can be
278powered only when the spk is in use. 313powered 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 */
281static 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 */
288static 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
291Please see soc-dapm.h for all other widgets that support events. 327Please see soc-dapm.h for all other widgets that support events.
292 328
293 329
2945.1 Event types 330Event types
295--------------- 331-----------
296 332
297The following event types are supported by event widgets. 333The 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===========
1Dynamic PCM 2Dynamic PCM
2=========== 3===========
3 4
41. Description 5Description
5============== 6===========
6 7
7Dynamic PCM allows an ALSA PCM device to digitally route its PCM audio to 8Dynamic PCM allows an ALSA PCM device to digitally route its PCM audio to
8various digital endpoints during the PCM stream runtime. e.g. PCM0 can route 9various 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
24Consider the following phone audio subsystem. This will be used in this 25Consider the following phone audio subsystem. This will be used in this
25document for all examples :- 26document 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
30PCM0 <------------> * * <----DAI0-----> Codec Headset 31 *************
31 * * 32 PCM0 <------------> * * <----DAI0-----> Codec Headset
32PCM1 <------------> * * <----DAI1-----> Codec Speakers 33 * *
33 * DSP * 34 PCM1 <------------> * * <----DAI1-----> Codec Speakers
34PCM2 <------------> * * <----DAI2-----> MODEM 35 * DSP *
35 * * 36 PCM2 <------------> * * <----DAI2-----> MODEM
36PCM3 <------------> * * <----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
43This diagram shows a simple smart phone audio subsystem. It supports Bluetooth, 45This diagram shows a simple smart phone audio subsystem. It supports Bluetooth,
44FM digital radio, Speakers, Headset Jack, digital microphones and cellular 46FM 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
55and audio continues playing on the speakers. 57and audio continues playing on the speakers.
56 58
57Playback on PCM0 to Headset would look like :- 59Playback on PCM0 to Headset would look like :-
58 60::
59 ************* 61
60PCM0 <============> * * <====DAI0=====> Codec Headset 62 *************
61 * * 63 PCM0 <============> * * <====DAI0=====> Codec Headset
62PCM1 <------------> * * <----DAI1-----> Codec Speakers 64 * *
63 * DSP * 65 PCM1 <------------> * * <----DAI1-----> Codec Speakers
64PCM2 <------------> * * <----DAI2-----> MODEM 66 * DSP *
65 * * 67 PCM2 <------------> * * <----DAI2-----> MODEM
66PCM3 <------------> * * <----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
73The headset is removed from the jack by user so the speakers must now be used :- 76The headset is removed from the jack by user so the speakers must now be used :-
74 77::
75 ************* 78
76PCM0 <============> * * <----DAI0-----> Codec Headset 79 *************
77 * * 80 PCM0 <============> * * <----DAI0-----> Codec Headset
78PCM1 <------------> * * <====DAI1=====> Codec Speakers 81 * *
79 * DSP * 82 PCM1 <------------> * * <====DAI1=====> Codec Speakers
80PCM2 <------------> * * <----DAI2-----> MODEM 83 * DSP *
81 * * 84 PCM2 <------------> * * <----DAI2-----> MODEM
82PCM3 <------------> * * <----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
89The audio driver processes this as follows :- 93The audio driver processes this as follows :-
90 94
91 1) Machine driver receives Jack removal event. 951. Machine driver receives Jack removal event.
92 96
93 2) Machine driver OR audio HAL disables the Headset path. 972. 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 993. 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. 1024. Machine driver or audio HAL enables the speaker path.
99 103
100 5) DPCM runs the PCM ops for startup(), hw_params(), prepapre() and 1045. 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
103In this example, the machine driver or userspace audio HAL can alter the routing 107In this example, the machine driver or userspace audio HAL can alter the routing
104and then DPCM will take care of managing the DAI PCM operations to either bring 108and then DPCM will take care of managing the DAI PCM operations to either bring
@@ -112,36 +116,38 @@ DPCM machine driver
112The DPCM enabled ASoC machine driver is similar to normal machine drivers 116The DPCM enabled ASoC machine driver is similar to normal machine drivers
113except that we also have to :- 117except that we also have to :-
114 118
115 1) Define the FE and BE DAI links. 1191. Define the FE and BE DAI links.
116 120
117 2) Define any FE/BE PCM operations. 1212. Define any FE/BE PCM operations.
118 122
119 3) Define widget graph connections. 1233. Define widget graph connections.
120 124
121 125
1221 FE and BE DAI links 126FE 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 *************
128PCM0 <------------> * * <----DAI0-----> Codec Headset 133 PCM0 <------------> * * <----DAI0-----> Codec Headset
129 * * 134 * *
130PCM1 <------------> * * <----DAI1-----> Codec Speakers 135 PCM1 <------------> * * <----DAI1-----> Codec Speakers
131 * DSP * 136 * DSP *
132PCM2 <------------> * * <----DAI2-----> MODEM 137 PCM2 <------------> * * <----DAI2-----> MODEM
133 * * 138 * *
134PCM3 <------------> * * <----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
141For the example above we have to define 4 FE DAI links and 6 BE DAI links. The 146For the example above we have to define 4 FE DAI links and 6 BE DAI links. The
142FE DAI links are defined as follows :- 147FE DAI links are defined as follows :-
148::
143 149
144static 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
159This FE DAI link is pretty similar to a regular DAI link except that we also 165This FE DAI link is pretty similar to a regular DAI link except that we also
160set the DAI link to a DPCM FE with the "dynamic = 1". The supported FE stream 166set the DAI link to a DPCM FE with the ``dynamic = 1``. The supported FE stream
161directions should also be set with the "dpcm_playback" and "dpcm_capture" 167directions should also be set with the ``dpcm_playback`` and ``dpcm_capture``
162flags. There is also an option to specify the ordering of the trigger call for 168flags. There is also an option to specify the ordering of the trigger call for
163each FE. This allows the ASoC core to trigger the DSP before or after the other 169each FE. This allows the ASoC core to trigger the DSP before or after the other
164components (as some DSPs have strong requirements for the ordering DAI/DSP 170components (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
168dynamic and will change depending on runtime config. 174dynamic and will change depending on runtime config.
169 175
170The BE DAIs are configured as follows :- 176The BE DAIs are configured as follows :-
177::
171 178
172static 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
191This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets 198This BE DAI link connects DAI0 to the codec (in this case RT5460 AIF1). It sets
192the "no_pcm" flag to mark it has a BE and sets flags for supported stream 199the ``no_pcm`` flag to mark it has a BE and sets flags for supported stream
193directions using "dpcm_playback" and "dpcm_capture" above. 200directions using ``dpcm_playback`` and ``dpcm_capture`` above.
194 201
195The BE has also flags set for ignoring suspend and PM down time. This allows 202The BE has also flags set for ignoring suspend and PM down time. This allows
196the BE to work in a hostless mode where the host CPU is not transferring data 203the BE to work in a hostless mode where the host CPU is not transferring data
197like a BT phone call :- 204like a BT phone call :-
198 205::
199 ************* 206
200PCM0 <------------> * * <----DAI0-----> Codec Headset 207 *************
201 * * 208 PCM0 <------------> * * <----DAI0-----> Codec Headset
202PCM1 <------------> * * <----DAI1-----> Codec Speakers 209 * *
203 * DSP * 210 PCM1 <------------> * * <----DAI1-----> Codec Speakers
204PCM2 <------------> * * <====DAI2=====> MODEM 211 * DSP *
205 * * 212 PCM2 <------------> * * <====DAI2=====> MODEM
206PCM3 <------------> * * <====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
213This allows the host CPU to sleep whilst the DSP, MODEM DAI and the BT DAI are 221This allows the host CPU to sleep whilst the DSP, MODEM DAI and the BT DAI are
214still in operation. 222still 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
220DSP firmware. 228DSP firmware.
221 229
222 230
2232 FE/BE PCM operations 231FE/BE PCM operations
224---------------------- 232--------------------
225 233
226The BE above also exports some PCM operations and a "fixup" callback. The fixup 234The BE above also exports some PCM operations and a ``fixup`` callback. The fixup
227callback is used by the machine driver to (re)configure the DAI based upon the 235callback is used by the machine driver to (re)configure the DAI based upon the
228FE hw params. i.e. the DSP may perform SRC or ASRC from the FE to BE. 236FE 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
231DAI0. This means all FE hw_params have to be fixed in the machine driver for 239DAI0. This means all FE hw_params have to be fixed in the machine driver for
232DAI0 so that the DAI is running at desired configuration regardless of the FE 240DAI0 so that the DAI is running at desired configuration regardless of the FE
233configuration. 241configuration.
242::
234 243
235static 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
254The other PCM operation are the same as for regular DAI links. Use as necessary. 263The other PCM operation are the same as for regular DAI links. Use as necessary.
255 264
256 265
2573 Widget graph connections 266Widget graph connections
258-------------------------- 267------------------------
259 268
260The BE DAI links will normally be connected to the graph at initialisation time 269The BE DAI links will normally be connected to the graph at initialisation time
261by the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this 270by the ASoC DAPM core. However, if the BE codec or BE DAI is a dummy then this
262has to be set explicitly in the driver :- 271has 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
269Writing a DPCM DSP driver 279Writing a DPCM DSP driver
@@ -273,24 +283,25 @@ The DPCM DSP driver looks much like a standard platform class ASoC driver
273combined with elements from a codec class driver. A DSP platform driver must 283combined with elements from a codec class driver. A DSP platform driver must
274implement :- 284implement :-
275 285
276 1) Front End PCM DAIs - i.e. struct snd_soc_dai_driver. 2861. 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. 2882. DAPM graph showing DSP audio routing from FE DAIs to BEs.
279 289
280 3) DAPM widgets from DSP graph. 2903. DAPM widgets from DSP graph.
281 291
282 4) Mixers for gains, routing, etc. 2924. Mixers for gains, routing, etc.
283 293
284 5) DMA configuration. 2945. DMA configuration.
285 295
286 6) BE AIF widgets. 2966. BE AIF widgets.
287 297
288Items 6 is important for routing the audio outside of the DSP. AIF need to be 298Items 6 is important for routing the audio outside of the DSP. AIF need to be
289defined for each BE and each stream direction. e.g for BE DAI0 above we would 299defined for each BE and each stream direction. e.g for BE DAI0 above we would
290have :- 300have :-
301::
291 302
292SND_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),
293SND_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
295The BE AIF are used to connect the DSP graph to the graphs for the other 306The BE AIF are used to connect the DSP graph to the graphs for the other
296component drivers (e.g. codec graph). 307component drivers (e.g. codec graph).
@@ -301,33 +312,33 @@ Hostless PCM streams
301 312
302A hostless PCM stream is a stream that is not routed through the host CPU. An 313A hostless PCM stream is a stream that is not routed through the host CPU. An
303example of this would be a phone call from handset to modem. 314example of this would be a phone call from handset to modem.
304 315::
305 316
306 ************* 317 *************
307PCM0 <------------> * * <----DAI0-----> Codec Headset 318 PCM0 <------------> * * <----DAI0-----> Codec Headset
308 * * 319 * *
309PCM1 <------------> * * <====DAI1=====> Codec Speakers/Mic 320 PCM1 <------------> * * <====DAI1=====> Codec Speakers/Mic
310 * DSP * 321 * DSP *
311PCM2 <------------> * * <====DAI2=====> MODEM 322 PCM2 <------------> * * <====DAI2=====> MODEM
312 * * 323 * *
313PCM3 <------------> * * <----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
320In this case the PCM data is routed via the DSP. The host CPU in this use case 331In this case the PCM data is routed via the DSP. The host CPU in this use case
321is only used for control and can sleep during the runtime of the stream. 332is only used for control and can sleep during the runtime of the stream.
322 333
323The host can control the hostless link either by :- 334The 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
340This DAI link is enabled when DAPM detects a valid path within the DAPM graph. 351This DAI link is enabled when DAPM detects a valid path within the DAPM graph.
341The machine driver sets some additional parameters to the DAI link i.e. 352The machine driver sets some additional parameters to the DAI link i.e.
353::
342 354
343static 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
351static 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==============
2ALSA SoC Layer
3==============
4
5The 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===================
1ASoC jack detection 2ASoC 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===================
1ASoC Machine Driver 2ASoC Machine Driver
2=================== 3===================
3 4
@@ -9,9 +10,10 @@ interrupts, clocking, jacks and voltage regulators.
9The machine driver can contain codec and platform specific code. It registers 10The machine driver can contain codec and platform specific code. It registers
10the audio subsystem with the kernel as a platform device and is represented by 11the audio subsystem with the kernel as a platform device and is represented by
11the following struct:- 12the following struct:-
13::
12 14
13/* SoC machine */ 15 /* SoC machine */
14struct 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
38probe()/remove() 40probe()/remove()
39---------------- 41----------------
@@ -55,9 +57,10 @@ initialisation e.g. the machine audio map can be connected to the codec audio
55map, unconnected codec pins can be set as such. 57map, unconnected codec pins can be set as such.
56 58
57struct snd_soc_dai_link is used to set up each DAI in your machine. e.g. 59struct 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 */
60static 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
71struct snd_soc_card then sets up the machine with its DAIs. e.g. 74struct 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 */
74static 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
81Machine Power Map 85Machine 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 @@
1ALSA SoC Layer 1=======================
2============== 2ALSA SoC Layer Overview
3=======================
3 4
4The overall project goal of the ALSA System on Chip (ASoC) layer is to 5The overall project goal of the ALSA System on Chip (ASoC) layer is to
5provide better ALSA support for embedded system-on-chip processors (e.g. 6provide 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
71Documentation
72=============
73
74The documentation is spilt into the following sections:-
75
76overview.txt: This file.
77
78codec.txt: Codec driver internals.
79
80DAI.txt: Description of Digital Audio Interface standards and how to configure
81a DAI within your codec and CPU DAI drivers.
82
83dapm.txt: Dynamic Audio Power Management
84
85platform.txt: Platform audio DMA and DAI.
86
87machine.txt: Machine driver internals.
88
89pop_clicks.txt: How to minimise audio artifacts.
90
91clocking.txt: ASoC clocking for best power performance.
92
93jack.txt: ASoC jack detection.
94
95DPCM.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====================
1ASoC Platform Driver 2ASoC Platform Driver
2==================== 3====================
3 4
@@ -9,21 +10,23 @@ Audio DMA
9========= 10=========
10 11
11The platform DMA driver optionally supports the following ALSA operations:- 12The platform DMA driver optionally supports the following ALSA operations:-
13::
12 14
13/* SoC audio ops */ 15 /* SoC audio ops */
14struct 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
23The platform driver exports its DMA functionality via struct 25The platform driver exports its DMA functionality via struct
24snd_soc_platform_driver:- 26snd_soc_platform_driver:-
27::
25 28
26struct 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
49Please refer to the ALSA driver documentation for details of audio DMA. 52Please refer to the ALSA driver documentation for details of audio DMA.
50http://www.alsa-project.org/~iwai/writing-an-alsa-driver/ 53http://www.alsa-project.org/~iwai/writing-an-alsa-driver/
@@ -57,11 +60,11 @@ SoC DAI Drivers
57 60
58Each SoC DAI driver must provide the following features:- 61Each SoC DAI driver must provide the following features:-
59 62
60 1) Digital audio interface (DAI) description 631. Digital audio interface (DAI) description
61 2) Digital audio interface configuration 642. Digital audio interface configuration
62 3) PCM's description 653. PCM's description
63 4) SYSCLK configuration 664. SYSCLK configuration
64 5) Suspend and resume (optional) 675. Suspend and resume (optional)
65 68
66Please see codec.txt for a description of items 1 - 4. 69Please see codec.txt for a description of items 1 - 4.
67 70
@@ -71,9 +74,9 @@ SoC DSP Drivers
71 74
72Each SoC DSP driver usually supplies the following features :- 75Each SoC DSP driver usually supplies the following features :-
73 76
74 1) DAPM graph 771. DAPM graph
75 2) Mixer controls 782. Mixer controls
76 3) DMA IO to/from DSP buffers (if applicable) 793. DMA IO to/from DSP buffers (if applicable)
77 4) Definition of DSP front end (FE) PCM devices. 804. Definition of DSP front end (FE) PCM devices.
78 81
79Please see DPCM.txt for a description of item 4. 82Please 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=====================
1Audio Pops and Clicks 2Audio Pops and Clicks
2===================== 3=====================
3 4
@@ -20,10 +21,11 @@ currently, however future audio codec hardware will have better pop and click
20suppression. Pops can be reduced within playback by powering the audio 21suppression. Pops can be reduced within playback by powering the audio
21components in a specific order. This order is different for startup and 22components in a specific order. This order is different for startup and
22shutdown and follows some basic rules:- 23shutdown 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
28This assumes that the codec PCM output path from the DAC is via a mixer and then 30This assumes that the codec PCM output path from the DAC is via a mixer and then
29a PGA (programmable gain amplifier) before being output to the speakers. 31a 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
36ADC until all the pops have occurred. This follows similar power rules to 38ADC until all the pops have occurred. This follows similar power rules to
37playback in that components are powered in a sequence depending upon stream 39playback in that components are powered in a sequence depending upon stream
38startup or shutdown. 40startup 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
45Zipper Noise 48Zipper Noise