Opened 8 years ago

Closed 15 months ago

#7150 closed defect (fixed)

SCUMM/HE: Can't play multiple instances of a sound effect on different channels

Reported by: SF/somerandomhefan Owned by: AndywinXp
Priority: normal Component: Engine: SCUMM
Version: Keywords:
Cc: Game:

Description

This is a bug I noticed in all kinds of different games from Humongous Entertainment. ScummVM seems to have trouble playing multiple sound effects simultaneously. You can notice this by rapidly clicking on clickpoints in just about any of the Junior Adventures. A lot of the animations triggered by this will be silent.

For a particularly obvious example that's easy to replicate, load the save I've attached for the third Freddi Fish game in ScummVM and click on the button the cursor in the screenshot points at. (In case save files only work with the exact version of the game that created them, it's the version available on Steam. Its MD5 checksum is 8368f552b1e3eba559f8d559bcc4cadb.) This will cause the organ to play a pre-recorded song. But whenever it plays a note twice in succession, the second time is silent. Then do the same with the original interpreter. I've attached a separate save file for it. This time, every single note can be heard.

Ticket imported from: bugs/7150.

Attachments (5)

Scumm sound effect bug.png (214.8 KB ) - added by SF/somerandomhefan 8 years ago.
freddi3-win-1-freddi3.sg0 (33 bytes ) - added by SF/somerandomhefan 8 years ago.
freddi3-win-1-freddi3.sg1 (45.7 KB ) - added by SF/somerandomhefan 8 years ago.
freddi3.sg0 (650 bytes ) - added by SF/somerandomhefan 8 years ago.
freddi3.sg1 (256.1 KB ) - added by SF/somerandomhefan 8 years ago.

Download all attachments as: .zip

Change History (8)

by SF/somerandomhefan, 8 years ago

Attachment: freddi3-win-1-freddi3.sg1 added

comment:1 by raziel-, 4 years ago

ScummVM 2.2.0git (Jul 15 2020 10:24:49)
Features compiled in: Vorbis FLAC MP3 RGB zLib MPEG2 Theora AAC A/52 FreeType2 FriBiDi JPEG PNG cloud (servers, local)

Issue is still there with above ScummVM version.

Freddi Fish 3: The Case of the Stolen Conch Shell (Windows)

AmigaOS4 - PPC - BE - SDL

comment:2 by sev-, 3 years ago

Summary: SCUMM (possibly HE-only): Issues when playing multiple sound effectsSCUMM/HE: Issues when playing multiple sound effects

comment:3 by SomeRandomHEFan, 2 years ago

I've done some research using the debug log (debug level 5) and seem to have uncovered precisely what it is that's giving ScummVM trouble. The problem appears to be that it can't play the same sound effect on two channels at once.

For example, older Junior Adventures (such as Spy Fox 1) handle the typing sound effect when entering a save's name in a very simple way. They simply play it through channel 1 every time. ScummVM can handle this just fine.
More recent Junior Adventures (such as Spy Fox 2 and 3) opt for a better approach. If you enter two letters in quick succession, the second instance of the sound effect will play on a different channel than the first (these games generally seem to use channels 4 and 5 for this). ScummVM can't handle this and fails to play the second instance entirely, despite the debug log claiming it should have happened. It can only play the typing sound effect again once the first instance is finished.
On a playthrough of Spy Fox 2, I took a look at the debug log whenever I noticed a sound effect failing to play, and it always happened when the debug log claimed the game was trying to play two instances of a sound effect on channels 4 and 5. So this is likely the cause behind the whole issue.

I hope this information suffices to get this fixed.

comment:4 by SomeRandomHEFan, 2 years ago

Summary: SCUMM/HE: Issues when playing multiple sound effectsSCUMM/HE: Can't play multiple instances of a sound effect on different channels

comment:5 by Thunderforge, 19 months ago

Issue #13588 seems to be another instance of this: if the same volcano erupts twice in a row, the sound many only play once.

comment:6 by SomeRandomHEFan, 15 months ago

Much to my delight, this has finally been fixed by the audio code rewrite.

Someone from the ScummVM team can close this now. Don't know if I'm qualified to do it myself.

comment:7 by AndywinXp, 15 months ago

Owner: set to AndywinXp
Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.