1 | <sect2>
|
---|
2 | <title>Configuring alsa-utils</title>
|
---|
3 |
|
---|
4 | <sect3><title>Config files</title>
|
---|
5 |
|
---|
6 | <para><filename>/etc/asound.state</filename></para>
|
---|
7 |
|
---|
8 | </sect3>
|
---|
9 |
|
---|
10 | <sect3><title>Configuration Information</title>
|
---|
11 |
|
---|
12 | <para>Probably the easiest way to store mixer levels is to set and retrieve
|
---|
13 | them using a bootscript. It is possible to do this with a
|
---|
14 | <userinput>post-install</userinput> line in
|
---|
15 | <filename>/etc/modules.conf</filename> but this is left as an exercise for
|
---|
16 | those readers who wish to do this.</para>
|
---|
17 |
|
---|
18 | <para>The alsa-drivers package installs a script as
|
---|
19 | <filename>/etc/rc.d/init.d/alsasound</filename>. While it is possible to use
|
---|
20 | this script, it contains a lot of extraneous detail which isn't needed on an
|
---|
21 | LFS system and so we create our own script
|
---|
22 | <filename>/etc/rc.d/init.d/alsa</filename>.</para>
|
---|
23 |
|
---|
24 | <para>To create the alsa script, do the following:</para>
|
---|
25 |
|
---|
26 | <para><screen><userinput>cat > /etc/rc.d/init.d/alsa << "EOF"</userinput>
|
---|
27 | #!/bin/sh
|
---|
28 | # Begin $rc_base/init.d/alsa
|
---|
29 |
|
---|
30 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
31 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
32 | # ALSA specific parts by Mark Hymers - markh@linuxfromscratch.org
|
---|
33 | # Stores mixer settings in the default location: /etc/asound.state
|
---|
34 |
|
---|
35 | source /etc/sysconfig/rc
|
---|
36 | source $rc_functions
|
---|
37 |
|
---|
38 | case "$1" in
|
---|
39 | start)
|
---|
40 | echo "Starting alsa... Restoring volumes..."
|
---|
41 | loadproc /usr/sbin/alsactl restore
|
---|
42 | #echo " Loading MIDI font..."
|
---|
43 | #loadproc sfxload /path/to/soundfont
|
---|
44 | ;;
|
---|
45 |
|
---|
46 | stop)
|
---|
47 | echo "Stopping alsa... Saving volumes......"
|
---|
48 | loadproc /usr/sbin/alsactl store
|
---|
49 | #echo " Removing MIDI font.........."
|
---|
50 | #loadproc sfxload -i
|
---|
51 | ;;
|
---|
52 |
|
---|
53 | restart)
|
---|
54 | $0 stop
|
---|
55 | /usr/bin/sleep 1
|
---|
56 | $0 start
|
---|
57 | ;;
|
---|
58 |
|
---|
59 | *)
|
---|
60 | echo "Usage: $0 {start|stop|restart}"
|
---|
61 | exit 1
|
---|
62 | ;;
|
---|
63 |
|
---|
64 | esac
|
---|
65 |
|
---|
66 | # End $rc_base/init.d/alsa
|
---|
67 | <userinput>EOF
|
---|
68 | chmod 755 /etc/rc.d/init.d/alsa</userinput></screen></para>
|
---|
69 |
|
---|
70 | <para>You can then create the appropriate symlinks:
|
---|
71 | <screen><userinput>cd /etc/rc.d/init.d &&
|
---|
72 | ln -sf ../init.d/alsa ../rc0.d/K35alsa &&
|
---|
73 | ln -sf ../init.d/alsa ../rc1.d/K35alsa &&
|
---|
74 | ln -sf ../init.d/alsa ../rc2.d/S40alsa &&
|
---|
75 | ln -sf ../init.d/alsa ../rc3.d/S40alsa &&
|
---|
76 | ln -sf ../init.d/alsa ../rc4.d/S40alsa &&
|
---|
77 | ln -sf ../init.d/alsa ../rc5.d/S40alsa &&
|
---|
78 | ln -sf ../init.d/alsa ../rc6.d/K35alsa</userinput></screen></para>
|
---|
79 |
|
---|
80 | <para>Note that all channels of your soundcard are muted by default. You can
|
---|
81 | use the <filename>alsamixer</filename> program from alsa-utils (or any other
|
---|
82 | OSS mixer) to change this.</para>
|
---|
83 |
|
---|
84 | <para>Also, the first time the above script is run, it will complain that
|
---|
85 | there is no state in <filename>/etc/asound.state</filename>. You can
|
---|
86 | prevent this by running the following commands after installing alsa-utils:
|
---|
87 | <screen><userinput>touch /etc/asound.state &&
|
---|
88 | alsactl store</userinput></screen></para>
|
---|
89 |
|
---|
90 | <para>A final note is that the lines loading <filename>sfxload</filename>
|
---|
91 | are commented out. They are there as an example of other things you may
|
---|
92 | wish to do in the startup script. <filename>sfxload</filename> is a
|
---|
93 | separate package of interest to SoundBlaster AWE and Live! users. It is
|
---|
94 | designed for loading "sound-fonts" (which are used for MIDI output). You
|
---|
95 | may wish to delete these lines and add your own or, if you have the relevant
|
---|
96 | soundcard, install <filename>sfxload</filename> and uncomment them.</para>
|
---|
97 |
|
---|
98 | </sect3>
|
---|
99 |
|
---|
100 | </sect2>
|
---|
101 |
|
---|