Opened 14 years ago
Closed 14 years ago
#4400 closed defect (fixed)
DIG: Cutscene does not stop existing music before playing
|Reported by:||SF/auroris||Owned by:||aquadran|
Cutscenes, pre-rendered video sequences, do not properly stop scene music before playing. The result is overlapping music tracks playing. Bug is present in Win32 ScummVM Daily Snapshot (build from Subversion trunk, 3154K Win32 exe file, last update: July 12, 2009, 10:10 am) Bug is also present in ScummVM 0.13.1 Release.
Ticket imported from: #2820389. Ticket imported from: bugs/4400.
Change History (9)
comment:1 by , 14 years ago
|Summary:||Cutscene does not stop existing music before playing → DIG: Cutscene does not stop existing music before playing|
comment:2 by , 14 years ago
comment:3 by , 14 years ago
comment:4 by , 14 years ago
To clarify a bit, I've looked at what happens at the beginning of the game, when setting off the explosives. This is part of the game script:
[01D9] (BA) talkActor("/COCKPIT.013/Confirm everybody inside.",13)  (A9) wait.waitForMessage()  (BA) talkActor("/COCKPIT.014/All in, Cora.",3)  (A9) wait.waitForMessage()  (AC) soundKludge([4097,2020])  (AC) soundKludge([4096,8]) [023B] (43) VAR_MAINMENU_KEY = 0  (A4) VAR_VIDEONAME = "sq2.san"  (C9) kernelSetFunctions.startVideo()
The "soundKludge" opcodes translate to:
I'm not very familiar with how Digital iMUSE works, but ImuseSetSequence() eventually leads to playDigMusic() being called for "seqExplosion1b", with transition tpe 6. This sets _stopingSequence to 1.
The _stopingSequence counter is handled in refreshScripts(), where it eventually triggers a "force restore music state" event, i.e. ImuseSetSequence(0). I'm speculating that this would stop the music. However, it won't happen until after the SMUSH cutscene has finished, because we don't call refreshScripts() while the cutscene is running.
The refreshScripts() function is called from scummLoop_handleSound(). That's why I said that maybe the problem is that we don't call that function.
comment:5 by , 14 years ago
This bug is nice to get fixed before the release. Raising priority for keeping the track.
comment:6 by , 14 years ago
|Priority:||normal → high|
comment:7 by , 14 years ago
I made change to smush loop to handle imuse state, stopingSequence works as suppose to work. But final result is not what suppose to work. Imuse must work while smush playing, it must finish still played old song. But it start new one that one which suppose to work after animation sequence. I have idea how to workaround this.
comment:8 by , 14 years ago
|Status:||new → closed|
comment:9 by , 14 years ago
I made workaround which fix issue.
The problem may be that during cutscenes, we don't call scummLoop_handleSound(), so even if the script says that a track should be faded or a sequence stopped or whatever, it won't happen until possibly after the cutscene has finished.
Assigning to aquadran, since he's the one who actually understands Digital iMUSE.