source: multimedia/libdriv/alsa/alsa-inst.xml@ f45b1953

10.0 10.1 11.0 11.1 11.2 11.3 12.0 12.1 6.0 6.1 6.2 6.2.0 6.2.0-rc1 6.2.0-rc2 6.3 6.3-rc1 6.3-rc2 6.3-rc3 7.10 7.4 7.5 7.6 7.6-blfs 7.6-systemd 7.7 7.8 7.9 8.0 8.1 8.2 8.3 8.4 9.0 9.1 basic bdubbs/svn elogind gnome initial-import kde5-13430 kde5-14269 kde5-14686 kea ken/TL2024 ken/inkscape-core-mods ken/tuningfonts krejzi/svn lazarus lxqt nosym perl-modules plabs/newcss plabs/python-mods python3.11 qt5new rahul/power-profiles-daemon renodr/vulkan-addition reorg systemd-11177 systemd-13485 trunk upgradedb v1_0 v5_0 v5_0-pre1 v5_1 v5_1-pre1 xry111/intltool xry111/llvm18 xry111/soup3 xry111/test-20220226 xry111/xf86-video-removal
Last change on this file since f45b1953 was f45b1953, checked in by Mark Hymers <markh@…>, 22 years ago

Initial revision

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@3 af4574ff-66df-0310-9fd7-8a98e5e911e0

  • Property mode set to 100644
File size: 6.5 KB
Line 
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/&lt;kernel-version&gt;/kernel/drivers/sound/ \
11 --with-kernel=&lt;path-to-kernel-source-tree-to-build-for&gt; \
12 --with-sequencer=yes --with-oss=yes \
13 --with-cards=&lt;soundcards-to-compile&gt; &&
14make &&
15make install </userinput></screen></para>
16
17<para>Replace &lt;path-to-kernel-source-tree-to-build-for&gt; and
18&lt;kernel-version&gt; with which the path to the source tree of the
19kernel version you want to build the drivers for (most commonly your
20current version) and the kernel version number respectively. You also
21need to replace &lt;soundcards-to-compile&gt; with the card names
22you need drivers for (read the SOUNDCARDS section below); otherwise
23"./configure --help" gives you a list of
24drivers you can compile.</para>
25
26<para>There are two ways of setting up the modules. The easiest
27way is the "let the kernel module loader load them automatically"-way,
28the 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 &gt;&gt; /etc/modules.conf &lt;&lt; "EOF"</userinput>
34alias char-major-116 snd
35options snd snd_major=116 snd_cards_limit=1
36alias snd-card-0 snd-card-&lt;soundcard&gt;
37alias sound-slot-0 snd-card-0
38alias sound-service-0-0 snd-mixer-oss
39alias sound-service-0-3 snd-pcm-oss
40post-install snd-card-&lt;soundcard&gt; /usr/sbin/alsactl restore
41<userinput>EOF</userinput></screen></para>
42
43<para>Remember to replace &lt;soundcard&gt; with whatever is
44appropriate. Note that if you are going to use the LFS-style alsa
45script 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
48have the post-install line in modules.conf, you don't need a startup
49script. If on the other hand you want to use an LFS style startup
50script (because you want to perform other operations at startup/shutdown
51or for another reason), you can use this script here:</para>
52
53<para><screen><userinput>cat &gt; /etc/rc.d/init.d/alsa &lt;&lt; "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
61source /etc/sysconfig/rc
62source $rc_functions
63
64if [ -f /etc/sysconfig/alsa ]
65then
66 source /etc/sysconfig/alsa
67fi
68
69if [ -z "$CONF" ]
70then
71 echo "Please create an /etc/sysconfig/alsa file containing"
72 echo "a CONF value (usually /etc/asound.conf)"
73 exit 1;
74fi
75
76case "$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
102esac
103
104# End $rc_base/init.d/alsa
105<userinput>EOF
106chmod 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.
109This is because they are only needed for certain soundcards and also
110require an additional program (<userinput>sfxload</userinput>). An
111example of a soundcard which needs MIDI fonts loaded in order to play
112MIDI files is the Soundblaster Live! which is based on a emu10k1
113chip.</para>
114
115<para>If you are using the above script, you will also need
116a <filename>/etc/sysconfig/alsa</filename> file. Create this using
117the following commands:</para>
118
119<para><screen><userinput>cat &gt; /etc/sysconfig/alsa &lt;&lt; "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
124CONF=/etc/asound.conf
125
126# FONT is where your midi font (if any) is stored.
127FONT=/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 &amp;&amp;
134ln -sf ../init.d/alsa ../rc0.d/K35alsa &amp;&amp;
135ln -sf ../init.d/alsa ../rc1.d/K35alsa &amp;&amp;
136ln -sf ../init.d/alsa ../rc2.d/S40alsa &amp;&amp;
137ln -sf ../init.d/alsa ../rc3.d/S40alsa &amp;&amp;
138ln -sf ../init.d/alsa ../rc4.d/S40alsa &amp;&amp;
139ln -sf ../init.d/alsa ../rc5.d/S40alsa &amp;&amp;
140ln -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
143the <filename>alsamixer</filename> (in alsa-utils, requires alsa-lib) or any
144other OSS mixer program (like kmix, gmix, aumix) to unmute them. We
145recommend that you do this <emphasis>before</emphasis> running the
146script above because otherwise alsactl will complain that it cannot read
147the <filename>/etc/asound.conf</filename> file. You can do this by
148running <userinput>alsamixer</userinput>, setting the volumes and then
149running <userinput>alsactl -f /etc/asound.conf store</userinput>. This
150means 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>
155run the snddevices script in the alsa-driver directory. From the
156alsa-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 &&
165make 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 &&
172make 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 &&
179make install</userinput></screen></para>
180
181<para>These commands are all you need to install
182alsa-oss-lib or alsa-tools. Remember oss-lib is only for future
183versions and the alsa-tools are only useful for the owners of very old
184or expensive cards (e.g multichannel cards), so most people
185don't need it.</para>
186
187</sect3>
188</sect2>
189
Note: See TracBrowser for help on using the repository browser.