MIDIUSB icon indicating copy to clipboard operation
MIDIUSB copied to clipboard

Avoid long time execution when sending midiusb packet

Open YruamaLairba opened this issue 8 years ago • 5 comments
trafficstars

I just discovered that sometimes, sending a midiusb packet take more than 250ms. Typically this happen when the Arduino is connected to the computer, but no app to get the midi data. Is there a simple way to avoid or reduce this delay from the arduino side ?

YruamaLairba avatar Aug 19 '17 14:08 YruamaLairba

Hi @YruamaLairba , probably what you are seeing is the USB_send timeout if the interface is not yet configured. Do you also experience the long delay if you open the serial port?

facchinm avatar Sep 04 '17 14:09 facchinm

Yes, the long delay is here when the serial port is open. This how i report the 250ms delay. The USB_send timeout seems a good way, can you tell me more about it or indicate some documentation ?

YruamaLairba avatar Sep 04 '17 16:09 YruamaLairba

Related to #46.

franky47 avatar Nov 06 '18 08:11 franky47

Edit - I was having this issue, mostly due to my use of an outdated core for production devices. I backported the timeout counter from usb.send() from the current core and I'm no longer experiencing this issue.

DisasterAreaDesigns avatar Mar 24 '19 03:03 DisasterAreaDesigns

There's an easy way to check, if the port is ready. See my reply here: https://github.com/arduino-libraries/MIDIUSB/issues/46

DanielRudrich avatar Oct 04 '19 13:10 DanielRudrich