-
Notifications
You must be signed in to change notification settings - Fork 18
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
refactor getWinUsbMxId() to fix luxonis/XLink#57 #60
Conversation
This needs testing on various Windows hardware/setups to ensure the new Win32 path -> libusb path code works and the assumptions it makes are valid. I'll test on three machines: Win11 usb3, Win10 usb3, Win10 usb2 👴 |
Good results on my 3 windows test machines. One was additionally interesting... I used my updated
That last computer, 16 years old, still works. Yes the frames come in slowly from 3 devices while some share the same controller's usb2 bandwidth. Yet, it works with 3 OAKs attached. And works...better. Better meaning that when the I continue to think the following:
|
Thanks a bunch for this exploration! |
FATAL logs would likely have to be removed for that, if you have another commit ready with that, will then reference that |
Can you/your team do some dev unit testing on Windows machines with this PR? I'd like to have one or two other people review/test this code before removing the debugging code. |
We will - if you have a commit with that removed I can reference your repo /w changes (can be separate from this PR/branch), in DepthAI and get the testing in |
- mvLog(MVLOG_FATAL) temporarily to aid in debug+test
8fb1391
to
bdab3a0
Compare
Done. This PR's head has CI ready code. |
Changes went through our Windows testing as well - I'll go ahead and merge to |
complete refactor of
getWinUsbMxId()
to fix #57Ready for review. Some things to keep in mind
libusb_get_device_list()
using a single snapshot of the entire PCI+USB tree using the sameSetupDiGetClassDevsA()
Win32 api. That libusb list and libusb path is refreshed on every call tolibusb_get_device_list()
and the path to any specific device might change between calls.SetupDiGetClassDevsA()
in this function. If it is critical to handle that scenario, then this PR can be changed to be similar to libusb and get a single snapshot of the complete PCI+USB tree. That will make this function somewhat slower since the entire tree has to be walked to find hubs and devices. I don't recommend a single snapshot at this time.