We’re trying to set up FMOD for our Unreal Engine based game in Docker containers, however experiencing issues during FMOD initialization.
You can obtain docs for Unreal Engine containers (well, at least instructions on how to build them) here: Containers Quick Start | Unreal Engine Documentation
First, Windows. This is the most problematic one. This is what logged during attempt to cook project:
LogInit: Display: LogFMOD: Error: c:\jk\workspace\Build__2.2__Unreal_Win\core_api\platforms\win\src\fmod_os_misc.cpp(87) - COM not initialized on this thread, call CoInitializeEx(nullptr, COINIT_APARTMENTTHREADED) to avoid this. LogFMOD: Error: c:\jk\workspace\Build__2.2__Unreal_Win\core_api\platforms\win\src\fmod_os_misc.cpp(101) - IMMDeviceEnumerator::RegisterEndpointNotificationCallback returned 0x80070424. LogFMOD: Error: 'FMOD::Studio::System::create(&StudioSystem)' returned 'Error initializing output device.' LogFMOD: Error: 'StudioSystem->getCoreSystem(&lowLevelSystem)' returned 'An invalid object handle was used.' LogFMOD: Error: 'lowLevelSystem->setOutput(FMOD_OUTPUTTYPE_NOSOUND_NRT)' returned 'An invalid object handle was used.' LogFMOD: Error: 'StudioSystem->initialize(1, FMOD_STUDIO_INIT_ALLOW_MISSING_PLUGINS | FMOD_STUDIO_INIT_SYNCHRONOUS_UPDATE, FMOD_INIT_MIX_FROM_UPDATE, nullptr)' returned 'An invalid object handle was used.'
I believe that first error message (about CoInitializeEx) is a 100% bug. I don’t see calls to CoInitialize/CoInitializeEx anywhere in FMOD plugin. There’s neither any guarantee that Unreal Engine itself will call it anywhere. However, your own documentation says that
CoInitializeEx is required before calling any of FMOD functions: https://fmod.com/resources/documentation-api?version=2.00&page=platforms-win.html#com
WRT IMMDeviceEnumerator::RegisterEndpointNotificationCallback: 0x80070424 means that desktop experience is not installed on a Windows Server system. And this is true! We are trying to cook a game build, this is not a desktop system. I believe this can be reproduced outside of containers on a Windows Server Core system.
I’m not sure whether later errors are a concequence of IMMDeviceEnumerator::RegisterEndpointNotificationCallback one or are caused by something different. Note again that we do not actually plan to play any sounds, this happens just because FFMODAssetBuilder::Create is called from FFMODStudioEditorModule::OnPostEngineInit.
Now, to Linux. Here’s situation is much better:
LogFMOD: Error: ../../../core_api/platforms/linux/src/fmod_os_misc.cpp(458) - Cannot set real-time thread priorities due to insufficient privileges
This message is originally a warning, but then promoted to an error because we have a zero-warning policy for the cooking process. However, I want to argue that making it a warning is too much. User almost NEVER has permissions to raise priority of their processes. You even can’t set priority to realtime on Windows unless running under user with admin priviledges! So, I believe this call should either be completely excluded on Linux or message downgraded to something like “info or even debug”