openAVproductions/openAV-Ctlra

Release pending USB transactions before device close

Opened this issue · 0 comments

With libusb debug enabled (export LIBUSB_DEBUG=2..5) a bunch of warnings/errors are printed. Some are not so bad (timeouts are expected at debug=5), however upon close with debug=2 a bunch of valid warnings/errors are printed:

libusb: error [do_close] Device handle closed while transfer was still being processed, but the device is still connected as far as we know
libusb: error [do_close] A cancellation hasn't even been scheduled on the transfer for which the device is closing
libusb: error [release_interface] release interface failed, error -1 errno 95
ctlra_dev_impl_usb_close:Ctrla Warning: release interface ret: -99

Cancelling the pending reads (or just not issuing new ones and letting the existing ones time-out) should solve this issue.