christofmuc / KnobKraft-orm

The KnobKraft Orm - The free modern cross-platform MIDI Sysex Librarian
GNU Affero General Public License v3.0
207 stars 27 forks source link

Linux version can't send large sysex (e.g. Take 5 patches) #318

Open christofmuc opened 7 months ago

christofmuc commented 7 months ago
          Very strange. It seems that both programs want to send the same bytes, and actually do so by handing it over to the JUCE libraries sendMessage function. 

Let's assume Linux MID uses ALSA.

Looking the source from the sendMessageNow() in juce_Midi_linux.cpp, it seems there is no upper limit of message size - but the message would be broken apart into multiple blocks in case ALSA wants to. But the blocks are immediately relayed to the "Sequencer", which for ALSA seems to also be the output device.

Googling, this seems to be a frequent issue with Linux MIDI and ALSA, e.g.

* https://github.com/thestk/rtmidi/issues/214
* https://github.com/davidmoreno/rtpmidid/issues/93
* https://github.com/asb2m10/dexed/issues/157
* https://forum.electra.one/t/command-line-preset-file-upload-tool/592/16

Sadly, the JUCE library even swallows error messages from the Linux send code instead of logging or reporting it.

it seems for Linux, we'd need to drop JUCE. We're on JUCE 7.0.6, and I did not see anything in the release log https://github.com/juce-framework/JUCE/releases that indicates they are willing to touch the Linux MIDI code. I'll open a new issue for the large sysex on Linux topic because this is probably not Take 5 specific. Thanks for reporting!

Originally posted by @christofmuc in https://github.com/christofmuc/KnobKraft-orm/issues/122#issuecomment-2030129422

christofmuc commented 7 months ago

The amidi tool was reported to work (in the original thread), but that uses ALSA raw midi ports, while JUCE MIDI is using the Sequencer API...