MT-32: sysex is not delayed properly (exc. buffer overflow )
It needs an extra delay of
(length + 2) * 1000 / 3125
added.
There's two spots in LowLevelMidiDriver.cpp that need this added. These are lines 1053 and 1559. I can fix the first but I don't know how to get the length at line 1559.
See http://scummvm.svn.sourceforge.net/viewvc/scummvm?revision=47336&view=revision
There's a person having this issue with their old MT-32 here.
http://exult.sourceforge.net/forum/read.php?f=1&i=346445&t=346445
Partial fix to get you started
Will fix, but wont do it exactly as seen in the ScummVM.
Forcing a delay directly after a sysex send can unnecessarily cause the midi play thread to become unresponsive to commands from the main engine thread. That is undesirable for a few reasons.
Will change things so a correct length delay will be used to hold the thread from sending further data only if its required,
This patch for DOSBox might be relevant to our problem as well https://sourceforge.net/tracker/?func=detail&aid=3159289&group_id=52551&atid=467234
what actually got committed to dosbox to fix sysex delay http://pastebin.com/UkZqJFrs
This could be the cause of bug 3300027.
The scummvm diff can be better viewed https://github.com/scummvm/scummvm/commit/e11e9338d151e659bbd8d23922375b550e362dd3#engines/kyra/sound_midi.cpp
Pretty sure I actually fixed this a long time ago. Regardless I was never able to reproduce it on my own first revision MT32 that I developed Exult's Mt32 support with