Open Peaj opened 2 months ago
i am getting into the libusb-side of the implementation, where there is a check for active_transfers
before setting request_close
. i am still trying to figure out how the whole ecosystem works, so maybe original contributors can give us a better insight on how this was planned...
in driver_vive.libusb.h
in survive_close_usb_device
at line 300 you'll find (for your considering)
if (usbInfo->active_transfers == 0) {
usbInfo->request_close = true;
SV_VERBOSE(100, "Acking close for %s", survive_colorize_codename(usbInfo->so));
}
I did not look at libusb yet as I was building with the default setting of HIDAPI. The libusb implementation could bring insights into how it should be handled though. But dirver_vive.hidapi.h is not using active_transfers at all. I am not even sure when to user libusb over hidapi. Is hidapi a windows only thing?
Fixes infinite loop during vive driver shutdown.
survive_handle_close_request_flag
in drive_vive.c never shutdown the usb connection becauseusbInfo.requestClose
was nevertrue
.I updated
survive_close_usb_device
to set therequestClose
flag to true sosurvive_handle_close_request_flag
can react to it and close the connection.I am not 100% sure where this flag is supposed to be set but from my understanding
survive_close_usb_device
should be reasonable and so far the plugin seems to shutdown gracefully.Fixes #312