Hi,

  There are some things that bothered me in soundoff/soundon, and I'm 
interested to know if you think this is a good change.

  soundon
    A) ignore everything after a '#', rather than everything after a space, 
which isn't that obvious as a comment character.

  soundoff
    A) Same as above.
    B) When the program using the soundcard has switches, soundoff prints them 
without a space, which is unfortunate (e.g. "ossxmix-b" rather 
than "ossxmix -b"). Per proc(5), the command line is separated by NULs, so a 
sed will now convert them to spaces.
    C) grep for all modules using osscore, and try to remove them too. Remove 
now unneccesary (I think) rmmods for cuckoo* and $VIDEODRIVERS.

Yours,
        Yair K.
--- setup/Linux/sbin/soundoff	2008-02-02 00:33:43.098553987 +0200
+++ setup/Linux/sbin/soundoff	2008-02-04 15:43:37.909428864 +0200
@@ -31,7 +31,7 @@
   do
     if test -f /proc/$n/cmdline
     then
-      echo $n `cat /proc/$n/cmdline`
+      echo $n `cat /proc/$n/cmdline | sed 's/\x00/ /'`
     else
       echo $n Unknown
     fi
@@ -42,10 +42,6 @@
   exit 2
 fi
 
-# Some video drivers depend on osscore (soundcore) and need to be removed
-# before OSS can be unloaded.
-#VIDEODRIVERS="tvmixer saa7134-empress saa7134-dvb saa7134"
-
 # Save mixer settings automatically if requested
 if test -f $OSSLIBDIR/etc/userdefs && grep -q "autosave_mixer yes" $OSSLIBDIR/etc/userdefs
 then
@@ -54,19 +50,15 @@
 
 for i in 1 2 3
 do
-  for n in $VIDEODRIVERS `cat $OSSLIBDIR/etc/installed_drivers | sed 's/ .*//'`
+  for n in `egrep "^osscore" /proc/modules 2>/dev/null | cut -d ' ' -f 4 | sed 's/,/ /g'` `cat $OSSLIBDIR/etc/installed_drivers | sed 's/#.*//'` osscore
   do
     /sbin/modprobe -r $n > /dev/null 2>&1
   done
 done
 
-rmmod cuckoo > /dev/null 2>&1
-rmmod cuckoo_pcm > /dev/null 2>&1
-rmmod cuckoo_mixer > /dev/null 2>&1
-
 #modprobe -r snd-pcm > /dev/null 2>&1
 
-for n in `cat $OSSLIBDIR/etc/installed_drivers | sed 's/ .*//'` osscore
+for n in `egrep "^osscore" /proc/modules 2>/dev/null | cut -d ' ' -f 4 | sed 's/,/ /g'` `cat $OSSLIBDIR/etc/installed_drivers | sed 's/#.*//'` osscore
 do
     /sbin/modprobe -r $n
 done
--- setup/Linux/sbin/soundon	2008-02-02 00:33:43.107552614 +0200
+++ setup/Linux/sbin/soundon	2008-02-04 04:44:01.686848519 +0200
@@ -149,7 +149,7 @@
 
 echo "osscore module loaded OK" >> $LOG
 
-for n in `cat $OSSLIBDIR/etc/installed_drivers | sed 's/ .*//'`
+for n in `cat $OSSLIBDIR/etc/installed_drivers | sed 's/#.*//'`
 do
 	OPTIONS=
 
_______________________________________________
oss-devel mailing list
oss-devel@mailman.opensound.com
http://mailman.opensound.com/mailman/listinfo/oss-devel

Reply via email to