a2jmidid icon indicating copy to clipboard operation
a2jmidid copied to clipboard

Hard-coded MIDI message size

Open zwizwa opened this issue 1 year ago • 0 comments

MIDI messages larger than 16 bytes are silently dropped. This is easily triggered by sending sysex.

Dropping happens in a2j_process_outgoing() The size is set by MAX_JACKMIDI_EV_SIZE, which is used in the definition of struct a2j_delivery_event. The size of that struct is used in the allocation of a jack_ringbuffer.

I've changed the event size to 512 in my branch to support my use case, which involves sysex messages of 264 bytes. This seems to work fine.

Looking for feedback on what to do to fix this. I can spend some time on it. Other people have run into this limitation: https://linuxmusicians.com/viewtopic.php?t=25434

The core issue seems to be the size of the ring buffer, which should probably be configurable via command line options.

Additionally it is probably wise to make the ring buffer elements variable size.

zwizwa avatar Dec 01 '23 13:12 zwizwa