DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Developer's Forum, for discussion of bugs, code, and other developmental aspects of DOSBox.

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby sethmeisterg » 2010-4-06 @ 21:19

Sorry to bump this thread, but I was wondering if this code has made it into the DOSBOX core yet. Also, has anyone tried creating a custom piece of hardware that sits between the MT-32 and the MIDI host and inserts the proper delay (only for SYSEX messages)? (I can build just such a device, but I'm not sure if that will be good enough if that just shifts the timing and will therefore skew the sync of the music to the game). Also, just to clarify, must there be a 40ms delay between each byte of SYSEX messages *OR* between entire SYSEX messages (i.e. say you have a SYSEX with 10 bytes then a totally new SYSEX message of 8-byte length. Is the 40ms delay required between the 10th byte of SYSEX1 and byte 1 of SYSEX2 or between each of the 10 and 8 bytes of each of the SYSEX message streams)? Thanks.
User avatar
sethmeisterg
Newbie
 
Posts: 1
Joined: 2010-4-06 @ 21:15

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby robertmo » 2010-4-07 @ 05:38

User avatar
robertmo
l33t
 
Posts: 4762
Joined: 2003-6-18 @ 10:35

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2010-10-22 @ 11:49

Here's some midi recordings from SpeedBall 2 as you requested (only took 2 years). Dvwjr, did the patch progress any furthur, since? Would you please be as kind to put the source of your patch online, so it can be used in a recent DOSBox version?! Thanks in advance!
Attachments
sb2.zip
SpeedBall 2 midi recordings which require high delay settings to prevent Exc. Buffer overflow
(7.04 KiB) Downloaded 636 times
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2010-10-27 @ 21:35

Hi all,

I've also tried to implement a solution to this problem; currently it seem to be working _on my system_ for the following games:

[snap]see thread below[/snap]

For the record, I'm using Windows 7, USB Cakewalk UM-1G midi interface, MT-32 rev.0 version 1.07

Some games do not play music correctly with the patch, for example Monkey Island2 (while it works fine in the official v0.74). Maybe I'll make the functionality configurable, we'll see.

The patched exe and source (against SVN r3650) are attached. I would be very interested in other people's results!

Regards,
Ronald
Last edited by rcblanke on 2011-1-13 @ 17:22, edited 2 times in total.
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby HunterZ » 2010-10-27 @ 22:04

I bet it'd be possible to implement sysex delays using MIDI-OX.
You're perfect, yes it's true...but without me, you're only you.
User avatar
HunterZ
l33t++
 
Posts: 6100
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2010-10-27 @ 22:11

Maybe, but I couldn't get midi-ox working on Win7x64.
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby robertmo » 2010-10-30 @ 07:29

you should also say what games it is currently not working for on your system so we know whether we are discovering sth you don't already know.

it still has buffer overflow with dark sun 1

mortal kombat had two errors: buffer overflow and later checksum err.
buffer overflow no longer happens but checksum err still happens.
User avatar
robertmo
l33t
 
Posts: 4762
Joined: 2003-6-18 @ 10:35

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2010-11-21 @ 15:19

Thanks for your feedback, robertmo.

I've no idea what games were not working correctly, I can only test so much. Still, as dvwjr also mentioned before, using the busy bit may not be the way to go, because some games test this bit and might give up on sending the sysex data to the device if the timing is not perfect.

Thus, I also tried the buffered rotating list solution, but couldn't get it working well (normal notes playing while still handling sysex data, etc.). So I opted for another approach - to simply stall the emulation if a sysex is arriving too soon. That gives the MT-32 some air, and the emulated game won't notice. This seems to be working (somewhat) better, as I haven't found a game yet that doesn't work properly here. Tested are:

Aces of the Pacific & Expansion Disk: WWII: 1946
Advanced Tactical Air Command (ATAC)
Astro Chicken (from Space Quest 3)
Beneath a Steel Sky
Car and Driver
Code Name: ICEMAN
Colonization
Conquests of Camelot: The Search for the Grail
DaemonsGate
Dark Sun 1: Shattered Lands
Fire & Ice
Flight of the Amazon Queen: Interviewer for Hire
Flight of the Amazon Queen (CD version)
Gods
Heart of China
Hero Quest
Hoyle's Book of Games Volume 1
Hoyle's Book of Games Volume 2
Inferno
Jurassic Park
Leisure Suit Larry 3: Passionate Patty In Pursuit of the Pulsating Pectorals
Lemmings 2: The Tribes
Lure of the Temptress
Might and Magic 4: Clouds of Xeen
Might and Magic 4+5: World of Xeen

Mortal Kombat 1
Operation Stealth (aka James Bond: The Stealth Affair)
Prince of Persia 1 (v1.3)
Prince of Persia 2: The Shadow & The Flame
Prophecy: The Viking Child
Quest for Glory 2: Trial by Fire
Space Quest 1 SCI EGA
Space Quest 1 SCI VGA
Speedball 2: Brutal Deluxe
Tactical Fighter Experiment (TFX)
Tempest 2000
X-Wing


All work fine for me now, using the updated patch (attached).

Note that Mortal Kombat sends invalid sysex data right after the "probe" logo, causing the checksum error - the new patch skips this invalid message now.

Please provide any feedback you can; does the patched exe work reliably on your machine, what games are still problematic, anything.

Regards,
Ronald

EDIT: updated the list
Last edited by rcblanke on 2011-1-13 @ 18:08, edited 4 times in total.
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2010-11-30 @ 21:46

Another update; now the delay behavior is configurable. Use the [midi] 'sysexdelay' option to specify no delay (none), a stalling delay (stall) or delay using the MPU401 'ready to send' bit (statusbit). Timings remain unchanged. If anyone can find a game that still shows 'Exc. buffer overflow' on an 'old' MT-32 using this patch, I'd like to know.

Regards,
Ronald
Last edited by rcblanke on 2011-1-13 @ 17:15, edited 1 time in total.
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2010-12-09 @ 23:10

More minor changes; the delay for Dark Sun is slightly enlarged, and the config setting was moved to [midi]midiconfig; add "delaysysex" or "delayreadystate" to enable the patch.

Regards,
Ronald
Last edited by rcblanke on 2011-1-13 @ 17:15, edited 1 time in total.
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby HunterZ » 2010-12-20 @ 01:56

Decided to try this because my E-MU / Creative XMIDI 1x1 Tab is acting up with QFG1 and QFG2.

Results using max cycles and Win7 x64:


E-MU / Creative XMIDI 1x1 Tab:

Quest for Glory I (SCI0 EGA):
- DOSBox 0.74: "Exc. Checksum error", music when first exiting town sounds horrible.
- your build, delaysysex: no error, music sounds correct.
- your build, delayreadystate: no error, music sounds correct.

Might & Magic: Worlds of Xeen:
- DOSBox 0.74: "Exc. Checksum error", main menu music sounds wrong some of the time.
- your build, delaysysex: "Exc. Checksum error", main menu music sounds wrong some of the time.
- your build, delayreadystate: "Exc. Checksum error", main menu music sounds wrong some of the time.


M-Audio MIDISport Uno (old):

Quest for Glory I (SCI0 EGA):
- DOSBox 0.74: Occasional "Exc. Buffer overflow", music sounds fine as far as I can tell.
- your build, delaysysex: Try 1: "Exc. Buffer overflow", music sounded slightly off; Try 2: no error, sounds fine.
- your build, delayreadystate: no error, sounds fine.

Might & Magic: Worlds of Xeen:
- DOSBox 0.74: "Exc. Buffer overflow", main menu music sometimes sounds weird.
- your build, delaysysex: no error, sounds fine.
- your build, delayreadystate: no error, sounds fine.


I also tried DOSBox 0.74 and QFG1 on the E-MU XMIDI 1x1 Tab with LoopBe1 Monitor (loopback driver) with MIDI-OX and SendSX, but it didn't help because it seems they only slow down SysEx when it originates from the tools themselves and not when it's just being passed through :( LoopBe1 also likes to freak out and claim that I've short-circuited it when I haven't; I'd ditch it, but I'm not sure if there are any other MIDI loopback drivers that run under Win7 x64.


I would recommend testing with Prince of Persia 1, as I remember it being highly sensitive to overflow issues. I don't have it handy though.
User avatar
HunterZ
l33t++
 
Posts: 6100
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby Mau1wurf1977 » 2010-12-20 @ 03:35

GODS is another one and also Lure of Temptress (which is free ware and a excellent game!)
User avatar
Mau1wurf1977
l33t++
 
Posts: 7652
Joined: 2010-8-27 @ 04:15
Location: Western Australia

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2010-12-20 @ 09:51

Thanks for the feedback HunterZ. I'll retest the games you mentioned in your post. Please note that you should always reset (turn off/on, or Master Volume+Rhythm and Part 1) your MT-32 device after a checksum error, or it will be much more likely to fail again, even with the patch enabled.

Gods and LotT were already on my test-list, thank you Mau1wurf1977 !
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby HunterZ » 2010-12-20 @ 15:16

I'm pretty sure I was resetting just to be sure. I'm not too worried about Xeen in any case, as it's a CM-32/64 game anyways. In any case, I've switched back to my M-Audio as the primary interface for my synths because buffer overflows are less aggravating than checksum errors.
User avatar
HunterZ
l33t++
 
Posts: 6100
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2011-1-13 @ 17:15

Hmm, Xeen does indeed seem problematic. After skipping the first part of the introduction, a second batch of sysexes are loaded, among which a 267 byte large one. No amount of delay prevents the buffer overflow on my device after that particular sysex. Skipping the sysex prevents the problem, but AFAIK sysexes can be up to 1024 bytes, and thus should be no problem for the MT-32?

Prince of Persia 1 has no MT-32 support, but POP2 does. Works with the patch here.

Another minor improvement (very small sysexes are valid when not meant for the MT-32); I removed the old patches.

regards,
Ronald
Attachments
DOSBox.zip
Patched dosbox.exe
(1.29 MiB) Downloaded 555 times
sysex5.zip
Patch no.5
(2.66 KiB) Downloaded 496 times
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby HunterZ » 2011-1-13 @ 17:32

Prince of Persia v1.3 supports MT-32, I've tested it myself several years ago: http://en.wikipedia.org/wiki/List_of_MT ... uter_games
User avatar
HunterZ
l33t++
 
Posts: 6100
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby rcblanke » 2011-1-13 @ 18:08

Oh, you're absolutely right, sorry. FWIW, POP1 v1.3 with MT-32 works fine here.
User avatar
rcblanke
Oldbie
 
Posts: 1363
Joined: 2005-4-01 @ 09:44
Location: Sethanon

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby HunterZ » 2011-1-13 @ 18:30

I wouldn't worry too much about Xeen since it's a CM-32/64 game rather than plain MT-32, although I do wonder if CM-32/64 could have buffer overflow issues with DOSBox. I'm not sure how you'd know other than the sound being wrong since they don't have a display.
User avatar
HunterZ
l33t++
 
Posts: 6100
Joined: 2003-1-31 @ 19:04
Location: Seattle

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby Dominus » 2011-1-13 @ 19:24

Cm32/64 shouldn't have buffer overflow, same as the Mt32 v2 shouldn't have the issue (if I haven't forgotten parts of the discussion here ;))
User avatar
Dominus
DOSBox Moderator
 
Posts: 7978
Joined: 2002-10-03 @ 09:54
Location: Ludwigsburg

Re: DosBox v0.70 MIDI handling for the rev00 MT-32 Roland synth

Postby Mau1wurf1977 » 2011-1-13 @ 23:32

Yes no buffer overflows on these devices...

The max data transfer is limited by the MIDI adapter and these Roland modules are all capable of keeping up.

The MT-32 (Old) can't keep up though and needs little pauses which some games don't have.
User avatar
Mau1wurf1977
l33t++
 
Posts: 7652
Joined: 2010-8-27 @ 04:15
Location: Western Australia

PreviousNext

Return to DOSBox Development

Who is online

Users browsing this forum: No registered users and 1 guest