Playing events micro-freezes the CPU

Hello there,

We stumbled upon a weird performance issue on a new game running on FMOD 2.02.x (which we didn’t have on our previous title on FMOD 2.00.x). Our Studio setup and game code remain the same.

Every time we do…

// using the raw C# C-API wrapper
eventInstance.start(); // non persistant event

… there is a noticeable CPU freeze for a few frames.

But there’s something more puzzling to this:

  • sample data are properly loaded before playing
  • after some time (not dependent to further plays), the freezes disappear;
  • after playing an unreleased event just once (which will freeze), any subsequent plays (being released or not) will not freeze;
  • it seems bound to which CPU core FMOD is currently running on;
  • the freeze happens upon playing, not upon stopping (verified with longer sounds)

So our current workaround is to play a dummy event without releasing it when we initialize FMOD, and then no freeze will occur on subsequent plays (being released or not).

Is there anything that we missed?

EDIT: tested throughout 2.02.06 to 2.02.11 with a consistent behavior.

It is related to using convolution reverb.

We understand that convolutions are more expensive (we’ll be using normal reverb), though it seems peculiar that performances are fine whenever there’s an existing instance in the pool (it seems to only happen when the pool is empty). Here’s some profiling data.