# Multiple errors running Unreal Engine plugin in Docker containers

**URL:** https://qa.fmod.com/t/multiple-errors-running-unreal-engine-plugin-in-docker-containers/17966
**Category:** Unreal Engine
**Created:** [November 15, 2021, 4:38pm UTC](https://qa.fmod.com/t/multiple-errors-running-unreal-engine-plugin-in-docker-containers/17966 "2021-11-15T16:38:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![slonopotamus](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/slonopotamus/32/2860_2.png) [@slonopotamus](https://qa.fmod.com/u/slonopotamus)
#### Post date: [November 15, 2021, 4:38pm UTC](https://qa.fmod.com/t/multiple-errors-running-unreal-engine-plugin-in-docker-containers/17966/1 "2021-11-15T16:38:03Z")

</div>

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](https://docs.unrealengine.com/4.27/en-US/SharingAndReleasing/Containers/ContainersQuickStart/)

First, Windows. This is the most problematic one. This is what logged during attempt to cook project:

```auto
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](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”

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [November 23, 2021, 5:58am UTC](https://qa.fmod.com/t/multiple-errors-running-unreal-engine-plugin-in-docker-containers/17966/2 "2021-11-23T05:58:35Z")

</div>

> [@slonopotamus](#):
>
> First, Windows. This is the most problematic one.

CoInitialize/CoInitializeEx is called internally by FMOD during audio driver initialization; we have previously had users getting past the “Error initializing output device” error on Windows Server by starting the Windows Audio service. Can you please confirm that the Windows Audio service is running in your windows container?

> [@slonopotamus](#):
>
> Now, to Linux. Here’s situation is much better:

You arguments for downgrading this warning seem reasonable to me, I will pass this along to the dev team for them to evaluate.

Also, can you please let me know which version of FMOD you are using? Just so I can pin down where these error messages are coming from.

---

<div class="post-metadata">

### Author: ![slonopotamus](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/slonopotamus/32/2860_2.png) [@slonopotamus](https://qa.fmod.com/u/slonopotamus)
#### Post date: [November 23, 2021, 9:52am UTC](https://qa.fmod.com/t/multiple-errors-running-unreal-engine-plugin-in-docker-containers/17966/3 "2021-11-23T09:52:27Z")

</div>

> CoInitialize/CoInitializeEx is called internally by FMOD during audio driver initialization

It looks like it happens too late. I’m no longer getting that CoInitialize error if calling CoInitialize this way: [Initialize COM before making any calls to FMOD API by slonopotamus · Pull Request #68 · fmod/fmod-for-unreal · GitHub](https://github.com/fmod/fmod-for-unreal/pull/68)

> Can you please confirm that the Windows Audio service is running in your windows container?

I’m not sure how I do that. Most likely the answer will be “Windows Audio is not installed on Windows Server **Core** at all”.

> which version of FMOD you are using?

2.02.03

WRT “Cannot set real-time thread priorities due to insufficient privileges” on Linux. I’m actually seeing in when just running FMOD on Linux as normal user.

---

<div class="post-metadata">

### Author: ![jeff\_fmod](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/jeff_fmod/32/1766_2.png) [@jeff\_fmod](https://qa.fmod.com/u/jeff_fmod)
#### Post date: [November 24, 2021, 12:55am UTC](https://qa.fmod.com/t/multiple-errors-running-unreal-engine-plugin-in-docker-containers/17966/4 "2021-11-24T00:55:29Z")

</div>

> [@slonopotamus](#):
>
> I’m no longer getting that CoInitialize error if calling CoInitialize this way:

Okay that does indeed sound like a bug then, did that also resolve the other error messages?

> [@slonopotamus](#):
>
> I’m not sure how I do that.

You should just need to run the following line with admin priveleges in your Windows Server instance:

```auto
net start "Windows Audio"

```

If it says it failed, or already running, or that it isn’t installed, can you please tell me what version of Windows Server you are running?

> [@slonopotamus](#):
>
> WRT “Cannot set real-time thread priorities due to insufficient privileges” on Linux. I’m actually seeing in when just running FMOD on Linux as normal user.

Thank you for the extra info, I have reproduced this in Linux as described, that should make it a bit easier for the developers to reproduce the issue.
