real mt32 exc. buffer overflow

NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Forum rules
NOTICE: This forum is archived as read only.
Please use the Github Discussions at https://github.com/exult/exult/discussions
Locked
peer

real mt32 exc. buffer overflow

Post by peer »

it seems exult cannot init my mt32 properly

when it tries to precache timbres on startup (or on play when it reaches the guardian's screen during the intro) the mt32 will display "exc. buffer overflow" and some instruments don't sound right

under dosbox I would fix this for some games by reducing the dosbox clock speed

can I fix this under exult?

I am running Win7 64bit, using an Edirol UM-1EX midi interface
peer

Re: real mt32 exc. buffer overflow

Post by peer »

sorry for the double post but I forgot to say I am using Exult 1.4.9 rc1
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Dominus »

Is the device type set to mt32? And if yes is the buffer overflow (or underflow?) really apparent on the display? Just asking to know whether I should keep a close look to see it flash by or whether it stays a bit on screen.,,
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Malignant Manor »

From what I've read, you're not likely to get that problem on anything but the oldest generation of MT-32. You could try compiling Exult and trying the following.

Edit \audio\midi_drivers\LowLevelMidiDriver.cpp and change line 1053 to something higher like
next_sysex = SDL_GetTicks() + 50;
of even higher.
(I don't really know the audio code.)
peer

Re: real mt32 exc. buffer overflow

Post by peer »

yes, the device type is set to mt32

as for the timing, the message shows only for a fraction of a second but it definitely stands out - for me, if precacheTimbers is set to onPlay: yes in the config it will show just after the white noise pattern during the intro, just as the purple background takes over

I've tried on latest 1.5.0 download

playing themusic using a sysex file + music midi files seems ok (using MIDIOX / MIDIBar)
peer

Re: real mt32 exc. buffer overflow

Post by peer »

You could try compiling Exult and trying the following
thanks for looking into that suggestion, unfortunately I don't have the capability to custom compile exult at this time
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Malignant Manor »

Exult seems to use 40 milliseconds which is how long it should wait. I'll build with 50 and I can try to narrow it down more. It's going to take awhile for the first build to be ready.
peer

Re: real mt32 exc. buffer overflow

Post by peer »

to clarify yes this is the old MT32 model (without a headphone jack)

thanks for looking into it... in the mean time I am trying out the digital music packs but the volumes are (as documented) a little off so I might look at normalizing them
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Wizardry Dragon »

Oh god yes, I had to normalise all of the OGGs before I could even hear half of them in game. ><
----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Malignant Manor »

Looking at ScummVM, I see this fix which looks like a better solution.
http://scummvm.svn.sourceforge.net/view ... w=revision
peer

Re: real mt32 exc. buffer overflow

Post by peer »

this is my attempt at normalising the music

http://www.sendspace.com/file/cu2fkh

not perfect, but a lot more balanced compared to speech, I believe

feel free to share
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Malignant Manor »

You can try the download here. I would put this in a separate directory, and then delete it when SVN gets updated.
peer

Re: real mt32 exc. buffer overflow

Post by peer »

thanks but unfortunately that still causes the buffer overflow on the mt32 for me, at the same locations during startup or intro
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Malignant Manor »

I looked and there's another section where it sends sysex and needs the delay implemented. You can try this, but it isn't a proper fix. Colourless or someone else will have to look at it. I added a bug tracker about this.
peer

Re: real mt32 exc. buffer overflow

Post by peer »

that did fix the buffer overflow but the instruments still sound incorrect unfortunately - I'm not sure if this is a bug or just incomplete feature

I have recorded what I hear for the intros from the MT-32 in exult and dosbox and uploaded it, here:

http://www.filefront.com/17733262/u7mt32.zip

to me, it sounds like the rhythm channel is specifically not being patched properly, but other instruments are sometimes affected too

most notable differences are 0m40s in exult vs 0m35s in dosbox

and 2m30s in both

hope this helps a little
Malignant Manor
Site Admin
Posts: 985
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Malignant Manor »

It would be better to try and compare after Colourless has made a better fix and opening a bug tracker if you still have issues. I don't have an MT-32 and have no idea if my build is screwing anything up.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Dominus »

hmm, I couldn't reproduce this on OS X and on a VM running Windows XP. My MT32 is hooked up via some USB thing. No idea which one, but a cheaper one.
Going to try it on Windows 7 64bit now.

Edit: also can't reproduce on Windows 7 64bit.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Dominus »

But the music (Guardian intro) is noticeably different between Exult and the original running under Dosbox. But also different running Dosbox on my mac and compared to your recordings. I'm not sure which one (Exult or Dosbox) to really fully trust here :)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Dominus »

@peer,
another idea, I saw that the edirol has drivers for your OS, maybe try with or without the drivers (if the device is is recognized/useable without the drivers). Maybe these add some latency that screw with the MT32.
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Wizardry Dragon
Posts: 1241
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Wizardry Dragon »

If you have a OPAMP capable card such as the Auzentech X-Raider I have, you'll have some similar abnormalities, though I couldn't say if they're related code-wise or not. If you disable or remove the OPAMP it seems to fix it, but thats a bit of a cludgy workaround.
----------
Peter M Dodge
aka Wizardry Dragon
www.thefeudallands.ca
Cheers, Wizardry Dragon
Lead Designer, Ultima VII: The Feudal Lands
www.thefeudallands.ca
peer

Re: real mt32 exc. buffer overflow

Post by peer »

Dominus,

Thanks. Unfortunately the midi interface doesn't seem to work for me at all without the Win 7 x64 drivers installed. It used to under XP x64 but seemingly not under 7.

As far as I can tell the interface is fine though, as dosbox and midi files play back correctly (and the same). As close as I can recall the original sounding, that is. It's been a while :S

I will monitor the bug report and try again when it's resolved and an svn build with it is available, no hurry.
Dominus
Site Admin
Posts: 5656
Joined: Thu May 14, 2020 1:34 pm

Re: real mt32 exc. buffer overflow

Post by Dominus »

When you do a comparison of original U7 and Exult and record it, please disable sfx in both the original and Exult. This will make it easier to listen to them :)
--
Read the documentation and the FAQ! There is no excuse for not reading them! RTFM
Read the Rules!
We do not support Piracy/Abandonware/Warez!
Locked