[PC-BSD Commits] r19625 - pcbsd/current/overlays/desktop-overlay/usr/local/share/pcbsd/scripts

svn at pcbsd.org svn at pcbsd.org
Wed Oct 10 07:47:20 PDT 2012


Author: kris
Date: 2012-10-10 14:47:20 +0000 (Wed, 10 Oct 2012)
New Revision: 19625

Modified:
   pcbsd/current/overlays/desktop-overlay/usr/local/share/pcbsd/scripts/sound-dev-changed.sh
Log:

Add patch to sound detection to not use a tmp file, and add descriptions
to alsa config.

Submitted by: N V
Reviewed by: kmoore	


Modified: pcbsd/current/overlays/desktop-overlay/usr/local/share/pcbsd/scripts/sound-dev-changed.sh
===================================================================
--- pcbsd/current/overlays/desktop-overlay/usr/local/share/pcbsd/scripts/sound-dev-changed.sh	2012-10-10 14:07:25 UTC (rev 19624)
+++ pcbsd/current/overlays/desktop-overlay/usr/local/share/pcbsd/scripts/sound-dev-changed.sh	2012-10-10 14:47:20 UTC (rev 19625)
@@ -5,9 +5,15 @@
 
 regen_ossconf()
 {
+PCM_OSS_CONF_DIR=/compat/linux/etc/alsa/pcm/
+PCM_OSS_CONF=${PCM_OSS_CONF_DIR}pcm-oss.conf
 
+if [ ! -d $PCM_OSS_CONF_DIR ]; then
+  return
+fi
+
 PCM=`egrep -o 'pcm[0-9]+' /dev/sndstat | egrep -o '[0-9]+'`
-cat > /tmp/pcm-oss.conf <<EOF
+OSSCONF=`cat <<EOF
 # pcm-oss plugin configuration
 
 pcm.oss {
@@ -25,16 +31,19 @@
                 description "Open Sound System"
         }
 }
+EOF`
 
-EOF
+for NUM in $PCM; do
+  UNIT_DESC=`sysctl -in dev.pcm.${NUM}.%desc`
+  
+  OSSCONF_UNITS=${OSSCONF_UNITS}`cat <<EOF
 
-for NUM in $PCM; do
-  cat >> /tmp/pcm-oss.conf <<EOF
+ 
 pcm.oss${NUM} {
 	type oss
 	device /dev/dsp${NUM}
 	hint {
-		description "Open Sound System Unit ${NUM}"
+		description "oss${NUM}: ${UNIT_DESC}"
 	}
 }
 
@@ -42,14 +51,13 @@
 	type oss
 	device /dev/mixer${NUM}
 	hint {
-		description "Open Sound System Unit ${NUM}"
+		description "oss${NUM}: ${UNIT_DESC}"
 	}
 }
+EOF`
+done
 
-EOF
-
-done
-mv /tmp/pcm-oss.conf /compat/linux/etc/alsa/pcm/pcm-oss.conf
+echo "${OSSCONF}${OSSCONF_UNITS}" > $PCM_OSS_CONF
 }
 
 set_new_dev()



More information about the Commits mailing list