Update of /cvsroot/alsa/alsa-driver/utils In directory sc8-pr-cvs1:/tmp/cvs-serv25022
Modified Files: alsaconf alsasound alsasound.posix Log Message: fixed for the new module tools. Index: alsaconf =================================================================== RCS file: /cvsroot/alsa/alsa-driver/utils/alsaconf,v retrieving revision 1.6 retrieving revision 1.7 diff -u -r1.6 -r1.7 --- alsaconf 20 May 2003 10:09:18 -0000 1.6 +++ alsaconf 17 Jul 2003 18:14:28 -0000 1.7 @@ -36,6 +36,12 @@ distribution="unknown" fi +if [ -x /sbin/lsmod ]; then + lsmod=/sbin/lsmod +else + lsmod=/bin/lsmod +fi + usage() { echo "ALSA configurator version $version" echo "usage: alsaconf [options]" @@ -630,7 +636,7 @@ " > $TMP test $do_logging = 1 && echo "$1 ${*:2}" >> $LOGFILE /sbin/modprobe -C $TMP snd-$1 >/dev/null 2>&1 - /sbin/lsmod | grep snd-$1 >/dev/null 2>&1 || return 1 + $lsmod | grep -E '(snd-|snd_)' $1 >/dev/null 2>&1 || return 1 /sbin/modprobe -C $TMP snd-ioctl32 >/dev/null 2>&1 # mute mixers @@ -671,7 +677,7 @@ " > $TMP test $do_logging = 1 && echo "$1 ${*:2}" >> $LOGFILE /sbin/modprobe -C $TMP snd-$1 >/dev/null 2>&1 - /sbin/lsmod | grep snd-$1 >/dev/null 2>&1 || return 1 + $lsmod | grep -E '(snd-|snd_)' $1 >/dev/null 2>&1 || return 1 /sbin/modprobe -C $TMP snd-ioctl32 >/dev/null 2>&1 # mute mixers Index: alsasound =================================================================== RCS file: /cvsroot/alsa/alsa-driver/utils/alsasound,v retrieving revision 1.32 retrieving revision 1.33 diff -u -r1.32 -r1.33 --- alsasound 3 Jul 2003 11:36:52 -0000 1.32 +++ alsasound 17 Jul 2003 18:14:28 -0000 1.33 @@ -68,30 +68,44 @@ asoundcfg=/etc/asound.state aconnect=/usr/bin/aconnect alsascrdir=/etc/alsa.d +if [ -x /sbin/lsmod ]; then + lsmod=/sbin/lsmod +else + lsmod=lsmod +fi + +# modprobe returns 255 when failed.. +function probe_module () { + /sbin/modprobe $* + test $? = 0 && return 0 + return 1 +} function start() { # # insert all sound modules # + module_loaded=0 drivers=`/sbin/modprobe -c | \ grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | \ awk '{print $3}'` for i in $drivers; do if [ "$i" != off ]; then echo -n "Starting sound driver: $i " - /sbin/modprobe $i + probe_module $i && module_loaded=1 echo -e "$rc_done" fi done + test $module_loaded -eq 0 && return # # insert sequencer modules # if [ x"$START_ALSA_SEQ" = xyes -a -r /proc/asound/seq/drivers ]; then - t=`cut -d , -f 1 /proc/asound/seq/drivers` - if [ "x$t" != "x" ]; then - /sbin/modprobe $t - fi + cut -d , -f 1 /proc/asound/seq/drivers | \ + while read t ; do + test -z $t || /sbin/modprobe $t + done fi # # restore driver settings @@ -129,11 +143,15 @@ # Kill processes holding open sound devices # # DEVS=`find /dev/ -follow -type c -maxdepth 1 -print 2>/dev/null | xargs ls -dils | grep "1*1[46]," | cut -d: -f2 | cut -d" " -f2; echo /proc/asound/dev/*` - ossdevs="/dev/admmidi? /dev/adsp? /dev/amidi? /dev/audio* /dev/dmfm* \ + fuser -k /dev/admmidi? /dev/adsp? /dev/amidi? /dev/audio* /dev/dmfm* \ /dev/dmmidi? /dev/dsp* /dev/dspW* /dev/midi0? /dev/mixer? /dev/music \ - /dev/patmgr? /dev/sequencer* /dev/sndstat" - alsadevs="/dev/snd/*" - fuser -k $ossdevs $alsadevs 2> /dev/null 1>/dev/null + /dev/patmgr? /dev/sequencer* /dev/sndstat >/dev/null 2>&1 + if [ -d /proc/asound/dev ]; then + fuser -k /proc/asound/dev/* >/dev/null 2>&1 + fi + if [ -d /dev/snd ]; then + fuser -k /dev/snd/* >/dev/null 2>&1 + fi # # remove all sequencer connections if any # @@ -152,9 +170,13 @@ echo -n -e "${rc_warning}!!!alsactl not found!!!${rc_reset} " fi # + # mute master to avoid clicks at unload + # + /usr/bin/amixer set Master mute >/dev/null 2>&1 + # # remove all sound modules # - /sbin/lsmod | grep -E "^snd" | grep -Ev "^snd-page-alloc" | while read line; do \ + $lsmod | grep -E "^snd" | grep -Ev "(snd-page-alloc|snd_page_alloc)" | while read line; do \ /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \ done # remove the 2.2 soundcore module (if possible) Index: alsasound.posix =================================================================== RCS file: /cvsroot/alsa/alsa-driver/utils/alsasound.posix,v retrieving revision 1.13 retrieving revision 1.14 diff -u -r1.13 -r1.14 --- alsasound.posix 3 Jul 2003 11:36:53 -0000 1.13 +++ alsasound.posix 17 Jul 2003 18:14:28 -0000 1.14 @@ -31,6 +31,11 @@ config=/etc/modules.conf alsactl=/usr/sbin/alsactl asoundcfg=/etc/asound.state +if [ -x /sbin/lsmod ]; then + lsmod=/sbin/lsmod +else + lsmod=lsmod +fi if [ ! -r $config ]; then if [ -r /etc/conf.modules ]; then @@ -91,7 +96,7 @@ # # remove all sound modules # - /sbin/lsmod | grep -E "^snd" | grep -Ev "^snd-page-alloc" | while read line; do \ + $lsmod | grep -E "^snd" | grep -Ev "(snd-page-alloc|snd_page_alloc)" | while read line; do \ /sbin/rmmod `echo $line | cut -d ' ' -f 1`; \ done # remove the 2.2 soundcore module (if possible) ------------------------------------------------------- This SF.net email is sponsored by: VM Ware With VMware you can run multiple operating systems on a single machine. WITHOUT REBOOTING! Mix Linux / Windows / Novell virtual machines at the same time. Free trial click here: http://www.vmware.com/wl/offer/345/0 _______________________________________________ Alsa-cvslog mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/alsa-cvslog