Rev | Author | # | Line |
---|---|---|---|
18 | AristotlePagaltzis | 1 | <b>See also [Alsa5.1Notes].</b> |
16 | AlastairPorter | 2 | |
18 | AristotlePagaltzis | 3 | !!! Application support for [ALSA] |
12 | SamJansen | 4 | |
18 | AristotlePagaltzis | 5 | * There is a version of esd(1) that uses [ALSA] – that means that any app that currently uses esd(1) will be fine. (In [Debian] the [Package] is called <tt>libesd-alsa0</tt>.) |
12 | SamJansen | 6 | |
18 | AristotlePagaltzis | 7 | * [ALSA] has optional support for [OSS] compatibility for older apps that only know about the [OSS]-style sound drivers. To use it, make sure the <tt>snd-pcm-oss</tt> module is loaded. (In Debian, you can just set <tt>startosslayer=true</tt> in <tt>/etc/default/alsa</tt> for the startup scripts to do this for you.) |
12 | SamJansen | 8 | |
15 | IanMcDonald | 9 | |
18 | AristotlePagaltzis | 10 | !!! Module hints |
12 | SamJansen | 11 | |
18 | AristotlePagaltzis | 12 | * It may be a good idea to make sure you have the <tt>snd-pcm-oss</tt> module if you want backwards-compatibility for older apps (see further below). If you are compiling the modules from source, include <tt>--with-oss=yes</tt> on your <tt>./configure</tt> line. |
12 | SamJansen | 13 | |
18 | AristotlePagaltzis | 14 | * The sound-card on a Thinkpad 600E needs the <tt>snd-cs4236</tt> module, despite the card claiming to be a 46xx (and using a module named cs4232 in the older [OSS] driver series). |
12 | SamJansen | 15 | |
14 | JohnMcPherson | 16 | |
18 | AristotlePagaltzis | 17 | !!! My sound card doesn't work after an upgrade |
12 | SamJansen | 18 | |
18 | AristotlePagaltzis | 19 | Run <tt>alsaconf</tt>, it will probably fix it. |
12 | SamJansen | 20 | |
21 | |||
18 | AristotlePagaltzis | 22 | !!! Not all sound devices work |
12 | SamJansen | 23 | |
18 | AristotlePagaltzis | 24 | If one of your sound devices doesn't work and you get an error similar to <tt>EMU10K1_Audigy: probe of 0000:02:0a.0 failed with error -12</tt> then it might be because the devices are fighting over which sound card number they want to be. To fix this alter the sound card module options (see [Module] page on how to do this). One example of a configuration that works is <tt>options snd-emu10k1 index=-15</tt>. The <tt>index</tt> parameter specifies which card becomes which number, or if negative then it is a bitmask of numbers that it can be autoassigned to. To learn more about this look at the LinuxKernel source file <tt>Documentation/sound/alsa/ALSA-Configuration.txt</tt> |
14 | JohnMcPherson | 25 | |
26 | |||
18 | AristotlePagaltzis | 27 | !!! Software Mixing With [ALSA] |
19 | CraigBox | 28 | |
20 | AristotlePagaltzis | 29 | You can get [ALSA] to do software mixing for you without having to resort to something like esd(1). This is done via the dmix plugin and as [documented on the ALSA wiki | http://alsa.opensrc.org/index.php?page=DmixPlugin]. As of 1.0.9rc2, this is configured out of the box for the vast majority of consumer sound chipsets. (The first [Ubuntu] version to benefit from this was Breezy.) |
12 | SamJansen | 30 | |
20 | AristotlePagaltzis | 31 | If you have an earlier version, after you get [ALSA] going, you need to put the following in a <tt>.asoundrc</tt> file in your home directory. |
12 | SamJansen | 32 | |
17 | IanMcDonald | 33 | <verbatim> |
18 | AristotlePagaltzis | 34 | # .asoundrc file. Put this in your home directory. |
12 | SamJansen | 35 | |
18 | AristotlePagaltzis | 36 | pcm.mixed { |
37 | type dmix | ||
38 | ipc_key 123456 # Any unique value | ||
39 | ipc_key_add_uid true # No idea... | ||
40 | slave { | ||
41 | pcm "hw:0,0" | ||
42 | # Apparently for OSS emulation device, you have to set the period | ||
43 | # and the buffer sizes in powers of two. | ||
44 | period_time 0 | ||
45 | period_size 1024 # must be power of 2 | ||
46 | buffer_size 4096 # ditto | ||
47 | rate 44100 | ||
48 | } | ||
12 | SamJansen | 49 | |
18 | AristotlePagaltzis | 50 | # bindings are cool. This says, that only the first |
51 | # two channels are to be used by dmix, which is enough for | ||
52 | # (most) oss apps and also lets multichannel chios work | ||
53 | # much faster: | ||
12 | SamJansen | 54 | |
18 | AristotlePagaltzis | 55 | bindings { |
56 | 0 0 # from 0 => to 0 | ||
57 | 1 1 # from 1 => to 1 | ||
58 | } | ||
59 | } | ||
12 | SamJansen | 60 | |
18 | AristotlePagaltzis | 61 | pcm.!default { |
62 | type plug | ||
63 | slave.pcm mixed | ||
64 | } | ||
12 | SamJansen | 65 | |
18 | AristotlePagaltzis | 66 | pcm.dsp0 { |
67 | type plug | ||
68 | slave.pcm mixed | ||
69 | } | ||
12 | SamJansen | 70 | |
18 | AristotlePagaltzis | 71 | pcm.mixer0 { |
72 | type hw | ||
73 | card 0 | ||
74 | } | ||
17 | IanMcDonald | 75 | </verbatim> |
12 | SamJansen | 76 | |
18 | AristotlePagaltzis | 77 | There are some problems with this. First of all, [OSS] [Kernel] emulation won’t go through this layer. For an [OSS]-based application to use this, you need to use the <tt>aoss</tt> helper utility. Also, for [SDL] based applications (usually games) to use this, you will want the EnvironmentVariable <tt>AUDIODEV</tt> to be set to <tt>default</tt>, ie. <tt>export AUDIODEV=default</tt>. |
21 | LawrenceDoliveiro | 78 | |
79 | !!! Surround-Sound Notes | ||
80 | |||
81 | Couple of pages that might be useful, at the [ALSA Wiki|http://alsa.opensrc.org/SurroundSound] and [Halfgaar|http://www.halfgaar.net/surround-sound-in-linux], thanks to [Dave Phillips|http://www.linuxjournal.com/node/1000244]. | ||
12 | SamJansen | 82 | |
83 | |||
18 | AristotlePagaltzis | 84 | !!! Soundblaster SB16 module |
12 | SamJansen | 85 | |
18 | AristotlePagaltzis | 86 | On my [LinuxKernel2.6] system, I couldn't load the [ALSA] module for the [ISA] SB16 card, no matter what I did. Eventually, I discovered it loaded fine if I disabled the <tt>isapnp</tt> option for the module. Eg in <tt>/etc/modprobe.conf</tt>, I had |
12 | SamJansen | 87 | |
18 | AristotlePagaltzis | 88 | <verbatim> |
89 | options snd-sb16 isapnp=0 | ||
90 | </verbatim> | ||
12 | SamJansen | 91 | |
18 | AristotlePagaltzis | 92 | It seemed to be defaulting to trying to use <tt>isapnp</tt> but that didn't work, whether or not I enabled [Kernel] [ISA] [PnP] support and [BIOS] [PnP] support. |
12 | SamJansen | 93 | |
94 | |||
18 | AristotlePagaltzis | 95 | !!! modprobe(8) complains about unresolved symbols in <tt>schedule_work</tt> |
12 | SamJansen | 96 | |
18 | AristotlePagaltzis | 97 | You need to run <tt>touch include/linux/workqueue.h</tt> between <tt>./configure</tt> and <tt>make</tt> on <tt>alsa-driver</tt>. |
12 | SamJansen | 98 | |
18 | AristotlePagaltzis | 99 | If you want to do this while building from [SRPM], do the following: |
12 | SamJansen | 100 | |
18 | AristotlePagaltzis | 101 | Install the [SRPM]: |
12 | SamJansen | 102 | |
18 | AristotlePagaltzis | 103 | <verbatim> |
104 | rpm -ivh alsa-driver.x.y.z-p.src.rpm | ||
17 | IanMcDonald | 105 | </verbatim> |
14 | JohnMcPherson | 106 | |
18 | AristotlePagaltzis | 107 | Now open the <tt>alsa-driver.x.y.z-p.spec</tt> in the <tt>SPECS/</tt> directory, locate the <tt>%configure</tt> and <tt>make</tt> commands and add the following command between them: |
14 | JohnMcPherson | 108 | |
18 | AristotlePagaltzis | 109 | <verbatim> |
110 | touch include/linux/workqueue.h | ||
111 | </verbatim> | ||
14 | JohnMcPherson | 112 | |
18 | AristotlePagaltzis | 113 | Finally, [RPM] needs to be told to build the ''spec file'': |
14 | JohnMcPherson | 114 | |
18 | AristotlePagaltzis | 115 | <verbatim> |
116 | rpmbuild -bb --define 'cards als4000' --target $arch \ | ||
117 | alsa-driver.x.y.z-p.spec | ||
118 | </verbatim> | ||
14 | JohnMcPherson | 119 | |
18 | AristotlePagaltzis | 120 | You can now install the [RPM]s built in the <tt>RPMS/$arch/</tt> directory. |
14 | JohnMcPherson | 121 | |
122 | |||
18 | AristotlePagaltzis | 123 | !!! Compiling [ALSA] on RedHatLinux using the FreshRpms [SRPM] |
14 | JohnMcPherson | 124 | |
18 | AristotlePagaltzis | 125 | You probably want to set up your own <tt>.rpmmacros</b> file first, as per [RPMNotes]. Remember to specify the target architecture and the card (see the [ALSA soundcard matrix | http://www.alsa-project.org/alsa-doc/] to find yours) to compile for, eg.: |
14 | JohnMcPherson | 126 | |
18 | AristotlePagaltzis | 127 | <verbatim> |
128 | rpmbuild --rebuild alsa-driver.x.y.z-p.src.rpm \ | ||
129 | --define 'cards als4000' --target $arch | ||
130 | </verbatim> | ||
17 | IanMcDonald | 131 | |
18 | AristotlePagaltzis | 132 | where <tt>$arch</tt> might be <tt>athlon</tt>, f.ex. The [RPM]s will end up in <tt>RPMS/$arch/</tt>, ie f.ex in <tt>RPMS/athlon/</tt>. As with all source builds, you will need to recompile the [SRPM] if you upgrade your [Kernel]; you only need to install the <tt>kernel-module-alsa</tt> [RPM], however. |
22 | LawrenceDoliveiro | 133 | |
134 | !!! See also | ||
135 | [ALSA configuration notes|http://www.sabi.co.uk/Notes/linuxSoundALSA.html] |
lib/blame.php:177: Warning: Invalid argument supplied for foreach() (...repeated 5 times)