/[gentoo]/xml/htdocs/doc/en/alsa-guide.xml
Gentoo

Diff of /xml/htdocs/doc/en/alsa-guide.xml

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.37 Revision 1.47
1<?xml version='1.0' encoding="UTF-8"?> 1<?xml version="1.0" encoding="UTF-8"?>
2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/alsa-guide.xml,v 1.37 2004/06/15 07:21:07 bennyc Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/alsa-guide.xml,v 1.47 2004/12/09 17:16:40 cam Exp $ -->
3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 3<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
4 4
5<guide link = "/doc/en/alsa-guide.xml"> 5<guide link="/doc/en/alsa-guide.xml">
6<title>Gentoo Linux ALSA Guide</title> 6<title>Gentoo Linux ALSA Guide</title>
7<author title="Author"> 7<author title="Author">
8 <mail link="zu@pandora.be">Vincent Verleye</mail> 8 <mail link="zu@pandora.be">Vincent Verleye</mail>
9</author> 9</author>
10<author title="Author"> 10<author title="Author">
15</author> 15</author>
16<author title="Author"> 16<author title="Author">
17 <mail link="eradicator@gentoo.org">Jeremy Huddleston</mail> 17 <mail link="eradicator@gentoo.org">Jeremy Huddleston</mail>
18</author> 18</author>
19<author title="Editor"><!-- zhen@gentoo.org --> 19<author title="Editor"><!-- zhen@gentoo.org -->
20 John P. Davis 20 John P. Davis
21</author> 21</author>
22<author title="Editor"> 22<author title="Editor">
23 <mail link="swift@gentoo.org">Sven Vermeulen</mail> 23 <mail link="swift@gentoo.org">Sven Vermeulen</mail>
24</author> 24</author>
25<author title="Editor"> 25<author title="Editor">
31<author title="Editor"> 31<author title="Editor">
32 <mail link="erwin@gentoo.org">Erwin</mail> 32 <mail link="erwin@gentoo.org">Erwin</mail>
33</author> 33</author>
34 34
35<abstract> 35<abstract>
36This guide will show you how to set up the Advanced Linux Sound Architecture 36This guide will show you how to set up the Advanced Linux Sound Architecture
37(ALSA) on Gentoo Linux. In addition to the Gentoo Linux Desktop Configuration 37(ALSA) on Gentoo Linux. In addition to the Gentoo Linux Desktop Configuration
38Guide, this guide is supposed to give you more information on this subject. 38Guide, this guide is supposed to give you more information on this subject.
39</abstract> 39</abstract>
40 40
41<license/> 41<license/>
42 42
43<version>1.5.0</version> 43<version>1.5.9</version>
44<date>May 18, 2004</date> 44<date>2004-12-09</date>
45 45
46<chapter> 46<chapter>
47<title>The Advanced Linux Sound Architecture</title> 47<title>The Advanced Linux Sound Architecture</title>
48<section> 48<section>
49<title>What is ALSA?</title> 49<title>What is ALSA?</title>
71<title>USE Flags</title> 71<title>USE Flags</title>
72<body> 72<body>
73 73
74<p> 74<p>
75Gentoo provides an <c>alsa</c> USE flag which you should set in 75Gentoo provides an <c>alsa</c> USE flag which you should set in
76<path>/etc/make.conf</path> to allow our available packages to compile with 76<path>/etc/make.conf</path> to allow our available packages to compile with
77ALSA support. If you have <c>oss</c> in your USE variable as well, ALSA will 77ALSA support. If you have <c>oss</c> in your USE variable as well, ALSA will
78compile with OSS backward compatibility. 78compile with OSS backward compatibility.
79</p> 79</p>
80 80
81</body> 81</body>
85<body> 85<body>
86 86
87<p> 87<p>
88First of all, before continuing, make sure your kernel has <e>Sound Card 88First of all, before continuing, make sure your kernel has <e>Sound Card
89Support</e> enabled. If you used <c>genkernel</c> to build your kernel, then 89Support</e> enabled. If you used <c>genkernel</c> to build your kernel, then
90this is automatically true. Otherwise reconfigure your kernel. 90this is automatically true. Otherwise reconfigure your kernel. Additionally,
91</p> 91make sure you disable <e>Open Sound System</e> in your kernel configuration.
92 92If you don't, your system may try to use these drivers rather than the alsa
93ones. If you see a message about 'sound card not detected' and you are sure
94you have the correct driver, this is probably the reason.
93<p> 95</p>
94If you use a 2.6 kernel you can skip the rest of this section and continue with 96
95<uri link="#alsa-utils">Installing the ALSA Utils</uri> as 2.6 already has the 97<warn>
96necessary ALSA drivers in it. Of course, don't forget to enable support for the 98If you use a 2.6 kernel, you may use the drivers provided in the kernel, but
97sound card you have when configuring your kernel. 99we still recommend that you use media-sound/alsa-driver as they are more up
100to date than what is provided in the kernel tree. If you still wish to use
101the drivers provided with your kernel, you can skip the rest of this section
102and continue with <uri link="#alsa-utils">Installing the ALSA Utils</uri>.
103</warn>
104
98</p> 105<p>
99 106The first step in installing your sound drivers is figuring out what sound
100<p> 107card you have. If you don't already know, an easy trick is to search
101Users of 2.4 kernel sources will have to install the necessary ALSA drivers for 108for "audio" in the output of the <c>lspci</c> command. You can install
102their soundcard. First find out what soundcard you have. An easy trick is to 109this tool with <c>emerge pciutils</c>.
103search for "audio" in <path>/proc/pci</path>:
104</p> 110</p>
105 111
106<pre caption="Finding out the soundcard type"> 112<pre caption="Finding out the soundcard type">
107# <i>grep -i audio /proc/pci</i> 113# <i>lspci | grep -i audio</i>
108Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio 114Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (rev 64).
109Controller (rev 64).
110</pre> 115</pre>
111 116
112<p> 117<p>
113Now go to the <uri link="http://www.alsa-project.org/alsa-doc">ALSA Soundcard 118Now go to the <uri link="http://www.alsa-project.org/alsa-doc">ALSA Soundcard
114Matrix</uri> and search for your soundcard. In the above example you should go 119Matrix</uri> and search for your soundcard. In the above example you should go
115to the "VIA" manufacturer. You will receive a table with the known chipsets of 120to the "VIA" manufacturer. You will receive a table with the known chipsets of
116that vendor. The chipset in the above example is "via82c686"; the "Details" link 121that vendor. The chipset in the above example is "via82c686"; the "Details" link
117then informs me that the driver is called <path>via82xx</path>. 122then informs me that the driver is called <path>via82xx</path>. This is all the
123information you need, so you can safely discard the rest of that document.
118</p> 124</p>
119 125
120<p> 126<p>
121Based on this information we can now install the <c>alsa-driver</c> for our 127Based on this information we can now install the <c>alsa-driver</c> for our
122soundcard. First edit <path>/etc/make.conf</path> and <e>add</e> a new option 128soundcard. First edit <path>/etc/make.conf</path> and <e>add</e> a new option
126 132
127<pre caption="Editing /etc/make.conf for ALSA_CARDS"> 133<pre caption="Editing /etc/make.conf for ALSA_CARDS">
128ALSA_CARDS="via82xx" 134ALSA_CARDS="via82xx"
129</pre> 135</pre>
130 136
137<warn>
138If you have multiple sound cards in your system, separate them with a comma
139in the ALSA_CARDS variable. Ex: ALSA_CARDS="via82xx,emu10k1"
140</warn>
141
131<p> 142<p>
143If you want OSS compatibility (highly recommended), you should add 'oss' to
144your USE flags in <path>/etc/make.conf</path>. After that, you are ready to
132Now install <c>alsa-driver</c>: 145install <c>alsa-driver</c>:
133</p> 146</p>
134 147
135<pre caption="Installing ALSA Drivers"> 148<pre caption="Installing ALSA Drivers">
136# <i>emerge alsa-driver</i> 149# <i>emerge alsa-driver</i>
137</pre> 150</pre>
138 151
139<impo> 152<impo>
140Whenever you (re)compile your kernel sources, chances are that the ALSA drivers 153Whenever you (re)compile your kernel sources, chances are that the ALSA drivers
141will be overwritten. It is therefore adviseable to rerun <c>emerge 154will be deleted. It is therefore adviseable to rerun <c>emerge alsa-driver</c>
142alsa-driver</c> every time you (re)compile your kernel <e>after</e> having 155every time you (re)compile your kernel. Note that this will compile the
143rebooted into the new kernel. 156drivers for the kernel in /usr/src/linux, NOT the running kernel.
144</impo> 157</impo>
145 158
146</body> 159</body>
147</section> 160</section>
148<section id="alsa-utils"> 161<section id="alsa-utils">
149<title>Installing the ALSA Utils</title> 162<title>Installing the ALSA Utils</title>
150<body> 163<body>
151 164
152<p> 165<p>
153If you want backwards compatibility with OSS, you need to install 166If the in-kernel OSS compatibility is not sufficient for your needs, you will
154<c>alsa-oss</c>: 167want to install <c>alsa-oss</c>. This will provide you with the 'aoss'
168executable which can be used as demonstrated:
155</p> 169</p>
156 170
157<pre caption="Installing the ALSA OSS compatibility layer"> 171<pre caption="More OSS compatibility layer">
158# <i>emerge alsa-oss</i> 172# <i>emerge alsa-oss</i>
173# <i>aoss mpg123 music.mp3</i>
159</pre> 174</pre>
160 175
161<p> 176<p>
162Now install the ALSA Utils on your system (this is mandatory): 177Now install the ALSA Utils on your system (this is mandatory):
163</p> 178</p>
179<title>Automatically Loading the Kernel Modules</title> 194<title>Automatically Loading the Kernel Modules</title>
180<body> 195<body>
181 196
182<p> 197<p>
183If you use a modular kernel (such as when using <c>genkernel</c>) you have to 198If you use a modular kernel (such as when using <c>genkernel</c>) you have to
184edit <path>/etc/modules.d/alsa</path> so that it activates the necesary modules 199edit <path>/etc/modules.d/alsa</path> so that it activates the necessary
185at boot time. For the soundcard in our example: 200modules at boot time. For the soundcard in our example:
186</p> 201</p>
187 202
188<pre caption="/etc/modules.d/alsa"> 203<pre caption="/etc/modules.d/alsa">
189alias snd-card-0 snd-via82xx 204alias snd-card-0 snd-via82xx
190<comment># The following is only needed when you want OSS compatibility</comment> 205<comment># The following is only needed when you want OSS compatibility</comment>
208<section> 223<section>
209<title>Verifying the Device Files</title> 224<title>Verifying the Device Files</title>
210<body> 225<body>
211 226
212<p> 227<p>
213If you use DevFS (which is the default for Gentoo installations) make sure that 228This should be done automatically for you on recent installs, but if you run
214<path>/etc/devfsd.conf</path> has the ALSA devices and permissions correctly 229into problems, check that your ALSA devices and permissions are set correctly
215registered: 230by your /dev manager. If you use DevFS, check <path>/etc/devfsd.conf</path>
216</p> 231</p>
217 232
218<pre caption="/etc/devfsd.conf"> 233<pre caption="/etc/devfsd.conf">
219# ALSA/OSS stuff 234# ALSA/OSS stuff
220# Comment/change these if you want to change the permissions on 235# Comment/change these if you want to change the permissions on
267Now unmute the <e>Master</e> and <e>PCM</e> channels. If this isn't sufficient, 282Now unmute the <e>Master</e> and <e>PCM</e> channels. If this isn't sufficient,
268also unmute the <e>Center</e> and <e>Surround</e> channels. 283also unmute the <e>Center</e> and <e>Surround</e> channels.
269</p> 284</p>
270 285
271<pre caption="Unmuting the sound channels"> 286<pre caption="Unmuting the sound channels">
287<comment>(If you prefer an ncurses method:)</comment>
288
289# <i>alsamixer</i>
290
291<comment>(or)</comment>
292
272# <i>amixer set Master 100 unmute</i> 293# <i>amixer set Master 100 unmute</i>
273# <i>amixer set PCM 100 unmute</i> 294# <i>amixer set PCM 100 unmute</i>
274<comment>(Only if the above isn't sufficient:)</comment> 295<comment>(Only if the above isn't sufficient:)</comment>
275# <i>amixer set Center 100 unmute</i> 296# <i>amixer set Center 100 unmute</i>
276# <i>amixer set Surround 100 unmute</i> 297# <i>amixer set Surround 100 unmute</i>
298# <i>amixer set Headphone 100 unmute</i>
277</pre> 299</pre>
300
278 301
279<p> 302<p>
280To check if your sound works, play a wave file (using <c>aplay</c>), mp3 (using 303To check if your sound works, play a wave file (using <c>aplay</c>), mp3 (using
281<c>mpg123</c> or even <c>mplayer</c>) or any other sound file for that matter. 304<c>mpg123</c> or even <c>mplayer</c>) or any other sound file for that matter.
282</p>
283
284<p>
285To fine-tune the sound channel settings you can use the <c>alsamixer</c>
286application.
287</p> 305</p>
288 306
289</body> 307</body>
290</section> 308</section>
291</chapter> 309</chapter>
309<path>/usr/share/sfbank</path>. For instance, the SBLive has a sound font file 327<path>/usr/share/sfbank</path>. For instance, the SBLive has a sound font file
310called <path>8MBGMSFX.SF2</path> or <path>CT4GMSFX.SF2</path>. 328called <path>8MBGMSFX.SF2</path> or <path>CT4GMSFX.SF2</path>.
311</p> 329</p>
312 330
313<p> 331<p>
314After copying over the sound font, select them using <c>sfxload</c>: 332After copying over the sound font, select them using <c>asfxload</c>:
315</p> 333</p>
316 334
317<pre caption="Loading the sound font"> 335<pre caption="Loading the sound font">
318# <i>sfxload /usr/share/sfbank/8MBGMSFX.SF2</i> 336# <i>asfxload /usr/share/sfbank/8MBGMSFX.SF2</i>
319</pre> 337</pre>
320 338
321<p> 339<p>
322You must have this command run every time you boot, so it is adviseable to add 340You must have this command run every time you boot, so it is adviseable to add
323it to <path>/etc/conf.d/local.start</path> as well. 341it to <path>/etc/conf.d/local.start</path> as well.
343<pre caption="Installing Timidity++"> 361<pre caption="Installing Timidity++">
344# <i>emerge timidity++</i> 362# <i>emerge timidity++</i>
345</pre> 363</pre>
346 364
347<p> 365<p>
348A sample configuration file will be installed for you in
349<path>/usr/share/timidity/config/timidity.cfg</path>. If you don't have a
350timidity++ configuration setup yet, you can just use this one.
351</p>
352
353<pre caption="Using the default Timidity++ configuration file">
354# <i>cp /usr/share/timidity/config/timidity.cfg /usr/share/timidity</i>
355</pre>
356
357<p>
358For timidity to play sounds, it needs a soundfont. If you do not have any, 366For timidity to play sounds, it needs a soundfont. If you do not have any,
359install <c>timidity-eawpatches</c> which will give you some soundfonts. 367install <c>timidity-eawpatches</c> or <c>timidity-shompatches</c> which will
368give you some soundfonts. You can have multiple soundfont configurations
369installed, and you can place your own in <path>/usr/share/timidity/</path>.
370To switch between different timidity configurations, you should use the
371<e>timidity-update</e> tool provided in the timidity++ package.
360</p> 372</p>
361 373
362<pre caption="Installing timidity-eawpatches"> 374<pre caption="Installing soundfonts">
363# <i>emerge timidity-eawpatches</i> 375# <i>emerge timidity-eawpatches</i>
376# <i>timidity-update -g -s eawpatches</i>
377
378<comment>(or)</comment>
379
380# <i>emerge timidity-shompatches</i>
381# <i>timidity-update -g -s shompatches</i>
364</pre> 382</pre>
365 383
366<p> 384<p>
367Don't forget to add <c>timidity</c> to the default runlevel. 385Don't forget to add <c>timidity</c> to the default runlevel.
368</p> 386</p>
377<section> 395<section>
378<title>Testing MIDI Support</title> 396<title>Testing MIDI Support</title>
379<body> 397<body>
380 398
381<p> 399<p>
382You can use <c>pmidi</c> to test your MIDI configuration: 400You can use <c>aplaymidi</c> from the ALSA Utils to test your MIDI
383</p> 401configuration.
384
385<pre caption="Installing pmidi">
386# <i>emerge pmidi</i>
387</pre> 402</p>
388 403
389<p> 404<p>
390To see what MIDI output ports are available on your system, use the <c>-l</c> 405To see what MIDI output ports are available on your system, use the <c>-l</c>
391option: 406option:
392</p> 407</p>
393 408
394<pre caption="Viewing the MIDI output ports"> 409<pre caption="Viewing the MIDI output ports">
395# <i>pmidi -l</i> 410# <i>aplaymidi -l</i>
396</pre> 411</pre>
397 412
398<p> 413<p>
399If all looks fine, try playing a MIDI file to make sure everything works. With 414If all looks fine, try playing a MIDI file to make sure everything works. With
400the <c>-p</c> option you define what MIDI port you want to use. 415the <c>-p</c> option you define what MIDI port you want to use.
401</p> 416</p>
402 417
403<pre caption="Playing a MIDI file"> 418<pre caption="Playing a MIDI file">
404# <i>pmidi -p 65:0 "Final Fantasy 7 - Aerith' Theme.mid"</i> 419# <i>aplaymidi -p 65:0 "Final Fantasy 7 - Aerith' Theme.mid"</i>
405</pre> 420</pre>
406 421
407</body> 422</body>
408</section> 423</section>
409</chapter> 424</chapter>
459 of VIA 82xx bridge." 474 of VIA 82xx bridge."
460parm: mpu_port long array (min = 1, max = 8), description "MPU-401 port. 475parm: mpu_port long array (min = 1, max = 8), description "MPU-401 port.
461 (VT82C686x only)" 476 (VT82C686x only)"
462<i>parm: joystick int array (min = 1, max = 8), description "Enable 477<i>parm: joystick int array (min = 1, max = 8), description "Enable
463 joystick. (VT82C686x only)"</i> 478 joystick. (VT82C686x only)"</i>
464parm: ac97_clock int array (min = 1, max = 8), description "AC'97 codec 479parm: ac97_clock int array (min = 1, max = 8), description "AC'97 codec
465 clock (default 48000Hz)." 480 clock (default 48000Hz)."
466parm: dxs_support int array (min = 1, max = 8), description "Support for 481parm: dxs_support int array (min = 1, max = 8), description "Support for
467 DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 = 482 DXS channels (0 = auto, 1 = enable, 2 = disable, 3 = 48k only, 4 =
468 no VRA) 483 no VRA)
469</pre> 484</pre>
470 485
471<p> 486<p>
472If it has the <c>joystick</c> parameter, append <c>joystick=1</c> to your 487If it has the <c>joystick</c> parameter, append <c>joystick=1</c> to your

Legend:
Removed from v.1.37  
changed lines
  Added in v.1.47

  ViewVC Help
Powered by ViewVC 1.1.20