0
0

I made a plugin for FMOD using SC68 lib to play .sc68 songs. It says in the docs that SC68 isn’t thread safe.

When I use the playsound example FMOD crashes when I try to play two sounds simultaneously, and I guess that’s the reason.

Is there any way to make this working? I don’t know how FMOD/Windows handle plugins/dll’s, but can you somehow make the sounds use independent instances of the plugin to avoid data corruption?

  • You must to post comments
0
0

Try just wrapping your code with a global criticalsection.
See CreateCriticalSection, EnterCriticalSection, LeaveCriticalSection in the win32 api.

  • You must to post comments
0
0

Ok, so in other words the solution is "make the library thread-safe".

That’s far too complicated though, you really have to dig in deep into it and know how it works.

So what you’re saying is there is no way to use a library with FMOD that isn’t thread-safe.

  • You must to post comments
0
0

No, he means to wrap your functions with EnterCriticalSection/LeaveCriticalSection assuring that any call that’s made to your code is running in only one thread at any given time. The result is that even though the library is not thread safe its code will never be running in parallel.

  • You must to post comments
0
0

Oh ok. I’ll have a look at that then, thanks.

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.