Lag every 5 seconds

Hello.

I just importet the Unity package of Fmod and now my unity is loading anything every 5 seconds. It happens in the editor and also in playmode. I’m not sure but i think it has something to do with refreshing of any banks or something?

The loading circle of my mouse is kind of “flickering” and it looks the same as if i press “Fmod/Refresh Banks”… The “Strings Bank Write Time” in “FMODStudioCacke” gets also refrehsed during the lag.

In the profiler while playing i can see that “Audio (WASAPI) Feeder T…” is doing something which causes the lag. (See Image)

Does anybody know what possibly causes this problem and how to solve it?

Thank you very much.

4 Likes

I have the same issue

1 Like

I have found a solution for the problem…
Reinstall Fmod 2.00.0.5 and also reinstall the unity plugin 2.00.0.5.

I just tested it and it works fine now.
The new version 2.00.0.6 seams to cause this problem.

We’ve been encountering the same problem on 2.00.06. It looks like it’s reimporting the banks every 5 seconds:

Line 529 in EventManager.cs

// Clean out any stale .bank files
string[] currentBankFiles = Directory.GetFiles(bankTargetFolder, "*." + bankTargetExension);
foreach (var bankFileName in currentBankFiles)
{
    string assetString = bankFileName.Replace(Application.dataPath, "Assets");
    AssetDatabase.ImportAsset(assetString);
    UnityEngine.Object obj = AssetDatabase.LoadAssetAtPath<UnityEngine.Object>(assetString);
    string[] labels = AssetDatabase.GetLabels(obj);
    bool containsLabel = false;
    foreach (string label in labels)
    {
        if (label.Equals("FMOD"))
        {
            containsLabel = true;
            break;
        }
    }

    string bankName = Path.GetFileNameWithoutExtension(bankFileName);
    if (containsLabel && (!eventCache.EditorBanks.Exists((x) => bankName == x.Name)))
    {
        File.Delete(bankFileName);
        madeChanges = true;
    }
}

Reverting EventManager.cs to its state in 2.00.05 fixes the lag.

We had the same issue here as well. I imported Fmod 2.00.06 into a completely empty project, ran the empty game and the banks were being loaded every five seconds causing a lag.

As suggested here, we replaced the EventManager.cs with the one from version 2.00.05 and it fixes the visible lag.

Thanks everyone for the information, I have found the cause of this lag (importing assets to check the labels) and will get the fix out in the next release.

1 Like

Hey, can anyone link me to the script so I can replace my EventManager.cs with it? Our team updated to 2.00.06 from 2.00.00 so I don’t have the 2.00.05 to fall back on. Thanks :slight_smile:

Delete old FMOD and import 20004 ver.
Works fine for me.

Hey, thanks for the reply. I ended up getting my hands on the script from 2.00.05 and I’m having no issues now with 2.00.06.

I was having the same problem today. Really frustrating and delayed a whole days work trying to find the source. Can someone link the code to 2.00.05? Thanks. Or am I better off re-installing 2.00.05 version and relative it’s Unity Plug-in?

Thanks in advance,

Kaz

It is probably best to keep the whole plugin on the same version, you can roll back the same way you update: https://www.fmod.com/resources/documentation-unity?version=2.0&page=user-guide.html#updatingupgrading-the-integration

Or just comment out these lines?

if (lastCheckTime + FilePollTimeSeconds < Time.realtimeSinceStartup)
{
RefreshBanks();
lastCheckTime = Time.realtimeSinceStartup;
}

Getting this bug as well. Is there any confirmation of a fix coming for .00.007 and the ETA on that?