Ignore:
Timestamp:
07/31/2005 05:19:41 PM (19 years ago)
Author:
DJ Lucas <dj@…>
Branches:
10.0, 10.1, 11.0, 11.1, 11.2, 11.3, 12.0, 12.1, 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, xry111/intltool, xry111/llvm18, xry111/soup3, xry111/test-20220226, xry111/xf86-video-removal
Children:
5e82411c
Parents:
4d06a01f
Message:

Alsa startup scripts updated

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

File:
1 edited

Legend:

Unmodified
Added
Removed
  • multimedia/libdriv/alsa-utils.xml

    r4d06a01f r9700e433  
    9797
    9898      <para>Probably the easiest way to store mixer levels is to set and
    99       retrieve them using a bootscript.</para>
     99      retrieve them using at boot and shutdown.  We'll use a bootscript to
     100      store the values at shutdown.</para>
    100101
    101102      <indexterm zone="alsa-utils alsa-utils-init">
     
    114115      OSS mixer) to change this.</para>
    115116
    116       <para>The first time the above script is run, it will complain that
    117       there is no state in <filename>/etc/asound.state</filename>.  You can
    118       prevent this by running the following commands as the
    119       <systemitem class="username">root</systemitem> user after
    120       installing <application>ALSA Utilities</application>:</para>
     117      <para>The first time the dev.d script below is run, it will complain
     118      that there is no state in <filename>/etc/asound.state</filename>. 
     119      You can prevent this by running the following commands while still
     120      the <systemitem class="username">root</systemitem> user (after
     121      installing <application>ALSA Utilities</application>):</para>
    121122
    122123<screen role="root"><userinput>touch /etc/asound.state &amp;&amp;
    123124alsactl store</userinput></screen>
    124125
    125       <para>A final note is that the lines loading <filename>sfxload</filename>
    126       are commented out.  They are there as an example of other things you may
    127       wish to do in the startup script.  <filename>sfxload</filename> is a
    128       separate package of interest to SoundBlaster AWE and Live!
    129       users.  It is designed for loading "sound-fonts" (which are used for
    130       MIDI output).  You may wish to delete these lines and add
    131       your own or, if you have the relevant sound card, install
    132       <filename>sfxload</filename> and uncomment them.</para>
     126      <para>We will restore the volume using the stored settings and a
     127      dev.d handler script that will execute when the device is detected
     128      durring boot (when pluged in for USB devices).  While still the
     129      <systemitem class="username">root</systemitem> user, create the dev.d
     130      handler script with the following commands:</para>
     131
     132<screen role="root"><userinput>install -d -m755 /etc/dev.d/snd &amp;&amp;
     133cat &gt;&gt; /etc/dev.d/snd/alsa.dev &lt;&lt; "EOF" &amp;&amp;
     134#!/bin/sh -e
     135DEV_BASENAME="${DEVNAME##*/}"
     136N="${DEV_BASENAME#controlC}"
     137case "$DEV_BASENAME" in
     138        controlC[0-7])
     139                x=0
     140                while [ $x -lt 20 ]
     141                do
     142                        sleep 1
     143                        if [ -f /usr/sbin/alsactl ]; then
     144                        /usr/sbin/alsactl restore $N
     145                        exit 0
     146                        else
     147                                if [ $x -eq 20 ]; then
     148                                exit 1
     149                                fi
     150                        fi
     151                done &amp;
     152        ;;
     153esac
     154exit 0
     155EOF
     156chmod 755 /etc/dev.d/snd/alsa.dev</userinput></screen>
     157
     158
     159      <para>You may wish to do additional configuration on a per card basis.
     160      For example, if you wish to load soundfont banks into the first
     161      device (card0), use the following sample script:</para>
     162
     163<screen>#!/bin/sh -e
     164# Begin /etc/dev.d/snd/controlC0/asfxload.dev
     165
     166# Load GM8.sf2 for soundcard 0
     167/usr/bin/asfxload /usr/share/sounds/sf2/8mbgmsfx.sf2 -D "hw:0,2"
     168
     169# End /etc/dev.d/snd/controlC0/sfxload.dev</screen>
    133170
    134171    </sect3>
Note: See TracChangeset for help on using the changeset viewer.