westlicht / performer

PER|FORMER Eurorack Sequencer
https://westlicht.github.io/performer
MIT License
235 stars 70 forks source link

Fix usb #291

Closed av500 closed 3 years ago

av500 commented 3 years ago

(NOTE: this is a copy of the pull request sent to libusbhost)

the existing code had 4 issues which are now fixed:

1) after a CTRL REQUEST DATA in (e.g. when read the device descriptor) there was NO status packet sent. this basically means that the only working devices were the ones that ignore USB protocol errors and continue.

2) some USB devices (e.g. AKAI LPK25) have a max packet size of only 8 bytes, so even reading the 18 byte device descriptor fails. now only 8 bytes are read to get max packet size and then the full descriptor is read.

3) some USB devices (e.g. Arturia Beatstep Pro) have a TOGGLE error at their first DATA IN transaction, the state machine did not handle that and simply stopped, now a TOGGLE ERROR is treated like any other error and data can flow again

4) when iterating over the interfaces the drivers' analyze function was always passed the data buffer of the FIRST interface, this is now fixed and devices like AKAI MIDIMIX work

SloBloLabs commented 3 years ago

Vladimir was so kind to send me his patch and I can confirm Akai MPK mini finally working with this. #127 would be solved for me having the PR in stock firmware.

westlicht commented 3 years ago

@av500 sorry for the late review. I've been busy with work. Thanks a lot for these fixes. I'm not an expert in the USB protocol but I previously assumed that this library had some issues. I had some problems when trying to get the new Launchpad series to work but a firmware update from Novation seems to have resolved those issues, but it probably would have worked before with these changes in place. There are some minor comments. If you can fix those great, otherwise I'll do those changes myself.

av500 commented 3 years ago

thx for the review, I'll check your comments

av500 commented 3 years ago

@westlicht I fixed the buffer length and the two coding style issues and re-pushed the branch

westlicht commented 3 years ago

Looks great, merging this now.

napoleonthegreat94 commented 3 years ago

Thank you all for fixing usb host. Should we expect a new firmware with these changes?! My Arturia Microlab is now recognized with these improvements. Cant wait to get an official firmware for this.

CT-030 commented 3 years ago

Hello do you have a solution with the launchpad mini mk3 ver.1.0.4 ? It isn't working :/

ALJHONQ commented 1 year ago

Nc