source: multimedia/libdriv/alsa/utils/alsa-utils-config.xml@ 9f78330

10.0 10.1 11.0 11.1 11.2 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 krejzi/svn lazarus nosym perl-modules plabs/python-mods qt5new systemd-11177 systemd-13485 trunk upgradedb v5_1 v5_1-pre1 xry111/intltool xry111/soup3 xry111/test-20220226
Last change on this file since 9f78330 was 9f78330, checked in by Igor Živković <igor@…>, 19 years ago

fixed sleep location in alsa bootscript

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

  • Property mode set to 100644
File size: 3.7 KB
Line 
1<sect2>
2<title>Configuring <application><acronym>ALSA</acronym> Utilities</application></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
13them 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
16those readers who wish to do this.</para>
17
18<para>The <application><acronym>ALSA</acronym> Driver</application> package
19installs a script as <filename>/etc/rc.d/init.d/alsasound</filename>. While it
20is possible to use this script, it contains a lot of extraneous detail which
21isn't needed on an <acronym>LFS</acronym> system and so we create our own
22script <filename>/etc/rc.d/init.d/alsa</filename>.</para>
23
24<para>To create the <application><acronym>ALSA</acronym></application> script, do the following:</para>
25
26<screen><userinput><command>cat &gt; /etc/rc.d/init.d/alsa &lt;&lt; "EOF"</command>
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
35source /etc/sysconfig/rc
36source $rc_functions
37
38case "$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 /bin/sleep 1
56 $0 start
57 ;;
58
59 *)
60 echo "Usage: $0 {start|stop|restart}"
61 exit 1
62 ;;
63
64esac
65
66# End $rc_base/init.d/alsa
67<command>EOF
68chmod 755 /etc/rc.d/init.d/alsa</command></userinput></screen>
69
70<para>You can then create the appropriate symlinks:</para>
71<screen><userinput><command>cd /etc/rc.d/init.d &amp;&amp;
72ln -sf ../init.d/alsa ../rc0.d/K35alsa &amp;&amp;
73ln -sf ../init.d/alsa ../rc1.d/K35alsa &amp;&amp;
74ln -sf ../init.d/alsa ../rc2.d/S40alsa &amp;&amp;
75ln -sf ../init.d/alsa ../rc3.d/S40alsa &amp;&amp;
76ln -sf ../init.d/alsa ../rc4.d/S40alsa &amp;&amp;
77ln -sf ../init.d/alsa ../rc5.d/S40alsa &amp;&amp;
78ln -sf ../init.d/alsa ../rc6.d/K35alsa</command></userinput></screen>
79
80<para>Note that all channels of your soundcard are muted by default. You can
81use the <command>alsamixer</command> program from
82<application><acronym>ALSA</acronym> Utilities</application> (or any other
83<acronym>OSS</acronym> mixer) to change this.</para>
84
85<para>Also, the first time the above script is run, it will complain that
86there is no state in <filename>/etc/asound.state</filename>. You can
87prevent this by running the following commands after installing
88<application><acronym>ALSA</acronym> Utilities</application>:</para>
89<screen><userinput><command>touch /etc/asound.state &amp;&amp;
90alsactl store</command></userinput></screen>
91
92<para>A final note is that the lines loading <filename>sfxload</filename>
93are commented out. They are there as an example of other things you may
94wish to do in the startup script. <filename>sfxload</filename> is a
95separate package of interest to SoundBlaster AWE and Live!
96users. It is designed for loading "sound-fonts" (which are used for
97<acronym>MIDI</acronym> output). You may wish to delete these lines and add
98your own or, if you have the relevant soundcard, install <filename>sfxload
99</filename> and uncomment them.</para>
100
101</sect3>
102
103</sect2>
Note: See TracBrowser for help on using the repository browser.