USB-MIDI-Driver icon indicating copy to clipboard operation
USB-MIDI-Driver copied to clipboard

WaiterThread will spin and crash device

Open swilson opened this issue 6 years ago • 0 comments

If another app forcibly claims the UsbInterface, deviceConnection.bulkTransfer will immediately return -1 causing the MidiInputDevice WaiterThread to spin forever at thread priority 8. This will eventually lock up and crash most devices; the LAST KMSG bugreport logs are full of:

[11053.427626] usb 1-1: usbfs: process 7851 (2].WaiterThread) did not claim interface 3 before use

Fixed here by adding an error counter to the WaiterThread and bailing if it reaches an arbitrary watermark. Not ideal; really the whole stack should shut down if the interface gets claimed by someone else (kind of ridiculous the Android API allows this to occur in the first place).

swilson avatar Jan 07 '19 19:01 swilson