Skip to content
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

Add 'bind --force' option #164

Merged
merged 4 commits into from
Jan 19, 2022
Merged

Add 'bind --force' option #164

merged 4 commits into from
Jan 19, 2022

Conversation

dorssel
Copy link
Owner

@dorssel dorssel commented Dec 14, 2021

  • Remove 'bind --all' option (obsolete)

Fixes #118

@dorssel dorssel marked this pull request as draft December 14, 2021 17:50
@codecov
Copy link

codecov bot commented Jan 9, 2022

Codecov Report

Merging #164 (052185e) into master (72cb390) will increase coverage by 0.04%.
The diff coverage is 8.99%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #164      +/-   ##
==========================================
+ Coverage   29.91%   29.95%   +0.04%     
==========================================
  Files          21       23       +2     
  Lines        1882     1906      +24     
==========================================
+ Hits          563      571       +8     
- Misses       1319     1335      +16     
Impacted Files Coverage Δ
UsbIpServer/CommandHandlers.cs 0.00% <0.00%> (ø)
UsbIpServer/ConfigurationManager.cs 0.00% <0.00%> (ø)
UsbIpServer/ConnectedClient.cs 0.00% <0.00%> (ø)
UsbIpServer/ConsoleTools.cs 31.64% <0.00%> (-14.66%) ⬇️
UsbIpServer/ExportedDevice.cs 0.00% <0.00%> (ø)
UsbIpServer/Interop/VBoxUsb.cs 100.00% <ø> (ø)
UsbIpServer/NewDev.cs 0.00% <0.00%> (ø)
UsbIpServer/RegistryUtils.cs 0.00% <0.00%> (ø)
UsbIpServer/UsbDevice.cs 0.00% <0.00%> (ø)
UsbIpServer/Interop/VBoxUsbMon.cs 100.00% <100.00%> (ø)
... and 8 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 72cb390...052185e. Read the comment docs.

- Remove 'bind --all' option (obsolete)
@dorssel dorssel marked this pull request as ready for review January 17, 2022 00:22
@dorssel
Copy link
Owner Author

dorssel commented Jan 17, 2022

@benmcmorran
Don't worry, not asking to review this monster PR. This is just FYI.

The --force options is done! I had to refactor the entire device management (and registry layout), but all for the better. Not tied to BUSID anymore: now it is completely based on Windows unique Device Instance IDs. Much faster, and when using --force it completely (100%) bypasses VBoxUsbMon. I'll ask some users to test; could you do the same?
PR build artifact at: https://github.com/dorssel/usbipd-win/actions/runs/1705631433

@Josverl
Copy link
Collaborator

Josverl commented Jan 17, 2022

@dorssel ,
I gave this a quick try and all my tested devices work.

However I have seen a few times that usbipd wsl attach or detach crashes.
See: crash on attempted detach : https://gist.github.com/Josverl/06d2f1e633ae75b25c0290302c26fa4c

even when the ubuntu distro was stopped, the devices remained attached.
a restart of the server solved that

@dorssel
Copy link
Owner Author

dorssel commented Jan 17, 2022

@Josverl

even when the ubuntu distro was stopped, the devices remained attached.
a restart of the server solved that

Zooming in on this part of your report: the socket connection to the client is set to a 15 second keepalive timeout. When I attach a device and then do wsl --shutdown, 15 seconds later usbipd-win recognizes the lost connection and releases the device. Just to make sure, did you give it that much time?

EDIT: keep-alives sent after 10 seconds, 5 times 1 second apart: total timeout 15 seconds.

@dorssel
Copy link
Owner Author

dorssel commented Jan 17, 2022

@Josverl

See: crash on attempted detach : https://gist.github.com/Josverl/06d2f1e633ae75b25c0290302c26fa4c

EDIT:
Duh! Pilot error on my part. See fix: 052185e
New artifact at: https://github.com/dorssel/usbipd-win/actions/runs/1710391286

@benmcmorran
Copy link
Collaborator

I just tried this on a few embedded dev boards and everything worked well.

@dorssel
Copy link
Owner Author

dorssel commented Jan 19, 2022

Thank for testing, everyone! Merging...

@dorssel dorssel merged commit b90e4a5 into master Jan 19, 2022
@dorssel dorssel deleted the upper_filters branch January 19, 2022 12:10
@Josverl
Copy link
Collaborator

Josverl commented Jan 19, 2022

When I attach a device and then do wsl --shutdown, 15 seconds later usbipd-win recognizes the lost connection and releases the device. Just to make sure, did you give it that much time?
EDIT: keep-alives sent after 10 seconds, 5 times 1 second apart: total timeout 15 seconds.

hmm , no unlikely that I was that patient after shutting down WSL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Unable to attach USB Device to WSL2
3 participants