FMOD Ex - THREAD UNSAFE

There is an article in FMOD Ex documentation talking about thread safety.

Here is an excert of the REALLY important part of the article:

Thread safety, Firelight Technologies FMOD Ex

Do not call FMOD commands from different threads! This will lead to instability, corruption and possible crashes.

Some people are tempted to put System::update into a separate thread, do not do this.
To make FMOD thread safe would involve wrapping every FMOD function in a critical section, which adds unnecessary overhead, so at this time FMOD Ex is remaining 'not thread safe' for the time being.

This means that you SHOULD make the FMOD Ex calls from a unique thread.

You can't have a thread for the creation, another for updating the system, a third for music management ...
 

If you use more than one thread for FMOD Ex, you could have major bad effects like NO OUTPUT SOUND, SOUND BUT PLAYING TOO FAST, NO SOUND & PLAYING TOO FAST, ...
It can really happened, I've experience all these bad effects.


For 'classic' applications, these effects can be silent. But, when you want to deploy it with Java Web Start, your application will act strangely. These strange effects are the consequence of thread unsafe of FMOD Ex.

I don't know why bad effects become effective for JWS applications, where mostly there is no problems when they are executed 'classicly'.
 

Put all call in same thread !
 

By experimentation, the problem come predominantly from System_Create, System.init and System.update not in the same thread.

So at least, put the initialization step and update in the same thread.

 

Last modified on 18/11/2006
Copyright © 2004-2010 Jérôme JOUVIE - All rights reserved. http://jerome.jouvie.free.fr/