MT32 Stutter on Mac OS X

Ask for help with ScummVM problems

Moderator: ScummVM Team

Post Reply
rmaniac
Posts: 4
Joined: Mon Sep 04, 2006 10:06 pm

MT32 Stutter on Mac OS X

Post by rmaniac »

I am trying to use mt32 sound on Mac OS X. I have put the MT32_Control.ROM and MT32_PCM.ROM in the games directory. When I start the game is builds the sound cache. When the game plays (I have tried Sam and Max and Day of the Tenticle) the music has a very serious stutter and sometimes the voices and other sounds don't play at all. If I switch from the mt32 to default, all is well. I have used these same .ROM files with dosbox and it works perfectly. I tried these on 0.10.0 and 0.11.0svn and get the same effect. Is there something I am doing wrong?

Thanks
Brian
User avatar
Vinterstum
ScummVM Developer
Posts: 580
Joined: Sun Oct 16, 2005 6:59 am

Post by Vinterstum »

You're not doing anything wrong, the MT32 emulation just works very badly on macs.
rmaniac
Posts: 4
Joined: Mon Sep 04, 2006 10:06 pm

oh

Post by rmaniac »

Well thats strange. I patched dosbox and use the scummvm m32emu code to build it and the shared lib. It sounds perfect and seems to work very well. I wonder why it works so badly in scummvm. If there is anything I can do to help test a fix I would love to help.

Thanks
-Brian
Alho
Posts: 1
Joined: Fri Aug 03, 2007 12:52 pm

Post by Alho »

Hello everyone,

I too was frustrated when I found out that the mt32 emu stutters on my mac. A quick browse through the source code revealed a way to do a quick'n dirty fix: in OSystem_SDL::setSoundCallback(...) make the buffer length bigger, essentially by modifying

Code: Select all

for (;;) {
		if &#40;&#40;1000 * samples&#41; / _samplesPerSec < 100&#41;
			break;
		samples >>= 1;
to

Code: Select all

for &#40;;;&#41; &#123;
		if &#40;&#40;1000 * samples&#41; / _samplesPerSec < 10&#41;
			break;
		samples >>= 1;
This bigger buffer fixed the stutter at least for me (Intel MacBook 1.8GHz Os X 10.4.10). I only tested it in Fate of Atlantis, though.

It's also not necessarily a proper fix for the problem, since it does increase the sound latency, but anyway, it's a fix for those who are daring enough to compile their own version :) Perhaps the buffer size could be made into to a config option for the official version?

Cheers,
Timo

Edit: making the buffer 10 times longer might be a bit of overkill... :wink:

Edit 2: oops, I just realized that I decreased the buffer length, and that seemed to fix the problem :shock:
User avatar
Nagra
Posts: 43
Joined: Thu Nov 24, 2005 5:39 pm
Location: Lübeck, Germany

MT 32

Post by Nagra »

I strongly recommend to buy a real MT32 on ebay. In combination with a usb-midi-adaptor one can enjoy its wonderful sound... even on a mac and without any problems!

Have fun,
Nagra
Post Reply