Is a complete Alsa restart possibly without rebooting?
Hi,
I am debugging a problem that seems to require me to reboot the machine
after it happens as Alsa cannot recover. I am wondering whether there is any known way to script a complete Alsa restart, like I can do with networking or other drivers, so that I wouldn't have to do this reboot?
I've tried /etc/init.d/alsasound stop and then start. This doesn't work.
I've tried the stop/start with an rmmod of everything I can see in lsmod, but this doesn't work either.
I suspect that a big part of the problem is that the sound card itself is
getting into a state that the drivers and Alsa do not have the capabilities to get it out of and possibly what's happening is the reboot fixes it via a PCI reset operation.
Can anyone recommend a method that might actually work? This is a bit
painful because right now a simple adjustment even in alsamixer requires me to reboot the machine.
Thanks in advance,
Mark
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Hallo,
Quoted 9 lines · Mark Knecht hat gesagt: // Mark Knecht wrote:
I am debugging a problem that seems to require me to reboot the machine
after it happens as Alsa cannot recover. I am wondering whether there is any known way to script a complete Alsa restart, like I can do with networking or other drivers, so that I wouldn't have to do this reboot?I've tried
/etc/init.d/alsasoundstop and then start. This doesn't work.
I've tried the stop/start with an rmmod of everything I can see in lsmod, but this doesn't work either.
Quoted 8 lines
I suspect that a big part of the problem is that the sound card itself is
getting into a state that the drivers and Alsa do not have the capabilities to get it out of and possibly what's happening is the reboot fixes it via a PCI reset operation.Can anyone recommend a method that might actually work? This is a bit
painful because right now a simple adjustment even in alsamixer requires me to reboot the machine.
Debian has an init-script that accepts a "force-[stop|restart]" option. What this does is: It first kills all programs that use ALSA with:
procs_using_sound="$(echo $({ find /dev -print0 | xargs -0 stat -Lc '%t:%n' | grep -E '^(e|74):' \
| cut -d: -f2-; } | while read REPLY; do fuser "$REPLY" || true; done | cut -f2- -d:))" kill $procs_using_sound
sleep 2
kill -9 $procs_using_sound
and then rmmods like this:
rmmod -r $(lsmod | grep ^snd | awk '{print $1}')
Hope that helps... I could send you the file (or you could get it from debian.org), but basically that's it.
ciao
Signature · 8 lines
Frank Barknecht _ ______footils.org__ ------------------------------------------------------- This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET. http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Quoted 14 lines
Debian has an init-script that accepts a "force-[stop|restart]" option. What this does is: It first kills all programs that use ALSA with:
procs_using_sound="$(echo $({ find /dev -print0 | xargs -0 stat -Lc '%t:%n' | grep -E '^(e|74):' \
| cut -d: -f2-; } | while read REPLY; do fuser "$REPLY" || true; done | cut -f2- -d:))"kill $procs_using_sound
sleep 2
kill -9 $procs_using_soundand then rmmods like this:
Quoted 8 lines
rmmod -r $(lsmod | grep ^snd | awk '{print $1}')
Hope that helps... I could send you the file (or you could get it from debian.org), but basically that's it.
ciao
--
Frank Barknecht _ ______footils.org__
Frank,
I don't think you need to send the file. So far this is sort of what I'm
doing by hand, but it isn't working. I can stop audio apps, then stop Alsa, remove everything from memory (I think), and then restart Alsa. Alsa starts up cleanly with no error messages, but sound does not return.
As I said earlier, I think there *may* be two other things going on here:
1) The sound card hardware is a strange state after the driver does bad things to it.
2) alsasound start does not apparently reset the hardware completely.
I can understand #2 conceptually since the reboot sets up PCI addressing
and does other things to the card. If the driver was to mangle the PCI address of the card (I'm not suggesting it does, but just for instance) then I suppose the driver could not and should not try to fix that. My problem right now is I cannot see what's getting messed up, so I do not know how to reset it.
Luckily it's a pretty fast machine and a reboot is only about 45 seconds,
but it's frustrating to have to shut down email and other things to do it.
Thanks much,
Mark
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Quoted 1 line
I don't think you need to send the file. So far this is sort of what
I'm
Quoted 1 line
doing by hand, but it isn't working. I can stop audio apps, then stop
Alsa,
Quoted 1 line
remove everything from memory (I think), and then restart Alsa. Alsa
starts
Quoted 1 line
up cleanly with no error messages, but sound does not return.
Actually perhaps this is the problem that I am seeing as well on a P4P800 board with a hyperthreaded P4. I have a dual P3 which starts and stops alsa fine, at least up to about alsa 0.9.4. However, with this board if I do an alsa restart, modules reload, but no sound until reboot, and this happens with various builds at least as far back as 0.9.2
The main soundcard is an RME 96/8 PAD, but I also have an onboard intel compatible thing which seems to suffer the same issues.
Also in my case I don't get any OSS devices created, /dev/dsp, etc.
Just an extra datapoint I hope...
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Quoted 6 lines · Edward Wildgoose
Actually perhaps this is the problem that I am seeing as well on a P4P800 board with a hyperthreaded P4. I have a dual P3 which starts and stops alsa fine, at least up to about alsa 0.9.4. However, with this board if I do an alsa restart, modules reload, but no sound until reboot, and this happens with various builds at least as far back as 0.9.2
On my Athlon-mp and Athlon-xp all works fine.
Seems to be a P4-issue? Even Intel doesn't produce bugfree pentiums ... . Is there someone else using P4 and can reprodu the behaviour?
Eckhard Jokisch
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Quoted 8 lines · Edward Wildgoose
Actually perhaps this is the problem that I am seeing as well on a P4P800 board with a hyperthreaded P4. I have a dual P3 which starts and stops alsa fine, at least up to about alsa 0.9.4. However, with this board if I do an alsa restart, modules reload, but no sound until reboot, and this happens with various builds at least as far back as 0.9.2
The main soundcard is an RME 96/8 PAD, but I also have an onboard intel compatible thing which seems to suffer the same issues.
My P4P800 with a HT P4 runs just fine after reloading the ALSA drivers, with onboard and other soundcards. Maybe you didn't run "alsactl restore"?
HTH
Clemens
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Quoted 2 lines
Quoted 1 line · Edward Wildgoose
Actually perhaps this is the problem that I am seeing as well on a
P4P800
Quoted 1 line
Quoted 1 line
board with a hyperthreaded P4. I have a dual P3 which starts and stops
alsa
Quoted 1 line
Quoted 1 line
fine, at least up to about alsa 0.9.4. However, with this board if I do
an
Quoted 1 line
Quoted 1 line
alsa restart, modules reload, but no sound until reboot, and this
happens
Quoted 8 lines
Quoted 4 lines
with various builds at least as far back as 0.9.2
The main soundcard is an RME 96/8 PAD, but I also have an onboard intel compatible thing which seems to suffer the same issues.
My P4P800 with a HT P4 runs just fine after reloading the ALSA drivers, with onboard and other soundcards. Maybe you didn't run "alsactl restore"?
OK, assume that I didn't (although in my case it is part of the script, so it probably is getting called). Why would that cause the /dev/dsp OSS entries not to be created?
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
Quoted 10 lines · Edward Wildgoose
Quoted 10 lines
Quoted 8 lines · Edward Wildgoose
Actually perhaps this is the problem that I am seeing as well on a P4P800 board with a hyperthreaded P4. I have a dual P3 which starts and stops alsa fine, at least up to about alsa 0.9.4. However, with this board if I do an alsa restart, modules reload, but no sound until reboot, and this happens with various builds at least as far back as 0.9.2
The main soundcard is an RME 96/8 PAD, but I also have an onboard intel compatible thing which seems to suffer the same issues.
Quoted 7 lines
Quoted 3 lines
My P4P800 with a HT P4 runs just fine after reloading the ALSA drivers, with onboard and other soundcards. Maybe you didn't run "alsactl restore"?
OK, assume that I didn't (although in my case it is part of the script, so it probably is getting called). Why would that cause the
/dev/dspOSS entries not to be created?
It wouldn't, alsactl and the OSS device files aren't related.
I guess /dev/dsp is missing because your alsa script doesn't load the OSS emulation modules (the standard alsasound script in alsa-driver/utils/ certainly doesn't). Please try to add the following lines somewhere in the start function:
/sbin/modprobe snd-pcm-oss
/sbin/modprobe snd-mixer-oss
/sbin/modprobe snd-seq-oss
HTH
Clemens
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01
At Fri, 8 Aug 2003 21:25:02 +0100,
Quoted 15 lines · Edward Wildgoose
Quoted 3 lines
Quoted 1 line · Edward Wildgoose
Actually perhaps this is the problem that I am seeing as well on a
P4P800
Quoted 1 line
Quoted 1 line
board with a hyperthreaded P4. I have a dual P3 which starts and stops
alsa
Quoted 1 line
Quoted 1 line
fine, at least up to about alsa 0.9.4. However, with this board if I do
an
Quoted 1 line
Quoted 1 line
alsa restart, modules reload, but no sound until reboot, and this
happens
Quoted 5 lines
Quoted 4 lines
with various builds at least as far back as 0.9.2
The main soundcard is an RME 96/8 PAD, but I also have an onboard intel compatible thing which seems to suffer the same issues.
Quoted 7 lines
Quoted 3 lines
My P4P800 with a HT P4 runs just fine after reloading the ALSA drivers, with onboard and other soundcards. Maybe you didn't run "alsactl restore"?
OK, assume that I didn't (although in my case it is part of the script, so it probably is getting called). Why would that cause the
/dev/dspOSS entries not to be created?
i guess devfs configuration.
the entries for OSS devices are likely missing.
Takashi
-------------------------------------------------------
This SF.Net email sponsored by: Free pre-built ASP.NET sites including Data Reports, E-commerce, Portals, and Forums are available now. Download today and enter to win an XBOX or Visual Studio .NET.
http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/01