source: multimedia/libdriv/alsa/driver/alsa-driver-config.xml@ 64bc4bd

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 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 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 64bc4bd was 64bc4bd, checked in by Mark Hymers <markh@…>, 22 years ago

alsa rewrite

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

  • Property mode set to 100644
File size: 4.7 KB
Line 
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 &gt;&gt; /etc/modules.conf &lt;&lt; "EOF"</userinput>
17alias char-major-14 soundcore
18alias char-major-116 snd
19
20alias snd-card-0 snd-&lt;soundcard-name&gt;
21
22alias sound-slot-0 snd-card-0
23
24alias sound-service-0-0 snd-mixer-oss
25alias sound-service-0-1 snd-seq-oss
26alias sound-service-0-3 snd-pcm-oss
27alias sound-service-0-8 snd-seq-midi
28<userinput>EOF</userinput></screen></para>
29
30<para>&lt;soundcard-name&gt; needs to be replaced with the driver relevant
31to your soundcard. If you have more than one soundcard, you can add
32additional sections by repeating the above but changing the first 0 to 1 and
33so 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
37version of the kernel you are currently running, simply run
38<screen><userinput>depmod</userinput></screen> If you are compiling
39drivers for a different kernel version to that which you are running, you
40will 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
44them 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
47those 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
51this script, it contains a lot of extraneous detail which isn't needed on an
52LFS 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 &gt; /etc/rc.d/init.d/alsa &lt;&lt; "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
66source /etc/sysconfig/rc
67source $rc_functions
68
69case "$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
95esac
96
97# End $rc_base/init.d/alsa
98<userinput>EOF
99chmod 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 &amp;&amp;
103ln -sf ../init.d/alsa ../rc0.d/K35alsa &amp;&amp;
104ln -sf ../init.d/alsa ../rc1.d/K35alsa &amp;&amp;
105ln -sf ../init.d/alsa ../rc2.d/S40alsa &amp;&amp;
106ln -sf ../init.d/alsa ../rc3.d/S40alsa &amp;&amp;
107ln -sf ../init.d/alsa ../rc4.d/S40alsa &amp;&amp;
108ln -sf ../init.d/alsa ../rc5.d/S40alsa &amp;&amp;
109ln -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
112use the <filename>alsamixer</filename> program from alsa-utils (or any other
113OSS mixer) to change this.</para>
114
115<para>Also, the first time the above script is run, it will complain that
116there is no state in <filename>/etc/asound.state</filename>. You can
117prevent this by running the following commands after installing alsa-utils:
118<screen><userinput>touch /etc/asound.state &amp;&amp;
119alsactl store</userinput></screen></para>
120
121<para>A final note is that the lines loading <filename>sfxload</filename>
122are commented out. They are there as an example of other things you may
123wish to do in the startup script. <filename>sfxload</filename> is a
124seperate package of interest to SoundBlaster AWE and Live! users. It is
125designed for loading "sound-fonts" (which are used for MIDI output). You
126may wish to delete these lines and add your own or, if you have the relevant
127soundcard, install <filename>sfxload</filename> and uncomment them.</para>
128
129</sect3>
130
131</sect2>
132
Note: See TracBrowser for help on using the repository browser.