/[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.15 Revision 1.16
19 Sven Vermeulen</mail> 19 Sven Vermeulen</mail>
20</author> 20</author>
21<author title="Editor"><mail link="bennyc@gentoo.org"> 21<author title="Editor"><mail link="bennyc@gentoo.org">
22 Benny Chuang</mail> 22 Benny Chuang</mail>
23</author> 23</author>
24<author title="Editor"><mail link="blubber@gentoo.org">
25 Tiemo Kieft</mail>
26</author>
24 27
25<license/> 28<license/>
26 29
27<abstract> 30<abstract>
28This guide will show you how to set up the Advanced Linux Sound Architecture (ALSA) on Gentoo Linux. 31This guide will show you how to set up the Advanced Linux Sound Architecture (ALSA) on Gentoo Linux.
29In addition to the Gentoo Linux Desktop Configuration Guide, this guide is supposed to give you more information on this subject. </abstract> 32In addition to the Gentoo Linux Desktop Configuration Guide, this guide is supposed to give you more information on this subject. </abstract>
30 33
31<version>1.3.1</version> 34<version>1.3.2</version>
32<date>September 12, 2003</date> 35<date>September 25, 2003</date>
33 36
34<chapter> 37<chapter>
35<title>Introduction</title> 38<title>Introduction</title>
36<section> 39<section>
37 <title>What is ALSA?</title> 40 <title>What is ALSA?</title>
110</p> 113</p>
111<p>If you already have a working kernel configuration, make sure you remove all sound drivers (except for Sound Card Support). 114<p>If you already have a working kernel configuration, make sure you remove all sound drivers (except for Sound Card Support).
112If you wish to do this without having to reboot, you could do like this: 115If you wish to do this without having to reboot, you could do like this:
113</p> 116</p>
114<pre> 117<pre>
115# <c>cd /usr/src/linux</c> 118# <i>cd /usr/src/linux</i>
116# <c>cp .config ~/</c> 119# <i>cp .config ~/</i>
117# <c>make mrproper</c> 120# <i>make mrproper</i>
118# <c>cp ~/.config .</c> 121# <i>cp ~/.config .</i>
119# <c>make menuconfig</c> 122# <i>make menuconfig</i>
120</pre> 123</pre>
121<p> 124<p>
122Now select <e>Sound Card Support</e> as Module (M) and deselect all other sound drivers. 125Now select <e>Sound Card Support</e> as Module (M) and deselect all other sound drivers.
123Exit and say Y to save your kernel configuration. 126Exit and say Y to save your kernel configuration.
124After that, build the modules: 127After that, build the modules:
125</p> 128</p>
126<pre> 129<pre>
127# <c>make dep clean</c> 130# <i>make dep clean</i>
128# <c>make modules modules_install</c> 131# <i>make modules modules_install</i>
129</pre> 132</pre>
130<p> 133<p>
131Before installing your new modules, this last line will delete all your previous modules, 134Before installing your new modules, this last line will delete all your previous modules,
132even the ones from a previous ALSA installation. 135even the ones from a previous ALSA installation.
133</p> 136</p>
148 <title>ALSA modules</title> 151 <title>ALSA modules</title>
149<body> 152<body>
150 153
151<p> 154<p>
152Now it's time to install the ALSA drivers for your soundcard(s). If your soundcard is PCI, you can find out the name 155Now it's time to install the ALSA drivers for your soundcard(s). If your soundcard is PCI, you can find out the name
153and type of your soundcard by looking at the output of /proc/pci 156and type of your soundcard by looking at the output of /proc/pci.
154<pre># <c>grep audio /proc/pci</c></pre> 157</p>
158<pre>
159# <i>grep audio /proc/pci</i>
155</p> 160</pre>
161
156 162
157<p> 163<p>
158<warn> 164<warn>
159If you had a previous sound setup and there are still non-ALSA sound modules loaded, unload them <e>now</e>. 165If you had a previous sound setup and there are still non-ALSA sound modules loaded, unload them <e>now</e>.
160Check with <c>lsmod</c> and use <c>rmmod</c> to unload all sound-related modules on your system. 166Check with <c>lsmod</c> and use <c>rmmod</c> to unload all sound-related modules on your system.
170Mine is <c>snd-emu10k1</c>, since I have an SBlive! soundcard, with the <e>EMU10K1</e> chipset. 176Mine is <c>snd-emu10k1</c>, since I have an SBlive! soundcard, with the <e>EMU10K1</e> chipset.
171We'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. 177We'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.
172</p> 178</p>
173 179
174<pre> 180<pre>
175# <c>env ALSA_CARDS='emu10k1' emerge alsa-driver</c> 181# <i>env ALSA_CARDS='emu10k1' emerge alsa-driver</i>
176</pre> 182</pre>
177<note> 183<note>
178You 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>. 184You 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>.
179For example, like this: <c>echo 'ALSA_CARDS="emu10k1"' >> /etc/make.conf</c> 185For example, like this: <c>echo 'ALSA_CARDS="emu10k1"' >> /etc/make.conf</c>
180</note> 186</note>
222</warn> 228</warn>
223<p> 229<p>
224Check the ALSA portion <e>at the bottom of the file</e>. 230Check the ALSA portion <e>at the bottom of the file</e>.
225By tweaking this line you can specify the max number of soundcards you have (generally, just one). 231By tweaking this line you can specify the max number of soundcards you have (generally, just one).
226</p> 232</p>
227<p>
228<pre caption="At the bottom of /etc/modules.d/alsa"> 233<pre caption="At the bottom of /etc/modules.d/alsa">
229# Set this to the correct number of cards. 234<comment>Set this to the correct number of cards.</comment>
230<c>options snd cards_limit=1</c> 235options snd cards_limit=1
231</pre>
232</p> 236</pre>
233<p> 237<p>
234Now we'll specify the sounddriver(s) ALSA should use. In the same file, edit like this: 238Now we'll specify the sounddriver(s) ALSA should use. In the same file, edit like this:
239</p>
235<pre caption="In /etc/modules.d/alsa"> 240<pre caption="In /etc/modules.d/alsa">
236## and then run `modules-update' command. 241## and then run `modules-update' command.
237## Read alsa-driver's INSTALL file in /usr/share/doc for more info. 242## Read alsa-driver's INSTALL file in /usr/share/doc for more info.
238## 243##
239## ALSA portion 244## ALSA portion
240<c>alias snd-card-0 snd-emu10k1</c> 245alias snd-card-0 snd-emu10k1
241<c>## If you have more than one, add: 246<comment>## If you have more than one, add:</comment>
242## alias snd-card-1 snd-intel8x0 247## alias snd-card-1 snd-intel8x0
243## alias snd-card-2 snd-ens1370</c> 248## alias snd-card-2 snd-ens1370
244## OSS/Free portion 249## OSS/Free portion
245## alias sound-slot-0 snd-card-0 250## alias sound-slot-0 snd-card-0
246## alias sound-slot-1 snd-card-1 251## alias sound-slot-1 snd-card-1
247## 252##
248</pre> 253</pre>
249</p>
250<p>
251<note> 254<note>
252If you have more than one soundcard, adjust the <c>cards_limit</c> value and add more snd-card aliases to the file. 255If you have more than one soundcard, adjust the <c>cards_limit</c> value and add more snd-card aliases to the file.
253I don't have experience with this, but you can find examples for configurations with two or more soundcards in 256I don't have experience with this, but you can find examples for configurations with two or more soundcards in
254<uri link="http://www.alsa-project.org/alsa-doc/alsa-howto/c1660.htm">Chapter 6</uri> 257<uri link="http://www.alsa-project.org/alsa-doc/alsa-howto/c1660.htm">Chapter 6</uri>
255of the <uri link="http://www.alsa-project.org/alsa-doc/alsa-howto/alsa-howto.html">ALSA Howto</uri>. 258of the <uri link="http://www.alsa-project.org/alsa-doc/alsa-howto/alsa-howto.html">ALSA Howto</uri>.
256</note> 259</note>
257</p>
258<p> 260<p>
259Last thing to do in this file, almost at the end, check if these lines are there and uncommented: 261Last thing to do in this file, almost at the end, check if these lines are there and uncommented:
262</p>
260<pre caption="Near the end of /etc/modules.d/alsa"> 263<pre caption="Near the end of /etc/modules.d/alsa">
261alias /dev/mixer snd-mixer-oss 264alias /dev/mixer snd-mixer-oss
262alias /dev/dsp snd-pcm-oss 265alias /dev/dsp snd-pcm-oss
263alias /dev/midi snd-seq-oss 266alias /dev/midi snd-seq-oss
264</pre> 267</pre>
265</p>
266<p> 268<p>
267Now double-check the file <path>/etc/modules.d/alsa</path> and when you're sure everyting is ok, run <c>modules-update</c>. 269Now double-check the file <path>/etc/modules.d/alsa</path> and when you're sure everyting is ok, run <c>modules-update</c>.
268<pre> 270<pre>
269# <i>modules-update</i> 271# <i>modules-update</i>
270</pre> 272</pre>
298 <title>Adding alsasound to a runlevel</title> 300 <title>Adding alsasound to a runlevel</title>
299<body> 301<body>
300<p> 302<p>
301First thing to do now, is to make ALSA startup at boottime. Like this: 303First thing to do now, is to make ALSA startup at boottime. Like this:
302<pre> 304<pre>
303# <c>rc-update add alsasound boot</c> 305# <i>rc-update add alsasound boot</i>
304</pre> 306</pre>
305</p> 307</p>
306<p> 308<p>
307<warn>Note that the alsasound script should be added to the "boot" runlevel, not the "default" runlevel.</warn> 309<warn>Note that the alsasound script should be added to the "boot" runlevel, not the "default" runlevel.</warn>
308</p> 310</p>
313<body> 315<body>
314<p> 316<p>
315Since we're Linux users, we don't want to reboot. So we'll start the alsasound script manually. 317Since we're Linux users, we don't want to reboot. So we'll start the alsasound script manually.
316</p> 318</p>
317<pre> 319<pre>
318# <c>/etc/init.d/alsasound start</c> 320# <i>/etc/init.d/alsasound start</i>
319</pre> 321</pre>
320<p> 322<p>
321ALSA is running now. If everything is ok, you should be able to see the ALSA modules loaded when running <c>lsmod</c>. 323ALSA is running now. If everything is ok, you should be able to see the ALSA modules loaded when running <c>lsmod</c>.
322However, sound won't work yet, because the channels are still muted. We need <c>amixer</c> for this. 324However, sound won't work yet, because the channels are still muted. We need <c>amixer</c> for this.
323</p> 325</p>
368<p>When you ever rebuild your kernel, or upgrade to another kernel, you'll have to rebuild the ALSA modules.</p> 370<p>When you ever rebuild your kernel, or upgrade to another kernel, you'll have to rebuild the ALSA modules.</p>
369<p>Although you might have installed <c>alsa-driver</c>, <c>alsa-libs</c> and <c>alsa-utils</c>, only the first will 371<p>Although you might have installed <c>alsa-driver</c>, <c>alsa-libs</c> and <c>alsa-utils</c>, only the first will
370have to be installed again, since it will put the alsa modules in 372have to be installed again, since it will put the alsa modules in
371<path>/lib/modules/*/kernel/sound/pci/</path>.</p> 373<path>/lib/modules/*/kernel/sound/pci/</path>.</p>
372<pre caption="needed after each kernel compile"> 374<pre caption="needed after each kernel compile">
373# <c>emerge alsa-driver</c> 375# <i>emerge alsa-driver</i>
374</pre> 376</pre>
375</body> 377</body>
376</section> 378</section>
377<section> 379<section>
378 <title>/etc/modules.autoload</title> 380 <title>/etc/modules.autoload</title>

Legend:
Removed from v.1.15  
changed lines
  Added in v.1.16

  ViewVC Help
Powered by ViewVC 1.1.20