Decode Buffer Size is very high

Hi there, I can’t help but notice that when using the custom ring buffer through pcmreadcallback that the decode buffer size has to be set at an unusually high value to avoid popping and clicking. In my experience it seems like most audio programs work well with input buffer sizes of 128 samples or less for accurate realtime playback, but even the demo userCreatedSound absolutely chokes with a buffer size this small.
Am I doing something wrong here, or is this just a limitation?

2 Likes

There is some information about this in our docs for System::setDSPBufferSize and Studio API Threads white paper.

Hi cameron, do you have more info on this please?
I have this same issue and reading the docs is not helping much.

FMOD chooses the most optimal size by default for best stability, depending on the output type. It is not recommended changing this value unless you really need to. You may get worse performance than the default settings chosen by FMOD.

System::setDSPBufferSize
The FMOD software mixer mixes to a ringbuffer. The size of this ringbuffer is determined here. It mixes a block of sound data every ‘bufferlength’ number of samples, and there are ‘numbuffers’ number of these blocks that make up the entire ringbuffer. Adjusting these values can lead to extremely low latency performance (smaller values), or greater stability in sound output (larger values).

Warning! The ‘buffersize’ is generally best left alone. Making the granularity smaller will just increase CPU usage (cache misses and DSP network overhead). Making it larger affects how often you hear commands update such as volume/pitch/pan changes. Anything above 20ms will be noticeable and sound parameter changes will be obvious instead of smooth.