Opened 14 years ago

Closed 14 years ago

Last modified 20 months ago

#2890 closed defect (fixed)

SCUMM: Sound mixer initialization failed!

Reported by: eriktorbjorn Owned by: fingolfin
Priority: normal Component: Engine: SCUMM
Keywords: Cc:
Game:

Description

Lately, the development version of ScummVM has occasionally given me the following warning message on startup:

WARNING: Sound mixer initialization failed!

Apparently, this happens if the SCUMM engine calls setupMusic() before the first mixer callback. This is one of the first things the SCUMM engine does, which is probably why I get the warning fairly often.

Ticket imported from: #1588848. Ticket imported from: bugs/2890.

Change History (4)

comment:1 by fingolfin, 14 years ago

The reason is clear, a quick fix is trivial -- but I am not sure about how to do the proper fix.

Essentially, the Audio::Mixer::_mixerReady flag only gets set to true when the Audio::Mixer::mixCallback is called for the first time. Which may or may not be the case before the ScummEngine tries to use the mixer (depending on the speed of your system and various other factors).

Possible fixes: * Always set _mixerReady to true. Not sure how we'd deal with systems where the mixer callback is not available, i.e. where no sound is available * Insert a brief delay into sdl.cpp after setting the mixer callback. A hack, and limited to the SDL backend (others will suffer from similar problems) * Call Audio::Mixer::mixCallback once "manually" to get the flag set. An ugly hack * Add a new Audio::Mixer::setIsReady() method or so, to explicitly tell the mixer that it has been hooked up * Others?

comment:2 by fingolfin, 14 years ago

Owner: set to fingolfin
Resolution: fixed
Status: newclosed

comment:3 by fingolfin, 14 years ago

Should hopefully be fixed, please reopen if not

comment:4 by digitall, 20 months ago

Component: --Unset--Engine: SCUMM
Note: See TracTickets for help on using tickets.