Opened 21 years ago

Closed 21 years ago

#1215 closed defect (fixed)

LOOMCD: Sound lock up

Reported by: Kirben Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game: Loom

Description

Latest ScummVM cvs version. English version of Loom (CD) Compiled under mingw with GCC 3.2.3 and running under Windows XP. I'm using mp3 for play back of sound.

Loom CD often causes ScummVM to lock up during music or speech. I can only load/save games but not move since mouse cursor doesn't return. Sometimes using ESC helps skips past lock up but not always. Could this be related to recent mixer changes ?

A save game is attached, select a Sheep and click on the image of Sheep. The lock up should occur after second line of speech from shepherd

Ticket imported from: #802396. Ticket imported from: bugs/1215.

Attachments (2)

loomcd.s03 (66.6 KB ) - added by Kirben 21 years ago.
Select and click on sheep
loomcd.s16 (66.7 KB ) - added by Kirben 21 years ago.
Go right and skip scene

Download all attachments as: .zip

Change History (16)

by Kirben, 21 years ago

Attachment: loomcd.s03 added

Select and click on sheep

comment:1 by Kirben, 21 years ago

The problem seems mp3 (maybe ogg too?) specific, it doesn't occur wihen playing back sound direct from CD.

comment:2 by fingolfin, 21 years ago

Owner: fingolfin removed

comment:3 by fingolfin, 21 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:4 by Kirben, 21 years ago

Status: closednew

comment:5 by Kirben, 21 years ago

Still occurs in some situations, go right and skip scene when shephards start appearing, ScummVM should lock up.

by Kirben, 21 years ago

Attachment: loomcd.s16 added

Go right and skip scene

comment:6 by fingolfin, 21 years ago

Status: newclosed

comment:7 by fingolfin, 21 years ago

You meant left, I assume? :-) Anyway, fixed. Feel free to reopen if you find yet another case.

comment:8 by Kirben, 21 years ago

Status: closednew

comment:9 by Kirben, 21 years ago

Yes I meant to the left, the problem still occurs but it gets a bit further now. To reproduce, skip the shephards appearing sequence as soon as first sound starts.

comment:10 by fingolfin, 21 years ago

I just checked, this bug already occured in 0.5.1. I'll try to fix it anyway - but at least now I know it's *not* because of some of my recent changes :-)

comment:11 by fingolfin, 21 years ago

Owner: fingolfin removed
Summary: LOOMCD: Sound often causes lock up.LOOMCD: Sound lock up

comment:12 by fingolfin, 21 years ago

This happens even in 0.4.1

Roughly, the problem is the mixing of CD used for speed, and CD used to play the distaff tunes. When you skip the cutscene (pressing ESC), the cutscene override fires. E.g. at the start of the shepard encounted, that's the override section in room-23-202. The following happens there: [01AD] (14) print(11,[Center(),Pos(160,152),PlayCDTrack(0,0)]); [01BB] (AE) WaitForMessage() [01BD] (AE) WaitForMessage() [01BF] (80) breakHere() [01C0] (28) unless (!Bit[7]) goto 01BF;

The print stops all CD playback (which stops the music timer and resets it to 0). Bit[7] in turn is controlled by script 31, which plays the distaff notes/tunes. It sets it to 1 at entry and to 0 at exit (kind of a flag: distaff is in use!). The distaff note *also* makes use of the CD. In particular, script 31 has this near its end: [03D4] (80) breakHere() [03D5] (38) unless (VAR_MUSIC_TIMER >= 96) goto 03D4;

So to sum it up: the conversation script's override stops CD playback, which stops&resets the music timer. Then it waits for script 31 to finish. However, script 31 waits for the music timer - which at this point has been stopped and reset to 0. Ka-boom, deadlock.

I have now put an experimental fix into CVS. Essentially, the idea is not to stop the music timer when stopping via a print opcode. This fixes the bug, but might cause all sorts of regression, which is why I call it experimental.

comment:13 by fingolfin, 21 years ago

Owner: set to fingolfin

comment:14 by fingolfin, 21 years ago

Status: newclosed
Note: See TracTickets for help on using tickets.