/[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.7 Revision 1.8
4<guide link = "/doc/en/alsa-guide.xml"> 4<guide link = "/doc/en/alsa-guide.xml">
5<title>Gentoo Linux ALSA Guide</title> 5<title>Gentoo Linux ALSA Guide</title>
6<author title="Author"><mail link="zu@pandora.be"> 6<author title="Author"><mail link="zu@pandora.be">
7 Vincent Verleye</mail> 7 Vincent Verleye</mail>
8</author> 8</author>
9 9
10<author title="Editor"><mail link="zhen@gentoo.org"> 10<author title="Editor"><mail link="zhen@gentoo.org">
11 John P. Davis</mail> 11 John P. Davis</mail>
12</author> 12</author>
13 13
14<abstract> 14<abstract>
15This guide will show you how to set up the Advanced Linux Sound Architecture (ALSA) on Gentoo Linux. 15This guide will show you how to set up the Advanced Linux Sound Architecture (ALSA) on Gentoo Linux.
16In addition to the Gentoo Linux Desktop Configuration Guide, this guide is supposed to give you more information on this subject. </abstract> 16In addition to the Gentoo Linux Desktop Configuration Guide, this guide is supposed to give you more information on this subject. </abstract>
17 17
18<version>1.2</version> 18<version>1.2</version>
19<date>09 February 2003</date> 19<date>18 February 2003</date>
20 20
21<chapter> 21<chapter>
22<title>Introduction</title> 22<title>Introduction</title>
23<section> 23<section>
24 <title>What is ALSA?</title> 24 <title>What is ALSA?</title>
25<body> 25<body>
26<p> 26<p>
27The Advanced Linux Sound Architecture (ALSA) is a project to improve the Linux sound subsystem by rewriting 27The Advanced Linux Sound Architecture (ALSA) is a project to improve the Linux sound subsystem by rewriting
28large chunks of it. 28large chunks of it.
29It is anticipated that ALSA will make it into Linux kernel 2.6.x (or 3.x.x -- whichever comes first) as it becomes ready. 29It is anticipated that ALSA will make it into Linux kernel 2.6.x (or 3.x.x -- whichever comes first) as it becomes ready.
30</p> 30</p>
31 31
32<p> 32<p>
33ALSA provides audio and MIDI functionality for Linux. 33ALSA provides audio and MIDI functionality for Linux.
34</p> 34</p>
70However, some vendors may provide binary-only packages. 70However, some vendors may provide binary-only packages.
71</p> 71</p>
72<p>To know if your card is supported, you can find a Soundcard Matrix of supported and not-supported cards here: 72<p>To know if your card is supported, you can find a Soundcard Matrix of supported and not-supported cards here:
73<uri>http://www.alsa-project.org/alsa-doc/</uri>. 73<uri>http://www.alsa-project.org/alsa-doc/</uri>.
74</p> 74</p>
75</body> 75</body>
76</section> 76</section>
77</chapter> 77</chapter>
78 78
79<chapter> 79<chapter>
80<title>Installation</title> 80<title>Installation</title>
81<section> 81<section>
82 <title>Kernel modules</title> 82 <title>Kernel modules</title>
83<body> 83<body>
84<p> 84<p>
85Since we're still using 2.4.x kernel sources, we'll have to compile kernel modules and ALSA modules separately. 85Since we're still using 2.4.x kernel sources, we'll have to compile kernel modules and ALSA modules separately. People who are using a 2.5.x kernel can do this from within their kernel configuration, since the ALSA modules are included in the kernel sources and should be built there.
86</p> 86</p>
87<p> 87<p>
88First we'll make sure that our kernel configuration is ready for use with ALSA. 88First we'll make sure that our kernel configuration is ready for use with ALSA.
89All you need in your kernel configuration is having Sound Card Support set to be built as a module (M). 89All you need in your kernel configuration is having Sound Card Support set to be built as a module (M).
90This will build <c>soundcore.o</c>. 90This will build <c>soundcore.o</c>.
91</p> 91</p>
92<p> 92<p>
93<note> 93<note>
94Possibly, this will also work when you built Sound Card Support in the kernel (Y) instead of building it as a module (M). 94Possibly, this will also work when you built Sound Card Support in the kernel (Y) instead of building it as a module (M).
95However, the official ALSA documentation suggests building it as a module, since ALSA will try loading it. 95However, the official ALSA documentation suggests building it as a module, since ALSA will try loading it.
96</note> 96</note>
97</p> 97</p>
98<p>If you already have a working kernel configuration, make sure you remove all sound drivers (except for Sound Card Support). 98<p>If you already have a working kernel configuration, make sure you remove all sound drivers (except for Sound Card Support).
99If you wish to do this without having to reboot, you could do like this: 99If you wish to do this without having to reboot, you could do like this:
100</p> 100</p>
126<p> 126<p>
127<note>However, there's no need to reinstall <c>nvidia-kernel</c>, the Nvidia drivers are in a separate directory 127<note>However, there's no need to reinstall <c>nvidia-kernel</c>, the Nvidia drivers are in a separate directory
128in <path>/lib/modules/*/video</path> and won't get deleted by a <c>make modules modules_install</c> 128in <path>/lib/modules/*/video</path> and won't get deleted by a <c>make modules modules_install</c>
129</note> 129</note>
130</p> 130</p>
131</body> 131</body>
132</section> 132</section>
133 133
134<section> 134<section>
135 <title>ALSA modules</title> 135 <title>ALSA modules</title>
136<body> 136<body>
137 137
138<p> 138<p>
139Now it's time to install the ALSA drivers for your soundcard(s). If your soundcard is PCI, you can find out the name 139Now it's time to install the ALSA drivers for your soundcard(s). If your soundcard is PCI, you can find out the name
140and type of your soundcard by looking at the output of /proc/pci 140and type of your soundcard by looking at the output of /proc/pci
141<pre>#<c>grep audio /proc/pci</c></pre> 141<pre># <c>grep audio /proc/pci</c></pre>
142</p> 142</p>
143 143
144<p> 144<p>
145<warn> 145<warn>
146If you had a previous sound setup and there are still non-ALSA sound modules loaded, unload them <e>now</e>. 146If you had a previous sound setup and there are still non-ALSA sound modules loaded, unload them <e>now</e>.
147Check with <c>lsmod</c> and use <c>rmmod</c> to unload all sound-related modules on your system. 147Check with <c>lsmod</c> and use <c>rmmod</c> to unload all sound-related modules on your system.
148</warn> 148</warn>
149</p> 149</p>
150 150
151<p> 151<p>
152We could simply do an <c>emerge alsa-driver</c> now, this would compile and install <e>all</e> ALSA sound drivers. 152We could simply do an <c>emerge alsa-driver</c> now, this would compile and install <e>all</e> ALSA sound drivers.
153</p> 153</p>
154<p> 154<p>
155However, to save some time, lookup the <e>Module Name</e> of your soundcard(s) on the 155However, to save some time, lookup the <e>Module Name</e> of your soundcard(s) on the
156<uri link="http://www.alsa-project.org/alsa-doc">ALSA Soundcard Matrix</uri> under the <e>Install</e> section. 156<uri link="http://www.alsa-project.org/alsa-doc">ALSA Soundcard Matrix</uri> by following the <e>Details</e> link in the <e>Driver and Docs</e> column in the row of the chipset of your soundcard.
157Mine is <c>EMU10K1</c>, since I have an SBlive! soundcard. 157Mine is <c>snd-emu10k1</c>, since I have an SBlive! soundcard, with the <e>EMU10K1</e> chipset.
158We'll set ALSA_CARDS environment to this value before emerging, so emerge will only compile the drivers we need. 158We'll set ALSA_CARDS environment to the value of the module name before emerging (but without the snd prefix), so emerge will only compile the drivers we need.
159</p> 159</p>
160 160
161<p> 161<p>
162<pre> 162<pre>
163# <c>env ALSA_CARDS='emu10k1' emerge alsa-driver</c> 163# <c>env ALSA_CARDS='emu10k1' emerge alsa-driver</c>
164</pre> 164</pre>
165</p> 165</p>
166<p> 166<p>
167<note>
168You can also add this value in <path>/etc/make.conf</path>, so when you have to emerge the alsa-driver later on you can just run <c>emerge alsa-driver</c>.
169For example, like this: <c>echo 'ALSA_CARDS="emu10k1"' >> /etc/make.conf</c>
170</note>
171
167<note> 172<note>
168When you want to install ALSA drivers for more than one soundcard, you could set ALSA_CARDS to a space-separated list 173When you want to install ALSA drivers for more than one soundcard, you could set ALSA_CARDS to a space-separated list
169of drivers; like this: <c>env ALSA_CARDS='emu10k1 intel8x0 ens1370' emerge alsa-driver</c> 174of drivers; like this: <c>env ALSA_CARDS='emu10k1 intel8x0 ens1370' emerge alsa-driver</c>
170</note> 175</note>
171 176
172<note>If you want to have OSS compatibility, make sure to emerge <i>alsa-oss</i>, it is the ALSA/OSS compatibility 177<note>If you want to have OSS compatibility, make sure to emerge <i>alsa-oss</i>, it is the ALSA/OSS compatibility
173wrapper. </note> 178wrapper. </note>
174 179
175</p> 180</p>
176<p> 181<p>
177After this, the ALSA modules should be installed on your system. 182After this, the ALSA modules should be installed on your system.
178</p> 183</p>
179</body> 184</body>
180</section> 185</section>
181<section> 186<section>
184<p> 189<p>
185Let's start configuring now to get ALSA working properly. 190Let's start configuring now to get ALSA working properly.
186We'll need to edit some files, to let our system know about the freshly installed ALSA modules. 191We'll need to edit some files, to let our system know about the freshly installed ALSA modules.
187</p> 192</p>
188<p> 193<p>
189First file to edit is <path>/etc/modules.d/alsa</path>. 194First file to edit is <path>/etc/modules.d/alsa</path>.
190</p> 195</p>
191<warn> 196<warn>
192There is no need to edit <path>/etc/modules.conf</path>. Instead, always edit files in <path>/etc/modules.d</path>. 197There is no need to edit <path>/etc/modules.conf</path>. Instead, always edit files in <path>/etc/modules.d</path>.
193</warn> 198</warn>
194<p> 199<p>
195Check the ALSA portion <e>at the bottom of the file</e>. 200Check the ALSA portion <e>at the bottom of the file</e>.
196By tweaking this line you can specify the max number of soundcards you have (generally, just one). 201By tweaking this line you can specify the max number of soundcards you have (generally, just one).
197</p> 202</p>
198<p> 203<p>
199<pre caption="At the top of /etc/modules.d/alsa"> 204<pre caption="At the bottom of /etc/modules.d/alsa">
200# Alsa 0.9.X kernel modules' configuration file. 205alias /dev/mixer snd-mixer-oss
201# $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/alsa-guide.xml,v 1.7 2003/02/09 23:27:14 zhen Exp $ 206alias /dev/dsp snd-pcm-oss
207alias /dev/midi snd-seq-oss
202 208
203# ALSA portion 209# Set this to the correct number of cards.
204alias char-major-116 snd
205<c>options snd major=116 cards_limit=1</c> 210<c>options snd cards_limit=1</c>
206# OSS/Free portion
207alias char-major-14 soundcore
208
209##
210## IMPORTANT:
211</pre> 211</pre>
212</p> 212</p>
213<p> 213<p>
214Now we'll specify the sounddriver(s) ALSA should use. In the same file, edit like this: 214Now we'll specify the sounddriver(s) ALSA should use. In the same file, edit like this:
215<pre caption="A bit lower in /etc/modules.d/alsa"> 215<pre caption="In /etc/modules.d/alsa">
216## and then run `update-modules' command. 216## and then run `update-modules' command.
217## Read alsa-driver's INSTALL file in /usr/share/doc for more info. 217## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
218## 218##
219## ALSA portion 219## ALSA portion
220<c>alias snd-card-0 snd-emu10k1</c> 220<c>alias snd-card-0 snd-emu10k1</c>
221<c>## If you have more than one, add: 221<c>## If you have more than one, add:
222## alias snd-card-1 snd-intel8x0 222## alias snd-card-1 snd-intel8x0
223## alias snd-card-2 snd-ens1370</c> 223## alias snd-card-2 snd-ens1370</c>
224## OSS/Free portion 224## OSS/Free portion
225## alias sound-slot-0 snd-card-0 225## alias sound-slot-0 snd-card-0
226## alias sound-slot-1 snd-card-1 226## alias sound-slot-1 snd-card-1
227## 227##
228</pre> 228</pre>
229</p> 229</p>
230<p> 230<p>
231<note> 231<note>
232If you have more than one soundcard, adjust the <c>cards_limit</c> value and add more snd-card aliases to the file. 232If you have more than one soundcard, adjust the <c>cards_limit</c> value and add more snd-card aliases to the file.
233I don't have experience with this, but you can find examples for configurations with two or more soundcards in 233I don't have experience with this, but you can find examples for configurations with two or more soundcards in
234<uri link="http://www.alsa-project.org/alsa-doc/alsa-howto/c1660.htm">Chapter 6</uri> 234<uri link="http://www.alsa-project.org/alsa-doc/alsa-howto/c1660.htm">Chapter 6</uri>
235of the <uri link="http://www.alsa-project.org/alsa-doc/alsa-howto/alsa-howto.html">ALSA Howto</uri>. 235of the <uri link="http://www.alsa-project.org/alsa-doc/alsa-howto/alsa-howto.html">ALSA Howto</uri>.
236</note> 236</note>
237</p> 237</p>
238<p> 238<p>
239Last thing to do in this file, at the very bottom, check if these lines are there and uncommented: 239Last thing to do in this file, almost at the end, check if these lines are there and uncommented:
240<pre caption="at the very bottom of /etc/modules.d/alsa"> 240<pre caption="Near the end of /etc/modules.d/alsa">
241alias /dev/mixer snd-mixer-oss 241alias /dev/mixer snd-mixer-oss
242alias /dev/dsp snd-pcm-oss 242alias /dev/dsp snd-pcm-oss
243alias /dev/midi snd-seq-oss 243alias /dev/midi snd-seq-oss
244</pre> 244</pre>
245</p> 245</p>
246<p> 246<p>
247Now double-check the file <path>/etc/modules.d/alsa</path> and when you're sure everyting is ok, run <c>update-modules</c>. 247Now double-check the file <path>/etc/modules.d/alsa</path> and when you're sure everyting is ok, run <c>update-modules</c>.
248<pre> 248<pre>
249# <c>update-modules</c> 249# <c>update-modules</c>
250</pre> 250</pre>
251</p> 251</p>
252<note> 252<note>
253Running <c>update-modules</c> here will insert the data from <path>/etc/modules.d/alsa</path> into <path>/etc/modules.conf</path> 253Running <c>update-modules</c> here will insert the data from <path>/etc/modules.d/alsa</path> into <path>/etc/modules.conf</path>
254</note> 254</note>
255<p> 255<p>
256You should also verify that /etc/devfsd.conf has the alsa devices and permissions correctly registered. 256You should also verify that /etc/devfsd.conf has the alsa devices and permissions correctly registered.
257</p> 257</p>
258<pre> 258<pre caption="/etc/devfsd.conf">
259# nano -w /etc/devfsd.conf
260</pre>
261<pre>
262# ALSA/OSS stuff 259# ALSA/OSS stuff
263# Comment/change these if you want to change the permissions on 260# Comment/change these if you want to change the permissions on
264# the audio devices 261# the audio devices
265LOOKUP snd MODLOAD ACTION snd 262LOOKUP snd MODLOAD ACTION snd
266LOOKUP dsp MODLOAD 263LOOKUP dsp MODLOAD
267LOOKUP mixer MODLOAD 264LOOKUP mixer MODLOAD
268LOOKUP midi MODLOAD 265LOOKUP midi MODLOAD
269REGISTER sound/.* PERMISSIONS root.audio 660 266REGISTER sound/.* PERMISSIONS root.audio 660
270REGISTER snd/.* PERMISSIONS root.audio 660 267REGISTER snd/.* PERMISSIONS root.audio 660
271</pre> 268</pre>
272<note> 269<note>
273Notice that devfsd.conf sets /dev/sound permissions to be root.audio. Thus, for non-root users to use audio they will have to be part of the audio group. 270Notice that devfsd.conf sets /dev/sound permissions to be root.audio. Thus, for non-root users to use audio they will have to be part of the audio group.
274</note> 271</note>
275</body> 272</body>
276</section> 273</section>
336</p> 333</p>
337When you reboot your system, the <e>alsasound</e> init script will properly save and restore your volume settings. 334When you reboot your system, the <e>alsasound</e> init script will properly save and restore your volume settings.
338</body> 335</body>
339</section> 336</section>
340</chapter> 337</chapter>
341<chapter> 338<chapter>
342<title>Final Notes</title> 339<title>Final Notes</title>
343<section> 340<section>
344 <title>After kernel-upgrades..</title> 341 <title>After kernel-upgrades..</title>
345<body> 342<body>
346<p>When you ever rebuild your kernel, or upgrade to another kernel, you'll have to rebuild the ALSA modules.</p> 343<p>When you ever rebuild your kernel, or upgrade to another kernel, you'll have to rebuild the ALSA modules.</p>
347<p>Although you might have installed <c>alsa-driver</c>, <c>alsa-libs</c> and <c>alsa-utils</c>, only the first will 344<p>Although you might have installed <c>alsa-driver</c>, <c>alsa-libs</c> and <c>alsa-utils</c>, only the first will
348have to be installed again, since it will put the alsa modules in 345have to be installed again, since it will put the alsa modules in
349<path>/lib/modules/*/kernel/sound/pci/</path>.</p> 346<path>/lib/modules/*/kernel/sound/pci/</path>.</p>
350<pre caption="needed after each kernel compile"> 347<pre caption="needed after each kernel compile">
351emerge alsa-driver 348# <c>emerge alsa-driver</c>
352</pre> 349</pre>
353</body> 350</body>
354</section> 351</section>
355<section> 352<section>
356 <title>/etc/modules.autoload</title> 353 <title>/etc/modules.autoload</title>
357<body> 354<body>
358<p>You won't have to edit this file for use with ALSA. After our <c>rc-update add alsasound boot</c>, our system will 355<p>You won't have to edit this file for use with ALSA. After our <c>rc-update add alsasound boot</c>, our system will
359load the correct modules at startup.</p> 356load the correct modules at startup.</p>
360<p>It's not necessary to add <c>snd-pcm-oss</c> or <c>snd-mixer-oss</c> in this file. 357<p>It's not necessary to add <c>snd-pcm-oss</c> or <c>snd-mixer-oss</c> in this file.
361Check the <uri link="http://www.djcj.org/LAU/guide/alsbook/faq1.html">this FAQ</uri> for more info.</p> 358Check the <uri link="http://www.djcj.org/LAU/guide/alsbook/faq1.html">this FAQ</uri> for more info.</p>
362</body> 359</body>
363</section> 360</section>
364<section> 361<section>
365 <title>More links..</title> 362 <title>More links..</title>
366<body> 363<body>
367<p> 364<p>
368You could check these for additional info: 365You could check these for additional info:
369</p> 366</p>
370<p> 367<p>
371<ul> 368<ul>
372<li><uri link="http://www.gentoo.org/doc/desktop.html">The Gentoo Linux Desktop Configuration Guide</uri></li> 369<li><uri link="http://www.gentoo.org/doc/en/desktop.xml">The Gentoo Linux Desktop Configuration Guide</uri></li>
373<li><uri link="http://www.alsa-project.org">ALSA Project Homepage</uri></li> 370<li><uri link="http://www.alsa-project.org">ALSA Project Homepage</uri></li>
374<li><uri link="http://www.alsa-project.org/documentation.php3">ALSA Users Documentation</uri></li> 371<li><uri link="http://www.alsa-project.org/documentation.php3">ALSA Users Documentation</uri></li>
375<li><uri link="http://www.djcj.org">ALSA Howto's and FAQ's</uri></li> 372<li><uri link="http://www.djcj.org">ALSA Howto's and FAQ's</uri></li>
376<li><uri link="http://tldp.org/HOWTO/Sound-HOWTO/index.html">Linux Sound HOWTO</uri></li> 373<li><uri link="http://tldp.org/HOWTO/Sound-HOWTO/index.html">Linux Sound HOWTO</uri></li>
377<li><uri link="http://linux-sound.org/">Sound and MIDI Software For Linux</uri></li> 374<li><uri link="http://linux-sound.org/">Sound and MIDI Software For Linux</uri></li>
378</ul> 375</ul>
379</p> 376</p>
380</body> 377</body>
381</section> 378</section>
382</chapter> 379</chapter>
383</guide> 380</guide>

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

  ViewVC Help
Powered by ViewVC 1.1.20