I have two questions. One related to callback and another related with threading in FMOD.

I have a DSP unit which calls a READCALLBACK. The call back does some heavy compuatation on sample that is passed to it (FMOD passes it in chunks of 1024 samples). So my question is what happens to the samples if the callback takes more time then the rate at which samples are passed down the sound pipeline.

Are they queued or just dropped? The reason I want to know this is that when I play 3 sound sources and do some processing on each sample the sound plays soooo slowly and there is a lot of noise.

I have several thread running which update the data passed to the callback. And I am calling system->update() in each individual thread once I update the data. Is that ok?


  • You must to post comments

They are not queued or dropped, you are just stalling fmod’s thread so the sound hardware will repeat the buffer that hasnt been filled properly yet, so you get stuttering/repeating audio. This is called buffer underrun.

You can’t stall fmod’s thread – it is very timing sensitive and you have to be very fast. System::getCPUUsage will show the load you are exerting on the dsp system if you have a custom callback.

Do NOT call fmod commands from different threads. No it is not alright. This same topic comes up all the time and is explained in the documentation.

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.