[FMOD] assert : assertion: 'mLastSchedulePoint >= mLength' failed

FMOD Version: 2.02.19
Unity Version: 2020.3.30f1

This error appears for me periodically when playing on Unity Editor at timeScale = 10 or faster. It doesn’t seem to affect game performance or sound playback however, but it does trigger Unity’s Error Pause.

It is reproducible even when setting Pitch to the same value as timeScale, but does not seem to happen when using normal speed (timeScale 1).

Is there a setting I’m missing, or something I’m doing wrong?

[FMOD] assert : assertion: 'mLastSchedulePoint >= mLength' failed

UnityEngine.Debug:LogError (object)
FMODUnity.RuntimeUtils:DebugLogError (string) (at Assets/Plugins/FMOD/src/RuntimeUtils.cs:580)
FMODUnity.RuntimeManager:DEBUG_CALLBACK (FMOD.DEBUG_FLAGS,intptr,int,intptr,intptr) (at Assets/Plugins/FMOD/src/RuntimeManager.cs:91)

Hi,

This assert only occurs when an event stop is pending and the current time is longer than the length of the timeline - while logically I could see why timescale adjustment might cause it, it is still something that shouldn’t be occuring.

Can I get you to elaborate on the structure of the event that’s causing the assert, if you’ve been able to figure out which on it is specifically, and the stop conditions/whether you’re manually stopping it from code? If you set your logging level to “log” in FMOD’s settings, do you receive any other messages?

While this is not the only event that triggers the assert error, I was able to reproduce it with only one looping BGM enabled in the whole game (all other scripts that play sounds had their respective Play/Loop/Stop calls disabled, but with references still linked).

The BGM has two clips in it: one is the actual bgm and the other is a silent clip of the same length. There is a (relative) magnet region above each, and the bgm will smoothly transition between audible and silent depending on the state of the game (via a parameter).

The code that controls this will create the bgm instance once onStart, then sets the parameter to 0 or 1 based on whether the bgm should be audible or not afterwards. instance.start and instance.stop are not called again until the game closes. For testing, it is currently swapping between 0 and 1 quite frequently.

When running at timeScale 20, the assert error appears every 2~3minutes.

Here are the logs using ‘Log’ logging level:

[FMOD] SystemI::createSound : filename = Assets/FMOD/Project/Build/Desktop/Music.bank : mode 02010082
[FMOD] SystemI::createSound : FMOD_NONBLOCKING specified.  Putting into queue to be opened asynchronously!
[FMOD] AsyncThread::add : add sound to async queue : soundi = 00000190065FAAA8, queue head = 000001904C2391B8, queue count = 0
[FMOD] AsyncThread::threadFunc : Starting Asynchronous operation on sound 00000190065FAAA8
[FMOD] SystemI::createSoundInternal :     Create name='Assets/FMOD/Project/Build/Desktop/Music.bank', mode=0x02010082
[FMOD] SystemI::createSoundInternal :     exinfo->cbsize             = 224
[FMOD] SystemI::createSoundInternal :     exinfo->length             = 5704672
[FMOD] SystemI::createSoundInternal :     exinfo->fileoffset         = 30592
[FMOD] SystemI::createSoundInternal :     exinfo->numsubsounds       = 1
[FMOD] SystemI::createSoundInternal :     exinfo->inclusionlist      = 000001904C224F30
[FMOD] SystemI::createSoundInternal :     exinfo->inclusionlistnum   = 1
[FMOD] SystemI::createSoundInternal :     exinfo->suggestedsoundtype = 5
[FMOD] SystemI::createSoundInternal :     exinfo->initialseekposition = 47288
[FMOD] SystemI::createSoundInternal :     exinfo->initialseekpostype = 1
[FMOD] SystemI::createSoundInternal :     Stream 0/1: name='ng_music', format=5, channels=2, frequency=48000, lengthbytes=646912, lengthpcm=2271549, pcmblocksize=0, loopstart=0, loopend=0, mode=0x00000000, channelmask=0x00000000, channelorder=0, peakvolume=0.483612.
[FMOD] AsyncThread::threadFunc : Finished Asynchronous operation on sound 00000190065FAAA8
[FMOD] SystemI::createSound : filename = Assets/FMOD/Project/Build/Desktop/Music.bank : mode 02010082
[FMOD] SystemI::createSound : FMOD_NONBLOCKING specified.  Putting into queue to be opened asynchronously!
[FMOD] AsyncThread::add : add sound to async queue : soundi = 00000190065FCC68, queue head = 000001904C2391B8, queue count = 0
[FMOD] AsyncThread::add : add sound to async queue : soundi = 00000190065FBEE8, queue head = 000001904C2391B8, queue count = 0
[FMOD] AsyncThread::threadFunc : Starting Asynchronous operation on sound 00000190065FCC68
[FMOD] SystemI::createSoundInternal :     Create name='Assets/FMOD/Project/Build/Desktop/Music.bank', mode=0x02010082
[FMOD] SystemI::createSoundInternal :     exinfo->cbsize             = 224
[FMOD] SystemI::createSoundInternal :     exinfo->length             = 5704672
[FMOD] SystemI::createSoundInternal :     exinfo->fileoffset         = 30592
[FMOD] SystemI::createSoundInternal :     exinfo->numsubsounds       = 1
[FMOD] SystemI::createSoundInternal :     exinfo->inclusionlist      = 000001904C222D70
[FMOD] SystemI::createSoundInternal :     exinfo->inclusionlistnum   = 1
[FMOD] SystemI::createSoundInternal :     exinfo->suggestedsoundtype = 5
[FMOD] SystemI::createSoundInternal :     exinfo->initialseekpostype = 1
[FMOD] SystemI::createSoundInternal :     Stream 0/1: name='ng_music', format=5, channels=2, frequency=48000, lengthbytes=646912, lengthpcm=2271549, pcmblocksize=0, loopstart=0, loopend=0, mode=0x00000000, channelmask=0x00000000, channelorder=0, peakvolume=0.483612.
[FMOD] AsyncThread::threadFunc : Finished Asynchronous operation on sound 00000190065FCC68
[FMOD] AsyncThread::threadFunc : Starting Asynchronous operation on sound 00000190065FBEE8
[FMOD] AsyncThread::threadFunc : Finished Asynchronous operation on sound 00000190065FBEE8
[FMOD] assert : assertion: 'mLastSchedulePoint >= mLength' failed
[FMOD] SoundI::release : ng_music (00000190065FAAA8)
[FMOD] SoundI::release :     ng_music (0000018F2698CA98)
[FMOD] SoundI::release :     ng_music (00000190065FBEE8)
[FMOD] SoundI::release : ng_music (00000190065F7808)
[FMOD] SoundI::release :     ng_music (0000018F21E76C28)
[FMOD] SoundI::release :     ng_music (00000190065F9B78)

Thanks for the logs and additional information.

Unfortunately, I haven’t been able to reproduce the assert using a similar setup - would it be possible to get you to upload your FMOD Studio and Unity projects (or stripped down versions where you can consistently reproduce the issue) to your FMOD User Profile so I can test it on my end?

Hi Louis,

I’ve uploaded a Unity project (with FMOD Studio project under Assets/FMOD/Project) to my User Profile. It reproduces the issue with all relevant fmod scripts intact.

Apologies, I may have made a mistake with the FMOD Integration version number; the package version shows 2.02.18, but the Setup wizard and About Integration tabs both show 2.02.19.

I’ve also found that it is possible to reproduce the assert even with a timeScale of 1 (regular speed), as long the transition between magnet regions is triggered rapidly (ie parameter is changed repeatedly between 0 and 2). Whenever the track reaches the end (the point where it’ll loop back to start), the assert error [mLastSchedulePoint >= mLength’ failed] happens.

Much appreciated, I’ll take a look and get back to you shortly.

No problem!

Apologies for the delayed response. To follow up on this, I’ve been able to reproduce the issue, so thanks again for uploading the Unity project. I’ve since passed it on to the development team for further investigation - if there’s any further development or info on the specifics of the assert following that, I’ll get back to you.

1 Like