/[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.70 Revision 1.71
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.70 2006/11/02 18:24:36 nightmorph Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/alsa-guide.xml,v 1.71 2007/01/31 15:54:35 nightmorph Exp $ -->
3 3
4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd"> 4<!DOCTYPE guide SYSTEM "/dtd/guide.dtd">
5 5
6<guide link="/doc/en/alsa-guide.xml"> 6<guide link="/doc/en/alsa-guide.xml">
7<title>Gentoo Linux ALSA Guide</title> 7<title>Gentoo Linux ALSA Guide</title>
8 8
9<author title="Author"> 9<author title="Author">
10 <mail link="fox2mike@gentoo.org">Shyam Mani</mail> 10 <mail link="fox2mike@gentoo.org">Shyam Mani</mail>
11</author> 11</author>
12<author title="Author">
13 <mail link="nightmorph@gentoo.org">Joshua Saddler</mail>
14</author>
15<author title="Contributor">
16 <mail link="flameeyes@gentoo.org">Diego Pettenò</mail>
17</author>
12 18
13<abstract> 19<abstract>
14This document helps a user setup ALSA on Gentoo Linux. 20This document helps a user setup ALSA on Gentoo Linux.
15</abstract> 21</abstract>
16 22
17<!-- The content of this document is licensed under the CC-BY-SA license --> 23<!-- The content of this document is licensed under the CC-BY-SA license -->
18<!-- See http://creativecommons.org/licenses/by-sa/2.5 --> 24<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
19<license/> 25<license/>
20 26
21<version>2.15</version> 27<version>2.16</version>
22<date>2006-11-02</date> 28<date>2007-01-31</date>
23 29
24<chapter> 30<chapter>
25<title>Introduction</title> 31<title>Introduction</title>
26<section> 32<section>
27<title>What is ALSA?</title> 33<title>What is ALSA?</title>
28<body> 34<body>
29 35
30<p> 36<p>
31ALSA, which stands for <e>Advanced Linux Sound Architecture</e>, provides 37ALSA, which stands for <e>Advanced Linux Sound Architecture</e>, provides
32audio and MIDI (<e>Musical Instrument Digital Interface</e>) functionality to 38audio and MIDI (<e>Musical Instrument Digital Interface</e>) functionality to
33the Linux operating system. ALSA is the default sound subsystem in the 2.6 39the Linux operating system. ALSA is the default sound subsystem in the 2.6
34kernel thereby replacing OSS (<e>Open Sound System</e>), which was used in the 40kernel thereby replacing OSS (<e>Open Sound System</e>), which was used in the
352.4 kernels. 412.4 kernels.
36</p> 42</p>
37 43
64<title>Installing ALSA</title> 70<title>Installing ALSA</title>
65<section> 71<section>
66<title>Options</title> 72<title>Options</title>
67<body> 73<body>
68 74
69<warn> 75<warn>
70The methods shown below are mutually exclusive. You cannot have ALSA compiled 76The methods shown below are mutually exclusive. You cannot have ALSA compiled
71in your kernel and use <c>media-sound/alsa-driver</c>. It <e>will</e> fail. 77in your kernel and use <c>media-sound/alsa-driver</c>. It <e>will</e> fail.
72</warn> 78</warn>
73 79
74<p> 80<p>
75The two options are : 81The two options are :
76</p> 82</p>
77 83
78<ol> 84<ol>
79 <li> 85 <li>Use ALSA provided by your kernel.</li>
80 Use ALSA provided by your kernel. This is the preferred/recommended
81 method.
82 </li>
83 <li>
84 Use Gentoo's <c>media-sound/alsa-driver</c> package. 86 <li>Use Gentoo's <c>media-sound/alsa-driver</c> package.</li>
85 </li>
86</ol> 87</ol>
87 88
88<p> 89<p>
89We shall take a peek into both before finally deciding on one. 90The in-kernel drivers and the <c>alsa-driver</c> package can vary a little; it's
91possible that features and fixes found in one might not yet be incorporated into
92the other. The upstream developers are aware of this, but the two drivers are
93effectively separate branches of the ALSA project; they are not entirely
94identical. You should be aware that they might function slightly differently, so
95if one doesn't work for you, try the other! We shall take a peek into both
96before finally deciding on one.
90</p> 97</p>
91 98
92<p> 99<p>
93If you were to use ALSA provided by the kernel, the following are the pros and 100If you were to use ALSA provided by the kernel, the following are the pros and
94cons : 101cons :
95</p> 102</p>
96 103
97<table> 104<table>
98<tr> 105<tr>
99 <th>Kernel ALSA</th> 106 <th>Kernel ALSA</th>
100 <th>Pros and Cons</th> 107 <th>Pros and Cons</th>
101</tr> 108</tr>
102<tr> 109<tr>
103 <th>+</th> 110 <th>+</th>
104 <ti>Pretty stable as drivers are integrated into kernel.</ti> 111 <ti>
112 No need to emerge yet another package; drivers are integrated into kernel.
113 </ti>
105</tr> 114</tr>
106<tr> 115<tr>
107 <th>+</th> 116 <th>+</th>
108 <ti>One shot solution, no repeating emerges.</ti> 117 <ti>One shot solution, no repeating emerges.</ti>
109</tr> 118</tr>
110<tr> 119<tr>
111 <th>-</th> 120 <th>-</th>
112 <ti>Might be a slightly older version than <c>alsa-driver</c>.</ti> 121 <ti>Might be a slightly different version than <c>alsa-driver</c>.</ti>
113</tr> 122</tr>
114</table> 123</table>
115 124
116<p> 125<p>
117And, if you were to use alsa-driver, 126And, if you were to use alsa-driver,
118</p> 127</p>
119 128
120<table> 129<table>
121<tr> 130<tr>
122 <th>alsa-driver</th> 131 <th>alsa-driver</th>
123 <th>Pros and Cons</th> 132 <th>Pros and Cons</th>
124</tr> 133</tr>
125<tr> 134<tr>
126 <th>+</th> 135 <th>+</th>
127 <ti>Latest drivers from the ALSA Project.</ti> 136 <ti>Possibly the latest drivers from the ALSA Project.</ti>
137</tr>
138<tr>
139 <th>+</th>
140 <ti>Useful if you intend to develop audio drivers.</ti>
128</tr> 141</tr>
129<tr> 142<tr>
130 <th>-</th> 143 <th>-</th>
131 <ti>Every kernel recompile requires a re-emerge of <c>alsa-driver</c>.</ti> 144 <ti>Every kernel recompile requires a re-emerge of <c>alsa-driver</c>.</ti>
132</tr> 145</tr>
133<tr> 146<tr>
134 <th>-</th> 147 <th>-</th>
135 <ti>Needs certain kernel config options disabled to work correctly.</ti> 148 <ti>Needs certain kernel config options disabled to work correctly.</ti>
136</tr> 149</tr>
137</table> 150</table>
138 151
139</body> 152</body>
140</section> 153</section>
141<section> 154<section>
142<title>So...</title> 155<title>So...</title>
143<body> 156<body>
144 157
145<p> 158<p>
146The main difference between using <c>alsa-driver</c> and ALSA that comes with 159The differences between <c>alsa-driver</c> and the in-kernel ALSA drivers are
147the kernel is that <c>alsa-driver</c> is generally more up to date than the 160quite subtle, as mentioned earlier. Since there are not any huge differences,
148version in the kernel. Since this does not make any huge difference as 161this guide will go through the process of using the ALSA provided by the kernel
149such, you are encouraged to use the ALSA provided by the kernel for ease of use. 162<e>first</e> for ease of use. However, if you run into problems, try switching
150Before reporting any sound related issues to <uri 163to <c>alsa-driver</c>. Before reporting any sound related issues to <uri
151link="https://bugs.gentoo.org">Gentoo Bugzilla</uri>, please try to reproduce 164link="https://bugs.gentoo.org">Gentoo Bugzilla</uri>, please try to reproduce
152them using <c>alsa-driver</c> and file the bug report no matter what the 165them using <c>alsa-driver</c> and file the bug report no matter what the
153result. 166result.
154</p> 167</p>
155 168
156</body> 169</body>
157</section> 170</section>
158<section id="lspci"> 171<section id="lspci">
159<title>Before you proceed</title> 172<title>Before you proceed</title>
160<body> 173<body>
161 174
162<p> 175<p>
163Whichever method of install you choose, you need to know what drivers your 176Whichever method of install you choose, you need to know what drivers your
164sound card uses. In most cases, sound cards (onboard and otherwise) are PCI 177sound card uses. In most cases, sound cards (onboard and otherwise) are PCI
165based and <c>lspci</c> will help you in digging out the required information. 178based and <c>lspci</c> will help you in digging out the required information.
198# <i>lspci -v | grep -i audio</i> 211# <i>lspci -v | grep -i audio</i>
1990000:00:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 06) 2120000:00:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 06)
200</pre> 213</pre>
201 214
202<p> 215<p>
203We now know that the sound card on the machine is a Sound Blaster Live! and 216We now know that the sound card on the machine is a Sound Blaster Live! and
204the card manufacturer is Creative Labs. Head over to the 217the card manufacturer is Creative Labs. Head over to the
205<uri link="http://www.alsa-project.org/alsa-doc/"> ALSA Soundcard Matrix</uri> 218<uri link="http://www.alsa-project.org/alsa-doc/"> ALSA Soundcard Matrix</uri>
206page and select Creative Labs from the drop down menu. You will be taken to 219page and select Creative Labs from the drop down menu. You will be taken to
207the Creative Labs matrix page where you can see that the SB Live! uses the 220the Creative Labs matrix page where you can see that the SB Live! uses the
208<c>emu10k1</c> module. That is the information we need for now. If you are 221<c>emu10k1</c> module. That is the information we need for now. If you are
209interested in detailed information, you can click on the link next to the 222interested in detailed information, you can click on the link next to the
210"Details" and that will take you to the <c>emu10k1</c> specific page. 223"Details" and that will take you to the <c>emu10k1</c> specific page.
211</p> 224</p>
212 225
226<p>
227If you intend to use MIDI, then you should add <c>midi</c> to your USE flags in
228<path>/etc/make.conf</path> before emerging any ALSA packages. Later in the
229guide, we will show you how to set up <uri link="#midi">MIDI support</uri>.
230</p>
231
232<pre caption="MIDI support in /etc/make.conf">
233<comment>(If you want MIDI support)</comment>
234USE="midi"
235
236<comment>(If you don't need MIDI)</comment>
237USE="-midi"
238</pre>
239
213</body> 240</body>
214</section> 241</section>
215<section id="kernel"> 242<section id="kernel">
216<title>Using ALSA provided by your Kernel</title> 243<title>Using ALSA provided by your Kernel</title>
217<body> 244<body>
218 245
219<p> 246<p>
220If you're a person who likes to keep things simple like I do, then this is 247If you're a person who likes to keep things simple like I do, then this is
221the way to go. 248the way to go.
222</p> 249</p>
223 250
224<note> 251<note>
225Since the 2005.0 release, Gentoo Linux uses 2.6 as the default kernel. Unless 252Since the 2005.0 release, Gentoo Linux uses 2.6 as the default kernel. Unless
226you are specifically using the 2.4 profile, <c>gentoo-sources</c> will be a 253you are specifically using the 2.4 profile, <c>gentoo-sources</c> will be a
2272.6 kernel on <e>most</e> architectures. Please check that your kernel is a 2542.6 kernel on <e>most</e> architectures. Please check that your kernel is a
242# <i>cd /usr/src/linux</i> 269# <i>cd /usr/src/linux</i>
243# <i>make menuconfig</i> 270# <i>make menuconfig</i>
244</pre> 271</pre>
245 272
246<note> 273<note>
247The above example assumes that <path>/usr/src/linux</path> symlink points to 274The above example assumes that <path>/usr/src/linux</path> symlink points to
248the kernel sources you want to use. Please ensure the same before proceeding. 275the kernel sources you want to use. Please ensure the same before proceeding.
249</note> 276</note>
250 277
251<p> 278<p>
252Now we will look at some of the options we will have to enable in the 2.6 279Now we will look at some of the options we will have to enable in the 2.6
253kernel to ensure proper ALSA support for our sound card. 280kernel to ensure proper ALSA support for our sound card.
254</p> 281</p>
255 282
256<p> 283<p>
257Please note that for the sake of ease, all examples show ALSA built as modules. 284Please note that for ease of use, all examples show ALSA built as modules. It
258It is advisable to follow the same as it then allows the use of <c>alsaconf</c> 285is advisable to follow the same as it then allows the use of <c>alsaconf</c>
259which is a boon when you want to configure your card. Please do <e>not</e> skip 286which is a boon when you want to configure your card. Please do <e>not</e> skip
260the <uri link="#alsa-config">Configuration</uri> section of this document. If 287the <uri link="#alsa-config">Configuration</uri> section of this document. If
261you still like to have options built-in, ensure that you make changes to your 288you still like to have options built-in, ensure that you make changes to your
262config accordingly. 289config accordingly.
263</p> 290</p>
264 291
265<pre caption="Kernel Options for ALSA"> 292<pre caption="Kernel Options for ALSA">
266Device Drivers ---&gt; 293Device Drivers ---&gt;
267 Sound ---&gt; 294 Sound ---&gt;
268 295
269<comment>(This needs to be enabled)</comment> 296<comment>(This needs to be enabled)</comment>
270&lt;M&gt; Sound card support 297&lt;M&gt; Sound card support
271 298
272<comment>(Make sure OSS is disabled)</comment> 299<comment>(Make sure OSS is disabled)</comment>
273Open Sound System ---&gt; 300Open Sound System ---&gt;
381CONFIG_SOUND_PRIME is not set 408CONFIG_SOUND_PRIME is not set
382# <i>grep SND .config</i> 409# <i>grep SND .config</i>
383<comment>(and 3. is true)</comment> 410<comment>(and 3. is true)</comment>
384CONFIG_SND is not set 411CONFIG_SND is not set
385</pre> 412</pre>
386 413
387<p> 414<p>
388Now all you have to do is type the magic words... and no, it's not abracadabra. 415Now all you have to do is type the magic words... and no, it's not abracadabra.
389</p> 416</p>
390 417
391<pre caption="Installing alsa-driver"> 418<pre caption="Installing alsa-driver">
392# <i>emerge alsa-driver</i> 419# <i>emerge alsa-driver</i>
393</pre> 420</pre>
394 421
395<impo> 422<impo>
396Please note that you will have to run <c>emerge alsa-driver</c> after every 423Please note that you will have to run <c>emerge alsa-driver</c> after every
397kernel (re)compile, as the earlier drivers are deleted. 424kernel (re)compile, as the earlier drivers are deleted. To make this task
425easier, you may want to emerge the <c>module-rebuild</c> package, which will
426keep track of module packages and rebuild them for you. First run <c>module
427rebuild populate</c> to create the list, and then after every kernel
428(re)compile, you just run <c>module-rebuild rebuild</c>, and your external
429modules will be rebuilt.
398</impo> 430</impo>
399 431
400</body> 432</body>
401</section> 433</section>
402</chapter> 434</chapter>
403 435
404<chapter> 436<chapter>
405<title>Configuring/Testing ALSA</title> 437<title>Configuring/Testing ALSA</title>
406<section id="alsa-utilities"> 438<section id="alsa-utilities">
407<title>ALSA Utilities</title> 439<title>ALSA Utilities</title>
408<body> 440<body>
409 441
410<p> 442<p>
411<c>alsa-utils</c> forms an integral part of ALSA as it has a truckload of 443<c>alsa-utils</c> forms an integral part of ALSA as it has a truckload of
412programs that are highly useful, including the ALSA Initscripts. Hence we 444programs that are highly useful, including the ALSA Initscripts. Hence we
419 451
420<note> 452<note>
421If you activated ALSA in your <uri link="#kernel">kernel</uri> <e>and</e> did 453If you activated ALSA in your <uri link="#kernel">kernel</uri> <e>and</e> did
422not compile ALSA as modules, please proceed to the 454not compile ALSA as modules, please proceed to the
423<uri link="#initscript">ALSA Initscript</uri> section. The rest of you need 455<uri link="#initscript">ALSA Initscript</uri> section. The rest of you need
424to configure ALSA. This is made very easy by the existence of the 456to configure ALSA. This is made very easy by the existence of the
425<c>alsaconf</c> tool provided by <c>alsa-utils</c>. 457<c>alsaconf</c> tool provided by <c>alsa-utils</c>.
426</note> 458</note>
427 459
428</body> 460</body>
429</section> 461</section>
430<section id="alsa-config"> 462<section id="alsa-config">
431<title>Configuration</title> 463<title>Configuration</title>
432<body> 464<body>
433 465
466<p>
467Recent versions of <c>udev</c> (<c>>=udev-103</c>) provide some degree of
468kernel-level autoconfiguration of your sound card. If possible, try to rely on
469just letting your kernel automatically setup your sound card for you. Otherwise,
470use <c>alsaconf</c> to configure your card, as shown below.
471</p>
472
434<note> 473<note>
435Please shut down any programs that <e>might</e> access the sound card while 474Please shut down any programs that <e>might</e> access the sound card while
436running <c>alsaconf</c>. 475running <c>alsaconf</c>.
437</note> 476</note>
438 477
439<p> 478<p>
440The easiest way to configure your sound card is to run <c>alsaconf</c>. Just 479Another way to configure your sound card is to run <c>alsaconf</c>. Just type
441type <c>alsaconf</c> in a shell as root. 480<c>alsaconf</c> in a shell as root.
442</p> 481</p>
443 482
444<pre caption="Invoking alsaconf"> 483<pre caption="Invoking alsaconf">
445# <i>alsaconf</i> 484# <i>alsaconf</i>
446</pre> 485</pre>
447 486
448<p> 487<p>
449You will now see a neat menu guided interface that will automatically probe 488You will now see a neat menu guided interface that will automatically probe
450your devices and try to find out your sound card. You will be asked to pick 489your devices and try to find out your sound card. You will be asked to pick
451your sound card from a list. Once that's done, it will ask you permission to 490your sound card from a list. Once that's done, it will ask you permission to
452automatically make required changes to <path>/etc/modules.d/alsa</path>. 491automatically make required changes to <path>/etc/modules.d/alsa</path>.
453It will then adjust your volume settings to optimum levels, run 492It will then adjust your volume settings to optimum levels, run
454<c>modules-update</c> and start the <path>/etc/init.d/alsasound</path> service. 493<c>modules-update</c> and start the <path>/etc/init.d/alsasound</path> service.
455Once <c>alsaconf</c> exits, you can proceed with setting up the ALSA 494Once <c>alsaconf</c> exits, you can proceed with setting up the ALSA
456initscript. 495initscript.
499</p> 538</p>
500 539
501<pre caption="Adding users to the audio group"> 540<pre caption="Adding users to the audio group">
502<comment>(Substitute &lt;username&gt; with your user)</comment> 541<comment>(Substitute &lt;username&gt; with your user)</comment>
503# <i>gpasswd -a &lt;username&gt; audio </i> 542# <i>gpasswd -a &lt;username&gt; audio </i>
504Adding user &lt;username&gt; to group audio 543Adding user &lt;username&gt; to group audio
505</pre> 544</pre>
506 545
507</body> 546</body>
508</section> 547</section>
509<section> 548<section>
510<title>Volume Check!</title> 549<title>Volume Check!</title>
511<body> 550<body>
512 551
513<p> 552<p>
514We've completed all the setups and pre-requisites, so let's fire up ALSA. If 553We've completed all the setups and prerequisites, so let's fire up ALSA. If
515you ran <c>alsaconf</c>, you can skip this step, since <c>alsaconf</c> already 554you ran <c>alsaconf</c>, you can skip this step, since <c>alsaconf</c> already
516does this for you. 555does this for you.
517</p> 556</p>
518 557
519<pre caption="Start the service"> 558<pre caption="Start the service">
520<comment>(ALSA as modules)</comment>
521# <i>/etc/init.d/alsasound start</i> 559# <i>/etc/init.d/alsasound start</i>
522 * Loading ALSA modules ...
523 * Loading: snd-card-0 ... [ ok ]
524 * Loading: snd-pcm-oss ... [ ok ]
525 * Loading: snd-seq ... [ ok ]
526 * Loading: snd-emu10k1-synth ... [ ok ]
527 * Loading: snd-seq-midi ... [ ok ]
528 * Restoring Mixer Levels ... [ ok ]
529<comment>(ALSA compiled in)</comment>
530# <i>/etc/init.d/alsasound start</i>
531 * Loading ALSA modules ...
532 * Restoring Mixer Levels ... [ ok ]
533</pre> 560</pre>
534 561
535<p> 562<p>
536Now that the required things have been taken care of, we need to check up on 563Now that the required things have been taken care of, we need to check up on
537the volume as in certain cases, it is muted. We use <c>alsamixer</c> for this 564the volume as in certain cases, it is muted. We use <c>alsamixer</c> for this
538purpose. 565purpose.
539</p> 566</p>
540 567
541<pre caption="Starting alsamixer"> 568<pre caption="Starting alsamixer">
542<comment>(Opens up a console program. Only required settings are shown)</comment> 569<comment>(Opens up a console program. Only required settings are shown)</comment>
543# <i>alsamixer</i> 570# <i>alsamixer</i>
544</pre> 571</pre>
545 572
546<impo> 573<impo>
547If you have issues starting up <c>alsamixer</c> and get errors such as 574If you have issues starting up <c>alsamixer</c> and get errors such as
803# <i>grep device_mode /etc/modules.d/*</i> 830# <i>grep device_mode /etc/modules.d/*</i>
804</pre> 831</pre>
805 832
806<p> 833<p>
807Usually it is a file called <path>alsa</path> with the line <c>options snd 834Usually it is a file called <path>alsa</path> with the line <c>options snd
808device_mode=0666</c>. Remove this line and restart the alsasound service and 835device_mode=0666</c>. Remove this line and restart the alsasound service and
809that should take care of this issue. 836that should take care of this issue.
810</p> 837</p>
811 838
812</body> 839</body>
813</section> 840</section>
814</chapter> 841</chapter>
815 842
816<chapter> 843<chapter>
817<title>Other things ALSA</title> 844<title>Other things ALSA</title>
818<section> 845<section id="midi">
819<title>Setting up MIDI support</title> 846<title>Setting up MIDI support</title>
820<body> 847<body>
848
849<p>
850First, check to make sure that you enabled the <c>midi</c> USE flag in
851<path>/etc/make.conf</path>.
852</p>
853
854<pre caption="MIDI support in /etc/make.conf">
855USE="midi"
856</pre>
857
858<p>
859If you didn't previously enable <c>midi</c>, go ahead and add it to
860<path>/etc/make.conf</path> now. You will also need to re-emerge any ALSA
861packages that use the <c>midi</c> flag, such as <c>alsa-lib</c>,
862<c>alsa-utils</c>, and <c>alsa-driver</c>.
863</p>
821 864
822<p> 865<p>
823If your sound card is one of those that come with on-board MIDI synthesizers 866If your sound card is one of those that come with on-board MIDI synthesizers
824and you would like to listen to some .mid files, you have to install 867and you would like to listen to some .mid files, you have to install
825<c>awesfx</c> which is basically a set of utilities for controlling the AWE32 868<c>awesfx</c> which is basically a set of utilities for controlling the AWE32
826driver. We need to install it first. If you don't have a hardware synthesizer, 869driver. We need to install it first. If you don't have a hardware synthesizer,
827you can use a virtual one. Please see the section on 870you can use a virtual one. Please see the section on
828<uri link="#vsynth">Virtual Synthesizers</uri> for more information. 871<uri link="#vsynth">Virtual Synthesizers</uri> for more information.
829</p> 872</p>
830 873
831<pre caption="Installing awesfx"> 874<pre caption="Installing awesfx">
832# <i>emerge awesfx</i> 875# <i>emerge awesfx</i>
833</pre> 876</pre>
834 877
835<note> 878<note>
883</section> 926</section>
884<section id="vsynth"> 927<section id="vsynth">
885<title>Virtual Synthesizers</title> 928<title>Virtual Synthesizers</title>
886<body> 929<body>
887 930
888<p> 931<p>
889If your sound card lacks a hardware synthesizer, you could use a virtual one 932If your sound card lacks a hardware synthesizer, you could use a virtual one
890like <c>timidity++</c>. Installation is a breeze. 933like <c>timidity++</c>. Installation is a breeze.
891</p> 934</p>
892 935
893<pre caption="Installing timidity++"> 936<pre caption="Installing timidity++">
894# <i>emerge timidity++</i> 937# <i>emerge timidity++</i>
895</pre> 938</pre>
896 939
897<p> 940<p>
898For timidity to play sounds, it needs a sound font. If you do not have any, 941For timidity to play sounds, it needs a sound font. Fortunately, the ebuild will
899install <c>timidity-eawpatches</c> or <c>timidity-shompatches</c> which will 942install some sound font packages for you. There are a few other font packages
900give you some sound fonts. You can have multiple sound font configurations 943available in Portage, such as <c>timidity-freepats</c> and
944<c>timidity-eawpatches</c>. You can have multiple sound font configurations
901installed, and you can place your own in <path>/usr/share/timidity/</path>. 945installed, and you can place your own in <path>/usr/share/timidity/</path>. To
902To switch between different timidity configurations, you should use the 946switch between different timidity configurations, you should use the
903<c>timidity-update</c> tool provided in the timidity++ package. 947<c>timidity-update</c> tool provided in the timidity++ package. In later
948versions of timidity, <c>eselect</c> is used to switch configurations.
904</p> 949</p>
905 950
906<pre caption="Installing sound fonts"> 951<pre caption="Changing configurations">
907# <i>emerge timidity-eawpatches</i> 952<comment>(replace eawpatches with the name of your sound font package)</comment>
908# <i>timidity-update -g -s eawpatches</i> 953# <i>timidity-update -g -s eawpatches</i>
909 954
910<comment>(or)</comment> 955<comment>(Use eselect if you have installed >=timidity-2.13.2-r3)</comment>
911 956# <i>eselect timidity list</i>
912# <i>emerge timidity-shompatches</i> 957# <i>eselect timidity set eawpatches</i>
913# <i>timidity-update -g -s shompatches</i>
914</pre> 958</pre>
915 959
916<p> 960<p>
917Don't forget to add <c>timidity</c> to the default runlevel. 961Don't forget to add <c>timidity</c> to the default runlevel.
918</p> 962</p>
919 963
920<pre caption="Adding timidity to the default runlevel"> 964<pre caption="Adding timidity to the default runlevel">
921# <i>rc-update add timidity default</i> 965# <i>rc-update add timidity default</i>
922# <i>/etc/init.d/timidity start</i> 966# <i>/etc/init.d/timidity start</i>
923</pre> 967</pre>
924 968
925<p> 969<p>
926You can now try out <uri link="#doc_chap4_pre3">Playing MIDI</uri> files. 970You can now try out <uri link="#doc_chap4_pre3">Playing MIDI</uri> files.
927</p> 971</p>
928 972
929</body> 973</body>
930</section> 974</section>
931<section> 975<section>
932<title>Tools and Firmware</title> 976<title>Tools and Firmware</title>
933<body> 977<body>
934 978
935<p> 979<p>
936Some specific sound cards can benefit from certain tools provided by the 980Some specific sound cards can benefit from certain tools provided by the
937<c>alsa-tools</c> and <c>alsa-firmware</c> packages. If you need 981<c>alsa-tools</c> and <c>alsa-firmware</c> packages. You may install either with
938<c>alsa-tools</c>, be sure to define the ALSA_TOOLS variable in 982a simple <c>emerge</c>.
939<path>/etc/make.conf</path> with the tools you require. For instance:
940</p>
941
942<pre caption="Selecting ALSA Tools in /etc/make.conf">
943ALSA_TOOLS="as10k1 ac3dec"
944</pre>
945
946<p>
947If the ALSA_TOOLS variable is not set, all available tools will be built.
948Now, install the <c>alsa-tools</c> (and/or <c>alsa-firmware</c>) package(s):
949</p> 983</p>
950 984
951<pre caption="Installing ALSA Tools"> 985<pre caption="Installing ALSA Tools">
952# <i>emerge alsa-tools</i> 986# <i>emerge alsa-tools</i>
953</pre> 987</pre>
954 988
955</body> 989</body>
956</section> 990</section>
957<section> 991<section>
992<title>Multiple sound cards</title>
993<body>
994
995<p>
996You can more than one sound card in your system simultaneously, provided that
997you have built ALSA as modules in your kernel (or have installed
998<c>alsa-driver</c> instead). You just need to specify which should be started
999first in <path>/etc/modules.d/alsa</path>. Your cards are identified by their
1000driver names inside this file. 0 is the first card, 1 is the second, and so on.
1001Here's an example for a system with two sound cards.
1002</p>
1003
1004<pre caption="Two sound cards in /etc/modules.d/alsa">
1005options snd-emu10k1 index=0
1006options snd-via82xx index=1
1007</pre>
1008
1009<p>
1010Or, if you have two cards that use the same driver, you specify them on the same
1011line, using comma-separated numbers. Here's an example for a system with three
1012sound cards, two of which are the same Intel High Definition Audio card.
1013</p>
1014
1015<pre caption="Multiple sound cards in /etc/modules.d/alsa">
1016options snd-ymfpci index=0
1017options snd-hda-intel index=1,2
1018</pre>
1019
1020</body>
1021</section>
1022<section>
1023<title>Plugins</title>
1024<body>
1025
1026<p>
1027You may want to install some plugins for extra functionality.
1028<c>alsa-plugins</c> is a collection of useful plugins, which include: PulseAudio
1029output, a sample rate converter, jack (a low-latency audio server), and an
1030encoder that lets you output 6-channel audio through digital S/PDIF connections
1031(both optical and coaxial). You can choose which of its plugins you want
1032installed by adding their USE flags to <path>/etc/portage/package.use</path>.
1033</p>
1034
1035<pre caption="Installing alsa-plugins">
1036# <i>emerge -avt alsa-plugins</i>
1037</pre>
1038
1039</body>
1040</section>
1041<section>
958<title>A Big thank you to...</title> 1042<title>A big thank you to...</title>
959<body> 1043<body>
960 1044
961<p> 1045<p>
962Everyone who contributed to the earlier version of the Gentoo ALSA Guide: 1046Everyone who contributed to the earlier version of the Gentoo ALSA Guide:
963Vincent Verleye, Grant Goodyear, Arcady Genkin, Jeremy Huddleston, 1047Vincent Verleye, Grant Goodyear, Arcady Genkin, Jeremy Huddleston,
964John P. Davis, Sven Vermeulen, Benny Chuang, Tiemo Kieft and Erwin. 1048John P. Davis, Sven Vermeulen, Benny Chuang, Tiemo Kieft and Erwin.
965</p> 1049</p>
966 1050
967</body> 1051</body>
968</section> 1052</section>
969<section> 1053<section>
970<title>References</title> 1054<title>References</title>
971<body> 1055<body>
972 1056
973<ul> 1057<ul>

Legend:
Removed from v.1.70  
changed lines
  Added in v.1.71

  ViewVC Help
Powered by ViewVC 1.1.20