Opened 13 years ago

Closed 13 years ago

Last modified 13 years ago

#5554 closed defect (invalid)

SysEx issues with real MT-32

Reported by: SF/benshadwick Owned by:
Priority: normal Component: Engine: SCI
Version: Keywords:
Cc: Game: Quest for Glory 2

Description

ScummVM version: 1.3.0svn54897 (Dec 13 2010 11:14:31) Language: English Version: Quest for Glory Anthology CD-ROM Platform: Windows 7 x64 Description: When I launch Quest for Glory II: Trial by Fire in the ScummVM version listed above on my real MT-32, I get an \"Exc. Checksum error\" while ScummVM is uploading the SysEx banks (which indicates that ScummVM is probably sending the SysEx data too rapidly). I then get title screen music that sounds noticeably different from what I hear when running the original Sierra interpreter version in DOSBox.

I\'ve made some recordings using Audacity just for this bug report; you can find them here: http://www.multiupload.com/L0O83O213Q

The files are one minute recordings of title screen music, with descriptions as follows: qfg2-dosbox.ogg - Recording while playing original version in DOSBox at 1800 cycles (avoids same "Exc. Checksum error"). qfg2-scummvm.ogg - Recording while playing in ScummVM. qfg2-scummvm2.ogg - For this one I started the game in DOSBox, then cut off the MIDI connection to my MT-32 and switched over to running the game in ScummVM, then restored the MIDI connection. Net result is running with ScummVM but with original version SysEx.

Ticket imported from: #3138384. Ticket imported from: bugs/5554.

Change History (14)

comment:1 by digitall, 13 years ago

Can't replicate Exc. Checksum error on my MT-32 and latest HEAD on Linux with USB-MIDI cable.

Also, we should have accounted for this : "First generation units, having control ROM versions below 2.00, require a 40 millisecond delay between system exclusive messages." https://secure.wikimedia.org/wikipedia/en/wiki/Roland_MT-32#Compatibility_problems

Can you confirm whether your MT-32 is a first generation unit and how you have interfaced it (Sound card Midi Port)?

Could you also confirm if this issue occurs with v1.2.1?

comment:2 by SF/benshadwick, 13 years ago

Mine is indeed a first-generation (ROM v1.07 with no headphone jack). ***If you're not doing the 40ms delay, then that's almost certainly the problem.*** Note that I get the same error (but not weird sound as far as I can tell) in DOSBox if I run at over 1800 cycles or so, as the original QFG2 sound engine doesn't use a CPU speed-independent delay mechanism.

I am running on Windows 7 x64 and using an E-MU Xmidi 1x1 Tab USB-MIDI interface to connect to the MT-32 MIDI-In.

I will have to test with ScummVM 1.2.1 and get back to you as I currently have only the mentioned daily SVN build installed.

comment:3 by digitall, 13 years ago

I think this 40ms delay is probably the issue. It doesn't seem to be deal with by the backend Midi driver.

Grepping the HEAD source code shows that the sky (Beneath A Steel Sky) accounts for this, but I can't find an explicit delay code for any other engines.

This will be dealt with by the SCI sound team for that engine and this bug updated.

However, the requirement for this delay should probably be done in the backend MIDI sysex send API, rather than per engine.

comment:4 by SF/benshadwick, 13 years ago

Agreed.

Did you still need me to test with 1.2.1, or has this been sufficiently analyzed for now?

comment:5 by digitall, 13 years ago

This should be sufficient, however very few of the team own first generation MT-32 hardware, so if you could test when the SCI sound developers apply a fix and update this bug.

If you have time, knowing whether the problem occurs with v1.2.0, v1.2.1 and latest HEAD svn build would probably be useful, but is not probably necessary.

comment:6 by SF/benshadwick, 13 years ago

I'm tracking this bug and will definitely verify the fix once I see that one has made it into an SVN build.

comment:7 by SF/sven3000, 13 years ago

I have a first-generation MT-32 as well, and I can't reproduce this issue. I get no checksum error with ScummVM (rev. 54940), nor with DOSBox regardless of the number of cycles. The game version I'm using is 1.102, maybe yours is older?

Note that ScummVM 1.2 does have a checksum calculation bug, which I found and has been fixed (patch #3118257).

Also, my menu screen music sounds different from yours, both in DOSBox and ScummVM. Here's what it sounds like: http://www.ookii.org/misc/qfg2.mp3

comment:8 by SF/benshadwick, 13 years ago

sven3000: That sounds pretty similar except for mine seems to have more resonance in the bass. Both my 5.25" 360KB floppy version and Quest for Glory Anthology version are 1.105, so it looks like yours is the older version? Also, according to Wikipedia my serial number indicates that I have an "old-type" revision 1 PCB; maybe yours is a revision 0?

I've now tested in ScummVM 1.2 and in SVN r54941 and get the same results as in the previous SVN version that I was originally testing with ("Exc. Checksum error" message and strange instrument sounds).

I also tried basically turning off the MT-32, launching the DOS version of QFG2, then turning on the MT-32 after the sysex would have been sent. The resulting music is identical to what I hear from ScummVM as far as I can tell.

comment:9 by SF/sven3000, 13 years ago

Nope, mine is also old-style revision 1 PCB. Yet I definitely can't reproduce the problem.

comment:10 by digitall, 13 years ago

benshadwick : Just checked SCI engine code more carefully.

This 40ms delay for rev00 MT32 _is_ accounted for in the code in engines/sci/sound/drivers/midi.cpp lines 979 to 981 i.e. in void MidiPlayer_Midi::sysEx(const byte *msg, uint16 length)

However, for speed, this delay is only added when the configuration boolean "native_mt32" is set.

This can be found in Options->MT-32->True Roland MT-32 (disable GM emulation) or as native_mt32=true in the configuration file.

Please confirm this is set. If not, then setting it should fix the observed problem.

comment:11 by SF/benshadwick, 13 years ago

tdhs: True Roland MT-32 mode is indeed set, and I have verified that this results in native_mt32=true being set in scummvm.ini.

I also get the "Exc. Checksum error" message with QFG1EGA v1.200.

Maybe I should try building ScummVM from source and tinkering with the delay or something.

comment:12 by SF/benshadwick, 13 years ago

Got ScummVM to build myself in MSVC++ 2010 Express (Win32 Debug). Tried increasing the delay to 4000ms and I still got the Exc. Checksum error almost right at the beginning. The delay is definitely taking effect because the sysex takes much longer.

This seems to indicate that maybe the checksum isn't being calculated correctly so that the MT-32 sees it as a match to the SysEx data. Or, it's possible that the SysEx data is being mangled so that it doesn't match the checksum.

comment:13 by SF/benshadwick, 13 years ago

Update:

I've been playing QFG1EGA in DOSBox and noticed that some of the music sounded totally wrong even though I was starting up with 1500-1800 cycles to avoid a checksum error. I decided to switch from my E-MU Xmidi 1x1 Tab USB-MIDI interface to my M-Audio MIDIsport Uno USB now that the latter has a working Win7 x64 driver, and I noticed that I no longer get that error in either DOSBox nor ScummVM, and both QFG1EGA in DOSBox and QFG2 in DOSBox and ScummVM sound correct. In fact, QFG2 sounds the same in both DOSBox and ScummVM now, and it sounds the same as sven3000's recording.

I'm going to have to apologize for wasting everyone's time and close this as invalid. Hopefully I can get the Xmidi working properly so that I can trust it again if I need it in the future.

comment:14 by SF/benshadwick, 13 years ago

Resolution: invalid
Status: newclosed
Note: See TracTickets for help on using tickets.