r4858 - in trunk/BOOK: . introduction/welcome multimedia/libdriv

dj at linuxfromscratch.org dj at linuxfromscratch.org
Sun Jul 31 10:19:50 PDT 2005


Author: dj
Date: 2005-07-31 11:19:41 -0600 (Sun, 31 Jul 2005)
New Revision: 4858

Modified:
   trunk/BOOK/general.ent
   trunk/BOOK/introduction/welcome/changelog.xml
   trunk/BOOK/introduction/welcome/credits.xml
   trunk/BOOK/multimedia/libdriv/alsa-utils.xml
Log:
Alsa startup scripts updated

Modified: trunk/BOOK/general.ent
===================================================================
--- trunk/BOOK/general.ent	2005-07-31 15:01:09 UTC (rev 4857)
+++ trunk/BOOK/general.ent	2005-07-31 17:19:41 UTC (rev 4858)
@@ -2,7 +2,7 @@
 <!ENTITY month        "07">
 <!ENTITY year         "2005">
 <!ENTITY version      "svn-&year;&month;&day;">
-<!ENTITY releasedate  "July &day;th, &year;">
+<!ENTITY releasedate  "July &day;st, &year;">
 <!ENTITY pubdate      "&year;-&month;-&day;"> <!-- metadata req. by TLDP -->
 <!ENTITY blfs-version "svn">                  <!-- svn|[release #] -->
 <!ENTITY lfs-version  "stable">          <!-- version|stable|testing|unstable|development] -->
@@ -21,7 +21,7 @@
 <!ENTITY publisher      "Unknown">
 
 
-<!ENTITY blfs-bootscripts-version     "20050709">
+<!ENTITY blfs-bootscripts-version     "20050731">
 <!ENTITY blfs-bootscripts-download    "&downloads-root;/blfs-bootscripts-&blfs-bootscripts-version;.tar.bz2">
 
 <!-- Part II -->

Modified: trunk/BOOK/introduction/welcome/changelog.xml
===================================================================
--- trunk/BOOK/introduction/welcome/changelog.xml	2005-07-31 15:01:09 UTC (rev 4857)
+++ trunk/BOOK/introduction/welcome/changelog.xml	2005-07-31 17:19:41 UTC (rev 4858)
@@ -25,6 +25,11 @@
   <itemizedlist>
     
     <listitem>
+      <para>July 31st, 2005 [dj]: Updated bootscripts tarball and added
+      the alsa dev.d helpers scripts.</para>
+    </listitem>
+
+    <listitem>
       <para>July 31st, 2005 [richard]: Updated to firefox-1.0.6.</para>
     </listitem>
     

Modified: trunk/BOOK/introduction/welcome/credits.xml
===================================================================
--- trunk/BOOK/introduction/welcome/credits.xml	2005-07-31 15:01:09 UTC (rev 4857)
+++ trunk/BOOK/introduction/welcome/credits.xml	2005-07-31 17:19:41 UTC (rev 4858)
@@ -443,8 +443,8 @@
 
       <listitem>
         <para><emphasis>Alexander E. Patrakov</emphasis>
-        for patches and suggestions to improve the book content and increasing
-        the l10n awareness.</para>
+        for patches and suggestions to improve the book content, assistance 
+        with alsa dev.d helpers, and increasing the l10n awareness.</para>
       </listitem>
 
       <listitem>

Modified: trunk/BOOK/multimedia/libdriv/alsa-utils.xml
===================================================================
--- trunk/BOOK/multimedia/libdriv/alsa-utils.xml	2005-07-31 15:01:09 UTC (rev 4857)
+++ trunk/BOOK/multimedia/libdriv/alsa-utils.xml	2005-07-31 17:19:41 UTC (rev 4858)
@@ -96,7 +96,8 @@
       <title>Configuration Information</title>
 
       <para>Probably the easiest way to store mixer levels is to set and
-      retrieve them using a bootscript.</para>
+      retrieve them using at boot and shutdown.  We'll use a bootscript to
+      store the values at shutdown.</para>
 
       <indexterm zone="alsa-utils alsa-utils-init">
         <primary sortas="f-alsa">alsa</primary>
@@ -113,24 +114,60 @@
       <application>ALSA Utilities</application> (or any other
       OSS mixer) to change this.</para>
 
-      <para>The first time the above script is run, it will complain that
-      there is no state in <filename>/etc/asound.state</filename>.  You can
-      prevent this by running the following commands as the
-      <systemitem class="username">root</systemitem> user after
-      installing <application>ALSA Utilities</application>:</para>
+      <para>The first time the dev.d script below is run, it will complain 
+      that there is no state in <filename>/etc/asound.state</filename>.  
+      You can prevent this by running the following commands while still 
+      the <systemitem class="username">root</systemitem> user (after
+      installing <application>ALSA Utilities</application>):</para>
 
 <screen role="root"><userinput>touch /etc/asound.state &&
 alsactl store</userinput></screen>
 
-      <para>A final note is that the lines loading <filename>sfxload</filename>
-      are commented out.  They are there as an example of other things you may
-      wish to do in the startup script.  <filename>sfxload</filename> is a
-      separate package of interest to SoundBlaster AWE and Live!
-      users.  It is designed for loading "sound-fonts" (which are used for
-      MIDI output).  You may wish to delete these lines and add
-      your own or, if you have the relevant sound card, install
-      <filename>sfxload</filename> and uncomment them.</para>
+      <para>We will restore the volume using the stored settings and a 
+      dev.d handler script that will execute when the device is detected 
+      durring boot (when pluged in for USB devices).  While still the 
+      <systemitem class="username">root</systemitem> user, create the dev.d
+      handler script with the following commands:</para>
 
+<screen role="root"><userinput>install -d -m755 /etc/dev.d/snd &&
+cat >> /etc/dev.d/snd/alsa.dev << "EOF" &&
+#!/bin/sh -e
+DEV_BASENAME="${DEVNAME##*/}"
+N="${DEV_BASENAME#controlC}"
+case "$DEV_BASENAME" in
+        controlC[0-7])
+                x=0
+                while [ $x -lt 20 ]
+                do
+                        sleep 1
+                        if [ -f /usr/sbin/alsactl ]; then
+                        /usr/sbin/alsactl restore $N
+                        exit 0
+                        else
+                                if [ $x -eq 20 ]; then
+                                exit 1
+                                fi
+                        fi
+                done &
+        ;;
+esac
+exit 0
+EOF
+chmod 755 /etc/dev.d/snd/alsa.dev</userinput></screen>
+
+
+      <para>You may wish to do additional configuration on a per card basis.
+      For example, if you wish to load soundfont banks into the first 
+      device (card0), use the following sample script:</para>
+
+<screen>#!/bin/sh -e
+# Begin /etc/dev.d/snd/controlC0/asfxload.dev
+
+# Load GM8.sf2 for soundcard 0
+/usr/bin/asfxload /usr/share/sounds/sf2/8mbgmsfx.sf2 -D "hw:0,2"
+
+# End /etc/dev.d/snd/controlC0/sfxload.dev</screen>
+
     </sect3>
 
   </sect2>




More information about the blfs-book mailing list