I’ve gotten everything working so far, but I added the FMOD_NONBLOCKING flag to the createSound() call and then poll before allowing playback to begin, it still seems to block, or at least pause, on that call. I have removed calls to other FMOD functions to isolate it down to the creation call. I followed all of the procedures outlined in the non-blocking tutorial. As far as I know (our game’s codebase is wide and I haven’t studied all of it) all of the fmod calls occur from the same thread, including the fmod system update call.
Is there some other step necessary to using the non-blocking flag correctly?
EDIT : I meant to mention that I am also using the FMOD_OPENMEMORYPOINT and FMOD_CREATECOMPRESSEDSAMPLE, as I want fmod to use the sample data already in memory instead of creating its own copy. Or at least that’s how I understand the operation of those flags from the documentation. I don’t know if these flags affect the operation of createSound() or not.
- BruceC asked 10 years ago
FMOD_NONBLOCKING does nothing but allocate some memory, then put that memory onto a queue and signal a semaphore.
Have you got slow custom memory allocators? What platform are you talking about? The createSound call does next to nothing when you use nonblocking so there shouldnt be any stall.
[quote="brett":iotnpqmj]FMOD_NONBLOCKING does nothing but allocate some memory, then put that memory onto a queue and signal a semaphore.
Have you got slow custom memory allocators? What platform are you talking about? The createSound call does next to nothing when you use nonblocking so there shouldnt be any stall.[/quote:iotnpqmj]
This is on the XBox360, and is not using a custom allocator (unless our tech guys haven’t told us about it).
Is there a penalty for multiple createSound() calls on the same frame?
I looked more closely and this was only happening for sounds with multiple tracks, which I implemented by creating an FMOD sound for each track in our sound. So I might wind up calling createSound() five or six times for each sound created. When I switched it to only create the first track when our sound asset is created, then only call createSound() for other tracks when they are requested, it fixed the hitch. Ultimately, I expect this to be a moot point as we plan to switch for the native FMOD format and sound designer for multi-track sounds, which I am hoping will not have the overhead of multiple createSound() calls that I’m seeing. Still, any insight into what I might have done wrong is appreciated.
- BruceC answered 10 years ago
Please login first to submit.