View Issue Details

IDProjectCategoryView StatusLast Update
0000861OpenMPT[All Projects] Generalpublic2017-02-12 14:46
Reportermanx 
Assigned ToSaga Musix 
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
Product VersionOpenMPT 1.27.00.* (current testing) 
Target VersionFixed in Version 
Summary0000861: PortMIDI is incompatible with UNICODE
Description

The solution is to either fix PortMIDI, or use something else like either directly midiInFoo/midiOutFoo or RtMidi.

TagsNo tags attached.
Has the bug occurred in previous versions?
Tested code revision (in case you know it)

Relationships

child of 0000570 assignedmanx OpenMPT UNICODE build 

Activities

Saga Musix

Saga Musix

2016-08-12 19:11

administrator   ~0002595

Concerning RtMidi: They apparently have a (statically defined) maximum length for SysEx messages (1024 bytes), which I find potentially dangerous and questionable - OpenMPT itself cannot currently make use of such long messages, but VST could.

manx

manx

2016-08-12 19:41

administrator   ~0002596

So, RtMidi uses:

#define  RT_SYSEX_BUFFER_SIZE 1024
#define  RT_SYSEX_BUFFER_COUNT 4

and PortMidi uses (portmidi.c and pmwinmm.c, we enter that code with bufferSize==0):

if (bufferSize <= 0) bufferSize = 256; /* default buffer size */
...
midi->buffer_len = bufferSize; /* portMidi input storage */
...
#define INPUT_SYSEX_LEN 64
#define MIN_INPUT_BUFFERS 16
...
int max_sysex_len = midi->buffer_len * 4;
int num_input_buffers = max_sysex_len / INPUT_SYSEX_LEN;
...
if (num_input_buffers < MIN_INPUT_BUFFERS)
    num_input_buffers = MIN_INPUT_BUFFERS;

So, yes, the constants and overall buffering strategy is a little different, but not fundamentally so.

AFAIK a fixed limit (which has to be set upfront) is kind of imposed by winmm anyway - but I have not done any WINAPI MIDI in years, let alone sysex handling, so I might be wrong here.

Saga Musix

Saga Musix

2017-02-12 14:46

administrator   ~0002876

Closing this as we got rid of PortMidi entirely, so there is nothing to fix anymore.

Issue History

Date Modified Username Field Change
2016-08-12 14:33 manx New Issue
2016-08-12 14:33 manx Relationship added child of 0000570
2016-08-12 19:11 Saga Musix Note Added: 0002595
2016-08-12 19:41 manx Note Added: 0002596
2017-02-12 14:46 Saga Musix Assigned To => Saga Musix
2017-02-12 14:46 Saga Musix Status new => closed
2017-02-12 14:46 Saga Musix Resolution open => no change required
2017-02-12 14:46 Saga Musix Target Version OpenMPT 1.?? (long term goals) =>
2017-02-12 14:46 Saga Musix Note Added: 0002876