- Home /
How do I get rid of FMOD errors in the console: "An error occured that wasn't supposed to. Contact support."
I've run into a strange fmod-related audio bug with Unity Editor.
Upon opening Unity, the console emits this long set of errors(1) many, many times. This slows down opening the Editor significantly -- but further, the repetitive errors are also emitted every time I Build a Player, making the process many minutes slower than usual.
This error briefly occurred last week, but simply sync'ing to an old changeset and then sync'ing back to the head revision caused it to go away.
However, the error's back now, and isn't consistently found at the same changeset -- while head revision always seems to display the problem, sync'ing around to different changesets has (several times) shown that one changeset will on one sync display the problem, and on another sync won't.
My teammates have not seen this bug; it's only on my machine.
Here's some possibly-relevant specs:
Unity 4.2.0f4
Fabric 2.1.7c
Windows 7
Echo Gina3G soundcard with driver revision 8.5
Other than iTunes (which I always have open), no other sound software is open. Restarting my PC doesn't seem to make any difference.
Any ideas?
(1) Editor.log:
Validating Project structure ... 0.106595 seconds. Platform assembly: C:\Program Files (x86)\Unity\Editor\Data\Managed\nunit.framework.dll (this message is harmless) result == FMOD_OK
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 275)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 275)
result == FMOD_OK
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 281)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 281)
m_wetGroup
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 284)
m_dryGroup
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 285)
result == FMOD_OK
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 312)
An invalid object handle was used.
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 312)
result == FMOD_OK
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 315)
An invalid object handle was used.
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 315)
result == FMOD_OK
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 318)
An invalid parameter was passed to this function.
(Filename: C:/BuildAgent/work/cac08d8a5e25d4cb/Runtime/Audio/AudioSource.cpp Line: 318)
result == FMOD_OK
Uninstalling my Echo Gina3G soundcard, physically removing the card, restarting, and verifying that my onboard soundcard was working made no difference to the problem.
Upgrading to Unity 4.3.4f1 just made the problem worse; now ins$$anonymous$$d of only emitting (1) in the Editor, endless errors are now also emitted upon executing the game itself(2).
No idea what's causing this. :(
(2) Editor.log
Platform assembly: E:\mechanical_butterfly\jumpTanks\JumpTanks32_Rapid_Data\$$anonymous$$anaged\System.Core.dll (this message is harmless) An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 282)
An invalid parameter was passed to this function.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 319)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 276)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 282)
An invalid object handle was used.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 313)
An invalid object handle was used.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 316)
An invalid parameter was passed to this function.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 319)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 276)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 282)
An invalid object handle was used.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 313)
An invalid object handle was used.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 316)
An invalid parameter was passed to this function.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 319)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 276)
An invalid object handle was used.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 313)
An invalid parameter was passed to this function.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 316)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 319)
An error occured that wasn't supposed to. Contact support.
(Filename: C:/BuildAgent/work/d3d49558e4d408f4/Runtime/Audio/AudioSource.cpp Line: 276)
An error occured that wasn't supposed to. Contact support.
//...
ISSUE RESOLVED:
In my case I had one scene with a script that had a public ref to an array of prefabs. I had 365 prefabs plugged in through the inspector. This caused the error. Once I dropped the size of the array in the inspector to 295, the error went away.
So I spoke too soon. The problem has come back with a vengeance-- sometimes now crippling my project and crashing Unity. The errors again are:
result == F$$anonymous$$OD_O$$anonymous$$ UnityEditor.DockArea:OnGUI()
An error occured that wasn't supposed to. Contact support. UnityEditor.DockArea:OnGUI()
m_wetGroup UnityEditor.DockArea:OnGUI()
m_dryGroup UnityEditor.DockArea:OnGUI()
REPEAT UNTIL CRASH
I don't believe it is a corrupt .unity file on my end as the user above suggested. Reason is I reverted to a previous version of my project that was working fine and eventually the problem reappeared. I also created a brand new scene and copy pasted elements of my buggy scene into it... The errors appeared when I added an object with a script that had 365 publicly referenced prefabs through the inspector. I dropped this to 295 prefabs and the problem went away.
For a while. Now the problem is back.
In another scene I am referencing many of these same prefabs from different scripts. $$anonymous$$y scene is now crashing with the above errors every time it tries to compile a script change or I try to swap to a different scene.
I am linking to many of these prefabs-- and I suspect the number of prefabs I'm linking to is causing the problem. The more prefabs I link to, the worse the errors get.
However, I'm building a game with over 100 levels. If I can't link to 300 prefabs without Unity crashing I'm sunk.
I'll file another bug report and will report back here if I find any fixes.
Answer by nathanfrost0x · Mar 13, 2014 at 04:30 AM
This ended up being a corrupt .unity file.
Even when I don't knowingly make any change to an open .unity file, Unity often wants to save it with some opaque binary change. Up to this point, I've always "gone along with" Unity and submitted the "changed" .unity file to source control.
It appears that one of these "non-changes" corrupted the .unity file such that it demonstrated the above behavior. Simply rolling back to the previous change fixed the problem.
From now on, I plan to revert every .unity file that claims it is changed unless I really meant to change it.
I'm getting this same behavior. Do you think you could clarify what you mean by a '.unity' file?
Unity saves your scenes with the extension .unity
, so I would assume they're talking about a scene file.
Okay thank you. I reverted to a previous version of the project before the error appeared and the errors vanished-- but then returned this morning. arrrg. I will keep troubleshooting and have filed a bug report.
Answer by sebastiansgames · Jul 30, 2014 at 04:59 PM
I had the exact same issue (long repetition of exactly the same errors mentioned above). After much troubleshooting I discovered the solution for my situation:
I had a glitched prefab.
In my project, I have one root prefab that is duplicated over and over and the values are tweaked in the inspector. What I didn't notice is that the prefab had begun to take on children in the Project tab that should not have been there. Moreover, every time I duplicated the prefab, another one of these phantom children objects would be added.
So the problem compounded. By phantom, I mean that while I could select the child objects in the Project window, I could NOT DELETE THEM (tried right clicking, hitting delete, nothing worked). When I dragged one of these prefabs directly into the scene, Unity would stall for a long time as it tried to figure out whether there was a child there or not. Finally, after a long list of errors, the object would indeed appear with children in my scene. At that point I could delete the child objects from the prefab in the hierarchy, and then apply the changes to the original prefab.
One last thing I'll mention is that in my game I use a level editor to tweak the prefab public values. My level editor invokes 'SetDirty' to ensure changes to the prefab are saved. I imagine that somewhere during the SetDirty invocation the glitch happened.
I'll post a bug report/solution to Unity.
Answer by JaredThomson · Nov 08, 2015 at 02:45 PM
I'm intentionally abusing the editor to do some profiling out of curiosity. I get this error or a crash with the following code.
void Start()
{
double iterations = 5000.0;
Debug.Log("***** Start");
GameObject root = new GameObject("root");
root.AddComponent<SpriteRenderer>();
root.AddComponent<AudioSource>();
root.AddComponent<Light>();
GameObject latest = root;
using (new Timer("new GameObject()", iterations ))
{
for(int i = 0; i < (int)iterations ; ++i)
{
var go = new GameObject();
go.AddComponent<SpriteRenderer>();
go.AddComponent<AudioSource>();
go.AddComponent<Light>();
go.transform.parent = latest.transform;
latest = go;
}
}
Destroy(root);
root = new GameObject("root");
root.AddComponent<SpriteRenderer>();
root.AddComponent<AudioSource>();
root.AddComponent<Light>();
latest = root;
using (new Timer("GameObject.Instantiate", iterations ))
{
for (int i = 0; i < (int)iterations ; ++i)
{
var go = Instantiate(latest) as GameObject;
go.transform.parent = latest.transform;
latest = go;
}
}
Destroy(root);
Timer.PrintAll();
}
For the curious, the timer used in this code is this:
class Timer : IDisposable
{
private readonly string m_Text;
private Stopwatch m_Stopwatch;
private double m_DivBy;
private static List<string> m_Backlog = new List<string>();
public Timer(string text, double divBy = 0.0)
{
m_Text = text;
m_DivBy = divBy;
m_Stopwatch = Stopwatch.StartNew();
}
public void Dispose()
{
m_Stopwatch.Stop();
if (m_DivBy != 0.0)
{
m_Backlog.Add(string.Format("Profiled {0}: {1} seconds. {2} milliseconds.", m_Text, m_Stopwatch.Elapsed.TotalSeconds / m_DivBy, m_Stopwatch.Elapsed.TotalMilliseconds / m_DivBy));
}
else
{
m_Backlog.Add(string.Format("Profiled {0}: {1} seconds. {2} milliseconds.", m_Text, m_Stopwatch.Elapsed.TotalSeconds, m_Stopwatch.Elapsed.TotalMilliseconds));
}
}
public static void PrintAll()
{
foreach(var result in m_Backlog)
{
Debug.Log(result);
}
}
}
Running 5000 iterations causes this error to occur.
Running 10000 iterations is a 100% crash of the editor with no crash reporter.
Your answer
Follow this Question
Related Questions
Clicking on error logs in console causes console to spam GUI Errors 1 Answer
host set to C:\Program Files\Unity\Hub\Editor\2019.4.9f1\Editor\Data\Tools\RoslynScripts\..\.. 0 Answers
Disable Unity audio/FMOD on iOS 0 Answers
Should not be capturing when there is a hotcontrol 10 Answers
Not getting any audio in my simple roll-a-ball unity/Fmod builds. 1 Answer