All of lore.kernel.org
 help / color / mirror / Atom feed
* Is a complete Alsa restart possibly without rebooting?
@ 2003-08-06 15:44 Mark Knecht
  2003-08-06 16:30 ` Frank Barknecht
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Knecht @ 2003-08-06 15:44 UTC (permalink / raw)
  To: Alsa-Devel

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is a complete Alsa restart possibly without rebooting?
  2003-08-06 15:44 Is a complete Alsa restart possibly without rebooting? Mark Knecht
@ 2003-08-06 16:30 ` Frank Barknecht
  2003-08-06 17:04   ` Mark Knecht
  0 siblings, 1 reply; 9+ messages in thread
From: Frank Barknecht @ 2003-08-06 16:30 UTC (permalink / raw)
  To: Alsa-Devel

Hallo,
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/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.

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
-- 
 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* RE: Is a complete Alsa restart possibly without rebooting?
  2003-08-06 16:30 ` Frank Barknecht
@ 2003-08-06 17:04   ` Mark Knecht
  2003-08-06 17:37     ` Edward Wildgoose
  0 siblings, 1 reply; 9+ messages in thread
From: Mark Knecht @ 2003-08-06 17:04 UTC (permalink / raw)
  To: Frank Barknecht, Alsa-Devel

> 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
> --
>  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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is a complete Alsa restart possibly without rebooting?
  2003-08-06 17:04   ` Mark Knecht
@ 2003-08-06 17:37     ` Edward Wildgoose
  2003-08-07 18:49       ` Eckhard Jokisch
  2003-08-08 15:21       ` Clemens Ladisch
  0 siblings, 2 replies; 9+ messages in thread
From: Edward Wildgoose @ 2003-08-06 17:37 UTC (permalink / raw)
  To: Alsa-Devel

>    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.

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is a complete Alsa restart possibly without rebooting?
  2003-08-06 17:37     ` Edward Wildgoose
@ 2003-08-07 18:49       ` Eckhard Jokisch
  2003-08-08 15:21       ` Clemens Ladisch
  1 sibling, 0 replies; 9+ messages in thread
From: Eckhard Jokisch @ 2003-08-07 18:49 UTC (permalink / raw)
  To: Alsa-Devel

Edward Wildgoose wrote:

>
> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is a complete Alsa restart possibly without rebooting?
  2003-08-06 17:37     ` Edward Wildgoose
  2003-08-07 18:49       ` Eckhard Jokisch
@ 2003-08-08 15:21       ` Clemens Ladisch
  2003-08-08 20:25         ` Edward Wildgoose
  1 sibling, 1 reply; 9+ messages in thread
From: Clemens Ladisch @ 2003-08-08 15:21 UTC (permalink / raw)
  To: Edward Wildgoose; +Cc: Alsa-Devel

Edward Wildgoose wrote:
> 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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is a complete Alsa restart possibly without rebooting?
  2003-08-08 15:21       ` Clemens Ladisch
@ 2003-08-08 20:25         ` Edward Wildgoose
  2003-08-11  9:57           ` Clemens Ladisch
  2003-08-11 10:03           ` Takashi Iwai
  0 siblings, 2 replies; 9+ messages in thread
From: Edward Wildgoose @ 2003-08-08 20:25 UTC (permalink / raw)
  To: Clemens Ladisch, Alsa-Devel

> Edward Wildgoose wrote:
> > 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"?

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is a complete Alsa restart possibly without rebooting?
  2003-08-08 20:25         ` Edward Wildgoose
@ 2003-08-11  9:57           ` Clemens Ladisch
  2003-08-11 10:03           ` Takashi Iwai
  1 sibling, 0 replies; 9+ messages in thread
From: Clemens Ladisch @ 2003-08-11  9:57 UTC (permalink / raw)
  To: Edward Wildgoose; +Cc: Alsa-Devel

Edward Wildgoose wrote:
> > Edward Wildgoose wrote:
> > > 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"?
>
> 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?

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: Is a complete Alsa restart possibly without rebooting?
  2003-08-08 20:25         ` Edward Wildgoose
  2003-08-11  9:57           ` Clemens Ladisch
@ 2003-08-11 10:03           ` Takashi Iwai
  1 sibling, 0 replies; 9+ messages in thread
From: Takashi Iwai @ 2003-08-11 10:03 UTC (permalink / raw)
  To: Edward Wildgoose; +Cc: Clemens Ladisch, Alsa-Devel

At Fri, 8 Aug 2003 21:25:02 +0100,
Edward Wildgoose wrote:
> 
> > Edward Wildgoose wrote:
> > > 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"?
> 
> 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?

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

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2003-08-11 10:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-08-06 15:44 Is a complete Alsa restart possibly without rebooting? Mark Knecht
2003-08-06 16:30 ` Frank Barknecht
2003-08-06 17:04   ` Mark Knecht
2003-08-06 17:37     ` Edward Wildgoose
2003-08-07 18:49       ` Eckhard Jokisch
2003-08-08 15:21       ` Clemens Ladisch
2003-08-08 20:25         ` Edward Wildgoose
2003-08-11  9:57           ` Clemens Ladisch
2003-08-11 10:03           ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.