2002-08-27 07:44:12 +08:00
|
|
|
<sect2>
|
|
|
|
<title>Configuring alsa-utils</title>
|
|
|
|
|
|
|
|
<sect3><title>Config files</title>
|
2003-03-06 09:19:52 +08:00
|
|
|
|
2003-04-21 06:15:01 +08:00
|
|
|
<para><filename>/etc/asound.state</filename></para>
|
2003-03-06 09:19:52 +08:00
|
|
|
|
2002-08-27 07:44:12 +08:00
|
|
|
</sect3>
|
|
|
|
|
|
|
|
<sect3><title>Configuration Information</title>
|
|
|
|
|
2003-03-06 09:19:52 +08:00
|
|
|
<para>Probably the easiest way to store mixer levels is to set and retrieve
|
|
|
|
them using a bootscript. It is possible to do this with a
|
|
|
|
<userinput>post-install</userinput> line in
|
|
|
|
<filename>/etc/modules.conf</filename> but this is left as an exercise for
|
|
|
|
those readers who wish to do this.</para>
|
|
|
|
|
|
|
|
<para>The alsa-drivers package installs a script as
|
|
|
|
<filename>/etc/rc.d/init.d/alsasound</filename>. While it is possible to use
|
|
|
|
this script, it contains a lot of extraneous detail which isn't needed on an
|
|
|
|
LFS system and so we create our own script
|
|
|
|
<filename>/etc/rc.d/init.d/alsa</filename>.</para>
|
|
|
|
|
|
|
|
<para>To create the alsa script, do the following:</para>
|
|
|
|
|
|
|
|
<para><screen><userinput>cat > /etc/rc.d/init.d/alsa << "EOF"</userinput>
|
|
|
|
#!/bin/sh
|
|
|
|
# Begin $rc_base/init.d/alsa
|
|
|
|
|
|
|
|
# Based on sysklogd script from LFS-3.1 and earlier.
|
|
|
|
# Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
|
|
|
# ALSA specific parts by Mark Hymers - markh@linuxfromscratch.org
|
|
|
|
# Stores mixer settings in the default location: /etc/asound.state
|
|
|
|
|
|
|
|
source /etc/sysconfig/rc
|
|
|
|
source $rc_functions
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
2003-03-20 08:13:12 +08:00
|
|
|
echo "Starting alsa... Restoring volumes..."
|
2003-03-06 09:19:52 +08:00
|
|
|
loadproc /usr/sbin/alsactl restore
|
2003-03-20 08:13:12 +08:00
|
|
|
#echo " Loading MIDI font..."
|
2003-03-06 09:19:52 +08:00
|
|
|
#loadproc sfxload /path/to/soundfont
|
|
|
|
;;
|
|
|
|
|
|
|
|
stop)
|
2003-03-20 08:13:12 +08:00
|
|
|
echo "Stopping alsa... Saving volumes......"
|
2003-03-06 09:19:52 +08:00
|
|
|
loadproc /usr/sbin/alsactl store
|
2003-03-20 08:13:12 +08:00
|
|
|
#echo " Removing MIDI font.........."
|
2003-03-06 09:19:52 +08:00
|
|
|
#loadproc sfxload -i
|
|
|
|
;;
|
|
|
|
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
/usr/bin/sleep 1
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
|
|
|
|
*)
|
|
|
|
echo "Usage: $0 {start|stop|restart}"
|
|
|
|
exit 1
|
|
|
|
;;
|
|
|
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
# End $rc_base/init.d/alsa
|
|
|
|
<userinput>EOF
|
|
|
|
chmod 755 /etc/rc.d/init.d/alsa</userinput></screen></para>
|
|
|
|
|
|
|
|
<para>You can then create the appropriate symlinks:
|
|
|
|
<screen><userinput>cd /etc/rc.d/init.d &&
|
|
|
|
ln -sf ../init.d/alsa ../rc0.d/K35alsa &&
|
|
|
|
ln -sf ../init.d/alsa ../rc1.d/K35alsa &&
|
|
|
|
ln -sf ../init.d/alsa ../rc2.d/S40alsa &&
|
|
|
|
ln -sf ../init.d/alsa ../rc3.d/S40alsa &&
|
|
|
|
ln -sf ../init.d/alsa ../rc4.d/S40alsa &&
|
|
|
|
ln -sf ../init.d/alsa ../rc5.d/S40alsa &&
|
|
|
|
ln -sf ../init.d/alsa ../rc6.d/K35alsa</userinput></screen></para>
|
|
|
|
|
|
|
|
<para>Note that all channels of your soundcard are muted by default. You can
|
|
|
|
use the <filename>alsamixer</filename> program from alsa-utils (or any other
|
|
|
|
OSS mixer) to change this.</para>
|
|
|
|
|
|
|
|
<para>Also, the first time the above script is run, it will complain that
|
|
|
|
there is no state in <filename>/etc/asound.state</filename>. You can
|
|
|
|
prevent this by running the following commands after installing alsa-utils:
|
|
|
|
<screen><userinput>touch /etc/asound.state &&
|
|
|
|
alsactl store</userinput></screen></para>
|
|
|
|
|
|
|
|
<para>A final note is that the lines loading <filename>sfxload</filename>
|
|
|
|
are commented out. They are there as an example of other things you may
|
|
|
|
wish to do in the startup script. <filename>sfxload</filename> is a
|
2003-04-08 05:14:53 +08:00
|
|
|
separate package of interest to SoundBlaster AWE and Live! users. It is
|
2003-03-06 09:19:52 +08:00
|
|
|
designed for loading "sound-fonts" (which are used for MIDI output). You
|
|
|
|
may wish to delete these lines and add your own or, if you have the relevant
|
|
|
|
soundcard, install <filename>sfxload</filename> and uncomment them.</para>
|
|
|
|
|
2002-08-27 07:44:12 +08:00
|
|
|
</sect3>
|
|
|
|
|
|
|
|
</sect2>
|
|
|
|
|