Build issue

Hi,
we are using Unity 2022.3.60f1 and fmod 2.02.21. We are running builds on CirceCI and recently (maybe after Unity upgrade from 2022.3.22f1) our macos build started failing. IOS arcade builds are fine, but macos fails. After adding some logs, I’ve pinpointed the issue in the UpdateCache function, specifically to the:

INFO 2025-04-22 07:42:00.831 (t1) – FMOD: EventManager.UpdateCache: string bank is not valid: ../fmod-blast-park/Build/Mobile/Master.strings.bank, ERR_INVALID_HANDLE, An invalid object handle was used.
FMOD: EventManager.UpdateCache: string bank is not valid: ../fmod-blast-park/Build/Mobile/Master.strings.bank, ERR_INVALID_HANDLE, An invalid object handle was used.

#0 GetStacktrace(int)
#1 DebugStringToFile(DebugStringToFileData const&)
#2 DebugLogHandler_CUSTOM_Internal_Log(LogType, LogOption, ScriptingBackendNativeStringPtrOpaque*, ScriptingBackendNativeObjectPtrOpaque*)
#3 (Mono JIT Code) (wrapper managed-to-native) UnityEngine.DebugLogHandler:Internal_Log (UnityEngine.LogType,UnityEngine.LogOption,string,UnityEngine.Object)
#4 (Mono JIT Code) [DebugLogHandler.cs:10] UnityEngine.DebugLogHandler:LogFormat (UnityEngine.LogType,UnityEngine.Object,string,object)
#5 (Mono JIT Code) [Logger.cs:139] UnityEngine.Logger:LogFormat (UnityEngine.LogType,string,object)
#6 (Mono JIT Code) [Debug.bindings.cs:113] UnityEngine.Debug:LogFormat (string,object)
#7 (Mono JIT Code) [EventManager.cs:201] FMODUnity.EventManager:UpdateCache ()
#8 (Mono JIT Code) [EventManager.cs:33] FMODUnity.EventManager:RefreshBanks ()
#9 (Mono JIT Code) [EventManager.cs:1105] FMODUnity.EventManager:BuildTargetChanged ()
#10 (Mono JIT Code) [EventManager.cs:607] FMODUnity.EventManager/<>c:<.cctor>b__15_0 ()
#11 (Mono JIT Code) [EditorUtils.cs:1712] FMODUnity.BuildStatusWatcher:SetBuildInProgress (bool)
#12 (Mono JIT Code) [EditorUtils.cs:1739] FMODUnity.BuildStatusWatcher/BuildProcessor:OnPreprocessBuild (UnityEditor.Build.Reporting.BuildReport)
#13 (Mono JIT Code) [BuildPipelineInterfaces.cs:499] UnityEditor.Build.BuildPipelineInterfaces/<>c__DisplayClass16_0:b__1 (UnityEditor.Build.IPreprocessBuildWithReport)

We are using a single bank build setting for all apple platforms, so the same built banks work on arcade builds, but not on macos…

We are checking if it’s anything related to file access rights, but on first look everything seems fine. Any ideas/tips what could be the issue?

Thanks,
Marko

To make it weirder, local build works fine…

Downgrading unity back to .19 seems to solve the issue…
UpdateCache function executes normally and banks get copied into StreamingAssets folder.

For the .60 build, the issue seems to be CreateSystem:

FMOD failed to initialize the output device.: "A call to a standard soundcard driver failed, which could possibly mean a bug in the driver or resources were missing or exhausted. " (57)

This gets triggered on the first loadbank (lazy init of system). How does CreateSystem work for headless batch build?

Hi,

Thank you for the information.

There is a known issue with CI builds at the moment. A workaround is hard setting the auditioning system to NOSOUND. Could you please test updating the EditorUtils.cs underline 541:

private static void CreateSystem()
{
    RuntimeUtils.DebugLog("FMOD Studio: Creating editor system instance");
    RuntimeUtils.EnforceLibraryOrder();

    FMOD.RESULT result = FMOD.Debug.Initialize(FMOD.DEBUG_FLAGS.LOG, FMOD.DEBUG_MODE.FILE, null, "fmod_editor.log");
    if (result != FMOD.RESULT.OK)
    {
        RuntimeUtils.DebugLogWarning("FMOD Studio: Cannot open fmod_editor.log. Logging will be disabled for importing and previewing");
    }

    CheckResult(FMOD.Studio.System.create(out system));

    FMOD.System lowlevel;
    CheckResult(system.getCoreSystem(out lowlevel));

    // New lines to force no sound
    CheckResult(lowlevel.setOutput(FMOD.OUTPUTTYPE.NOSOUND));

Please let me know if this allows builds to succeed. Note, that auditioning events in the Unity editor or in a timeline will not work with this change. For the change to be applied you can either build banks or delete the FMODStudioSettings object.

Could I also please grab the fmod_editor.log? This should be found in your Unity project directory.

Hi Connor,
forcing NOSOUND helped, fmod updates the cache and copies the banks to target folder. I’ve wrapped the force nosound with a batch mode check, so that editor preview still works.

            if (Application.isBatchMode) {
                CheckResult(lowlevel.setOutput(FMOD.OUTPUTTYPE.NOSOUND));
            }

Here are the log outputs:

for failed build:

[LOG] System::create                           : Header version = 2.02.21. Current version = 2.02.21.
[LOG] Manager::init                            : maxchannels = 256 studioflags = 00000006 flags 00000000 extradriverdata 0x0.
[LOG] SystemI::init                            : Initialize version=20221 (141420), maxchannels=256, flags=0x00020000
[LOG] SystemI::setOutputInternal               : Setting output to 'FMOD Core Audio Output'
[LOG] OutputCoreAudio::init                    : Output running 2 channels at 48000Hz sample rate.
[LOG] OutputCoreAudio::init                    : Maximum hardware read size: 2048 samples, Software buffer size: 512 samples, Number of software buffers: 4.
[LOG] Thread::initThread                       : Init FMOD stream thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFB, Stack Size: 98304, Semaphore: No, Sleep Time: 10, Looping: Yes.
[LOG] Thread::initThread                       : Init FMOD mixer thread. Affinity: 0x4000000000000001, Priority: 0xFFFF7FFA, Stack Size: 81920, Semaphore: Yes, Sleep Time: 0, Looping: Yes.
[LOG] Thread::callback                         : FMOD stream thread finished.
[LOG] Thread::callback                         : FMOD mixer thread finished.
[LOG] SystemI::close                           : Closed.
[LOG] LiveUpdate::release                      :
[LOG] LiveUpdate::reset                        : Reset connection (reason Disconnected)

with nosound fix:

[LOG] System::create                           : Header version = 2.02.21. Current version = 2.02.21.
[LOG] SystemI::setOutputInternal               : Setting output to 'FMOD NoSound Output'
[LOG] Manager::init                            : maxchannels = 256 studioflags = 00000006 flags 00000000 extradriverdata 0x0.
[LOG] SystemI::init                            : Initialize version=20221 (141420), maxchannels=256, flags=0x00020000
[LOG] Thread::initThread                       : Init FMOD stream thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFB, Stack Size: 98304, Semaphore: No, Sleep Time: 10, Looping: Yes.
[LOG] Thread::initThread                       : Init FMOD mixer thread. Affinity: 0x4000000000000001, Priority: 0xFFFF7FFA, Stack Size: 81920, Semaphore: No, Sleep Time: 0, Looping: Yes.
[LOG] AsyncManager::init                       : manager 0x348bc9408 isAsync 0 updatePeriod 0.02
[LOG] AsyncManager::init                       : done
[LOG] PlaybackSystem::init                     :
[LOG] Thread::initThread                       : Init FMOD Studio sample load thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFD, Stack Size: 98304, Semaphore: No, Sleep Time: 1, Looping: No.
[LOG] PlaybackSystem::init                     : done
[LOG] Thread::initThread                       : Init FMOD Studio bank load thread. Affinity: 0x4000000000000003, Priority: 0xFFFF7FFD, Stack Size: 98304, Semaphore: No, Sleep Time: 1, Looping: No.
[LOG] Manager::init                            : done.
[LOG] Manager::readBank                        : fileversion = 142, compatVersion = 140 (oldest = 44, newest = 142)
[LOG] Manager::readBank                        : fileversion = 142, compatVersion = 140 (oldest = 44, newest = 142)
[LOG] Manager::readBank                        : fileversion = 142, compatVersion = 140 (oldest = 44, newest = 142)
[LOG] Manager::readBank                        : fileversion = 142, compatVersion = 140 (oldest = 44, newest = 142)
etc...
1 Like

Thank you for the logs, good to hear that helped the issue. I will add your solution to the task.

Please let me know if there is anything else I can assist with!