-
-
Notifications
You must be signed in to change notification settings - Fork 47
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB device suddenly works. But why? #75
Comments
Use git to find out the difference between releases. I can only guess what exactly affected this. P S. The only change was that the deadlock had been fixed in receive thread. I think that something has fixed on server side. |
In this case I also have to guess. I can tell you that with version v.0.9.6.3 attaching this USB device is firstly detected and displayed in the device manager. However after detaching and unbinding it was still there in the device manager and instead of removing it from the device manager another unkown device showed up with an error mark. Also in the registry the keys in the USB enum devices persist. When you attach a second time then you will get displayed 2 of these devices in the device manager and after detaching you also get 2 unkown devices showed up with an error mark - and so on ... Because of that I wrote a powershell script which manually deleted the affected registry keys of these USB enum devices to "clear" the status as it should be after detaching. But this was only a fix and didn't go down to the main reason of this issue. So it seems that you changed something in your code since v.0.9.6.3 which also affects this issue. |
There are four commits since the latest release and only one really was for the driver. |
Thank you. Perhaps this issue has something to do with this here d1155ff. Also the title "Fix detach deadlock" could suggest this. |
There are no such loops in the driver. It can be issues with virtual device power management, for example see #72. I don't have such devices and can't investigate what is going on. |
Now I have noticed by further investigation that the device stays connected as long as you use the device (moving sliders, rotating controls, pressing buttons). Then when you do nothing on the device it takes about 1 second and the device diconnects and reconnects. So it seems that if you don't give input signals to the device it disconnects and reconnects. Do you think that probably here in this fix d1155ff is another little bug (here is also a function called wait_detach_timeout)? Or how can I support you here finding the bug? |
Please pay attention to power management stuff |
Thank you. Can you give a hint where these functions should be included. At the moment I have no overview and don't know how to start here. I just tested this device with another USBIP software and there the device is working normal. The device reboots when you stop giving input signals. You can see it here if you stop rotating the controller the device reboots. As long as you rotate or do something the device stays on. The device should stay stable without rebooting. Or is it possible to add a code line to not go into such a suspend mode and stay in power mode all the time? |
I don't know, I have no such devices. You don't need to include something, you could modify existing code. For example, make all WDFQUEUEs not power managed |
I tried now to set all entries from |
Set all to cfg.PowerManaged = WdfFalse |
The Here are the logs and zipped etl files (start capture - attaching the device - rotating knob - stopped rotating and device reboots - again rotation knob pressing a button - stopped doing anything and the device reboots again - stop capture):: Can it be that this part of code can lead to the described issue? usbip-win2/drivers/ude/device.cpp Line 177 in fcb8232
The code seems to unlink and cancel all devices in a while loop. Perhaps this also unlinks devices which should't be unlinked. So it could be that after a controller was rotated it goes into this while loop and unlinks all devices. It should instead only unlink the device which was triggered before. Can this be the problem? Update: Here are PCAP captures of usbipd server (start capture - attaching the device - 3 reboots - detaching - stop capture): |
I do not get what is working and what isn't. If Linux is a server and usbip2 is a client, that's enough. Windows usbipd server is not a canonical implementation, I do not care about it. I'm going to implement server part for usbip2 this year (at least start development). |
This would be a good combitnation to also have your usbipd server for windows. Perhaps such issues will then be history. At the moment we try to get it done with usbipd-win. |
Here is a USB device that has about 7 USB devices in it. This USB device was causing a few problems (with version v.0.9.6.3) and I would like to ask if there have been any changes to the code recently. I compiled usbip manually with the current code (v.0.9.6.4) and the device now works. I also compiled the current code on the server side and it could also be due to the server code that this USB device suddenly works. Can you say whether you have made any changes to the code recently to better support such USB devices?
The text was updated successfully, but these errors were encountered: