More alsa problems
Adam Myrow
amyrow at midsouth.rr.com
Mon Feb 3 07:43:36 EST 2003
The nice thing about modules.conf is that you can automate a lot with it.
For example, here's mine. Note that you can't just copy it verbatim. The
README in the ALSA source tree has examples. Here, I'll add comments
explaining what each line is doing.
alias char-major-116 snd
#This is required.
alias snd-card-0 snd-card-sbawe
#This is for basic sound card support. You would replace the name here
#with the name of the driver you are using. I think it is snd-sb16 for a
#regular SB16.
#You may also need a line passing the IRQ/address, etc. I didn't because
#my card is PNP. The INSTALL file in the ALSA source tree has a lot of
#examples of passing such options.
post-install snd-card-0 /usr/sbin/alsactl restore
#This wasn't in the docs, but basically says to run the given command
#after loading the module. I suggest this to make things easier.
alias char-major-14 soundcore
#This is another required line.
alias sound-slot-0 snd-card-0
#I think this is the beginning of OSS emulation support and is required.
alias sound-service-0-0 snd-mixer-oss
#This is to allow non-ALSA mixers to work.
alias sound-service-0-1 snd-seq-oss
#This is for MIDI support. If you never use MIDI, you could probably
#leave it out, but it never hurts.
post-install sound-service-0-1 /usr/local/bin/sfxload -c30 -r30 synthgs
#This is specific to the AWE64. You can pretty much forget this line as
#it calls a specific utility on my system.
alias sound-service-0-3 snd-pcm-oss
#This allows non-ALSA programs to play sounds. another required line.
alias sound-service-0-8 snd-seq-oss
#This seems redundant, but I think it is in the docs.
alias sound-service-0-12 snd-pcm-oss
#another redundant line, but it's in the docs.
With all that in place, the mere act of trying to play or record a sound
will cause the right modules to load. I get some messages in syslog about
being unable to locate modules, and am not sure how to fix it, but this
works for me. Note that the first time you load up ALSA, you may not
hear any sound. Use the mixer program of your choice (I like rexima) to
set the volumes to your liking. Then type as root "alsactl store." From
then on, you will have no problems, hopefully. If you want to mute or
unmute the microphone or line-in, you'll have to use either amixer or
Alsamixer since I have yet to find a text-based mixer other than the Alsa
ones that let you do it. Again, an "alsactl store" will set the defaults,
and thanks to the suggested line in modules.conf, it will be restored when
needed.
An alternative to modules.conf is to edit /etc/rc.d/rc.modules and
manually load the modules. Then, add an "/usr/sbin/alsactl restore" to
/etc/rc.d/rc.local. the advantage of this is that the sound is always in
memory and may be a bit faster. I did it the other way because that's how
the docs suggest it. Also, if I'm not using sound for awhile, the first
method saves memory when it unloads the drivers.
Alsa is supposedly going to be in the 2.6 Linux kernel. I hope they make
it a bit more friendly to set up by then.
More information about the Speakup
mailing list