/[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.45 Revision 1.46
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.45 2004/12/02 20:27:35 dertobi123 Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/alsa-guide.xml,v 1.46 2004/12/08 11:12:50 neysx 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">
11 <mail link="g2boojum@gentoo.org">Grant Goodyear</mail> 11 <mail link="g2boojum@gentoo.org">Grant Goodyear</mail>
12</author> 12</author>
13<author title="Author"> 13<author title="Author">
14 <mail link="agenkin@gentoo.org">Arcady Genkin</mail> 14 <mail link="agenkin@gentoo.org">Arcady Genkin</mail>
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>
28<author title="Editor"> 28<author title="Editor">
29 <mail link="blubber@gentoo.org">Tiemo Kieft</mail> 29 <mail link="blubber@gentoo.org">Tiemo Kieft</mail>
30</author> 30</author>
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.7</version> 43<version>1.5.8</version>
44<date>2004-12-02</date> 44<date>2004-12-08</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>
50<body> 50<body>
51 51
52<p> 52<p>
53ALSA is the <e>Advanced Linux Sound Architecture</e>, a project dedicated to the 53ALSA is the <e>Advanced Linux Sound Architecture</e>, a project dedicated to the
54development of a high-quality Linux sound subsystem. It has replaced OSS 54development of a high-quality Linux sound subsystem. It has replaced OSS
55(<e>Open Sound System</e>) as default sound subsystem in the 2.6 kernel series. 55(<e>Open Sound System</e>) as default sound subsystem in the 2.6 kernel series.
56</p> 56</p>
57 57
58<p> 58<p>
59ALSA provides efficient support for all types of audio interfaces, is fully 59ALSA provides efficient support for all types of audio interfaces, is fully
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>
82</section> 82</section>
83<section> 83<section>
84<title>Kernel Modules</title> 84<title>Kernel Modules</title>
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,
91make sure you disable <e>Open Sound System</e> in your kernel configuration.
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.
91</p> 95</p>
92 96
93<warn> 97<warn>
94If you use a 2.6 kernel you can skip the rest of this section and continue with 98If you use a 2.6 kernel, you may use the drivers provided in the kernel, but
95<uri link="#alsa-utils">Installing the ALSA Utils</uri> as 2.6 already has the 99we still recommend that you use media-sound/alsa-driver as they are more up
96necessary ALSA drivers in it. Of course, don't forget to enable support for the 100to date than what is provided in the kernel tree. If you still wish to use
97sound card you have when configuring your kernel. 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>.
98</warn> 103</warn>
99 104
100<p> 105<p>
101Users of 2.4 kernel sources will have to install the necessary ALSA drivers for 106The first step in installing your sound drivers is figuring out what sound
102their soundcard. First find out what soundcard you have. An easy trick is to 107card you have. If you don't already know, an easy trick is to search
103search for "audio" in the output of the <c>lspci</c> command. You can install 108for "audio" in the output of the <c>lspci</c> command. You can install
104it with <c>emerge pciutils</c>. 109this tool with <c>emerge pciutils</c>.
105</p> 110</p>
106 111
107<pre caption="Finding out the soundcard type"> 112<pre caption="Finding out the soundcard type">
108# <i>lspci | grep -i audio</i> 113# <i>lspci | grep -i audio</i>
109Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (rev 64). 114Multimedia audio controller: VIA Technologies, Inc. VT82C686 AC97 Audio Controller (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>. This is all the 122then informs me that the driver is called <path>via82xx</path>. This is all the
118information you need, so you can safely discard the rest of that document. 123information you need, so you can safely discard the rest of that document.
119</p> 124</p>
120 125
121<p> 126<p>
122Based 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
123soundcard. 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
124called ALSA_CARDS to it. Inside this variable you declare the soundcard driver 129called ALSA_CARDS to it. Inside this variable you declare the soundcard driver
125you want to use: 130you want to use:
126</p> 131</p>
127 132
128<pre caption="Editing /etc/make.conf for ALSA_CARDS"> 133<pre caption="Editing /etc/make.conf for ALSA_CARDS">
129ALSA_CARDS="via82xx" 134ALSA_CARDS="via82xx"
130</pre> 135</pre>
131 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
132<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
133Now install <c>alsa-driver</c>: 145install <c>alsa-driver</c>:
134</p> 146</p>
135 147
136<pre caption="Installing ALSA Drivers"> 148<pre caption="Installing ALSA Drivers">
137# <i>emerge alsa-driver</i> 149# <i>emerge alsa-driver</i>
138</pre> 150</pre>
139 151
140<impo> 152<impo>
141Whenever 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
142will be overwritten. It is therefore adviseable to rerun <c>emerge 154will be deleted. It is therefore adviseable to rerun <c>emerge alsa-driver</c>
143alsa-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
144rebooted into the new kernel. 156drivers for the kernel in /usr/src/linux, NOT the running kernel.
145</impo> 157</impo>
146 158
147</body> 159</body>
148</section> 160</section>
149<section id="alsa-utils"> 161<section id="alsa-utils">
150<title>Installing the ALSA Utils</title> 162<title>Installing the ALSA Utils</title>
151<body> 163<body>
152 164
153<p> 165<p>
154If you want backwards compatibility with OSS, you need to install 166If the in-kernel OSS compatibility is not sufficient for your needs, you will
155<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:
156</p> 169</p>
157 170
158<pre caption="Installing the ALSA OSS compatibility layer"> 171<pre caption="More OSS compatibility layer">
159# <i>emerge alsa-oss</i> 172# <i>emerge alsa-oss</i>
173# <i>aoss mpg123 music.mp3</i>
160</pre> 174</pre>
161 175
162<p> 176<p>
163Now install the ALSA Utils on your system (this is mandatory): 177Now install the ALSA Utils on your system (this is mandatory):
164</p> 178</p>
165 179
166<pre caption="Installing ALSA Utils"> 180<pre caption="Installing ALSA Utils">
167# <i>emerge alsa-utils</i> 181# <i>emerge alsa-utils</i>
168</pre> 182</pre>
169 183
170<p> 184<p>
171Now that the utils are installed, it is time to configure ALSA... 185Now that the utils are installed, it is time to configure ALSA...
172</p> 186</p>
173 187
174</body> 188</body>
175</section> 189</section>
176</chapter> 190</chapter>
177<chapter> 191<chapter>
178<title>Configuring ALSA</title> 192<title>Configuring ALSA</title>
179<section> 193<section>
180<title>Automatically Loading the Kernel Modules</title> 194<title>Automatically Loading the Kernel Modules</title>
181<body> 195<body>
182 196
183<p> 197<p>
184If 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
185edit <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
186at boot time. For the soundcard in our example: 200modules at boot time. For the soundcard in our example:
187</p> 201</p>
188 202
189<pre caption="/etc/modules.d/alsa"> 203<pre caption="/etc/modules.d/alsa">
190alias snd-card-0 snd-via82xx 204alias snd-card-0 snd-via82xx
191<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>
192alias sound-slot-0 snd-card-0 206alias sound-slot-0 snd-card-0
193alias /dev/mixer snd-mixer-oss 207alias /dev/mixer snd-mixer-oss
194alias /dev/dsp snd-pcm-oss 208alias /dev/dsp snd-pcm-oss
195alias /dev/midi snd-seq-oss 209alias /dev/midi snd-seq-oss
196</pre> 210</pre>
197 211
198<p> 212<p>
199Now run <c>modules-update</c> to save the changes you made to the 213Now run <c>modules-update</c> to save the changes you made to the
200<path>alsa</path> file into <path>/etc/modules.conf</path>: 214<path>alsa</path> file into <path>/etc/modules.conf</path>:
201</p> 215</p>
202 216
203<pre caption="Running modules-update"> 217<pre caption="Running modules-update">
204# <i>modules-update</i> 218# <i>modules-update</i>
205</pre> 219</pre>
206 220
207</body> 221</body>
208</section> 222</section>
209<section> 223<section>
210<title>Verifying the Device Files</title> 224<title>Verifying the Device Files</title>
211<body> 225<body>
212 226
213<p> 227<p>
214If 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
215<path>/etc/devfsd.conf</path> has the ALSA devices and permissions correctly 229into problems, check that your ALSA devices and permissions are set correctly
216registered: 230by your /dev manager. If you use DevFS, check <path>/etc/devfsd.conf</path>
217</p> 231</p>
218 232
219<pre caption="/etc/devfsd.conf"> 233<pre caption="/etc/devfsd.conf">
220# ALSA/OSS stuff 234# ALSA/OSS stuff
221# Comment/change these if you want to change the permissions on 235# Comment/change these if you want to change the permissions on
222# the audio devices 236# the audio devices
223LOOKUP snd MODLOAD ACTION snd 237LOOKUP snd MODLOAD ACTION snd
224LOOKUP dsp MODLOAD 238LOOKUP dsp MODLOAD
225LOOKUP mixer MODLOAD 239LOOKUP mixer MODLOAD
226LOOKUP midi MODLOAD 240LOOKUP midi MODLOAD
227REGISTER sound/.* PERMISSIONS root.audio 660 241REGISTER sound/.* PERMISSIONS root.audio 660
228REGISTER snd/.* PERMISSIONS root.audio 660 242REGISTER snd/.* PERMISSIONS root.audio 660
229</pre> 243</pre>
230 244
231</body> 245</body>
258# <i>amixer</i> 272# <i>amixer</i>
259</pre> 273</pre>
260 274
261<p> 275<p>
262If <c>amixer</c> produces lots of output then you're ready to unmute the 276If <c>amixer</c> produces lots of output then you're ready to unmute the
263channels. If you receive an error, doublecheck that your soundcard module is 277channels. If you receive an error, doublecheck that your soundcard module is
264started. 278started.
265</p> 279</p>
266 280
267<p> 281<p>
268Now 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,
269also unmute the <e>Center</e> and <e>Surround</e> channels. 283also unmute the <e>Center</e> and <e>Surround</e> channels.
270</p> 284</p>
271 285
272<pre caption="Unmuting the sound channels"> 286<pre caption="Unmuting the sound channels">
287<comment>If you prefer an ncurses method:</comment>
288# <i>alsamixer</i>
289
290or
291
273# <i>amixer set Master 100 unmute</i> 292# <i>amixer set Master 100 unmute</i>
274# <i>amixer set PCM 100 unmute</i> 293# <i>amixer set PCM 100 unmute</i>
275<comment>(Only if the above isn't sufficient:)</comment> 294<comment>(Only if the above isn't sufficient:)</comment>
276# <i>amixer set Center 100 unmute</i> 295# <i>amixer set Center 100 unmute</i>
277# <i>amixer set Surround 100 unmute</i> 296# <i>amixer set Surround 100 unmute</i>
278# <i>amixer set Headphone 100 unmute</i> 297# <i>amixer set Headphone 100 unmute</i>
279</pre> 298</pre>
280 299
300
281<p> 301<p>
282To check if your sound works, play a wave file (using <c>aplay</c>), mp3 (using 302To check if your sound works, play a wave file (using <c>aplay</c>), mp3 (using
283<c>mpg123</c> or even <c>mplayer</c>) or any other sound file for that matter. 303<c>mpg123</c> or even <c>mplayer</c>) or any other sound file for that matter.
284</p>
285
286<p>
287To fine-tune the sound channel settings you can use the <c>alsamixer</c>
288application.
289</p> 304</p>
290 305
291</body> 306</body>
292</section> 307</section>
293</chapter> 308</chapter>
294<chapter> 309<chapter>
295<title>Activating MIDI Support</title> 310<title>Activating MIDI Support</title>
296<section> 311<section>
297<title>Installing the Necessary Packages</title> 312<title>Installing the Necessary Packages</title>
298<body> 313<body>
299 314
300<p> 315<p>
301Some soundcards come with onboard MIDI synthesizers. To use them, you must first 316Some soundcards come with onboard MIDI synthesizers. To use them, you must first
302install the <c>awesfx</c> package: 317install the <c>awesfx</c> package:
303</p> 318</p>
336<title>Timidity++ Virtual Synthesizer</title> 351<title>Timidity++ Virtual Synthesizer</title>
337<body> 352<body>
338 353
339<p> 354<p>
340If your sound card does not come with a hardware synthesizer (or you don't want 355If your sound card does not come with a hardware synthesizer (or you don't want
341to use it), you can use <c>timidity++</c> to provide you with a virtual 356to use it), you can use <c>timidity++</c> to provide you with a virtual
342synthesizer. Start by emerging this package: 357synthesizer. Start by emerging this package:
343</p> 358</p>
344 359
345<pre caption="Installing Timidity++"> 360<pre caption="Installing Timidity++">
346# <i>emerge timidity++</i> 361# <i>emerge timidity++</i>
347</pre> 362</pre>
348 363
349<p> 364<p>
350For timidity to play sounds, it needs a soundfont. If you do not have any, 365For timidity to play sounds, it needs a soundfont. If you do not have any,
351install <c>timidity-eawpatches</c> which will give you some soundfonts. 366install <c>timidity-eawpatches</c> or <c>timidity-shompatches</c> which will
367give you some soundfonts. You can have multiple soundfont configurations
368installed, and you can place your own in <path>/usr/share/timidity/</path>.
369To switch between different timidity configurations, you should use the
370<e>timidity-update</e> tool provided in the timidity++ package.
352</p> 371</p>
353 372
354<pre caption="Installing timidity-eawpatches"> 373<pre caption="Installing soundfonts">
355# <i>emerge timidity-eawpatches</i> 374# <i>emerge timidity-eawpatches</i>
375# timidity-update -g -s eawpatches
376
377<comment> or </comment>
378
379# <i>emerge timidity-shompatches</i>
380# timidity-update -g -s shompatches
356</pre> 381</pre>
357 382
358<p> 383<p>
359Don't forget to add <c>timidity</c> to the default runlevel. 384Don't forget to add <c>timidity</c> to the default runlevel.
360</p> 385</p>
361 386
362<pre caption="Adding timidity to the default runlevel"> 387<pre caption="Adding timidity to the default runlevel">
363# <i>rc-update add timidity default</i> 388# <i>rc-update add timidity default</i>
364# <i>/etc/init.d/timidity start</i> 389# <i>/etc/init.d/timidity start</i>
365</pre> 390</pre>
366 391
367</body> 392</body>
368</section> 393</section>
369<section> 394<section>
370<title>Testing MIDI Support</title> 395<title>Testing MIDI Support</title>

Legend:
Removed from v.1.45  
changed lines
  Added in v.1.46

  ViewVC Help
Powered by ViewVC 1.1.20