FMOD_ERR_NOTREADY

In our Unreal 4.10.4 game on standalone PC, StudioSystem[EFMODSystemContext::Runtime]->update() in FFMODStudioModule::Tick will suddenly start returning FMOD_ERR_NOTREADY every frame. If the game is exited at that point, it will crash in FFMODStudioModule::DestroyStudioSystem. It looks like FMOD is corrupted at that point, although hard to tell for sure from a third party minidump. Everything seems fine up until it starts failing. Any ideas where to look for clues?

You can enable trace logging in FMODStudioModule by changing the debug initialization to the following:

FMOD::Debug_Initialize(FMOD_DEBUG_LEVEL_WARNING | FMOD_DEBUG_TYPE_TRACE, FMOD_DEBUG_MODE_CALLBACK, FMODLogCallback);

It should then print a callstack out of the error that causes the FMOD_ERR_NOTREADY result. That will help track down what is going on.

Adding FMOD_DEBUG_TYPE_TRACE doesn’t produce any more output. I can change the log level in Unreal, but then I get too much all the time.

I added a check/assert on the result from update(). I haven’t been able to repro this running out of the debugger, but I had it happen while running a packaged build. I connected the debugger to it, and it looked like the FFMODStudioModule object itself was corrupt - almost null.

To get the trace results coming through unreal, try editing FMODLogCallback and adding an extra case statement just before the verbose logging, to turn FMOD_RESULT messages into warnings:

// new code start
else if (strstr(message, "FMOD_RESULT"))
{
	UE_LOG(LogFMOD, Warning, TEXT("%s(%d) - %s"), UTF8_TO_TCHAR(file), line, UTF8_TO_TCHAR(message));
}
// new code end
else
{
	UE_LOG(LogFMOD, Verbose, TEXT("%s(%d) - %s"), UTF8_TO_TCHAR(file), line, UTF8_TO_TCHAR(message));
}

I did that, and I’m getting a lot of:

LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\lowlevel_api\src\fmod_dsp.cpp(490) – FMOD_RESULT = 31 – An invalid parameter was passed to this function.

Should I be concerned?

I’m not seeing a call stack.

I changed FMODLogCallback to log warnings only for FMOD_RESULT = 46, and reproduced it again on my machine, running out of a packaged build. Here are the logs:

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\lowlevel_api\src\fmod_sound.cpp(137) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_resource.cpp(144) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_instrument.cpp(1158) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_instrument.cpp(548) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_instrument.cpp(179) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_instrument.cpp(2928) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_instrument.cpp(2918) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_event.cpp(1352) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_event.cpp(1288) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_event.cpp(1225) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_timeline.cpp(1918) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_timeline.cpp(1932) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_timeline.cpp(1708) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_timeline.cpp(112) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_event.cpp(401) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_system.cpp(151) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_playback_system.cpp(1059) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_runtime_manager.cpp(235) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_asyncmanager.cpp(688) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_asyncmanager.cpp(718) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:195][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_asyncmanager.cpp(731) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:214][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_asyncmanager.cpp(182) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:214][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_studio_impl.cpp(1295) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:214][171]LogFMOD:Warning: c:\jk\workspace\Build__1.7__UE4Libs_Win\studio_api\src\fmod_studio_impl.cpp(3915) - FMOD_RESULT = 46 – Operation could not be performed because specified sound/DSP connection is not ready.

[2016.03.12-22.57.42:224][171]LogFMOD:Error: ‘StudioSystem[EFMODSystemContext::Runtime]->update()’ returned ‘Operation could not be performed because specified sound/DSP connection is not ready.’

Thanks for the log. This looks like Studio is calling some query functions on streaming sounds that potentially can return not ready. I’ll let you know when a fix is available.