Bonsoir
Merci de votre réponse, mais j'avais déjà essayé votre sound_basile sans succès ! Le problème me semble plus ardu, le service sound ne sait plus s'ouvrir, j'ai le message "cannot find sound service" et pourtant dès que je lance la commande echo 7a 2090 >/proc/asound/card0/codec97#0/ac97#0-0+regs
l'ensemble du système sonore fonctionne !
En fait je pensais à un fichier bat comme dans le tps sous dos qui automatiquement ne ferait passer sous root et enverrai au système la commande echo...
Pour info, le fichier sound de mandriva qui ne sait plus se lancer avec la commande echo..... intégrée dedans mais j'ai oublié sur quel forum je l'ai trouvée (et à l'époque, j'avais tenté de compiler un noyau 2.6.14 et le son marchait mais plus la wifi, avec la compilation du noyau mandriva 2.6.14, les deux fonctionne) :
#!/bin/sh
# (c) MandrakeSoft, Chmouel Boudjnah <chmouel@mandrakesoft.com>
# $Id: sound.init,v 1.10 2005/09/16 17:53:09 tvignaud Exp $
#
# sound: This shell script launch the sound on your system.
#
# chkconfig: 2345 18 69
# description: This shell script launch the sound on your system.
. /etc/rc.d/init.d/functions
PKLVL=$(cut -f1 /proc/sys/kernel/printk)
sysctl -n -w kernel.printk=0
function start_mixer () {
# udev is slow:
# ALSA
if [ -d /proc/asound ] && [ -x /usr/sbin/alsactl ]; then
# is ALSA already configured ?
if [[ ! -r /etc/asound.state ]]; then
# provide decent default sound level for alsa drivers
if [ -d /proc/asound ] && [ -x /usr/sbin/alsactl ];then
MIXER_SETTINGS=/root/tmp/asound.state_tmp
alsactl -f $MIXER_SETTINGS store
# set some sane default volume and unmute needed channels:
/etc/rc.d/rc.alsa_default $MIXER_SETTINGS
action "Setting mixer settings" alsactl -f $MIXER_SETTINGS restore
rm -f $MIXER_SETTINGS
return 0
fi
# if we've not alsa-utils, we'll fallback on OSS initialization below
elif [[ ! -d /dev/.udevdb ]]; then
# Not first boot:
# Done by alsa service but only if sound service is not
# enabled (hance this code path).
# We'll merge in back alsa service once mdk9.2 is released.
# [but we'll still handle both aumix & alsactl in order
# to manage packages removing / driver switch]
action "Loading mixer settings" /etc/dev.d/snd/controlC0/alsa.dev
return 0
fi
elif egrep -q '(sparcaudio|sound)' /proc/devices 2>/dev/null && \
# OSS
[ "$retval" -eq 0 ] && [ -x /usr/bin/aumix-text ];then
if [ ! -r /etc/.aumixrc ];then
action "Setting mixer settings" /usr/bin/aumix-text -v80 -w80 -c80
else
action "Loading mixer settings" /usr/bin/aumix-text -f /etc/.aumixrc -L
fi
fi
}
function stop_mixer () {
if [ -d /proc/asound ] && [ -x /usr/sbin/alsactl ];then
# done by alsa service (to merge back after mdk9.2 release)
#action "Saving mixer settings" /usr/sbin/alsactl store
return 0;
fi
if egrep -q '(sparcaudio|sound)' /proc/devices 2>/dev/null && [ -x /usr/bin/aumix-text ];then
action "Saving mixer settings" /usr/bin/aumix-text -f /etc/.aumixrc -S
fi
}
function module () {
opt=""
phrase=$1
alias=$2
[ -n "$3" ] && opt="-r"
module=`/sbin/modprobe -c | egrep -s "^alias( |\t)+"$alias"( |\t)+" | awk '{ print $3 }'`
if [ -n "$module" ] && [ "$module" != "off" ];then
action "$phrase ($module)" modprobe "$opt" $module
return $?
fi
}
case $1 in
start)
retval=0
if [ ! -d /proc/asound ] || grep -q "no soundcards" /proc/asound/cards;then
module "Loading sound module" sound || retval=1
/sbin/modprobe -c | awk '/^((alias)|(probe)) +sound-slot-[0-9]/ {print $2}' | ( \
while read line; do
[[ $line = snd-card-* ]] && continue #we do it via alsa script
module "Loading sound module" $line || retval=1
done
)
module "Loading midi module" midi
fi
start_mixer;
touch /var/lock/subsys/sound
echo 7a 2090 >/proc/asound/card0/codec97#0/ac97#0-0+regs
;;
stop)
# i should have the same semantic of alsa script than oss script,
# but i do not :-(, patches welcome.
stop_mixer;
rm -f /var/lock/subsys/sound
;;
status)
if egrep -q '(sparcaudio|sound)' /proc/devices;then
gprintf "Sound loaded"
echo
fi
;;
reload)
;;
restart)
$0 stop
$0 start
;;
*)
echo "Usage: %s\n" "$(basename $0) {start|stop|restart|status}"
exit 0
esac
sysctl -n -w kernel.printk=$PKLVL
exit 0
FRED L.
[
www.photorock.com]