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

USB device disconnect and shutdown #74

Open
jrogala opened this issue May 31, 2024 · 5 comments
Open

USB device disconnect and shutdown #74

jrogala opened this issue May 31, 2024 · 5 comments

Comments

@jrogala
Copy link

jrogala commented May 31, 2024

I try to make a VRS Wheel Base work via usbip. I have my host (ubuntu, fresh install) and client (windows, VRS driver installed). I can declare and bind my usb wheel base but whenever I attach to it, I lose the connection to it and I have to do a hard reboot of the wheel base (pluging/unpluging does not work).

Of course if I plug directly I have none of this and everything works fine.

I believe it may have to do with the firmware of the controller itself, but I don't have any experience on this low level stuff so I cannot pinpoint where is the problem. Isn't it supposed to be passthrough?

Here are the log:

@vadimgrn
Copy link
Owner

vadimgrn commented Jun 1, 2024

I see that the couple of IRPs (seqnum 61, 63) were not completed during the detaching, that causes this issue. I'll give you a build to test if I make a fix.

[3]14dc bulk_or_interrupt_transfer:req 6236f2a8 -> PipeHandle a04c6ca0, IN|SHORT_OK, TransferBufferLength 64
[3]14dc send:req 6236f2a8 -> 48{seqnum 59, devid 0x1000e, in[1]}, cmd_submit: flags 0, length 64, start_frame 0, isoc[-1], interval 4
[3]14dc recv_loop:req 62c8ff68 <- 111{seqnum 57, devid 0, in[0]}, ret_submit: status 0, actual_length 63, start_frame 0, isoc[0], error_count 0

[3]14dc bulk_or_interrupt_transfer:req 5ba212d8 -> PipeHandle a04c6ca0, IN|SHORT_OK, TransferBufferLength 64
[3]14dc send:req 5ba212d8 -> 48{seqnum 61, devid 0x1000e, in[1]}, cmd_submit: flags 0, length 64, start_frame 0, isoc[-1], interval 4
[3]14dc recv_loop:req 6236f2a8 <- 111{seqnum 59, devid 0, in[0]}, ret_submit: status 0, actual_length 63, start_frame 0, isoc[0], error_count 0

[3]14dc bulk_or_interrupt_transfer:req 62c8ff68 -> PipeHandle a04c6ca0, IN|SHORT_OK, TransferBufferLength 64
[3]14dc send:req 62c8ff68 -> 48{seqnum 63, devid 0x1000e, in[1]}, cmd_submit: flags 0, length 64, start_frame 0, isoc[-1], interval 4

[11]14dc TRACE_LEVEL_VERBOSE usbip::recv_thread_function:dev 62e32238, detaching
[3]14dc TRACE_LEVEL_INFORMATION `anonymous namespace'::detach:dev 62e32238, connection closed
[3]14dc TRACE_LEVEL_VERBOSE usbip::vhci::device_state_changed:192.168.1.19:3240/1-1, port 1, disconnected, subscribers 0
[3]14dc detach:dev 62e32238

@vadimgrn
Copy link
Owner

vadimgrn commented Jun 1, 2024

I've found a deadlock in the detach code, will give the test build tomorrow.

@vadimgrn
Copy link
Owner

vadimgrn commented Jun 2, 2024

@jrogala
Copy link
Author

jrogala commented Jun 2, 2024

Hello, thanks for your quick answer and build, it still does it with the newest build.

Here are the new log:
usbip-ude.txt
usbip-flt.txt

Thanks for your time!

@vadimgrn
Copy link
Owner

vadimgrn commented Jun 3, 2024

I did not expect that this will fix the issue, I just fixed the deadlock during the detach. I think usbip server is closing the connection for some reason. To make sure you could set -flag 0x1F instead of 0xF in command
tracelog.exe -start %NAME%-ude -guid #ed18c9c5-8322-48ae-bf78-d01d898a1562 -f %NAME%-ude.etl -flag 0xF -level 5

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

No branches or pull requests

2 participants