Re: usb stuff breaks after unplugging usb audio dongle

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, 7 Nov 2016 15:31:11 +0100, Greg KH wrote:
> On Mon, Nov 07, 2016 at 08:06:41AM -0500, Dennis New wrote:
> > So, I have a USB audio dongle (currently using ohci, but the same
> > would probably happen with ehci), and if I stupidly decide to
> > unplug it while I'm streaming audio (alsa) to it, mplayer (for
> > example) first freezes ... and if I quit mplayer immediately,
> > things are fine ... but if I try to continue playing (by
> > unpausing/seeking), mplayer goes into an infinite loop of errors
> > trying to write to the (alsa?) audio device, but more importantly,
> > my kernel's (4.8.6) entire usb system seems to break ... I can't
> > even properly load my ehci_pci kernel drivers (it is actually able
> > to load them, but they can't be unloaded... they seem to get
> > immediately hung too... even though the dongle was using ohci at
> > the time) ... my alsa sound is also broken/hung so I no longer get
> > audio ... I'm forced to reboot (and even here it can't power off, I
> > have to force it with the PrtSc buttons).
> 
> If you are able to get any kind of kernel log message when you remove
> the device, that would help out a lot in trying to track this issue
> down.  Without that, it's going to be almost impossible, sorry...

Hrm. I think the problem was with alsa-lib-1.0.29'ish. Upgrading to
alsa-lib-1.1.2 fixed the problem.

With the older alsa-lib, after abruptly unplugging my usb audio device,
although mplayer does freeze, if I try to resume it, "it" (alsa?) gets
into an endless loop:
...
[AO_ALSA] Trying to reset soundcard.
[AO_ALSA] Write error: No such device
[AO_ALSA] Trying to reset soundcard.
[AO_ALSA] Write error: No such device
[AO_ALSA] Trying to reset soundcard.
[AO_ALSA] Write error: No such device
[AO_ALSA] Trying to reset soundcard.

With the newer alsa-lib, mplayer gracefully instead simply says:
[AO_ALSA] pcm prepare error: File descriptor in bad state

With the older alsa-lib, mplayer, and perhaps other stuff were stuck in
a hung/zombie state, and I guess this was somehow causing the
snd-usb-audio kernel driver and/or usb stack to get hung as well? It
was also preventing my machine from powering off normally.

# ps -ef | grep mplayer
denn  25421     1  0 21:35 ?        00:00:01 [mplayer]
denn  25422 25421  0 21:35 ?        00:00:00 [mplayer] <defunct>

# lsof | grep mplayer
mplayer   25421       denn  cwd   unknown     /proc/25421/cwd
(readlink: No such file or directory)
mplayer   25421       denn  rtd   unknown     /proc/25421/root
(readlink: No such file or directory)
mplayer   25421       denn  txt   unknown     /proc/25421/exe
(readlink: No such file or directory)

Anywho, things work now.

--
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux