droelfdroelf / dtdump

An open Overbridge protocol implementation proof of concept.
MIT License
91 stars 14 forks source link

Why is libusb_set_configuration called twice? #6

Open Noir- opened 4 years ago

Noir- commented 4 years ago

I'm trying to understand the current implementation in order to add support for my Analog Rytm MKI. Is there any reason why this is called twice in a row? https://github.com/droelfdroelf/dtdump/blob/a0155554b40db44cd0b4422802ccbb9c742344ee/src/overbridge.c#L188

Also, is there any explanation available where this magic number (1) comes from?

droelfdroelf commented 4 years ago

The initialization was basically copy pasted from USB sniffer logs I took with the Elektron drivers. Not sure if it is really needed to call usb_set_configuration() twice. The parameters were also taken from the sniffer logs. As for the Analog Rhythm, I remember that some of the Elektron devices run USB not at high speed (480MBit/s) but full speed only (12MBit/s), maybe they do things differently here to save bandwidth.