0
0

Hello again,

I’ve a serious issue with the update function:
I’m working on a FMOD implementation of a game sound library. This lib stream all sound by itself so i create all sounds on fmod with createStream and OPEN_USER flag, and fill sound data inside a read callback passed in fmod sound parameters.

This just work fine (except some minor latency).

After 20-25 min of playtest, the fmod thread just crash (access violation). So i though about some multi thread memory problem on my side and decide to critical section my callback just to prevent any problem.

At this point my problem raise : instead crashing, the fmod system update function do not want to finish ! Frozing my main thread (All others threads still running just fine, and there no wait for some critical section to release).

Debuggin disassembly give me than a small section of the function loop forever.
I know this is just weird but any suggestion about this ? It just drive me crazy <_<

  • You must to post comments
0
0

[quote:3hrx9br5]FMOD_CHANNEL_CALLBACKTYPE_END[/quote:3hrx9br5]
This is inside the main thread but have been issues with people trying to clean up sound objects using Sound::release inside this callback but it doesn’t sound like you’re doing that here.

[quote:3hrx9br5]FMOD_CREATESOUNDEXINFO.pcmreadcallback[/quote:3hrx9br5]
This is called from the mixer thread and can cause race conditions but it sounds like you’re code is threadsafe.

From the information you have provided it sounds like you’re doing everything right. It’s hard for me to diagnose the problem, everything sounds quite standard. Would you be able to try to reproduce the issue outside your engine by modifiying one of the examples and send it to support@fmod.org?

  • You must to post comments
0
0
  1. Are you calling FMOD from multiple threads?
  2. What callbacks are you using, and what code are you calling inside the callbacks?
  3. Could your critical section be causing a deadlock?
  • You must to post comments
0
0

Thanks for your time ^^
1: nope i’m calling fmod only from my main thread

2:
I’m using a channel callback, with nearly no code : a switch to catch FMOD_CHANNEL_CALLBACKTYPE_END, and inside this case, a channel->getUserData followed by an atomic operation on my data if function result FMOD_OK

And a FMOD_CREATESOUNDEXINFO.pcmreadcallback with following code :
channel->getUserData give my sound object.
i take my buffer from a queue thread safe on this object
then memcopy my buffered data on fmod void* data (with the right size and checks)

(here i’ve put some critical section to be sure)

3: no deadlock possible from this critical (and also, when freezing, criticals sections are not involved)

  • You must to post comments
0
0

could not reproduce outside.

But i changed my sound management to avoid this problem.
Thanks anyway ^^

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.