Unity Errors in the Xcode Debugger Console - Magic Cookie?

Hi!

I keep getting this error when loading a Unity scene:

Error setting magic cookie: 268435468
Error setting up queue: 268435468
Error preparing track: 268435468

Do you think it has something to do with audio? Or is it just pure magic?

This shows up in the Xcode debugger console, when switching from an almost empty Unity scene to a more heavy gameplay scene.
It happens with Unity 1.7, on all devices and all OSs

Please let me know if you have any idea why it can’t set the magic cookie.
Also, on an iPod touch 2nd gen with OS3.1.3, the game crashes at that point (maybe it runs out of memory).

Thanks a lot,
Bogdan

Magic cookie is a special part in some audio files (like MPEG4 AAC) and it contains data necessary for decoding of the audio data.

This error comes from the very depth of our code which is used for playing compressed sounds - most probably something is wrong with audio file. Could you try re-compressing (preferably with iTunes) and see if that helps.

If problem persists, please submit a bug report with the audio file attached.

Thanks ReJ!

I recompressed the file with iTunes and made it AAC format (.m4a) The error is still there.

It is a huge problem for us, as it crashes the game on some devices (especially on OS 3.1.3)

In my gameplay scene, I have an Audio Source and an Audio Listener on the main camera. It also has a script, which plays the audio.

Here’s a sample of that code:

void Awake()
{
audio.clip = (AudioClip)Resources.Load("Predators_JungleMission_part1", typeof(AudioClip));
        if ((audio.clip)(PlayerPrefs.GetInt(GameConstants.MUSIC_ON, 1) == 1))
        {
                audio.Play();
        }
}

The above code gives that Magic Cookie error, plus these errors:

Error setting channel layout on queue: 268435468
Error setting up queue: 268435468
Error preparing track: 268435468

If I add the music file directly to the AudioSource Audio Clip variable, and set it to Play on Awake, I get the same error (without including the above code in Unity).

If I add the above code in Start() instead of Awake(), I get a crash 100% of the times on an iPod 2G, with OS 3.1.3

I’ll try to make a sample project with all the above and submit a bug report.

Meanwhile, if you have any tips to fix this, please let me know.

Thanks a lot,
Bogdan

Angry Mob Games

I seem to get this error even if I completely remove the .mp3/.m4a file from the scene.

Do you think it shows up only for compressed audio, or also for .wav files?

Thanks,
Bogdan

Here’s the error I get when running on the iPod Touch 2G with OS 3.1.3:

Error setting channel layout on queue: 268435468
Error setting up queue: 268435468
Error preparing track: 268435468
Program received signal:  “SIGSEGV”.
Data Formatters unavailable (Error calling dlopen for: "/Developer/usr/lib/libXcodeDebuggerSupport.dylib": "dlopen(/Developer/usr/lib/libXcodeDebuggerSupport.dylib, 10): no suitable image found.  Did find:
	/Developer/usr/lib/libXcodeDebuggerSupport.dylib: out of address space
	mkstringf, out of memory error")
warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/fb.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/fb.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/get.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/get.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/fog.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/fog.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/mbxlite_mp.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/mbxlite_mp.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/eglglue.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/eglglue.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/drawtex.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/drawtex.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/bufobj.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/bufobj.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/misc.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/misc.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/tnlapi.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/tnlapi.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/texrender.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/texrender.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/twiddle.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/twiddle.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/tnlvgp.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/tnlvgp.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/vgp.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/vgp.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/validatetnl.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/validatetnl.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/validate.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/validate.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/dispatch.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/dispatch.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/texdata.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/texdata.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/texcombine.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/texcombine.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/tex.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/tex.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/state.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/state.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/specialobject.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/specialobject.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/slaveport.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/slaveport.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/services_calls.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/services_calls.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/pixelops.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/pixelops.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/vertex.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/vertex.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/names.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/names.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/fbo.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/fbo.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/matrix.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/matrix.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/maths.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/maths.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/makemips.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/makemips.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/hostfunc_um.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/hostfunc_um.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/pvr_apphint.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/pvr_apphint.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/fence.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/fence.c".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/tnlcve.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/tnlcve.cpp".

warning: Could not find object file "/var/tmp/AppleMBX/AppleMBX-48~174/AppleMBX.build/MBXGLEngine.build/Objects-normal/armv6/twiddle_block.o" - no debug information available for "/SourceCache/AppleMBX/AppleMBX-48/MBXGLEngine/twiddle_block.c".

mi_cmd_stack_list_frames: Not enough frames in stack.
mi_cmd_stack_list_frames: Not enough frames in stack.

Hi ReJ!

This fixed the problem: I had the following code in the Awake() function:

sfxOn = (PlayerPrefs.GetInt(GameConstants.SFX_ON, 1) == 1);
       
        if (sfxOn)
        {
           
       	AudioListener.pause = false;
           
        }
        else
        {
           
        AudioListener.pause = true;
          
        }

And I just removed it, and it works fine now.
Could you please check, and let me know if that may have caused such errors?

Thanks,
Bogdan

i got the same error and i also used this “AudioListener.pause = false” thing at beginning of the scene to look if the player disabled sound. After removing the lines everything works.

What is the solution now for me to look if sound is disabled at the beginning of the scene?

Does it work if you move the code to the Start function instead of Awake?

how about a public static bool soundEnabled = false; (or the corresponding unityscript one)

thats faster than the lookup of a component anyway