[ scummvm-Patches-611997 ] RFC: Timer-based CD audio sync

noreply at sourceforge.net noreply at sourceforge.net
Fri Sep 20 08:40:08 CEST 2002


Patches item #611997, was opened at 2002-09-20 08:40
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=611997&group_id=37116

Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Torbjörn Andersson (eriktorbjorn)
Assigned to: Nobody/Anonymous (nobody)
Summary: RFC: Timer-based CD audio sync

Initial Comment:
This is an experimental patch that uses a real timer to
update the "MI1 timer", i.e. the timer that is
responsible for keeping the game in sync with CD audio.

My reasoning for this is that it's hard for scummLoop()
to keep the time on its own, what with things like
screen effects causing unpredictable delays while the
CD track just keeps running in the background.

At first I wanted to use the current position in the
CD/MP3 track, but that turned out to be tricky, and it
would still need a fallback mechanism in case the sound
fails to play for whatever reason.

It isn't flawless. For one thing, keeping in sync with
the Loom CD isn't an exact science. Another problem is
that the timer keeps running even when the game is
paused, which completely screws up the sync when the
game is resumed. (Hmm... it didn't occur to me until
now, but could the timer handler check for that
condition somehow?) Reloading a saved game in the
middle of a timed sequence might be a bit off, too, but
it should make a reasonably dignified recovery.

But aside from that bug, and regardless of how we
implement it, I don't think we'll ever be able to get
better sync than what this patch provides.

I've tested this patch with the Loom CD, and the MI1
intro, and they currently require slightly different
timing, so I'd be grateful if someone could test it
with whatever other games there are that use CD audio.
(Zak 256?)


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=418822&aid=611997&group_id=37116




More information about the Scummvm-tracker mailing list