1 | <sect2>
|
---|
2 | <title>Installation of alsa</title>
|
---|
3 |
|
---|
4 | <para>Unpack the packages you've downloaded</para>
|
---|
5 |
|
---|
6 | <sect3>
|
---|
7 | <title>Installation of the driver</title>
|
---|
8 |
|
---|
9 | <para><screen><userinput>./configure \
|
---|
10 | --with-moddir=/lib/modules/<kernel-version>/kernel/drivers/sound/ \
|
---|
11 | --with-kernel=<path-to-kernel-source-tree-to-build-for> \
|
---|
12 | --with-sequencer=yes --with-oss=yes \
|
---|
13 | --with-cards=<soundcards-to-compile> &&
|
---|
14 | make &&
|
---|
15 | make install </userinput></screen></para>
|
---|
16 |
|
---|
17 | <para>Replace <path-to-kernel-source-tree-to-build-for> and
|
---|
18 | <kernel-version> with which the path to the source tree of the
|
---|
19 | kernel version you want to build the drivers for (most commonly your
|
---|
20 | current version) and the kernel version number respectively. You also
|
---|
21 | need to replace <soundcards-to-compile> with the card names
|
---|
22 | you need drivers for (read the SOUNDCARDS section below); otherwise
|
---|
23 | "./configure --help" gives you a list of
|
---|
24 | drivers you can compile.</para>
|
---|
25 |
|
---|
26 | <para>There are two ways of setting up the modules. The easiest
|
---|
27 | way is the "let the kernel module loader load them automatically"-way,
|
---|
28 | the other one is to use the bootscript you'll find in the
|
---|
29 | /utils-directory of the driver.</para>
|
---|
30 |
|
---|
31 | <para>For both ways, you need to add some lines to /etc/modules.conf:</para>
|
---|
32 |
|
---|
33 | <para><screen><userinput>cat >> /etc/modules.conf << "EOF"</userinput>
|
---|
34 | alias char-major-116 snd
|
---|
35 | options snd snd_major=116 snd_cards_limit=1
|
---|
36 | alias snd-card-0 snd-card-<soundcard>
|
---|
37 | alias sound-slot-0 snd-card-0
|
---|
38 | alias sound-service-0-0 snd-mixer-oss
|
---|
39 | alias sound-service-0-3 snd-pcm-oss
|
---|
40 | post-install snd-card-<soundcard> /usr/sbin/alsactl restore
|
---|
41 | <userinput>EOF</userinput></screen></para>
|
---|
42 |
|
---|
43 | <para>Remember to replace <soundcard> with whatever is
|
---|
44 | appropriate. Note that if you are going to use the LFS-style alsa
|
---|
45 | script we give below, there is no need for the post-install line.</para>
|
---|
46 |
|
---|
47 | <para>If you want kmod to automatically load the modules, as long as you
|
---|
48 | have the post-install line in modules.conf, you don't need a startup
|
---|
49 | script. If on the other hand you want to use an LFS style startup
|
---|
50 | script (because you want to perform other operations at startup/shutdown
|
---|
51 | or for another reason), you can use this script here:</para>
|
---|
52 |
|
---|
53 | <para><screen><userinput>cat > /etc/rc.d/init.d/alsa << "EOF"</userinput>
|
---|
54 | #!/bin/sh
|
---|
55 | # Begin $rc_base/init.d/alsa
|
---|
56 |
|
---|
57 | # Based on sysklogd script from LFS-3.1 and earlier.
|
---|
58 | # Rewritten by Gerard Beekmans - gerard@linuxfromscratch.org
|
---|
59 | # ALSA specific parts by Mark Hymers - markh@linuxfromscratch.org
|
---|
60 |
|
---|
61 | source /etc/sysconfig/rc
|
---|
62 | source $rc_functions
|
---|
63 |
|
---|
64 | if [ -f /etc/sysconfig/alsa ]
|
---|
65 | then
|
---|
66 | source /etc/sysconfig/alsa
|
---|
67 | fi
|
---|
68 |
|
---|
69 | if [ -z "$CONF" ]
|
---|
70 | then
|
---|
71 | echo "Please create an /etc/sysconfig/alsa file containing"
|
---|
72 | echo "a CONF value (usually /etc/asound.conf)"
|
---|
73 | exit 1;
|
---|
74 | fi
|
---|
75 |
|
---|
76 | case "$1" in
|
---|
77 | start)
|
---|
78 | echo -n "Starting alsa... Restoring volumes..."
|
---|
79 | loadproc /usr/sbin/alsactl -f $CONF restore
|
---|
80 | #echo -n " Loading MIDI font..."
|
---|
81 | #loadproc sfxload $FONT
|
---|
82 | ;;
|
---|
83 |
|
---|
84 | stop)
|
---|
85 | echo -n "Stopping alsa... Saving volumes......"
|
---|
86 | loadproc /usr/sbin/alsactl -f $CONF store
|
---|
87 | #echo -n " Removing MIDI font.........."
|
---|
88 | #loadproc sfxload -i
|
---|
89 | ;;
|
---|
90 |
|
---|
91 | restart)
|
---|
92 | $0 stop
|
---|
93 | /usr/bin/sleep 1
|
---|
94 | $0 start
|
---|
95 | ;;
|
---|
96 |
|
---|
97 | *)
|
---|
98 | echo "Usage: $0 {start|stop|restart}"
|
---|
99 | exit 1
|
---|
100 | ;;
|
---|
101 |
|
---|
102 | esac
|
---|
103 |
|
---|
104 | # End $rc_base/init.d/alsa
|
---|
105 | <userinput>EOF
|
---|
106 | chmod 755 /etc/rc.d/init.d/alsa</userinput></screen></para>
|
---|
107 |
|
---|
108 | <para>Note that the Loading and Removing MIDI font lines are commented out.
|
---|
109 | This is because they are only needed for certain soundcards and also
|
---|
110 | require an additional program (<userinput>sfxload</userinput>). An
|
---|
111 | example of a soundcard which needs MIDI fonts loaded in order to play
|
---|
112 | MIDI files is the Soundblaster Live! which is based on a emu10k1
|
---|
113 | chip.</para>
|
---|
114 |
|
---|
115 | <para>If you are using the above script, you will also need
|
---|
116 | a <filename>/etc/sysconfig/alsa</filename> file. Create this using
|
---|
117 | the following commands:</para>
|
---|
118 |
|
---|
119 | <para><screen><userinput>cat > /etc/sysconfig/alsa << "EOF"</userinput>
|
---|
120 | # Begin /etc/sysconfig/alsa
|
---|
121 |
|
---|
122 | # CONF is where you want the system to store volume settings.
|
---|
123 | # /etc/asound.conf is recommended
|
---|
124 | CONF=/etc/asound.conf
|
---|
125 |
|
---|
126 | # FONT is where your midi font (if any) is stored.
|
---|
127 | FONT=/usr/share/8mbgmsfx.sf2
|
---|
128 |
|
---|
129 | # End /etc/sysconfig/alsa
|
---|
130 | <userinput>EOF</userinput></screen></para>
|
---|
131 |
|
---|
132 | <para>Then create the appropriate symlinks:
|
---|
133 | <screen><userinput>cd /etc/rc.d/init.d &&
|
---|
134 | ln -sf ../init.d/alsa ../rc0.d/K35alsa &&
|
---|
135 | ln -sf ../init.d/alsa ../rc1.d/K35alsa &&
|
---|
136 | ln -sf ../init.d/alsa ../rc2.d/S40alsa &&
|
---|
137 | ln -sf ../init.d/alsa ../rc3.d/S40alsa &&
|
---|
138 | ln -sf ../init.d/alsa ../rc4.d/S40alsa &&
|
---|
139 | ln -sf ../init.d/alsa ../rc5.d/S40alsa &&
|
---|
140 | ln -sf ../init.d/alsa ../rc6.d/K35alsa</userinput></screen></para>
|
---|
141 |
|
---|
142 | <para>Beware. All channels of your soundcard are muted by default. You can use
|
---|
143 | the <filename>alsamixer</filename> (in alsa-utils, requires alsa-lib) or any
|
---|
144 | other OSS mixer program (like kmix, gmix, aumix) to unmute them. We
|
---|
145 | recommend that you do this <emphasis>before</emphasis> running the
|
---|
146 | script above because otherwise alsactl will complain that it cannot read
|
---|
147 | the <filename>/etc/asound.conf</filename> file. You can do this by
|
---|
148 | running <userinput>alsamixer</userinput>, setting the volumes and then
|
---|
149 | running <userinput>alsactl -f /etc/asound.conf store</userinput>. This
|
---|
150 | means that the first time you run the script, it will have a valid
|
---|
151 | <filename>asound.conf</filename> file to use.</para>
|
---|
152 |
|
---|
153 | <para>If you get an error like
|
---|
154 | <screen>alsamixer: failed to open mixer #0/#0: No such file or directory</screen>
|
---|
155 | run the snddevices script in the alsa-driver directory. From the
|
---|
156 | alsa-driver source directory run:</para>
|
---|
157 |
|
---|
158 | <para><screen><userinput>./snddevices</userinput></screen></para>
|
---|
159 | </sect3>
|
---|
160 |
|
---|
161 | <sect3>
|
---|
162 | <title>Installation of the library</title>
|
---|
163 | <para>From the alsa-lib source directory, run:</para>
|
---|
164 | <para><screen><userinput>./configure &&
|
---|
165 | make install</userinput></screen></para>
|
---|
166 | </sect3>
|
---|
167 |
|
---|
168 | <sect3>
|
---|
169 | <title>Installation of the utils</title>
|
---|
170 | <para>From the alsa-utils source directory, run:</para>
|
---|
171 | <para><screen><userinput>./configure &&
|
---|
172 | make install</userinput></screen></para>
|
---|
173 | </sect3>
|
---|
174 |
|
---|
175 | <sect3>
|
---|
176 | <title>Installation of additional packages (alsa-oss-lib and alsa-tools)</title>
|
---|
177 |
|
---|
178 | <para><screen><userinput>./configure &&
|
---|
179 | make install</userinput></screen></para>
|
---|
180 |
|
---|
181 | <para>These commands are all you need to install
|
---|
182 | alsa-oss-lib or alsa-tools. Remember oss-lib is only for future
|
---|
183 | versions and the alsa-tools are only useful for the owners of very old
|
---|
184 | or expensive cards (e.g multichannel cards), so most people
|
---|
185 | don't need it.</para>
|
---|
186 |
|
---|
187 | </sect3>
|
---|
188 | </sect2>
|
---|
189 |
|
---|