Transition Error Causes FMOD to Die

This is a really odd one, but I’ve got a lot of supporting documentation. It occurs in both FMOD 2.00.05 and 2.00.07, in both FMOD Studio and the Unity integration, both macOS and Windows.

One of my events has a loop with a transition timeline and a transition region below it to jump away when a parameter changes. If the parameter changes at the right moment, it causes FMOD to fail spectacularly. Here’s a video in a minimal example project demonstrating:
Video Example

In the example project, if I trigger a parameter change in either FMOD Studio or via the Unity integration at m. 47, playback in the event hangs and it logs the following continuously:

22:49:21 fmod_playback_timeline.cpp(2021), assert(): assertion: 'leadTransition->timeline().length() == TimeUnit::zero()' failed 
22:49:21 "FMOD_ERROR (28): An error occurred that wasn't supposed to.  Contact support." 
22:49:21 "FMOD_ERROR /Users/raymond/jenkins/workspace/Build__2.0__Studio_Mac/studio/src/SoundSystem.cpp(415): mSystem->update()" 

The event will continue to assert and will only stop once told to stop immediately. Stopping with fade out hangs indefinitely.

Even worse, whatever the error is affects the rest of FMOD. In FMOD Studio, the meters stay at the level they were at just before the error messages started and the playback cursor stopped.

In Unity, FMOD stops playing most other events. Each additional event played allocates a new voice yet those voices are never freed so they pile up. For our players, this causes almost all sound in the game to stop entirely, and most new sounds will not play audibly.

If running in the Unity Editor, it also caused Unity to crash:
Unity_2020-02-05-220417_MacBook-Pro-3.log (157.6 KB)

What is it about this event that is so problematic? Is there any sort of workaround to avoid the bug in question?

Minimal Example Project

And here’s a video of it failing in Unity, where you can see how the metering is frozen and channel count is monotonically increasing with each new sound played. After I stop play mode, Unity crashes without fail, with the same crash log as attached.
Unity Example

Hi mrmiller,

We have a fix for this issue that will be available in the next version.

This issue is happening when encountering a loop with a transition timeline while already inside another transition timeline. Loops are followed during source and destination regions, but there is no support for following one transition timeline while in another. Currently this is not handled at all, and the change is to ignore the nested transition region (following the loop region as normal).

You can avoid this by avoiding transition timelines that encounter loop regions that have transition timelines.

Thanks! I had a feeling that was the case and worked around it last week by removing any loops and replacing them with transitions instead.

I should make a separate topic, but I’ve found a similar issue with transition regions in some specific circumstances. When playing into a transition region targeting a marker, playback stops immediately (stop button engages itself, so a different issue). For whatever reason, this doesn’t happen when going to a named region and doesn’t happen if it’s in the middle of the transition region, only the leading edge.

I would need some more information to understand what’s happening.

If the marker is at the end of the event, the event should stop by having reached its end. Ends of destination and magnet regions aren’t currently included in that end determination (which is a change slated for a future fmod version). There was also a fix added to 2.00.07 to address stopping due to loops encountered in transition destination regions that may be related.

Here’s an example project demonstrating it.

The pictured event stops immediately as soon as it hits the leading edge of the transition region. It doesn’t matter whether there’s a loop or more material after the destination. It doesn’t matter if you move that destination before the transition region so it’s definitely not at the end of the Event. Strangely enough, though, if you change the transition region to go to the destination region instead of the destination marker, it works fine. And regular transitions to the marker also work fine.

I believe the relative offset is required for it to break, which may make it a sort of boundary condition bug.

Thanks for the information, a fix for this issue will be available in 2.00.08.

The specific combination that causes this issue is tempo marker + start of a transition region + destination marker + relative/inverted transition. Any other combination should avoid this issue.

Thanks for the quick response!