r4962 - in branches/6.1/BOOK: introduction/welcome multimedia/libdriv

bdubbs at linuxfromscratch.org bdubbs at linuxfromscratch.org
Sat Aug 20 13:47:38 PDT 2005


Author: bdubbs
Date: 2005-08-20 14:47:37 -0600 (Sat, 20 Aug 2005)
New Revision: 4962

Modified:
   branches/6.1/BOOK/introduction/welcome/changelog.xml
   branches/6.1/BOOK/multimedia/libdriv/alsa-utils.xml
Log:
Update config script for alsa-utils

Modified: branches/6.1/BOOK/introduction/welcome/changelog.xml
===================================================================
--- branches/6.1/BOOK/introduction/welcome/changelog.xml	2005-08-20 15:58:18 UTC (rev 4961)
+++ branches/6.1/BOOK/introduction/welcome/changelog.xml	2005-08-20 20:47:37 UTC (rev 4962)
@@ -24,6 +24,11 @@
 
   <itemizedlist>
     <listitem>
+      <para>August 19th, 2005 [dj]: Updated dev.d scripts and surrounding 
+      text in alsa-utils.</para>
+    </listitem>
+    
+    <listitem>
       <para>August 12th, 2005 [randy]: Added a command to the PostgreSQL
       instructions to fix broken ownership of installed files.</para>
     </listitem>

Modified: branches/6.1/BOOK/multimedia/libdriv/alsa-utils.xml
===================================================================
--- branches/6.1/BOOK/multimedia/libdriv/alsa-utils.xml	2005-08-20 15:58:18 UTC (rev 4961)
+++ branches/6.1/BOOK/multimedia/libdriv/alsa-utils.xml	2005-08-20 20:47:37 UTC (rev 4962)
@@ -107,9 +107,9 @@
 
 <screen role="root"><userinput>make install-alsa</userinput></screen>
 
-      <para>Note that all channels of your sound card are muted by default.
-      You can use the <command>alsamixer</command> program from the
-      <application>ALSA Utilities</application> to change this.</para>
+      <note><para>All channels of your sound card are muted by default.  You
+      can use the <command>alsamixer</command> program from the
+      <application>ALSA Utilities</application> to change this.</para></note>
 
       <para>The first time the <filename class='directory'>dev.d</filename>
       script below is run, it will complain 
@@ -120,53 +120,67 @@
 <screen role="root"><userinput>touch /etc/asound.state &&
 alsactl store</userinput></screen>
 
-      <para>The volume settings will be restored from the saved state using a 
-      <filename class='directory'>dev.d</filename> handler script that will
-      execute when the device is detected 
-      during boot (when plugged in for USB devices).  While still the 
-      <systemitem class="username">root</systemitem> user, create the
-      <filename class='directory'>dev.d</filename> script with the following
-      commands:</para>
+      <para>The volume settings will be restored from the saved state using a
+      <filename class='directory'>/etc/dev.d/</filename> handler script that
+      will execute when the device is detected during boot (or when plugged in
+      for USB devices).</para>
 
+      <para>  While still the <systemitem class="username">root</systemitem>
+      user, create the <filename class='directory'>dev.d</filename> script with
+      the following commands:</para>
+
 <screen role="root"><userinput>install -v -d -m755 /etc/dev.d/snd &&
-cat >> /etc/dev.d/snd/alsa.dev << "EOF"
+cat > /etc/dev.d/snd/alsa.dev << "EOF"
 #!/bin/sh -e
+# This script is called by udevd when a change in a device is
+# detected, including initial detection upon bootup.
+# udevd sets the environment variables ACTION and DEVNAME.
+
+[ "$ACTION" = "add" ] || exit 0
 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 &
-        ;;
+    controlC[0-7])
+        x=0
+        while [ $x -lt 20 ]; do
+            # Wait up to 20 seconds for /usr to be mounted if necessary
+            if [ -f /usr/sbin/alsactl ]; then
+                /usr/sbin/alsactl restore $N
+	        exit 0
+            fi
+            sleep 1
+	    x=`expr $x + 1`
+        done & # Put the while command in the background and continue
+    ;;
 esac
 exit 0
 EOF
 chmod -v 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>
+      For example, if you wish to load soundfont banks, use the following 
+      sample script:</para>
 
 <screen>#!/bin/sh -e
-# Begin /etc/dev.d/snd/controlC0/asfxload.dev
+# Begin /etc/dev.d/snd/<replaceable>[DEVICE]</replaceable>/asfxload.dev
 
-# Load GM8.sf2 for soundcard 0
-/usr/bin/asfxload /usr/share/sounds/sf2/8mbgmsfx.sf2 -D "hw:0,2"
+x=0
+while [ $x -lt 20 ]; do
+    # Wait up to 20 seconds for /usr to be mounted if necessary
+    if [ -f /usr/bin/asfxload ]; then
+        # Load 8 MB sountfont bank
+        /usr/bin/asfxload /usr/share/sounds/sf2/8mbgmsfx.sf2 \
+            -D "<replaceable>[ALSA device string]</replaceable>"
+        exit 0
+    fi
+    sleep 1
+    x=`expr $x + 1`
+done & # Put the while command in the background and continue
 
-# End /etc/dev.d/snd/controlC0/sfxload.dev</screen>
-
+exit 0
+# End /etc/dev.d/snd/<replaceable>[DEVICE]</replaceable>/asfxload.dev</screen>
+-->
     </sect3>
 
   </sect2>
@@ -180,8 +194,9 @@
       <segtitle>Installed Directories</segtitle>
 
       <seglistitem>
-        <seg>aconnect, alsaconf, alsactl, alsamixer, amidi, amixer, aplay, aplaymidi,
-        arecord, arecordmidi, aseqnet, aseqdump, iecset, and speaker-test</seg>
+        <seg>aconnect, alsaconf, alsactl, alsamixer, amidi, amixer, aplay, 
+        aplaymidi, arecord, arecordmidi, aseqnet, aseqdump, iecset, 
+        and speaker-test</seg>
         <seg>None</seg>
         <seg>None</seg>
       </seglistitem>




More information about the blfs-book mailing list