/[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.53 Revision 1.54
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.53 2005/06/08 19:54:07 fox2mike Exp $ --> 2<!-- $Header: /var/cvsroot/gentoo/xml/htdocs/doc/en/alsa-guide.xml,v 1.54 2005/07/12 19:17:38 fox2mike 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 12
13<abstract> 13<abstract>
14This document helps a user setup ALSA on Gentoo Linux. 14This document helps a user setup ALSA on Gentoo Linux.
15</abstract> 15</abstract>
16 16
17<!-- The content of this document is licensed under the CC-BY-SA license --> 17<!-- The content of this document is licensed under the CC-BY-SA license -->
18<!-- See http://creativecommons.org/licenses/by-sa/2.0 --> 18<!-- See http://creativecommons.org/licenses/by-sa/2.5 -->
19<license/> 19<license/>
20 20
21<version>2.2</version> 21<version>2.3</version>
22<date>2005-06-09</date> 22<date>2005-07-12</date>
23 23
24<chapter> 24<chapter>
25<title>Introduction</title> 25<title>Introduction</title>
26<section> 26<section>
27<title>What is ALSA?</title> 27<title>What is ALSA?</title>
28<body> 28<body>
29 29
30<p> 30<p>
31ALSA, which stands for <e>Advanced Linux Sound Architecture</e>, provides 31ALSA, which stands for <e>Advanced Linux Sound Architecture</e>, provides
32audio and MIDI (<e>Musical Instrument Digital Interface</e>) functionality to 32audio and MIDI (<e>Musical Instrument Digital Interface</e>) functionality to
33the Linux operating system. ALSA is the default sound subsystem in the 2.6 33the 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 34kernel thereby replacing OSS (<e>Open Sound System</e>), which was used in the
352.4 kernels. 352.4 kernels.
36</p> 36</p>
37 37
58 58
59</body> 59</body>
60</section> 60</section>
61</chapter> 61</chapter>
62 62
63<chapter> 63<chapter>
64<title>Installing ALSA</title> 64<title>Installing ALSA</title>
65<section> 65<section>
66<title>Options</title> 66<title>Options</title>
67<body> 67<body>
68 68
69<warn> 69<warn>
70The methods shown below are mutually exclusive. You cannot have ALSA compiled 70The 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. 71in your kernel and use <c>media-sound/alsa-driver</c>. It <e>will</e> fail.
72</warn> 72</warn>
73
74<impo>
75<c>genkernel</c> users have their config built such a way that the ALSA
76sub-system in the kernel is active. Therefore <c>genkernel</c> users can
77proceed to the <uri link="#alsa-utilities">ALSA Utilities</uri> section
78directly.
79</impo>
80 73
81<p> 74<p>
82The two options are : 75The two options are :
83</p> 76</p>
84 77
85<ol> 78<ol>
86 <li> 79 <li>
87 Use ALSA provided by your kernel. This is the preferred/recommended 80 Use ALSA provided by your kernel. This is the preferred/recommended
88 method. 81 method.
89 </li> 82 </li>
90 <li> 83 <li>
91 Use Gentoo's <c>media-sound/alsa-driver</c> package. 84 Use Gentoo's <c>media-sound/alsa-driver</c> package.
92 </li> 85 </li>
93</ol> 86</ol>
94 87
152<p> 145<p>
153The main difference between using <c>alsa-driver</c> and ALSA that comes with 146The main difference between using <c>alsa-driver</c> and ALSA that comes with
154the kernel is that <c>alsa-driver</c> is generally more up to date than the 147the kernel is that <c>alsa-driver</c> is generally more up to date than the
155version in the kernel. Since this does not make any huge difference as 148version in the kernel. Since this does not make any huge difference as
156such, you are encouraged to use the ALSA provided by the kernel. 149such, you are encouraged to use the ALSA provided by the kernel.
157</p> 150</p>
158 151
159</body> 152</body>
160</section> 153</section>
161<section id="lspci"> 154<section id="lspci">
162<title>Before you proceed</title> 155<title>Before you proceed</title>
163<body> 156<body>
164 157
165<p> 158<p>
166Whichever method of install you choose, you need to know what drivers your 159Whichever method of install you choose, you need to know what drivers your
160sound card uses. In most cases, sound cards (onboard and otherwise) are PCI
167sound card uses. <c>lspci</c> will help you in digging out the required 161based and <c>lspci</c> will help you in digging out the required information.
168information. Please <c>emerge sys-apps/pciutils</c> to get <c>lspci</c>, if 162Please <c>emerge sys-apps/pciutils</c> to get <c>lspci</c>, if you don't have it
169you don't have it installed already. We now proceed to find out details about 163installed already. In case you have a USB sound card, <c>lsusb</c> from
170the sound card. 164<c>sys-apps/usbutils</c> <e>might</e> be of help. For ISA cards, try using
165<c>sys-apps/isapnptools</c>. Also, the following pages <e>may</e> help users
166with ISA based sound cards.
167</p>
168
169<ul>
170 <li>
171 <uri link="http://www.roestock.demon.co.uk/isapnptools/">The ISAPNPTOOLS
172 Page</uri>
173 </li>
174 <li>
175 <uri link="http://www2.linuxjournal.com/article/3269">LinuxJournal PnP
176 Article</uri>
177 </li>
178 <li>
179 <uri link="http://www.tldp.org/HOWTO/Sound-HOWTO/x320.html">TLDP Sound
180 HowTo</uri>
181 </li>
182</ul>
183
184<note>
185For ease of use/explanation, we assume the user has a PCI based sound card for
186the remainder of this guide.
187</note>
188
189<p>
190We now proceed to find out details about the sound card.
171</p> 191</p>
172 192
173<pre caption="Soundcard Details"> 193<pre caption="Soundcard Details">
174# <i>lspci -v | grep -i audio</i> 194# <i>lspci -v | grep -i audio</i>
1750000:00:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 06) 1950000:00:0a.0 Multimedia audio controller: Creative Labs SB Live! EMU10k1 (rev 06)
176</pre> 196</pre>
177 197
178<p> 198<p>
179We now know that the sound card on the machine is a Sound Blaster Live! and 199We now know that the sound card on the machine is a Sound Blaster Live! and
180the card manufacturer is Creative Labs. Head over to the 200the card manufacturer is Creative Labs. Head over to the
181<uri link="http://www.alsa-project.org/alsa-doc/"> ALSA Soundcard Matrix</uri> 201<uri link="http://www.alsa-project.org/alsa-doc/"> ALSA Soundcard Matrix</uri>
182page and select Creative Labs from the drop down menu. You will be taken to 202page and select Creative Labs from the drop down menu. You will be taken to
183the Creative Labs matrix page where you can see that the SB Live! uses the 203the Creative Labs matrix page where you can see that the SB Live! uses the
184<c>emu10k1</c> module. That is the information we need for now. If you are 204<c>emu10k1</c> module. That is the information we need for now. If you are
185interested in detailed information, you can click on the link next to the 205interested in detailed information, you can click on the link next to the
196If you're a person who likes to keep things simple like I do, then this is 216If you're a person who likes to keep things simple like I do, then this is
197the way to go. 217the way to go.
198</p> 218</p>
199 219
200<note> 220<note>
201Since the 2005.0 release, Gentoo Linux uses 2.6 as the default kernel. Unless 221Since the 2005.0 release, Gentoo Linux uses 2.6 as the default kernel. Unless
202you are specifically using the 2.4 profile, <c>gentoo-sources</c> will be a 222you are specifically using the 2.4 profile, <c>gentoo-sources</c> will be a
2032.6 kernel on <e>most</e> architectures. Please check that your kernel is a 2232.6 kernel on <e>most</e> architectures. Please check that your kernel is a
2042.6 series kernel. This method will <e>not</e> work on a 2.4 kernel. 2242.6 series kernel. This method will <e>not</e> work on a 2.4 kernel.
205</note> 225</note>
206 226
207<p> 227<p>
208Let us now configure the kernel to enable ALSA. 228Let us now configure the kernel to enable ALSA.
209</p> 229</p>
210 230
231<impo>
232<c>genkernel</c> users should now run <c>genkernel --menuconfig</c> and then follow
233the instructions in <uri link="#doc_chap2_pre3">Kernel Options for ALSA</uri>.
234</impo>
235
211<pre caption="Heading over to the source"> 236<pre caption="Heading over to the source">
212# <i>cd /usr/src/linux</i> 237# <i>cd /usr/src/linux</i>
213# <i>make menuconfig</i> 238# <i>make menuconfig</i>
214</pre> 239</pre>
215 240
216<note> 241<note>
217The above example assumes that <path>/usr/src/linux</path> symlink points to 242The above example assumes that <path>/usr/src/linux</path> symlink points to
218the kernel sources you want to use. Please ensure the same before proceeding. 243the kernel sources you want to use. Please ensure the same before proceeding.
219</note> 244</note>
220 245
221<p> 246<p>
222Now we will look at some of the options we will have to enable in the 2.6 247Now we will look at some of the options we will have to enable in the 2.6
223kernel to ensure proper ALSA support for our sound card. 248kernel to ensure proper ALSA support for our sound card.
224</p> 249</p>
225 250
226<note> 251<p>
227Please note that for the sake of ease, all examples show a modular kernel. It 252Please note that for the sake of ease, all examples show ALSA built as modules.
228is advisable to follow the same. Please do <e>not</e> skip the 253It is advisable to follow the same as it then allows the use of <c>alsaconf</c>
254which is a boon when you want to configure your card. Please do <e>not</e> skip the <uri
229<uri link="#alsa-config">Configuration</uri> section of this document. If 255link="#alsa-config">Configuration</uri> section of this document. If you still
230you still like to have options built-in, ensure that you make changes to your 256like to have options built-in, ensure that you make changes to your config
231config accordingly. 257accordingly.
232</note> 258</p>
233 259
234<pre caption="Kernel Options for ALSA"> 260<pre caption="Kernel Options for ALSA">
235Device Drivers ---&gt; 261Device Drivers ---&gt;
236 Sound ---&gt; 262 Sound ---&gt;
237 263
238<comment>(This needs to be enabled)</comment> 264<comment>(This needs to be enabled)</comment>
239&lt;M&gt; Sound card support 265&lt;M&gt; Sound card support
240 266
241<comment>(Make sure OSS is disabled)</comment> 267<comment>(Make sure OSS is disabled)</comment>
242Open Sound System ---&gt; 268Open Sound System ---&gt;
243 &lt; &gt; Open Sound System (DEPRECATED) 269 &lt; &gt; Open Sound System (DEPRECATED)
244 270
245<comment>(Move one step back and enter ALSA)</comment> 271<comment>(Move one step back and enter ALSA)</comment>
246Advanced Linux Sound Architecture ---&gt; 272Advanced Linux Sound Architecture ---&gt;
247 &lt;M&gt; Advanced Linux Sound Architecture 273 &lt;M&gt; Advanced Linux Sound Architecture
305<path>/etc/make.conf</path> and add a variable, <c>ALSA_CARDS</c>. 331<path>/etc/make.conf</path> and add a variable, <c>ALSA_CARDS</c>.
306</p> 332</p>
307 333
308<pre caption="Adding ALSA_CARDS to make.conf"> 334<pre caption="Adding ALSA_CARDS to make.conf">
309<comment>(For one sound card)</comment> 335<comment>(For one sound card)</comment>
310ALSA_CARDS="emu10k1" 336ALSA_CARDS="emu10k1"
311<comment>(For more than one, seperate names with spaces)</comment> 337<comment>(For more than one, seperate names with spaces)</comment>
312ALSA_CARDS="emu10k1 via82xx" 338ALSA_CARDS="emu10k1 via82xx"
313</pre> 339</pre>
314 340
315<p> 341<p>
316If you have compiled your kernel and want to use <c>alsa-driver</c>, please 342If you have compiled your kernel and want to use <c>alsa-driver</c>, please
317ensure the following before proceeding, else <c>alsa-driver</c> is likely to 343ensure the following before proceeding, else <c>alsa-driver</c> is likely to
318fail. The next code listing gives you one way of performing the checks. 344fail. The next code listing gives you one way of performing the checks.
319</p> 345</p>
346
347<note>
348<c>genkernel</c> users can proceed with <uri link="#doc_chap2_pre6">Installing
349alsa-driver</uri> as their configuration is in sync with the one shown below by
350default.
351</note>
320 352
321<ol> 353<ol>
322 <li> 354 <li>
323 <c>CONFIG_SOUND</c> is set. (Basic Sound support enabled) 355 <c>CONFIG_SOUND</c> is set. (Basic Sound support enabled)
324 </li> 356 </li>
325 <li> 357 <li>
326 <c>CONFIG_SOUND_PRIME</c> is not set. (In-built OSS support disabled) 358 <c>CONFIG_SOUND_PRIME</c> is not set. (In-built OSS support disabled)
327 </li> 359 </li>
328 <li> 360 <li>
329 <c>CONFIG_SND</c> is not set. (In-built ALSA support disabled) 361 <c>CONFIG_SND</c> is not set. (In-built ALSA support disabled)
330 </li> 362 </li>
331 <li> 363 <li>
332 <path>/usr/src/linux</path> points to the kernel you want ALSA working on. 364 <path>/usr/src/linux</path> points to the kernel you want ALSA working on.
333 </li> 365 </li>
334</ol> 366</ol>
335 367
336<pre caption=".config checks"> 368<pre caption=".config checks">
337<comment>(Assuming the linux symlink points to the correct kernel)</comment> 369<comment>(Assuming the linux symlink points to the correct kernel)</comment>
338# <i>cd /usr/src/linux</i> 370# <i>cd /usr/src/linux</i>
339# <i>grep SOUND .config</i> 371# <i>grep SOUND .config</i>
340<comment>(1. is true)</comment> 372<comment>(1. is true)</comment>
341CONFIG_SOUND=y 373CONFIG_SOUND=y
342<comment>(2. is true)</comment> 374<comment>(2. is true)</comment>
343CONFIG_SOUND_PRIME is not set 375CONFIG_SOUND_PRIME is not set
344# <i>grep SND .config</i> 376# <i>grep SND .config</i>
345<comment>(and 3. is true)</comment> 377<comment>(and 3. is true)</comment>
346CONFIG_SND is not set 378CONFIG_SND is not set
347</pre> 379</pre>
348 380
349<p> 381<p>
350Now all you have to do is type the magic words...and no, its not abracadabra. 382Now all you have to do is type the magic words... and no, it's not abracadabra.
351</p> 383</p>
352 384
353<pre caption="Installing alsa-driver"> 385<pre caption="Installing alsa-driver">
354# <i>emerge alsa-driver</i> 386# <i>emerge alsa-driver</i>
355</pre> 387</pre>
356 388
357<impo> 389<impo>
358Please note that you will have to run <c>emerge alsa-driver</c> after every 390Please note that you will have to run <c>emerge alsa-driver</c> after every
359kernel (re)compile, as the earlier drivers are deleted. 391kernel (re)compile, as the earlier drivers are deleted.
360</impo> 392</impo>
361 393
362</body> 394</body>
363</section> 395</section>
364</chapter> 396</chapter>
365 397
400 432
401<p> 433<p>
402The easiest way to configure your sound card is to run <c>alsaconf</c>. Just 434The easiest way to configure your sound card is to run <c>alsaconf</c>. Just
403type <c>alsaconf</c> in a shell as root. 435type <c>alsaconf</c> in a shell as root.
404</p> 436</p>
405 437
406<pre caption="Invoking alsaconf"> 438<pre caption="Invoking alsaconf">
407# <i>alsaconf</i> 439# <i>alsaconf</i>
408</pre> 440</pre>
409 441
410<p> 442<p>
411You will now see a neat menu guided interface that will automatically probe 443You will now see a neat menu guided interface that will automatically probe
412your devices and try to find out your sound card. You will be asked to pick 444your devices and try to find out your sound card. You will be asked to pick
413your sound card from a list. Once that's done, it will ask you permission to 445your sound card from a list. Once that's done, it will ask you permission to
414automatically make required changes to <path>/etc/modules.d/alsa</path>. 446automatically make required changes to <path>/etc/modules.d/alsa</path>.
415It will then adjust your volume settings to optimum levels and run 447It will then adjust your volume settings to optimum levels, run
416<c>modules-update</c> and starts the <path>/etc/init.d/alsasound</path> 448<c>modules-update</c> and start the <path>/etc/init.d/alsasound</path> service.
417service. Once <c>alsaconf</c> exits, you can proceed with setting up the ALSA 449Once <c>alsaconf</c> exits, you can proceed with setting up the ALSA initscript.
418initscript.
419</p> 450</p>
420 451
421</body> 452</body>
422</section> 453</section>
423<section id="initscript"> 454<section id="initscript">
424<title>ALSA Initscript</title> 455<title>ALSA Initscript</title>
425<body> 456<body>
426 457
427<p> 458<p>
428We're now almost all setup. Whichever method you chose to install ALSA, you'll 459We're now almost all setup. Whichever method you chose to install ALSA, you'll
429need to have something load your modules or initialize ALSA and restore your 460need to have something load your modules or initialize ALSA and restore your
430volume settings when your system comes up. The ALSA Initscript handles all of 461volume settings when your system comes up. The ALSA Initscript handles all of
431this for you and is called <c>alsasound</c>. Add it to the default run-level. 462this for you and is called <c>alsasound</c>. Add it to the default run-level.
432</p> 463</p>
433 464
434<pre caption="Adding ALSA to default"> 465<pre caption="Adding ALSA to default">
435# <i>rc-update add alsasound default</i> 466# <i>rc-update add alsasound boot</i>
436 * alsasound added to runlevel default 467 * alsasound added to runlevel boot
437 * rc-update complete. 468 * rc-update complete.
438</pre> 469</pre>
439 470
440<p> 471<p>
441Next, just check the <path>/etc/conf.d/alsasound</path> file and ensure that 472Next, just check the <path>/etc/conf.d/alsasound</path> file and ensure that
442SAVE_ON_STOP variable is set to yes. This saves your sound settings when you 473SAVE_ON_STOP variable is set to yes. This saves your sound settings when you
443shutdown your system. 474shutdown your system.
444</p> 475</p>
445 476
446</body> 477</body>
447</section> 478</section>
448<section> 479<section>
480<title>Audio Group</title>
481<body>
482
483<p>
484Before we move on to testing, there's one last <e>important</e> thing that needs
485to be setup. Rule of thumb in a *nix OS : Do not run as root unless needed.
486This applies here as well ;) How? Well, most of the times you should be logged
487in as a user and would like to listen to music or access your soundcard. For
488that to happen, you need to be in the "audio" group. At this point, we'll add
489users to the audio group, so that they won't have any issues when they want to
490access sound devices. We'll use <c>gpasswd</c> here and you need to be logged in
491as root for this to work.
492</p>
493
494<pre caption="Adding users to the audio group">
495<comment>(Substitute &lt;username&gt; with your user)</comment>
496# <i>gpasswd -a &lt;username&gt; audio </i>
497Adding user &lt;username&gt; to group audio
498</pre>
499
500</body>
501</section>
502<section>
449<title>Volume Check!</title> 503<title>Volume Check!</title>
450<body> 504<body>
451 505
452<p> 506<p>
453We've completed all the setups and pre-requisites, so let's fire up ALSA. If 507We've completed all the setups and pre-requisites, so let's fire up ALSA. If
454you ran <c>alsaconf</c>, you can skip this step, since <c>alsaconf</c> already 508you ran <c>alsaconf</c>, you can skip this step, since <c>alsaconf</c> already
455does this for you. 509does this for you.
456</p> 510</p>
457 511
458<pre caption="Start the service"> 512<pre caption="Start the service">
459<comment>(Modular Kernels)</comment> 513<comment>(ALSA as modules)</comment>
460# <i>/etc/init.d/alsasound start</i> 514# <i>/etc/init.d/alsasound start</i>
461 * Loading ALSA modules ... 515 * Loading ALSA modules ...
462 * Loading: snd-card-0 ... [ ok ] 516 * Loading: snd-card-0 ... [ ok ]
463 * Loading: snd-pcm-oss ... [ ok ] 517 * Loading: snd-pcm-oss ... [ ok ]
464 * Loading: snd-seq ... [ ok ] 518 * Loading: snd-seq ... [ ok ]
465 * Loading: snd-emu10k1-synth ... [ ok ] 519 * Loading: snd-emu10k1-synth ... [ ok ]
466 * Loading: snd-seq-midi ... [ ok ] 520 * Loading: snd-seq-midi ... [ ok ]
467 * Restoring Mixer Levels ... [ ok ] 521 * Restoring Mixer Levels ... [ ok ]
468<comment>(ALSA compiled in)</comment> 522<comment>(ALSA compiled in)</comment>
469# <i>/etc/init.d/alsasound start</i> 523# <i>/etc/init.d/alsasound start</i>
470 * Loading ALSA modules ... 524 * Loading ALSA modules ...
471 * Restoring Mixer Levels ... [ ok ] 525 * Restoring Mixer Levels ... [ ok ]
472</pre> 526</pre>
473 527
474<p> 528<p>
475Now that the required things have been take care of, we need to check up on 529Now that the required things have been taken care of, we need to check up on
476the volume as in certain cases, it is muted. We use <c>alsamixer</c> for this purpose. 530the volume as in certain cases, it is muted. We use <c>alsamixer</c> for this
531purpose.
477</p> 532</p>
478 533
479<pre caption="Starting alsamixer"> 534<pre caption="Starting alsamixer">
480<comment>(Opens up a console program. Only required settings are shown)</comment> 535<comment>(Opens up a console program. Only required settings are shown)</comment>
481# <i>alsamixer</i> 536# <i>alsamixer</i>
482</pre> 537</pre>
538
539<impo>
540If you have issues starting up <c>alsamixer</c> and get errors such as
541alsamixer: function snd_ctl_open failed for default: No such file or directory,
542this is usually an issue with udev setting up the devices. Run <c>killall -9
543udevd; udevstart</c> to reload /dev entries and fire up <c>alsamixer</c>. It
544should solve the issue.
545</impo>
483 546
484<p> 547<p>
485This is how the ALSA Mixer <e>might</e> look the first time you open it. Pay 548This is how the ALSA Mixer <e>might</e> look the first time you open it. Pay
486attention to the Master and PCM channels which both have an MM below them. 549attention to the Master and PCM channels which both have an MM below them.
487That means they are muted. If you try to play anything with <c>alsamixer</c> 550That means they are muted. If you try to play anything with <c>alsamixer</c>
488in this state, you will not hear anything on your speakers. 551in this state, you will not hear anything on your speakers.
489</p> 552</p>
490 553
491<figure link="/images/docs/alsa-mixermuted.png" short="AlsaMixer Muted" caption="The Alsa Mixer Main Window, Muted"/> 554<figure link="/images/docs/alsa-mixermuted.png" short="AlsaMixer Muted" caption="The Alsa Mixer Main Window, Muted"/>
492 555
493<p> 556<p>
494Now, we shall unmute the channels, and set volume levels as needed. 557Now, we shall unmute the channels, and set volume levels as needed.
495</p> 558</p>
496 559
497<warn> 560<warn>
498Both Master <e>and</e> PCM need to be unmuted and set to audible volume levels if 561Both Master <e>and</e> PCM need to be unmuted and set to audible volume levels
499you want to hear some output on your speakers. 562if you want to hear some output on your speakers.
500</warn> 563</warn>
501 564
502<ul> 565<ul>
503 <li> 566 <li>
504 To move between channels, use your left and right arrow keys. (&lt;- 567 To move between channels, use your left and right arrow keys. (&lt;-
505 &amp; -&gt;) 568 &amp; -&gt;)
506 </li> 569 </li>
507 <li> 570 <li>
508 To toggle mute, move to the specific channel, for example Master and press 571 To toggle mute, move to the specific channel, for example Master and press
509 the <e>m</e> key on the keyboard. 572 the <e>m</e> key on the keyboard.
510 </li> 573 </li>
511 <li> 574 <li>
512 To increase and decrease the volume levels, use the up and down arrow keys 575 To increase and decrease the volume levels, use the up and down arrow keys
513 respectively. 576 respectively.
514 </li> 577 </li>
523<p> 586<p>
524After you're all done, your ALSA Mixer should look similar to the one below. 587After you're all done, your ALSA Mixer should look similar to the one below.
525Note the 00 instead of the MM and also the volume levels for some optimum 588Note the 00 instead of the MM and also the volume levels for some optimum
526settings. 589settings.
527</p> 590</p>
528 591
529<figure link="/images/docs/alsa-mixerunmuted.png" short="AlsaMixer Unmuted" caption="Alsa Mixer ready to roll"/> 592<figure link="/images/docs/alsa-mixerunmuted.png" short="AlsaMixer Unmuted" caption="Alsa Mixer ready to roll"/>
530 593
531</body> 594</body>
532</section> 595</section>
533<section> 596<section>
534<title>Sound Check!</title> 597<title>Sound Check!</title>
535<body> 598<body>
536 599
537<p> 600<p>
601The irritating way to check your soundcard is to see if you can hear static on
602the speakers. This isn't exactly fun, but hey, it tells you the card is
603configured and working.
604</p>
605
606<pre caption="Bring on th static">
607# <i>cat /dev/urandom > /dev/dsp</i>
608</pre>
609
610<note>
611<path>/dev/dsp</path> is a symlink to <path>/dev/sound/dsp</path> and should be
612automatically created. Try re-directing the output to
613<path>/dev/sound/dsp</path> in case you don't get a "No such file or directory"
614error.
615</note>
616
617<p>
618You should hear static. Press <c>Ctrl + C</c> to stop. If you don't hear
619anything, now is a good time to go back and check/trace out the issue and
620rectify it.
621</p>
622
623<p>
538Finally. Some music. If everything above is perfect, you should be able to now 624Finally. Some music. If everything above is perfect, you should now be able to
539listen to some good music. A quick way to test is to use a command line tool 625listen to some good music. A quick way to test is to use a command line tool
540like <c>media-sound/madplay</c>. You could also use something more well known 626like <c>media-sound/madplay</c>. You could also use something more well known
541like <c>mpg123</c> or <c>xmms</c>. If you are an ogg fan, you could use 627like <c>mpg123</c> or <c>xmms</c>. If you are an ogg fan, you could use
542<c>ogg123</c> provided by <c>media-sound/vorbis-tools</c>. Use any player you 628<c>ogg123</c> provided by <c>media-sound/vorbis-tools</c>. Use any player you
543are comfortable with. As always, <c>emerge</c> what you need. 629are comfortable with. As always, <c>emerge</c> what you need.
544</p> 630</p>
545 631
546<pre caption="Getting the software"> 632<pre caption="Getting the software">
547<comment>(Install the applications you want)</comment> 633<comment>(Install the applications you want)</comment>
548# <i>emerge madplay mpg123 xmms</i> 634# <i>emerge madplay mpg123 xmms</i>
549<comment>(To play .ogg files)</comment> 635<comment>(To play .ogg files)</comment>
550# <i>emerge vorbis-tools</i> 636# <i>emerge vorbis-tools</i>
551</pre> 637</pre>
552 638
553<p> 639<p>
554And then play your favorite sound track... 640And then play your favorite sound track...
555</p> 641</p>
570 656
571Playing: Paul Oakenfold - Dread Rock.ogg 657Playing: Paul Oakenfold - Dread Rock.ogg
572Ogg Vorbis stream: 2 channel, 44100 Hz 658Ogg Vorbis stream: 2 channel, 44100 Hz
573Genre: Soundtrack 659Genre: Soundtrack
574Transcoded: mp3;160 660Transcoded: mp3;160
575Title: Dread Rock 661Title: Dread Rock
576Artist: Paul Oakenfold 662Artist: Paul Oakenfold
577Date: 2003 663Date: 2003
578Album: Matrix Reloaded 664Album: Matrix Reloaded
579Time: 00:11.31 [04:28.75] of 04:40.06 (200.6 kbps) Output Buffer 96.9% 665Time: 00:11.31 [04:28.75] of 04:40.06 (200.6 kbps) Output Buffer 96.9%
580</pre> 666</pre>
581 667
582</body> 668</body>
583</section> 669</section>
584<section> 670<section>
671<title> ALSA and USE</title>
672<body>
673
674<p>
675You can now add the <c>alsa</c> use flag to <path>/etc/make.conf</path> to
676ensure that your applications that support ALSA get built with it. Some
677architectures like x86 and amd64 have the flag enabled by default.
678</p>
679
680</body>
681</section>
682<section>
585<title>Issues?</title> 683<title>Issues?</title>
586<body> 684<body>
587 685
588<p> 686<p>
589If for some reason you're unable to hear sound, the first thing to do would 687If for some reason you're unable to hear sound, the first thing to do would
590be to check your <uri link="#doc_chap3_pre5">alsamixer</uri> settings. 80% of 688be to check your <uri link="#doc_chap3_pre6">alsamixer</uri> settings. 80% of
591the issues lie with muted channels or low volume. Also check your Window 689the issues lie with muted channels or low volume. Also check your Window
592Manager's sound applet and verify that volumes are set to audible levels. 690Manager's sound applet and verify that volumes are set to audible levels.
593</p> 691</p>
594 692
595<p> 693<p>
596<path>/proc</path> is your friend. And in this case, <path>/proc/asound</path> 694<path>/proc</path> is your friend. And in this case, <path>/proc/asound</path>
597is your best friend. We shall just take a short look at how much info is made 695is your best friend. We shall just take a short look at how much info is made
598available to us there. 696available to us there.
599</p> 697</p>
600 698
601<pre caption="Fun with /proc/asound"> 699<pre caption="Fun with /proc/asound">
602<comment>(First and foremost, if /proc/asound/cards shows your card, ALSA has 700<comment>(First and foremost, if /proc/asound/cards shows your card, ALSA has
603picked up your sound card fine.)</comment> 701picked up your sound card fine.)</comment>
604# <i>cat /proc/asound/cards</i> 702# <i>cat /proc/asound/cards</i>
6050 [Live ]: EMU10K1 - Sound Blaster Live! 7030 [Live ]: EMU10K1 - Sound Blaster Live!

Legend:
Removed from v.1.53  
changed lines
  Added in v.1.54

  ViewVC Help
Powered by ViewVC 1.1.20