Opened 17 years ago

Closed 17 years ago

Last modified 17 years ago

#977 closed defect (fixed)

0.5.0 RC: COMI: Trying to append to a nonexistant stream

Reported by: SF/inguin Owned by: fingolfin
Priority: blocker Component: Engine: SCUMM
Keywords: Cc:
Game: Monkey Island 3

Description

This one's a bug that allready keeps annoying me for several weeks. Everytime I play COMI, the game crashes sooner or later and pops up the debugger with an error message that says "ERROR: Trying to append to a nonexistant stream 1". The stream number is varying. There is no reliable way to reproduce this, but it always seems to happen when I interrupt a line of speech by pressing both mouse buttons at once, usually as soon as during the first conversation with Wally. Or, a few minutes ago, it happened when I hit a note during the banjo duel.

Ticket imported from: #769744. Ticket imported from: bugs/977.

Attachments (1)

comi.s03 (238.8 KB ) - added by SF/inguin 17 years ago.
Savegame, german COMI, "lite version"

Download all attachments as: .zip

Change History (11)

comment:1 by fingolfin, 17 years ago

To process your bug report appropriately, we need you to provide the following additional information:

* ScummVM version (scummvm -v) * Bug details, including instructions on reproducing it * Language of game (English, German, etc) * Version of game (Talkie, Floppy...) * Platform and Compiler (Win32, Linux, MacOS, etc) * Attach a save game if possible * If this bug only occurred recently, please note the last version without the bug, and the first version including the bug. That way we can fix it quicker by looking at the changes made.

This should only take you a little time but will make it much easier for us to process your bug report in a way that satisfies both you and us.

Thank you for your support!

comment:2 by SF/inguin, 17 years ago

* ScummVM version (scummvm -v) Most recent CVS (ScummVM 0.5.0pre-cvs), but it happened with all versions I tried during the last few weeks *Language of game (English, German, etc) German *Version of game (Talkie, Floppy...) Guess... ;-) * Platform and Compiler (Win32, Linux, MacOS, etc) Linux 2.4.21, gcc 2.95.3

comment:3 by SF/inguin, 17 years ago

I've created a backtrace, maybe this helps a bit:

#0 SoundMixer::appendStream (this=0x825cf18, index=2, sound=0x86c36c0, size=17640) at sound/mixer.cpp:196 #1 0x08079329 in IMuseDigital::handler (this=0x827c008) at scumm/imuse_digi.cpp:839 #2 0x08078c63 in imus_digital_handler (engine=0x824d9f0) at scumm/imuse_digi.cpp:695 #3 0x080def5c in Timer::handler (this=0x825d188, t=10) at common/timer.cpp:94 #4 0x080deec2 in Timer::timer_handler (t=10) at common/timer.cpp:76 #5 0x40062df3 in callback_wrapper (ms=10, param=0x80dee9c) at SDL_timer.c:252 #6 0x40062b71 in SDL_ThreadedTimerCheck () at SDL_timer.c:137 #7 0x40063020 in RunTimer (unused=0x0) at SDL_systimer.c:261 #8 0x40061edc in SDL_RunThread (data=0x824aeb8) at SDL_thread.c: 228 #9 0x400620df in RunThread (data=0x824aeb8) at SDL_systhread.c:82 #10 0x4009ef58 in pthread_start_thread (arg=0xbf7ffc00) at manager.c: 274 #11 0x4009efa2 in pthread_start_thread_event () at manager.c:298

comment:4 by SF/ender, 17 years ago

Moving to release critical. I just experienced this myself, when talking to Wally and escaping past a few of his lines.

comment:5 by SF/ender, 17 years ago

Priority: normalblocker
Summary: COMI: Trying to append to a nonexistant stream0.5.0 RC: COMI: Trying to append to a nonexistant stream

by SF/inguin, 17 years ago

Attachment: comi.s03 added

Savegame, german COMI, "lite version"

comment:6 by SF/inguin, 17 years ago

I found a reliable way to reproduce this bug: It always happens during the cutscene after greasing the canonballs. Savegame for the german version attached.

comment:7 by fingolfin, 17 years ago

The cause for this seems to be that _sound->_talkChannel's value can get out of sync with reality; in particular, it will point to a channel even if the voice data on that channel already finished, and something else (read: iMuseDigitial) is now using the channel. If ScummVM then tries to abort the current talk, calling _mixer- >stop(_sound->_talkChannel), that new channel is incorrectly killed, which leads to the observed bug.

The immediate fix would be to use a PlayingSoundHandle to get _talkChannel set to -1 once the talk channel goes away. The long time proper fix would be to overhaul our big mess of a sound system in the scumm part, where we somtimes use the mixer directly, sometimes go thru iMuse, sometimes through class Sound, sometimes thru iMuseDigital <shudder>. In particular, this problem is caused by the fact that two different APIs (iMuseDigital and Mixer) are used to create the talk sound depending on the scumm version, yet only the mixer is used to stop the talk sounds.

comment:8 by fingolfin, 17 years ago

Resolution: fixed
Status: newclosed

comment:9 by fingolfin, 17 years ago

I put a fix for this into CVS, using PlayingSoundHandles. Had to change quite some function to pass on the handle, but the real changes are far less than what the commit mail might suggest =)

Now, the difficult thing about this bug of course is: the fact that I can't reproduce it anymore (while I could before) doesn't gurantee it's really gone... but I am pretty confident that it is. can't reproduce it with inguin's savegame either.

comment:10 by fingolfin, 17 years ago

Owner: set to fingolfin
Note: See TracTickets for help on using tickets.