Multiple operations on same instance in same game frame

How does FMOD handle multiple calls to the same instance in the same frame? So eg assume this pseudo code is part of the game loop

FMOD::Studio::System system;
FMOD::Studio::EventInstance instance;
instance.start();
// some code
instance.start();
// some code
instance.start();
// some code
system.update();

Will this be one start? or multiple starts?

And similar question for this one:

FMOD::Studio::System system;
FMOD::Studio::EventInstance instance;
instance.start();
// some code
instance.stop();
// some code
instance.start();
instance.release();
// some code
instance.start();
// some code
instance.stop();
// some code
system.update();

Assuming you’re running in the default asynchronous processing mode, commands will be:

  1. Enqueued sequentially in the command buffer on the main thread when called
  2. Submitted to the update thread when the system.update() is called
  3. Executed on the update thread in the order the commands are present in the command buffer (i.e. calling order)

As a result, all commands enqueued will be executed, even if they would be repeated in a way that isn’t observable - i.e. the instance in your first snippet will be started, then restarted twice, even if the observable outcome is just that it starts.

The instance in your second snippet will:

  1. Start
  2. Stop
  3. Start
  4. Be marked for release
  5. Restart
  6. Stop
  7. Ultimately, release due to being in a stopped state while marked for release when the system updates

You can read more about the asynchronous processing model that Studio uses in the Studio System Processing section of the Studio API Guide.