| 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.21 2003/11/23 16:30:50 swift Exp $ --> |
2 | <!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/alsa-guide.xml,v 1.28 2004/03/10 18:42:08 swift 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"> |
| … | |
… | |
| 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> |
|
|
16 | <author title="Author"> |
|
|
17 | <mail link="eradicator@gentoo.org">Jeremy Huddleston</mail> |
| 15 | </author> |
18 | </author> |
| 16 | <author title="Editor"><!-- zhen@gentoo.org --> |
19 | <author title="Editor"><!-- zhen@gentoo.org --> |
| 17 | John P. Davis |
20 | John P. Davis |
| 18 | </author> |
21 | </author> |
| 19 | <author title="Editor"> |
22 | <author title="Editor"> |
| … | |
… | |
| 23 | <mail link="bennyc@gentoo.org">Benny Chuang</mail> |
26 | <mail link="bennyc@gentoo.org">Benny Chuang</mail> |
| 24 | </author> |
27 | </author> |
| 25 | <author title="Editor"> |
28 | <author title="Editor"> |
| 26 | <mail link="blubber@gentoo.org">Tiemo Kieft</mail> |
29 | <mail link="blubber@gentoo.org">Tiemo Kieft</mail> |
| 27 | </author> |
30 | </author> |
| 28 | |
31 | <author title="Editor"> |
| 29 | <license/> |
32 | <mail link="erwin@gentoo.org">Erwin</mail> |
|
|
33 | </author> |
| 30 | |
34 | |
| 31 | <abstract> |
35 | <abstract> |
| 32 | This guide will show you how to set up the Advanced Linux Sound Architecture |
36 | This guide will show you how to set up the Advanced Linux Sound Architecture |
| 33 | (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 |
| 34 | Guide, this guide is supposed to give you more information on this subject. |
38 | Guide, this guide is supposed to give you more information on this subject. |
| 35 | </abstract> |
39 | </abstract> |
| 36 | |
40 | |
|
|
41 | <license/> |
|
|
42 | |
| 37 | <version>1.3.4</version> |
43 | <version>1.4.1</version> |
| 38 | <date>November 23, 2003</date> |
44 | <date>March 10, 2004</date> |
| 39 | |
45 | |
| 40 | <chapter> |
46 | <chapter> |
| 41 | <title>Introduction</title> |
47 | <title>Introduction</title> |
| 42 | <section> |
48 | <section> |
| 43 | <title>What is ALSA?</title> |
49 | <title>What is ALSA?</title> |
| 44 | <body> |
50 | <body> |
| 45 | |
51 | |
| 46 | <p> |
52 | <p> |
| 47 | The Advanced Linux Sound Architecture (ALSA) is a project to improve the Linux |
53 | The Advanced Linux Sound Architecture (ALSA) is a project to improve the Linux |
| 48 | sound subsystem by rewriting large chunks of it. It is anticipated that ALSA |
54 | sound subsystem by rewriting large chunks of it. It has replaced the Open |
| 49 | will make it into Linux kernel 2.6.x (or 3.x.x -- whichever comes first) as it |
55 | Sound System (OSS) as the default sound subsystem in the 2.6 kernel, but it |
| 50 | becomes ready. |
56 | can be used with either 2.4 or 2.6 kernels. |
| 51 | </p> |
57 | </p> |
| 52 | |
58 | |
| 53 | <p> |
59 | <p> |
| 54 | ALSA provides audio and MIDI functionality for Linux. |
60 | ALSA provides audio and MIDI functionality for Linux. |
| 55 | </p> |
61 | </p> |
| … | |
… | |
| 87 | <section> |
93 | <section> |
| 88 | <title>Why use ALSA?</title> |
94 | <title>Why use ALSA?</title> |
| 89 | <body> |
95 | <body> |
| 90 | |
96 | |
| 91 | <p> |
97 | <p> |
| 92 | If your soundcard is supported by the Linux kernel sound system or the |
98 | Your sound card may be supported by modules available in the 2.4 kernel (these |
| 93 | commercial OSS/4Front sound driver system, which can be found in all 2.4.x |
99 | are also provided in the 2.6 kernel under the 'Open Sound System (DEPRECATED)' |
| 94 | Linux kernels, you could just aswell build <e>those modules</e> for use with |
100 | option). Additionally, you might be able to use the commercial OSS/4Front sound |
| 95 | your soundcard. If you want this, just read through the <uri |
101 | driver system. If you wish to use either of these systems, then you should read |
| 96 | link="http://www.tldp.org/HOWTO/Sound-HOWTO/index.html">Linux Sound HOWTO</uri>. |
102 | through the <uri link="http://www.tldp.org/HOWTO/Sound-HOWTO/index.html">Linux |
|
|
103 | Sound HOWTO</uri>. |
| 97 | </p> |
104 | </p> |
| 98 | |
105 | |
| 99 | <p> |
106 | <p> |
| 100 | However, those OSS/4Front drivers have some limitations -- being commercial is |
107 | The OSS/4Front drivers have some limitations, however. Being commercial is |
| 101 | one. ALSA is an attempt to go beyond these limitations and to do so in an open |
108 | one. ALSA is an attempt to go beyond these limitations with an open source |
| 102 | source fashion. ALSA is a fully GPL and LGPL'ed sound driver system, that |
109 | development model. ALSA is a fully GPL and LGPL'ed sound driver system that |
| 103 | provides a professional quality system for recording, playback, and MIDI |
110 | provides a professional quality system for recording, playback, and MIDI |
| 104 | sequencing. |
111 | sequencing. |
| 105 | </p> |
112 | </p> |
| 106 | |
113 | |
| 107 | </body> |
114 | </body> |
| … | |
… | |
| 142 | <section> |
149 | <section> |
| 143 | <title>Kernel modules</title> |
150 | <title>Kernel modules</title> |
| 144 | <body> |
151 | <body> |
| 145 | |
152 | |
| 146 | <p> |
153 | <p> |
| 147 | Since we're still using 2.4.x kernel sources, we'll have to compile kernel |
154 | When using the 2.4 kernels, you'll need to compile the alsa drivers separately |
| 148 | modules and ALSA modules separately. People who are using a 2.5.x kernel can |
155 | from the rest of the kernel. If you are using a 2.6 kernel, you have the |
| 149 | do this from within their kernel configuration, since the ALSA modules are |
156 | option of using the ALSA drivers included in the kernel or those provided |
| 150 | included in the kernel sources and should be built there. |
157 | by the <c>alsa-driver</c> package. |
| 151 | </p> |
158 | </p> |
| 152 | |
159 | |
| 153 | <p> |
160 | <p> |
| 154 | First we'll make sure that our kernel configuration is ready for use with ALSA. |
161 | First we'll make sure that our kernel configuration is ready for use with ALSA. |
| 155 | All you need in your kernel configuration is having Sound Card Support set to |
162 | All you need in your kernel configuration is having Sound Card Support set to |
| 156 | be built as a module (M). This will build <path>soundcore.o</path>. |
163 | be built as a module (M). This will build <path>soundcore.o</path>. |
| 157 | </p> |
164 | </p> |
| 158 | |
165 | |
| 159 | <note> |
166 | <note> |
| 160 | Possibly, this will also work when you built Sound Card Support in the kernel |
167 | Possibly, this will also work if you build 'Sound Card Support' in the kernel |
| 161 | (Y) instead of building it as a module (M). However, the official ALSA |
168 | (Y) instead of building it as a module (M). However, the official ALSA |
| 162 | documentation suggests building it as a module, since ALSA will try loading it. |
169 | documentation suggests building it as a module, since ALSA will try loading it. |
| 163 | </note> |
170 | </note> |
| 164 | |
171 | |
| 165 | <p> |
172 | <p> |
| … | |
… | |
| 176 | # <i>make menuconfig</i> |
183 | # <i>make menuconfig</i> |
| 177 | </pre> |
184 | </pre> |
| 178 | |
185 | |
| 179 | <p> |
186 | <p> |
| 180 | Now select <e>Sound Card Support</e> as Module (M) and deselect all other sound |
187 | Now select <e>Sound Card Support</e> as Module (M) and deselect all other sound |
| 181 | drivers. Exit and say Y to save your kernel configuration. After that, build |
188 | drivers. If you are using 2.6 with the ALSA modules provided by the kernel, select |
| 182 | the modules: |
189 | the drivers for your sound card as well (look in the <uri |
|
|
190 | link="#doc_chap2_sect3">ALSA modules</uri> section below if you need help |
|
|
191 | choosing the right drivers). Exit and say Y to save your kernel configuration. |
|
|
192 | After that, build the modules: |
| 183 | </p> |
193 | </p> |
| 184 | |
194 | |
| 185 | <pre caption="Kernel compilation"> |
195 | <pre caption="2.4 Kernel compilation"> |
| 186 | # <i>make dep clean</i> |
196 | # <i>make dep clean</i> |
| 187 | # <i>make modules modules_install</i> |
197 | # <i>make modules modules_install</i> |
| 188 | </pre> |
198 | </pre> |
|
|
199 | |
|
|
200 | <pre caption="2.6 Kernel compilation"> |
|
|
201 | # <i>make</i> |
|
|
202 | # <i>make modules_install</i> |
|
|
203 | </pre> |
|
|
204 | |
|
|
205 | <p> |
|
|
206 | If you compiled 2.6 with the ALSA modules provided by the kernel, please skip to |
|
|
207 | <uri link="#doc_chap2_sect4">Configuration of ALSA</uri> below. |
|
|
208 | </p> |
| 189 | |
209 | |
| 190 | <p> |
210 | <p> |
| 191 | Before installing your new modules, this last line will delete all your previous |
211 | Before installing your new modules, this last line will delete all your previous |
| 192 | modules, even the ones from a previous ALSA installation. |
212 | modules, even the ones from a previous ALSA installation. |
| 193 | </p> |
213 | </p> |
| … | |
… | |
| 214 | </pre> |
234 | </pre> |
| 215 | |
235 | |
| 216 | <warn> |
236 | <warn> |
| 217 | If you had a previous sound setup and there are still non-ALSA sound modules |
237 | If you had a previous sound setup and there are still non-ALSA sound modules |
| 218 | loaded, unload them <e>now</e>. Check with <c>lsmod</c> and use <c>rmmod</c> |
238 | loaded, unload them <e>now</e>. Check with <c>lsmod</c> and use <c>rmmod</c> |
| 219 | to unload all sound-related modules on your system. |
239 | to unload all sound-related modules on your system. If <c>rmmod</c> complains |
|
|
240 | about not being able to unload the modules because they are in use, try using |
|
|
241 | <c>/etc/init.c/alsasound stop</c> to remove them. |
| 220 | </warn> |
242 | </warn> |
| 221 | |
243 | |
| 222 | <p> |
244 | <p> |
| 223 | We could simply do an <c>emerge alsa-driver</c> now, this would compile and |
245 | We could simply do an <c>emerge alsa-driver</c> now, this would compile and |
| 224 | install <e>all</e> ALSA sound drivers. |
246 | install <e>all</e> ALSA sound drivers. |
| … | |
… | |
| 232 | since I have an SBlive! soundcard, with the <e>EMU10K1</e> chipset. We'll set |
254 | since I have an SBlive! soundcard, with the <e>EMU10K1</e> chipset. We'll set |
| 233 | ALSA_CARDS environment to the value of the module name before emerging (but |
255 | ALSA_CARDS environment to the value of the module name before emerging (but |
| 234 | without the snd prefix), so emerge will only compile the drivers we need. |
256 | without the snd prefix), so emerge will only compile the drivers we need. |
| 235 | </p> |
257 | </p> |
| 236 | |
258 | |
| 237 | <pre caption="Compile correct modules"> |
259 | <pre caption="With 2.4 Kernel"> |
| 238 | # <i>env ALSA_CARDS='emu10k1' emerge alsa-driver</i> |
260 | # <i>env ALSA_CARDS='emu10k1' emerge alsa-driver</i> |
| 239 | </pre> |
261 | </pre> |
|
|
262 | |
|
|
263 | <pre caption="With 2.6 Kernel"> |
|
|
264 | # <i>env ALSA_CARDS='emu10k1' emerge \>=media-sound/alsa-driver-1.0.2c</i> |
|
|
265 | </pre> |
|
|
266 | |
|
|
267 | <note> |
|
|
268 | 2.6 kernels require alsa-driver to be at least version 1.0.2c. |
|
|
269 | </note> |
| 240 | |
270 | |
| 241 | <note> |
271 | <note> |
| 242 | You can also add this value in <path>/etc/make.conf</path>, so when you have |
272 | You can also add this value in <path>/etc/make.conf</path>, so when you have |
| 243 | to emerge the alsa-driver later on you can just run <c>emerge alsa-driver</c>. |
273 | to emerge the alsa-driver later on you can just run <c>emerge alsa-driver</c>. |
| 244 | For example, like this: <c>echo 'ALSA_CARDS="emu10k1"' >> /etc/make.conf</c> |
274 | For example, like this: <c>echo 'ALSA_CARDS="emu10k1"' >> /etc/make.conf</c> |
| … | |
… | |
| 258 | <note> |
288 | <note> |
| 259 | If you plan on recompiling your kernels numerous times, it might |
289 | If you plan on recompiling your kernels numerous times, it might |
| 260 | be adviseable to emerge <c>alsa-driver</c> with <c>--buildpkg</c>. This |
290 | be adviseable to emerge <c>alsa-driver</c> with <c>--buildpkg</c>. This |
| 261 | will create a binary package for it. Later, after recompiling your kernel, |
291 | will create a binary package for it. Later, after recompiling your kernel, |
| 262 | you can just do <c>emerge --usepkg alsa-driver</c> which will install the |
292 | you can just do <c>emerge --usepkg alsa-driver</c> which will install the |
| 263 | binary package instead of recompiling it completely. |
293 | binary package instead of recompiling it completely. If 'depmod -a' ever |
|
|
294 | complains about sound drivers having unreferenced symbols when you do this, |
|
|
295 | you will need to recompile the alsa-driver package from source. |
| 264 | </note> |
296 | </note> |
| 265 | |
297 | |
| 266 | <p> |
298 | <p> |
| 267 | After this, the ALSA modules should be installed on your system. |
299 | After this, the ALSA modules should be installed on your system. |
| 268 | </p> |
300 | </p> |
| … | |
… | |
| 290 | Hereafter, we need to edit <path>/etc/modules.d/alsa</path>. |
322 | Hereafter, we need to edit <path>/etc/modules.d/alsa</path>. |
| 291 | </p> |
323 | </p> |
| 292 | |
324 | |
| 293 | <warn> |
325 | <warn> |
| 294 | There is no need to edit <path>/etc/modules.conf</path>. Instead, always edit |
326 | There is no need to edit <path>/etc/modules.conf</path>. Instead, always edit |
| 295 | files in <path>/etc/modules.d</path>. |
327 | files in <path>/etc/modules.d</path> and run <c>modules-update</c> to generate |
|
|
328 | <path>/etc/modules.conf</path> from the updated data. |
| 296 | </warn> |
329 | </warn> |
| 297 | |
|
|
| 298 | <p> |
|
|
| 299 | Check the ALSA portion <e>at the bottom of the file</e>. By tweaking this line |
|
|
| 300 | you can specify the max number of soundcards you have (generally, just one). |
|
|
| 301 | </p> |
|
|
| 302 | |
|
|
| 303 | <pre caption="At the bottom of /etc/modules.d/alsa"> |
|
|
| 304 | <comment>Set this to the correct number of cards.</comment> |
|
|
| 305 | options snd cards_limit=1 |
|
|
| 306 | </pre> |
|
|
| 307 | |
|
|
| 308 | <p> |
|
|
| 309 | Now we'll specify the sounddriver(s) ALSA should use. In the same file, edit |
|
|
| 310 | like this: |
|
|
| 311 | </p> |
|
|
| 312 | |
330 | |
| 313 | <pre caption="In /etc/modules.d/alsa"> |
331 | <pre caption="In /etc/modules.d/alsa"> |
| 314 | ## and then run `modules-update' command. |
332 | ## and then run `modules-update' command. |
| 315 | ## Read alsa-driver's INSTALL file in /usr/share/doc for more info. |
333 | ## Read alsa-driver's INSTALL file in /usr/share/doc for more info. |
| 316 | ## |
334 | ## |
| 317 | ## ALSA portion |
335 | ## ALSA portion |
| 318 | alias snd-card-0 snd-emu10k1 |
336 | alias snd-card-0 snd-emu10k1 |
| 319 | <comment>## If you have more than one, add:</comment> |
|
|
| 320 | ## alias snd-card-1 snd-intel8x0 |
337 | ## alias snd-card-1 snd-intel8x0 |
| 321 | ## alias snd-card-2 snd-ens1370 |
338 | ## alias snd-card-2 snd-ens1370 |
| 322 | ## OSS/Free portion |
339 | ## OSS/Free portion |
| 323 | ## alias sound-slot-0 snd-card-0 |
340 | alias sound-slot-0 snd-card-0 |
| 324 | ## alias sound-slot-1 snd-card-1 |
341 | ## alias sound-slot-1 snd-card-1 |
|
|
342 | ## alias sound-slot-2 snd-card-2 |
| 325 | ## |
343 | ## |
| 326 | </pre> |
344 | </pre> |
| 327 | |
345 | |
| 328 | <note> |
346 | <note> |
| 329 | If you have more than one soundcard, adjust the <c>cards_limit</c> value and add |
347 | If you have more than one soundcard, add more <c>snd-card</c> and <c>snd-slot</c> |
| 330 | more snd-card aliases to the file. I don't have experience with this, but you |
348 | aliases and adjust the <c>cards_limit</c> value at the end of the file. You can |
| 331 | can find examples for configurations with two or more soundcards in <uri |
349 | find examples for configurations with two or more soundcards in <uri |
| 332 | link="http://www.alsa-project.org/alsa-doc/alsa-howto/c1660.htm">Chapter 6</uri> |
350 | link="http://www.alsa-project.org/alsa-doc/alsa-howto/c1660.htm">Chapter 6</uri> |
| 333 | of the <uri |
351 | of the <uri |
| 334 | link="http://www.alsa-project.org/alsa-doc/alsa-howto/alsa-howto.html">ALSA |
352 | link="http://www.alsa-project.org/alsa-doc/alsa-howto/alsa-howto.html">ALSA |
| 335 | Howto</uri>. |
353 | Howto</uri>. |
| 336 | </note> |
354 | </note> |
| … | |
… | |
| 345 | alias /dev/dsp snd-pcm-oss |
363 | alias /dev/dsp snd-pcm-oss |
| 346 | alias /dev/midi snd-seq-oss |
364 | alias /dev/midi snd-seq-oss |
| 347 | </pre> |
365 | </pre> |
| 348 | |
366 | |
| 349 | <p> |
367 | <p> |
| 350 | Now double-check the file <path>/etc/modules.d/alsa</path> and when you're sure |
368 | After double-checking the file <path>/etc/modules.d/alsa</path> to make sure |
| 351 | everyting is ok, run <c>modules-update</c>. |
369 | everyting is ok, run <c>modules-update</c>. |
| 352 | </p> |
370 | </p> |
| 353 | |
371 | |
| 354 | <pre caption="Running modules-update"> |
372 | <pre caption="Running modules-update"> |
| 355 | # <i>modules-update</i> |
373 | # <i>modules-update</i> |
| … | |
… | |
| 392 | <section> |
410 | <section> |
| 393 | <title>Adding alsasound to a runlevel</title> |
411 | <title>Adding alsasound to a runlevel</title> |
| 394 | <body> |
412 | <body> |
| 395 | |
413 | |
| 396 | <p> |
414 | <p> |
|
|
415 | An init script is provided for you which will install all neccessary sound drivers |
|
|
416 | for your card (including the OSS support drivers if you set USE=oss). The first |
| 397 | First thing to do now, is to make ALSA startup at boottime. Like this: |
417 | thing to do now is to make ALSA startup at boot time: |
| 398 | </p> |
418 | </p> |
| 399 | |
419 | |
| 400 | <pre caption="Add ALSA to the default runlevel"> |
420 | <pre caption="Add ALSA to the boot runlevel"> |
| 401 | # <i>rc-update add alsasound boot</i> |
421 | # <i>rc-update add alsasound boot</i> |
| 402 | </pre> |
422 | </pre> |
| 403 | |
423 | |
| 404 | <warn> |
424 | <warn> |
| 405 | Note that the alsasound script should be added to the "boot" runlevel, not the |
425 | Note that the alsasound script should be added to the "boot" runlevel, not the |
| … | |
… | |
| 422 | </pre> |
442 | </pre> |
| 423 | |
443 | |
| 424 | <p> |
444 | <p> |
| 425 | ALSA is running now. If everything is ok, you should be able to see the ALSA |
445 | ALSA is running now. If everything is ok, you should be able to see the ALSA |
| 426 | modules loaded when running <c>lsmod</c>. However, sound won't work yet, |
446 | modules loaded when running <c>lsmod</c>. However, sound won't work yet, |
| 427 | because the channels are still muted. We need <c>amixer</c> for this. |
447 | because the channels are still muted. We need <c>amixer</c> to fix this. |
| 428 | </p> |
448 | </p> |
| 429 | |
449 | |
| 430 | <pre caption = "Running amixer"> |
450 | <pre caption = "Running amixer"> |
| 431 | # <i>amixer</i> |
451 | # <i>amixer</i> |
| 432 | </pre> |
452 | </pre> |
| 433 | |
453 | |
|
|
454 | <!-- alsasound init script will do this for them now... |
| 434 | <warn> |
455 | <warn> |
| 435 | You shouldn't get this, but <e>if</e> you get an error about "amixer: Mixer |
456 | You shouldn't get this, but <e>if</e> you get an error about "amixer: Mixer |
| 436 | attach default error: No such file or directory", you should manually modprobe |
457 | attach default error: No such file or directory", you should manually modprobe |
| 437 | <c>snd-mixer-oss</c> and <c>snd-pcm-oss</c> once. After that run amixer again. |
458 | <c>snd-mixer-oss</c> and <c>snd-pcm-oss</c> once. After that run amixer again. |
| 438 | </warn> |
459 | </warn> |
| … | |
… | |
| 440 | <pre caption="Only if you get an error when running amixer"> |
461 | <pre caption="Only if you get an error when running amixer"> |
| 441 | # <i>modprobe snd-mixer-oss</i> |
462 | # <i>modprobe snd-mixer-oss</i> |
| 442 | # <i>modprobe snd-pcm-oss</i> |
463 | # <i>modprobe snd-pcm-oss</i> |
| 443 | # <i>amixer</i> |
464 | # <i>amixer</i> |
| 444 | </pre> |
465 | </pre> |
|
|
466 | --> |
| 445 | |
467 | |
| 446 | <p> |
468 | <p> |
| 447 | If you got this far, now unmute Master and PCM channels. Some hardware |
469 | If you got this far, now unmute Master and PCM channels. Some hardware |
| 448 | even requires you to unmute the center channel or even the surround |
470 | even requires you to unmute the center channel or even the surround |
| 449 | channel. |
471 | channel. |
| … | |
… | |
| 465 | to your liking; the ncurses-based <c>alsamixer</c> is a great way to get them |
487 | to your liking; the ncurses-based <c>alsamixer</c> is a great way to get them |
| 466 | "just so". |
488 | "just so". |
| 467 | </p> |
489 | </p> |
| 468 | |
490 | |
| 469 | <p> |
491 | <p> |
| 470 | You may want to emerge <c>alsa-xmms</c> as that will provide ALSA support for |
492 | When you reboot your system, the <c>alsasound</c> init script will |
| 471 | XMMS. |
493 | properly save and restore your volume settings. |
| 472 | </p> |
|
|
| 473 | |
|
|
| 474 | <p> |
494 | </p> |
| 475 | When you reboot your system, the <c>alsasound</c> init script will properly saveand restore your volume settings. |
495 | |
|
|
496 | </body> |
|
|
497 | </section> |
|
|
498 | </chapter> |
|
|
499 | |
|
|
500 | <chapter> |
|
|
501 | <title>MIDI Support</title> |
|
|
502 | <section> |
|
|
503 | <title>Hardware Synthesizer</title> |
|
|
504 | <body> |
|
|
505 | |
| 476 | </p> |
506 | <p> |
|
|
507 | Some sound cards (SBLive, Audigy, and others) come with onboard MIDI synthesizers. |
|
|
508 | To use them, you must first install the <c>awesfx</c> package. |
|
|
509 | </p> |
|
|
510 | |
|
|
511 | <pre caption="Install awesfx"> |
|
|
512 | # <i>emerge awesfx</i> |
|
|
513 | </pre> |
|
|
514 | |
|
|
515 | <p> |
|
|
516 | Now, you should place your sound fonts in <path>/usr/share/sfbank/</path>. You |
|
|
517 | can probably get the sound fonts off of the windows driver CD for your sound card. |
|
|
518 | With the SBLive, one of the included sound font files is called 8MBGMSFX.SF2. |
|
|
519 | </p> |
|
|
520 | |
|
|
521 | <note> |
|
|
522 | On some recents CD supplied with a SBLive, the font file is called CT4GMSFX.SF2. |
|
|
523 | If it is your case, please replace all occurences of 8MBGMSFX.SF2 with |
|
|
524 | CT4GMSFX.SF2 in the examples. |
|
|
525 | </note> |
|
|
526 | |
|
|
527 | <p> |
|
|
528 | After copying over the sound font you want to use, you need to select it for use |
|
|
529 | with <c>/usr/bin/sfxload</c>. |
|
|
530 | </p> |
|
|
531 | |
|
|
532 | <pre caption="Selecting the sound font"> |
|
|
533 | # <i>/usr/bin/sfxload /usr/share/sfbank/8MBGMSFX.SF2</i> |
|
|
534 | </pre> |
|
|
535 | |
|
|
536 | <note> |
|
|
537 | You may wish to place this command in /etc/conf.d/local.start or in the startup |
|
|
538 | script for your sound card (/etc/alsa.d/emu10k1) to make sure it gets loaded |
|
|
539 | at startup. |
|
|
540 | </note> |
|
|
541 | |
|
|
542 | </body> |
|
|
543 | </section> |
|
|
544 | <section> |
|
|
545 | <title>Timidity++ Virtual Synthesizer</title> |
|
|
546 | <body> |
|
|
547 | |
|
|
548 | <p> |
|
|
549 | If your sound card does not come with a hardware synthesizer (or you don't |
|
|
550 | want to use it), you can use <c>timidity++</c> to provide you with a virtual |
|
|
551 | synthesizer. Start by emerging this package: |
|
|
552 | </p> |
|
|
553 | |
|
|
554 | <pre caption="Installing Timidity++"> |
|
|
555 | # <i>emerge timidity++</i> |
|
|
556 | </pre> |
|
|
557 | |
|
|
558 | <p> |
|
|
559 | A sample configuration file will be installed for you in |
|
|
560 | <path>/usr/share/timitidy/config/timidity.cfg</path>. If you don't have a |
|
|
561 | timidity++ configuration setup yet, you can just use this one. |
|
|
562 | </p> |
|
|
563 | |
|
|
564 | <pre caption="Use the default Timidity++ configuration file"> |
|
|
565 | # <i>cp /usr/share/timitidy/config/timidity.cfg /usr/share/timidity</i> |
|
|
566 | </pre> |
|
|
567 | |
|
|
568 | <p> |
|
|
569 | Now, you need to enable the init script to run when your system boots |
|
|
570 | and enable it now. |
|
|
571 | </p> |
|
|
572 | |
|
|
573 | <pre caption="Add timidity to default runlevel and start it now"> |
|
|
574 | # <i>rc-update add timidity default</i> |
|
|
575 | # <i>/etc/init.d/timidity start</i> |
|
|
576 | </pre> |
|
|
577 | |
|
|
578 | <p> |
|
|
579 | Note that there is a configuration file for the init script that you can |
|
|
580 | modify in <path>/etc/conf.d/timidity</path>, and sane defaults have been |
|
|
581 | chosen for you. |
|
|
582 | </p> |
|
|
583 | |
|
|
584 | </body> |
|
|
585 | </section> |
|
|
586 | <section> |
|
|
587 | <title>Testing MIDI Support</title> |
|
|
588 | <body> |
|
|
589 | |
|
|
590 | <p> |
|
|
591 | You can use <c>pmidi</c> to test out your MIDI configuration. To do so, |
|
|
592 | you need to first emerge its package. |
|
|
593 | </p> |
|
|
594 | |
|
|
595 | <pre caption="Installing pmidi"> |
|
|
596 | # <i>emerge pmidi</i> |
|
|
597 | </pre> |
|
|
598 | |
|
|
599 | <p> |
|
|
600 | The '-l' command line option to pmidi will list all detected MIDI output ports, |
|
|
601 | and '-p' can be used to select the one for playback. Check to see what |
|
|
602 | MIDI output ports are available on your system: |
|
|
603 | </p> |
|
|
604 | |
|
|
605 | <pre caption="Listed ports when using hardware synthesizer"> |
|
|
606 | # <i>pmidi -l</i> |
|
|
607 | Port Client name Port name |
|
|
608 | 64:0 Rawmidi 0 - EMU10K1 MPU-401 (U EMU10K1 MPU-401 (UART) |
|
|
609 | 65:0 Emu10k1 WaveTable Emu10k1 Port 0 |
|
|
610 | 65:1 Emu10k1 WaveTable Emu10k1 Port 1 |
|
|
611 | 65:2 Emu10k1 WaveTable Emu10k1 Port 2 |
|
|
612 | 65:3 Emu10k1 WaveTable Emu10k1 Port 3 |
|
|
613 | </pre> |
|
|
614 | |
|
|
615 | <pre caption="Listed ports when using Timidity++"> |
|
|
616 | # <i>pmidi -l</i> |
|
|
617 | Port Client name Port name |
|
|
618 | 64:0 Rawmidi 0 - ES1371 ES1371 |
|
|
619 | 128:0 TiMidity TiMidity port 0 |
|
|
620 | 128:1 TiMidity TiMidity port 1 |
|
|
621 | 128:2 TiMidity TiMidity port 2 |
|
|
622 | 128:3 TiMidity TiMidity port 3 |
|
|
623 | </pre> |
|
|
624 | |
|
|
625 | <p> |
|
|
626 | Now, try playing a MIDI file to make sure everything works: |
|
|
627 | </p> |
|
|
628 | |
|
|
629 | <pre caption="Play a song"> |
|
|
630 | # <i>pmidi -p 65:0 Final\ Fantasy\ 7\ -\ Aerith\'s\ Theme.mid</i> |
|
|
631 | or |
|
|
632 | # <i>pmidi -p 128:0 Final\ Fantasy\ 7\ -\ Aerith\'s\ Theme.mid</i> |
|
|
633 | </pre> |
| 477 | |
634 | |
| 478 | </body> |
635 | </body> |
| 479 | </section> |
636 | </section> |
| 480 | </chapter> |
637 | </chapter> |
| 481 | |
638 | |
| 482 | <chapter> |
639 | <chapter> |
| 483 | <title>Final Notes</title> |
640 | <title>Final Notes</title> |
| 484 | <section> |
641 | <section> |
| 485 | <title>After kernel-upgrades..</title> |
642 | <title>After kernel-upgrades...</title> |
| 486 | <body> |
643 | <body> |
| 487 | |
644 | |
| 488 | <p> |
645 | <p> |
| 489 | When you ever rebuild your kernel, or upgrade to another kernel, you'll have to |
646 | When you ever rebuild your kernel, or upgrade to another kernel, you'll have to |
| 490 | rebuild the ALSA modules. |
647 | rebuild the ALSA modules. |
| 491 | </p> |
648 | </p> |
| 492 | |
649 | |
| 493 | <p> |
650 | <p> |
| 494 | Although you might have installed <c>alsa-driver</c>, <c>alsa-libs</c> and |
651 | Although you might have installed <c>alsa-driver</c>, <c>alsa-lib</c> and |
| 495 | <c>alsa-utils</c>, only the first will have to be installed again, since it will |
652 | <c>alsa-utils</c>, only the first will have to be installed again, since it will |
| 496 | put the alsa modules in <path>/lib/modules/*/kernel/sound/pci/</path>. |
653 | put the alsa modules in <path>/lib/modules/*/kernel/sound/pci/</path>. |
| 497 | </p> |
654 | </p> |
| 498 | |
655 | |
| 499 | <pre caption="needed after each kernel compile"> |
656 | <pre caption="Needed after each kernel compile"> |
| 500 | # <i>emerge alsa-driver</i> |
657 | # <i>emerge alsa-driver</i> |
| 501 | </pre> |
658 | </pre> |
| 502 | |
659 | |
| 503 | </body> |
660 | </body> |
| 504 | </section> |
661 | </section> |
| 505 | <section> |
662 | <section> |
|
|
663 | <title>alsa-tools and alsa-firmware</title> |
|
|
664 | <body> |
|
|
665 | |
|
|
666 | <p> |
|
|
667 | The alsa-tools and alsa-firmware packages contain tools useful to only users of |
|
|
668 | specific sound cards. Most users will not need these. If you do need alsa-tools, |
|
|
669 | you can set the environment variable 'ALSA_TOOLS' to install just the needed tools |
|
|
670 | for your card: |
|
|
671 | </p> |
|
|
672 | |
|
|
673 | <pre caption="Installing alsa-tools"> |
|
|
674 | # <i>env ALSA_TOOLS='as10k1 ac3dec' emerge alsa-tools</i> |
|
|
675 | </pre> |
|
|
676 | |
|
|
677 | </body> |
|
|
678 | </section> |
|
|
679 | <section> |
|
|
680 | <title>Mixing versions</title> |
|
|
681 | <body> |
|
|
682 | |
|
|
683 | <p> |
|
|
684 | Often times, different versions of <c>alsa-driver</c>, <c>alsa-lib</c>, |
|
|
685 | <c>alsa-utils</c>, <c>alsa-tools</c>, and <c>alsa-oss</c> will work with each |
|
|
686 | other, but it is recommended that you try to keep the versions in sync. |
|
|
687 | </p> |
|
|
688 | |
|
|
689 | </body> |
|
|
690 | </section> |
|
|
691 | <section> |
| 506 | <title>/etc/modules.autoload</title> |
692 | <title>/etc/modules.autoload</title> |
| 507 | <body> |
693 | <body> |
| 508 | |
694 | |
| 509 | <p> |
695 | <p> |
| 510 | You won't have to edit this file for use with ALSA. After our <c>rc-update add |
696 | You won't have to edit this file for use with ALSA. After doing <c>rc-update add |
| 511 | alsasound boot</c>, our system will load the correct modules at startup. |
697 | alsasound boot</c>, the correct modules will be loaded at startup. |
| 512 | </p> |
698 | </p> |
| 513 | |
699 | |
|
|
700 | <!-- |
| 514 | <p> |
701 | <p> |
| 515 | It's not necessary to add <c>snd-pcm-oss</c> or <c>snd-mixer-oss</c> in this |
702 | It's not necessary to add <c>snd-pcm-oss</c> or <c>snd-mixer-oss</c> in this |
| 516 | file. Check the <uri link="http://www.djcj.org/LAU/guide/alsbook/faq1.html">this |
703 | file. Check the <uri link="http://www.djcj.org/LAU/guide/alsbook/faq1.html">this |
| 517 | FAQ</uri> for more info. |
704 | FAQ</uri> for more info. |
| 518 | </p> |
705 | </p> |
|
|
706 | --> |
| 519 | |
707 | |
| 520 | </body> |
708 | </body> |
| 521 | </section> |
709 | </section> |
| 522 | <section> |
710 | <section> |
| 523 | <title>Known bugs</title> |
711 | <title>Known bugs</title> |
| … | |
… | |
| 577 | </pre> |
765 | </pre> |
| 578 | |
766 | |
| 579 | </body> |
767 | </body> |
| 580 | </section> |
768 | </section> |
| 581 | <section> |
769 | <section> |
| 582 | <title>More links..</title> |
770 | <title>More links...</title> |
| 583 | <body> |
771 | <body> |
| 584 | |
772 | |
| 585 | <p> |
773 | <p> |
| 586 | You could check these for additional info: |
774 | You could check these for additional info: |
| 587 | </p> |
775 | </p> |