Hello Guys
Use FMOD_NONBLOCKING Flag To Create Steam Sound Duration 25s,when The Sound Openstate is FMOD_OPENSTATE_PLAYING I Call ReleaseSound to destroy it, ReleaseSound process stalling the main thread about 8ms,what can i do to avoid ReleaseSound talling the main thread?why does releasesound take so much time?@cameron-fmod
If the Stream is FMOD_OPENSTATE_PLAYING
, the Sound::release
call must wait until the stream thread has finished its current update pass before the stream can be safely released. To avoid any stall make sure you stop the stream first.
Hi mathew
Thank you reply ,I will judge whether the current state of sound is FMOD_OPENSTATE_READY If not, stop first and wait for FMOD_OPENSTATE_READY Release again, but there is a huge problem of thread consumption. What is the thread doing? Why is it consuming so much? There were about 50 sound in the system at that time.
To get some more information about how much CPU is being used by streaming, consider using System::getCPUUsage. If you have a lot of streaming content, consider loading some as FMOD_CREATECOMPRESSEDSAMPLE.
A post was split to a new topic: Pitch issues with 3D sounds
I used FMOD_CREATECOMPRESSEDSAMPLE to create sound, why to cost much CPU at the DSP process. Used the flag to creating sound should be hardware decoding, why use FMOD_CREATECOMPRESSEDSAMPLE the CPU cost is higher than not used it. The following are the results of my sound test using 50 different FSB Vorbis files, the sounds hadn’t stream sound.
used FMOD_CREATECOMPRESSEDSAMPLE:
used FMOD_CREATESAMPLE
When you play sounds as compressed samples your memory is lower because the audio data remains compressed in memory. CPU usage will be higher because chunks of the sound are decoded regularly on the CPU (there is no hardware offload for Vorbis). When you load as sample, the entire file is decoded up front, this uses a lot of memory but has very low runtime CPU cost.
thank you reply
if I want to support hardware decoded in Mobile Device (for example Qualcomm \ Kirin \ MTK \ IOS ), what should sound format?
There is no guaranteed hardware decoding available on mobile devices, you must use CPU decoding for most of your sounds. To support music playback, most phones can decode a single stream (mono or stereo) of AAC in hardware, that is all.
hi mathew
My program ready to increase FMOD Core API version , But I don’t know which version is more stable.my current version is 93157
The most stable version available at the moment is 2.00.13 (build 112159).
hi mathew
my program has a crash in sound release,I use FMOD_System_CreateSound ,create mode is:FMOD_OPENMEMORY | FMOD_NONBLOCKING
the crash stack:
Would you be able to send an example that can reproduce that crash?
Looking through the code, when creating a sound with open memory and non-blocking, the sound should not still have a codec to release when releasing the sound (I would expect that with a streaming sound). So I am not sure what conditions would allow that callstack to occur.
thank your reply
The crash probability is very low,so I can’t reproduce.
Well, the callstack seems to indicate that the issue is occuring with an ogg vorbis file. It’s possible that there’s an issue with a specific vorbis file, so it may be worth trying to identify if it is just one file that this is occurring with.