Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sysex not working #63

Open
robtoll opened this issue Jun 21, 2017 · 1 comment
Open

Sysex not working #63

robtoll opened this issue Jun 21, 2017 · 1 comment

Comments

@robtoll
Copy link

robtoll commented Jun 21, 2017

Hi. I'm unable to use system exclusive on any Android device. All of the standard Midi works fine, and sending sysex is fine, but the sysex response is missing bytes.

I've tested on emulators and hardware using Android 4,5,6 and 7.
When expecting a sysex reply of 144 bytes, it often returns 141. The 3 missing bytes are at the start.
It's completely random, so sometimes it gives an incorrect response immediately, other times after no more than 5 correct responses.

I've tried increasing the thread priority in the MidiInuptDevice file, changing the sleep time, and increasing the ready buffer size, to no avail.

The comments and suggestions in this issues (#58) doesn't help.

Is sysex given less priority than standard midi messages? If so, how do I get the sysex messages to use the same priority? I only need sysex, so I'd like it to be the main priority.

Thanks

@robtoll
Copy link
Author

robtoll commented Jul 2, 2017

Solved by increasing the timeout of the bulkTransfer call in MidiInputDevice.java.

If you're experiencing problems with long sysex midi messages, do the following...

Line 238 has the following line
length = deviceConnection.bulkTransfer(usbEndpoint, bulkReadBuffer, maxPacketSize, 10);

Change it to
length = deviceConnection.bulkTransfer(usbEndpoint, bulkReadBuffer, maxPacketSize, 100);

You may need to refine it for your own purposes - I'm only dealing with sysex messages that are 144 bytes long.

Hope this helps someone! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant