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