Usbctrl Restart freezes system

A forum for general AmigaOS 4.x support questions that are not platform-specific
User avatar
Raziel
Posts: 1171
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Usbctrl Restart freezes system

Post by Raziel »

@samo79

I forgot to add that i have USB and DMA fixed hardware.

I know it may be a pain, but did you do the same test with only the mouse hooked up and one with only the keyboard?
It may be the hardware you're using, maybe they use non-standard feedback commands?
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: Usbctrl Restart freezes system

Post by xenic »

@Raziel
know it may be a pain, but did you do the same test with only the mouse hooked up and one with only the keyboard?
It may be the hardware you're using, maybe they use non-standard feedback commands?
I've tested my system with 3 different mice. I also tried your test with keyboard disconnected and then with mouse disconnected. If there is a USB stick inserted when I do "USBCtrl Restart" I get the same "freeze" regardless of whether both keyboard & mouse are connected or if only one is connected. Since people with other hardware are having problems but not reporting a crash or freeze, I decided to check if it's a system freeze. I started the "Clock" utility with the second hand being displayed and performed a "USBCtrl Restart" with a USB stick inserted and the clock continued to display the second hand moving. I would have to conclude that what we are seeing is an input freeze/failure and not necessarily a complete system failure. Since the SAM has only USB input (no PS2), a USB failure has the same effect as a system freeze because the user is locked out. Are you using USB input only on your A1 or are you using PS2 for mouse or keyboard?

So far it appears that issuing a "USBCtrl Restart" with USB stick insterted is causing an input freeze on SAMs and other slightly less catastrophic problems on other hardware. I think we have enough evidence for this issue to be reported as a "bug" if we can get the attention of a developer or beta tester.
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
Raziel
Posts: 1171
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Usbctrl Restart freezes system

Post by Raziel »

Ah, i see

So it may be a freeze here aswell because i translated my clock with counting seconds as "no freeze, just lost USB"

I have both USB (mouse/keyboard)
I have aswell the USB2MIDI adapter plugged in continously and from time to time USB sticks

I should test with PS2 mouse/keyboard (will do eventually and report back)
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 4:06 pm
Location: North Florida, near the Big Bend

Re: Usbctrl Restart freezes system

Post by LyleHaze »

Raziel,

It sounds like the USB MIDI driver is working fine. :)

Please allow me to explain. Most people had no troubles with the driver, but a few still had random issues with it failing.
As i was updating the driver, it occurred to me that the USB MIDI driver never gave any indication of when it was shutting down.
If the USB stack stalled, or if the interface USB cord was unplugged, the driver would just exit quietly, without giving any notice of failure. To make it even harder to troubleshoot, it would silently restart the driver as soon as the problem went away. SO if there is a problem, the user was given no indication when or what the problem was about.

In the latest release of the driver, ANY error that interrupts the USB service will raise a requester informing the user of the problem. Only after that requester is closed will the USB driver complete its shutdown.
Once the new driver was out, people who were having USB MIDI issues could identify what they were doing that was causing the USB service to stall. It has "solved" the riddle of some people having troubles with the driver.

In your case, it looks like the cause of the USB interruption is the USBCTRL RESTART. When you do the Restart, the driver stops because USBERR_DETACHED. That's what you just did with a Restart, so it is expected.
When you unplug your USB MIDI interface, you get a requester with USBERR_STALL, which is warning you that it can no longer talk to the MIDI interface. I would expect that anytime the device is unplugged. I would also expect it if the USB cord has an intermittent break, or if some other application prevents the USB stack from servicing the MIDI interface.

If you don't want the requesters, you can roll back to the previous version. You'll also lose the ability to "alias" the names of your interfaces, but I suspect that only people with lots of MIDI ports use that feature.
I suppose I could make a version with a switch to deselect those alerts if there are people who want that option.

Thanks for the "heads up".
Make Beautiful Music,
LyleHaze
User avatar
Raziel
Posts: 1171
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Usbctrl Restart freezes system

Post by Raziel »

@LyleHaze

No way will i roll back the driver revision, i LOVE it :-)

Thanks for the explanation, i have one little question though

*If* and only *if* "USBCtrl Restart" works as it should it also *should* reattach my adapter after all USB gear has been detached?
Did i get that right, i don't have to hot-plug it every time i do that restart?

and one other thing...you don't seem to receive any emails from me, it doesn't bounce, they just don't seem to reach you.
Could you PM me a working email of yours?

Thank you very much
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 4:06 pm
Location: North Florida, near the Big Bend

Re: Usbctrl Restart freezes system

Post by LyleHaze »

Raziel,
USBCtrl Restart" works as it should it also *should* reattach my adapter after all USB gear has been detached?
Not quite. According to Sys:Documentation/usb/usbstack.doc :
"Termination of the usb stack cannot be performed until all users (external programs) of the USB stack has closed their session with the stack"

A later paragraph says this requirement applies to Restart as well.

I did a restart while the MIDI devices were attached, and they did NOT automatically reconnect. ( I seem to remember that they used to).
I removed all my USB MIDI gear, rebooted, and tried again with a flash drive, and the drive did not re-attach. So I think the MIDI driver might not be the cause.

Also, I would suggest that we are not freezing the system, we are just failing to restart the USB stack. (certainly a pain if your Kb/Mouse are USB)

I agree that this bug should be reported. Since the Amiga I'm on today is not fully updated, I'll ask another beta to duplicate the tests before I submit it.
I'll update this thread when there is more to report.

LyleHaze
User avatar
Raziel
Posts: 1171
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Usbctrl Restart freezes system

Post by Raziel »

@LyleHaze

Ah, ok, thanks for the explanation

Yay...perfect to have a betatester around :-)

/me adds LyleHaze to friends list :-D
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
User avatar
LyleHaze
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 525
Joined: Sat Jun 18, 2011 4:06 pm
Location: North Florida, near the Big Bend

Re: Usbctrl Restart freezes system

Post by LyleHaze »

Bugzilla item 6453.
User avatar
samo79
Posts: 572
Joined: Fri Jun 17, 2011 11:13 pm
Location: Italy

Re: Usbctrl Restart freezes system

Post by samo79 »

Raziel wrote:@samo79

I forgot to add that i have USB and DMA fixed hardware.

I know it may be a pain, but did you do the same test with only the mouse hooked up and one with only the keyboard?
It may be the hardware you're using, maybe they use non-standard feedback commands?
Well i try disabling the mouse (and i have the same freeze) but i can't disable the keyboard ! :-D

Aniway my USB mouse/keyboard are Logitech and all was in bundle when i buy my Sam from ACube 8-)
User avatar
Raziel
Posts: 1171
Joined: Sat Jun 18, 2011 4:00 pm
Location: a dying planet

Re: Usbctrl Restart freezes system

Post by Raziel »

@LyleHaze

Thank you very much

@samo79

Logitech here aswell, but as it seems it may not be an external USB hardware problem :-)
People are dying.
Entire ecosystems are collapsing.
We are in the beginning of a mass extinction.
And all you can talk about is money and fairytales of eternal economic growth.
How dare you!
– Greta Thunberg
Post Reply