How to reliably sync between tracks?

In our Unity game, we have multiple areas where we do multi-track adaptive music. (like usually it’s 3 tracks that fade in and out, and like another track with percussion placed manually on beat within fmod).

Usually it works great, but sometimes in builds (to say, iOS), sync is lost significantly (by half a second or so) and the result is a mess.

I guess FMOD attempts to start all tracks at the same time, but if for some reason takes a bit longer to load a track then it all gets out of sync?

Is there a way to make this more reliable?

Could you share a screenshot of your event? I’d like to know how your tracks are triggered.

If tracks are timeline synced (“Async” switched off on all trigger regions) they should be in sync even if they don’t load at the same time, or even if they are streamed. So yeah, a screenshot of how your event is set up would be good.

Here is the simplest one that I have seen get out of sync. (again this only happens on builds, it doesn’t happen in FMOD or in Unity)

All sounds have async off.

I strongly feel this is some scheduling issue (I feel like I’ve read something similar on the forums), but if there is something wrong with my set up, point it out.

In your exemple, which track goes out of sync from what? At which point of the timeline does it occur?

I mean, it’s two tracks, and they go out of sync with each other. I’m not able to tell which one is “more correct” (possibly the one that plays earlier?). Not sure if it’s the same one each time.

It doesn’t occur at a specific moment in the timeline. It happens in builds semi-randomly (but often enough that I can recreate it with a bit of persistence).

Simultaneous synchronous instruments should theoretically never get out of sync with each other. If that’s a reproductible bug, it could be of great interest to the FMOD staff.

But maybe that could be caused by streaming assets on low end devices. You should try deactivating the streaming mode on those assets (which is activated by default on long assets).

If this can be of any help, I had the same problem on an iOS Game a couple of years ago (“Secret Oops!” Unity+FMOD for Apple Arcade)
It was an event with two tracks (music layer + Drum layer) often they went out of synch.
I solved the problem by removing the stream feature for all involved assets
Not very clear to me how “Stream” works on a mobile device like an iPhone (I suppose there are different kind of storage memories with different access time)

This could potentially be due to a known issue with the sample accuracy of virtual voices. I see that one of your tracks starts at -∞ dB and I’m guessing the “wall distance” parameter automates that track’s volume up and down.
If this is the case, as a workaround you can try setting the initial volume of the “Audio 1” track to -79 dB and not automate it below -79dB. That should prevent this track, and any other timing-critical tracks, from going virtual and thus losing sync.
Please let me know if that doesn’t fix the issue and I will investigate further.

4 Likes