Streaming Music Stems Out of Sync when first booting the game

Hello,

I have scouted the forum looking for similar posts and it’s rather overwhelming how common this problem is. In short, I have a 5 stems music system and upon first booting the game, when no data has been cached yet in the computer, it is extremely common for the layers to start off sync from one another.

Because streaming assets don’t have an API implementation, it’s proving particularly difficult to fix this issue. Here is what we have tried or looking into or things that we just cannot do:

  1. Tried a scheduled delay on starting the music event = failed
  2. Scheduled delay on the System streaming = to be verified, but I doubt it will work cause I cannot push it much further than the 8129 default samples.
  3. Cannot merge music stems into a multichannel wav file due to the high complexity of the music implementation.
  4. Cannot pre-load music assets into memory due to file size and memory budget constraints. If we had been shipping only on PC I might have taken this route but our game is multi-platform.

I wish there was a way to pre-load a small chunk of streaming assets into memory. I think it should be added as a feature for future versions of FMOD. It could be controlled in Studio directly in the encoding options.

Any more insights into this issue would be helpful. Thank you.

Would you be able to provide an example that reproduces the issue at all? That way we might be able to engineer a workaround for you.

Hello Cameron,

I seem to have fixed the issue by customizing three properties:

  1. A Streaming Scheduled Delay set to 16258 samples. Pretty much doubling the default value.
  2. A Scheduled Delay of 16000 samples on the music event (half a second)
  3. A Scheduled Look-ahead of 48000 samples on the music event (1 second)

I think the Look-ahead is what really made this fix work.

I don’t consider this a 100% success as I have lost some responsiveness to our “intro to main” song state; but it is still a much better proposition than the bug we were previously experiencing.

May I keep pushing the idea to the whole FMOD team for a pre-loading / buffer option for streamed assets? Something akin to what your main competitor does already :slight_smile: It would be great to see it coming in one of your next updates.

Cheers
Giacomo

Glad to hear you found a workaround.

We already have a task to add this behavior but there is currently no ETA for it, I’ll add a +1 to it to see if we can get it added sooner.

1 Like

Thank you Cameron!

resurrecting this post.
Do you have any update on when we can expect this feature?
Working on a new game with a similar music system and immediately encountered the same problem I had a few years ago so I am gonna try my same fix

Why don’t you simply deactivate the stream mode on those assets?

memory usage by audio in a lot of cases has to be low to make room for the game itself

RAM is unfortunately not infinite, but it’d be nice if it would be :slight_smile:

1 Like

because of memory considerations.
For the longest time, Wwise has had the ability of buffering streaming assets, I don’t see why FMOD shouldn’t too. I am actually surprised this features hasn’t made it yet to development.
Hopefully soon (as I keep pushing for it :wink: )

1 Like

From the manual:
“Because streaming assets are loaded as they play and must be buffered before they can begin playback, an instrument that plays a streaming asset may exhibit latency when triggered. It is therefore best to use non-streaming assets in instruments that require low latency.”

So the problem isn’t buffering per-se, is more about syncing the start of playback of streaming assets contained in the same event. Hence why my fix seems to work.
My brain tells me that the expected behavior for such things should be that all streams triggered within the same event, whether using regular single-multi instruments or event instruments or even command inst. should sync up naturally… again, assuming that buffering isn’t the real issue, but more a time-schedule thing.

1 Like