Looping BGM is stopping randomly

We’ve got a problem with our bgm stopping mid game after a varying timeframe with no obvious cause.
We have debugged the code to see if any stop audio type commands are being called but nothing seems to be triggering it.

Any clues?

It seems like its happening when another event is played, but its not all the time, and its not always the same event that triggers it…

You should record a profile capture. To do that, enable live update in the Unity integration and connect via FMOD Studio when the game is running.

After you record a profile capture you can switch around what info is displayed with a control panel at the top of the window. One of the options is the lifetime view, which shows event instances as lines that clearly show when they start and stop.

Using this you can confirm that it is stopping, as opposed to the volume being set to 0 or some other parameter change that might cause it.

If the event is stopping, then it might be:
1.) Because the event was stopped with a stop() command
2.) Because the event is constantly being restarted with start() commands
3.) Because the event finished its timeline, and nothing was playing on a parameter - in this case add a sustain point to the timeline to stop it from finishing naturally.
4.) Because the bank was unloaded while the event is playing
5.) Because of event polyphony (unlikely for music, but worth checking)
6.) Because of bus polyphony on a parent bus the music is feeding into

If the event lifetime shows it keeping playing, but sound stops coming out, it may be due to the event or bus volume being set, or mute being set.

If you record a profile session that demonstrates the problem, and you can’t see what is going on, you can contact support and send the profile capture and project metadata, and we can investigate.