# Dedicated server builds on Unity

**URL:** https://qa.fmod.com/t/dedicated-server-builds-on-unity/19720
**Category:** Unity
**Created:** [January 10, 2023, 1:10pm UTC](https://qa.fmod.com/t/dedicated-server-builds-on-unity/19720 "2023-01-10T13:10:18Z")
**Posts on this page:** 5
**Page:** 1

<div class="post-metadata">

### Author: ![purefunctor](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@purefunctor](https://qa.fmod.com/u/purefunctor)
#### Post date: [January 10, 2023, 1:10pm UTC](https://qa.fmod.com/t/dedicated-server-builds-on-unity/19720/1 "2023-01-10T13:10:18Z")

</div>

Hi, I was just wondering if the same is being done for the Unity integration:

> [@Disabling fmod on dedicated server](https://qa.fmod.com/t/disabling-fmod-on-dedicated-server/16017/2):
>
> The integration already checks for IsRunningDedicatedServer() and will not initialize the FMOD System at runtime if it returns true.

When building using the “[Dedicated Server](https://forum.unity.com/threads/unity-2021-2-dedicated-server-target-and-stripping-optimizations-now-live-please-share-feedback.1143734/)” option, and then running, I get the following error:

```auto
Fallback handler could not load library [REDACTED]/Build/Server/Contents/Frameworks/MonoEmbedRuntime/osx/libfmodstudio
DllNotFoundException: fmodstudio assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) FMOD.Memory.FMOD5_Memory_GetStats(int&,int&,bool)
  at FMOD.Memory.GetStats (System.Int32& currentalloced, System.Int32& maxalloced, System.Boolean blocking) [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.RuntimeUtils.EnforceLibraryOrder () [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.StudioListener.OnEnable () [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 

DllNotFoundException: fmodstudio assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) FMOD.Memory.FMOD5_Memory_GetStats(int&,int&,bool)
  at FMOD.Memory.GetStats (System.Int32& currentalloced, System.Int32& maxalloced, System.Boolean blocking) [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.RuntimeUtils.EnforceLibraryOrder () [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.StudioBankLoader.Start () [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 

DllNotFoundException: fmodstudio assembly:<unknown assembly> type:<unknown type> member:(null)
  at (wrapper managed-to-native) FMOD.Memory.FMOD5_Memory_GetStats(int&,int&,bool)
  at FMOD.Memory.GetStats (System.Int32& currentalloced, System.Int32& maxalloced, System.Boolean blocking) [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.RuntimeUtils.EnforceLibraryOrder () [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.RuntimeManager.get_Instance () [0x0007c] in <0efa03edb56042da9adc70753267a1f4>:0 
Rethrow as SystemNotInitializedException: [FMOD] Initialization failed
  at FMODUnity.RuntimeManager.get_Instance () [0x000af] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.RuntimeManager.GetEventDescription (FMOD.GUID guid) [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.RuntimeManager.CreateInstance (FMOD.GUID guid) [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at FMODUnity.RuntimeManager.CreateInstance (FMODUnity.EventReference eventReference) [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 
  at AudioPlayer.Start () [0x0001c] in <a8eac1b1f70a4f67bde4f2d774ba6da1>:0 

NullReferenceException: Object reference not set to an instance of an object
  at FMODUnity.RuntimeManager.Start () [0x00000] in <0efa03edb56042da9adc70753267a1f4>:0 

ERROR: Shader TextMeshPro/Sprite shader is not supported on this GPU (none of subshaders/fallbacks are suitable)

```

I think in this case, I can make use of the `UNITY_SERVER` condition to not call into the integration, but I was just wondering if the same is being done on the internally to block any rouge calls.

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [January 13, 2023, 1:11am UTC](https://qa.fmod.com/t/dedicated-server-builds-on-unity/19720/2 "2023-01-13T01:11:09Z")

</div>

I can confirm we are not running the same check with Unity. Thanks for pointing it out - I’ve flagged this with the development team.

---

<div class="post-metadata">

### Author: ![purefunctor](https://avatars.discourse-cdn.com/v4/letter/p/dc4da7/32.png) [@purefunctor](https://qa.fmod.com/u/purefunctor)
#### Post date: [January 13, 2023, 6:30am UTC](https://qa.fmod.com/t/dedicated-server-builds-on-unity/19720/3 "2023-01-13T06:30:45Z")

</div>

Thanks!

For our project, we created a separate assembly definition for server code such that the FMODUnity DLL doesn’t get built/included, though, the native plugins are still copied to the server build. Since no code path ever touches it, we just manually remove it in our build step.

---

<div class="post-metadata">

### Author: ![amynox](https://avatars.discourse-cdn.com/v4/letter/a/8797f3/32.png) [@amynox](https://qa.fmod.com/u/amynox)
#### Post date: [January 22, 2024, 11:10pm UTC](https://qa.fmod.com/t/dedicated-server-builds-on-unity/19720/4 "2024-01-22T23:10:02Z")

</div>

Hi @Leah_FMOD ,  
Any update on this? We are experiencing the same issue with playfab server.  
Did the check in Unity was implemented ?

otherwise any idea to get this fixed in Playfab server (no audio support). Here is the error i’m getting:

```auto
DllNotFoundException: Unable to load DLL 'fmodstudio'. Tried the load the following dynamic libraries: Unable to load dynamic library 'fmodstudio' because of 'Failed to open the requested dynamic library (0x06000000) - The specified module could not be found. (WinError:0000007e)

```

Unity 2022.3.17f1 and FMOD 2.02.20

Many thanks

---

<div class="post-metadata">

### Author: ![Leah\_FMOD](https://yyz2.discourse-cdn.com/flex036/user_avatar/qa.fmod.com/leah_fmod/32/3685_2.png) [@Leah\_FMOD](https://qa.fmod.com/u/Leah_FMOD)
#### Post date: [January 25, 2024, 3:02am UTC](https://qa.fmod.com/t/dedicated-server-builds-on-unity/19720/5 "2024-01-25T03:02:05Z")

</div>

A similar check for Unity has not been implemented yet, and is primarily intended for users who specifically want FMOD **not** to run on a dedicated server. Otherwise, given the lack of audio support, the FMOD system should initialize using the output [`FMOD_OUTPUTTYPE_NOSOUND`](https://www.fmod.com/docs/2.02/api/core-api-system.html#fmod_outputtype_nosound), but based on your error it seems like your dedicated server build is lacking the FMOD libs full stop. Can you please confirm whether the FMOD libs are present?

Just to clarify, are you trying to have your dedicated server build run an FMOD system, or are you trying to have it not run FMOD at all?
