A
Anonymous
Gast
Hallo zusammen,
hab ein 'kleines' Problem mit meinem rcalsasound. Obwohl im Runlevel
eingetragen (init2 bis 5), startet mein Alsatreiber nicht beim booten ins init5
rcalsasound status -> status ist unused
rcalsasound start -> keine Reaktion
rcalsasound restart -> ah...schau der Alsa Treiber wird entladen und dann geladen Und ich habe wieder sound auf meinem Desktop.
rcalsasound stop -> Treiber wird nicht entladen.... :-(
*glmpf*
Um das kurz zu machen nur rcalsasound reload | restart | unload
zeigen Reaktionen.
Wer hat dieses Problem auch, bzw. wie kann dieses gelöst werden.
Hier der Code:
Thx
Gruss
Borusse-KLE
hab ein 'kleines' Problem mit meinem rcalsasound. Obwohl im Runlevel
eingetragen (init2 bis 5), startet mein Alsatreiber nicht beim booten ins init5
rcalsasound status -> status ist unused
rcalsasound start -> keine Reaktion
rcalsasound restart -> ah...schau der Alsa Treiber wird entladen und dann geladen Und ich habe wieder sound auf meinem Desktop.
rcalsasound stop -> Treiber wird nicht entladen.... :-(
*glmpf*
Um das kurz zu machen nur rcalsasound reload | restart | unload
zeigen Reaktionen.
Wer hat dieses Problem auch, bzw. wie kann dieses gelöst werden.
Hier der Code:
Code:
. /etc/rc.status
. /etc/sysconfig/sound
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v ditto but be verbose in local rc status
# rc_status -v -r ditto and clear the local rc status
# rc_failed set local and overall rc status to failed
# rc_reset clear local rc status (overall remains)
# rc_exit exit appropriate to overall rc status
# First reset status of this service
rc_reset
alsactl=/usr/sbin/alsactl
asoundcfg=/etc/asound.state
aconnect=/usr/bin/aconnect
lsmod=/bin/lsmod
#
# insert sequencer modules
#
load_sequencer() {
test "$LOAD_SEQUENCER" = "yes" && modprobe -q snd-seq
if [ x"$LOAD_SEQUENCER" = xyes -a -r /proc/asound/seq/drivers ]; then
OLDIFS="$IFS"
IFS=","
while read t x c; do
/sbin/modprobe $t
done < /proc/asound/seq/drivers
IFS="$OLDIFS"
fi
}
get_drivers() {
if [ -f /etc/modprobe.d/sound ]; then
cat /etc/modprobe.d/sound
else
/sbin/modprobe -c
fi | \
grep -E "^[[:space:]]*alias[[:space:]]+snd-card-[[:digit:]]" | sort | \
while read a b card; do
echo $card
done
}
#
# insert all sound modules
#
load_modules() {
module_loaded=0
c=""
drivers=`get_drivers`
for i in $drivers; do
if [ $i != off ]; then
if [ x$c = x ]; then
echo -n ": "
c=1
fi
echo -n " ${i##snd-}"
/sbin/modprobe $i && module_loaded=1
fi
done
rc_status -v -r
test $module_loaded -eq 0 && return 1
return 0
}
#
# rest of start action
#
start_rest() {
load_sequencer
if [ x"$LOAD_OSS_EMUL_MODULES" = xyes ]; then
/sbin/modprobe snd-pcm-oss
# test x"$LOAD_SEQUENCER" = xyes && /sbin/modprobe snd-seq-oss
fi
}
terminate() {
#
# Kill processes holding open sound devices
#
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 >/dev/null 2>&1
if [ -d /dev/snd ]; then
fuser -k /dev/snd/* >/dev/null 2>&1
fi
#
# remove all sequencer connections if any
#
if [ -f /proc/asound/seq/clients -a -x $aconnect ]; then
$aconnect --removeall
fi
}
#
# remove all sound modules
#
unload_modules() {
# mute master to avoid clicks at unload
/usr/bin/amixer set Master mute >/dev/null 2>&1
$lsmod | grep -E "^snd" | grep -Ev "(snd-page-alloc|snd_page_alloc)" | while read m s; do
/sbin/rmmod $m
done
}
# See how we were called.
case "$1" in
start)
if [ -d /proc/asound ]; then
start_rest
fi
;;
stop)
if [ -d /proc/asound ]; then
$alsactl -f $asoundcfg store
fi
;;
unload)
if [ -d /proc/asound ]; then
echo -n "Shutting down sound driver"
terminate
unload_modules
rc_status -v
fi
;;
reload|restart)
$0 unload
echo -n "Starting sound driver"
load_modules && start_rest
# hack - in case the mixer isn't restored
(sleep 1; $alsactl -f $asoundcfg restore)
rc_status
;;
status)
if [ -d /proc/asound ]; then
echo -n "ALSA sound driver loaded."
rc_status -v
else
echo -n "ALSA sound driver not loaded."
rc_status -u
fi
;;
*)
echo "Usage: $0 {start|stop|restart|reload|unload|status}"
exit 1
esac
rc_exit
Thx
Gruss
Borusse-KLE