-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
libusb open fails returns error not supported for USB HUBs with supported driver #1302
Comments
Please read here: did you install a supported driver? |
What is the version of libusb are you using? Please use libusb-1.0.26 or git. I have a similar smart HUB on Windows 10 x64 and I can not reproduce the issue.
|
Please post the full debug log of |
Can u please try getting the handle for the hub. |
Attaching the Logs
|
@Janarthanan-S-03 If you do not want to build from source, you can download libusb-1.0.26 binaries from this repo. It has the xusb binaries. |
@mcuee Installed and tried using libusb-1.0.26
The same issue exists. |
Now this is strange. |
For troubleshooting, can you use Zadig to install WinUSB driver to see if that helps? Thanks. You can also try libusbK driver. Zadig 2.8 download: |
@mcuee tried using libusb-win32 driver,libusbk driver but the issue still exists. |
Hi @mcuee Any update on this issue? |
Sorry but I have no ideas why this happens. Hopefully others can have better ideas. In any case, why do you want to talk to this Hub? What is your goal? |
In any case, why do you want to talk to this Hub? What is your goal? The issue still exists |
Looking at the debug output I cannot tell which driver the device (1.5 is bus 1 address 5, from session 51) is detected as using (or is it just recognized as a hub early in the enumeration?) and I guess the lack of a suitable driver is why it cannot be opened, but I am also not sure what /should/ happen here. @mcuee can you post your debug log from the similar smart hub where it works? @sonatique can you spot from the log what goes wrong? This is one example where I find our debug output is a bit difficult to parse and generally lacking. |
@tormodvolden
I would say that maybe it would worth experimenting with what would happen if lines 2515 to 2529 would be used to replace lines 2473 to 2487 (i.e. using the same function pointers for a hub than for a regular device). Or maybe should this hub be considered as composite device? |
@tormodvolden |
I think that should not be correct for this device. Related to USB Hub under Windows but not the same issue -- for external USB HUB. |
Thanks @sonatique, point 1 was relatively easy and point 2 was close to my guesses, but I couldn't see it explicitly in the log that the USB_API_HUB was assigned (and that it was not reassigned later). If you know the enumeration code well enough it is maybe obvious. But if the WinUSB.sys driver is installed for the device, as per the screenshot, why isn't the winusbx api assigned to it? |
Do I need to try anything? |
@Janarthanan-S-03 Can you compile libusb yourself (from git)? One small thing to get a bit more debug information is to uncomment Does the device show up in the Device Manager? |
@tormodvolden I have complied with the source. What operation do I need to perform? |
You can edit the file libusb/os/windows_winusb.c and on the line where you have:
Yes, that was a stupid question. What I meant to ask was, where in Device Manager does it show up, e.g. under Hub devices ("Universal Serial Bus controllers") or under "Universal Serial Bus devices" as a "WinUsb Device" ? |
|
So it shows up under "Universal Serial Bus devices" but as "USB2906 Smart Hub", thanks. |
This is what I have.
Full debug log. Click for the full debug log
|
If you select View -> "Devices by connection", or use another tool like USB Device Viewer, does it belong to a composite device? |
Unlikely. But I can only test this on Wednesday as I do not have access to the docking station right now. |
The ENUM_DEBUG helped to see what is going on. I think we should add it by default. What seems to happen is that the api is first detected as hub, then in the GEN pass the extra GUID is discovered and added as an EXT pass. In this EXT pass the api is detected as WinUSB, however it never gets set in the dev-priv, because that would only happen in the previous HUB and DEV passes (see "// Setup device"). |
@mcuee and @Janarthanan-S-03 please try these patches (or simply run the included xusb.exe which is statically linked with patched libusb). It is probably not an ideal fix, but it might do something.
|
I agree.
I will try this tommorrow when I have access to the docking station. |
Since I do not have the docking station with me today, I use a USB 2.0 hub and change the driver to WinUSB. Interestingly libusb git main, libusb-1.0.22 release onwards failed to open the device. libusb-1.0.21 release and libusb-1.0.20 release are able to open the device.
git HEAD debug log
libusb-issue1302-v1 debug log
libusb 1.0.21 release debug log
|
BTW, libusbK klist is able to open the device.
But it is not useful to swtich the driver to libusbK, libusb Windows will still fail to open the device. |
There were massive changes to the Windows enumeration between 1.0.21 and 1.0.22, for instance commit 71a779d. Can you please check if it worked before this commit, and after? Please also define ENUM_DEBUG whenever you compile a test version. |
The commit already failed. libusb-1.0.21.11255 debug log
|
This commit is still good: 0ccf7ea libusb-1.0.21.11199 debug log
|
I think I can quickly zoom down to the commits which breaks the external hub support. But I am not so sure whether it is easy to add it back. Let's see. |
Further zoom down: 8d248ab is bad already. Maybe this is the one. I will check later. libusb-1.0.21.11243 debug log
|
This commit is good: 0b3d4c6 libusb-1.0.21.11239 debug log
|
Indeed that paticular commit 8d248ab is the culprit. The one commit before it (libusb-1.0.21.11242) is good. libusb-1.0.21.11242 debug log
|
Thanks for bisecting this! Trying to understand why my patch didn't help for you: There is an extra GUID 2A34E4EF* found, but I cannot see any EXT pass for it. Is the libusb-issue1302-v1 debug log above truncated? |
No, I think xusb was crashing. Here is a new version: libusb-issue1302-v2.zip |
Great. This new version works fine. libusb-issue1302-v2 debug log
|
Please help to give it a try on your device. Thanks. |
Hmm, I have the docking station with me now but it is not on the docking station. It may be on the external monitor. But I will not have the access to the monitor until next Monday. |
I had previously a suspicion the issue affected composite devices, but it turned out to affect all hubs - once the hub API was assigned, it wouldn't be reassigned after a driver or GUID match. But I am still curious to see if the patch works for your "smart hub" as well. |
I will carry out the test early next week. |
Yes it still works. Please refer to the debug log posted above, especially the "device still referenced" warning messages. The debug log from git HEAD is also attached here for reference.
debug log from git HEAD
|
Thanks! So your smart hub 0424:2740, which always have worked, is not detected in the HUB pass, but detected with WinUSB in the DEV pass, and then again in its EXT pass. Since it detected correctly on the first shot, it doesn't matter if later matches reassigns the api or not. The debug log is a bit easier to read (and I don't get confused about any composite driver involved!):
GEN:
EXT:
|
I am not surprised by the leaks seen in the patched version. It is not a clean patch, it is just to see what can be done. We have some pending merge requests on the surrounding code, so I will rather continue on this after they have been merged and after having adding some more log verbosity, and hopefully find a proper way to fix it then. It would be good if @Janarthanan-S-03 can test the patched version too. |
Another log: the patched version works fine for a external USB hub using WinUSB driver (replaced the existing USB Hub driver with WinUSB using Zadig)
git main or libusb-1.0.27-rc1 will fail.
Full debug log: full debug log for the failure using libusb-1.0.27-rc1
|
My Dell WD19TB Thunderbolt Docking Station supports 10Gbps. Unfortunately I can not test PR #1428 under Windows because of this issue, even after I change the driver to WinUSB. Just wondering if you can help to see how I can apply your draft patch on top of PR #1428 (or better PR #1428 rebase to git). |
while trying to open a hub with vid:0x424 and pid:0x2906 in windows 10 x64 processor
logs:-
The text was updated successfully, but these errors were encountered: