Using APH to test a convolution plugin where folks are using higher sample rates and long FIR filters for digital room correction. Increasing the buffer size reduces CPU usage and audio dropouts.
On Windows, able to increase the buffer size to 8192 samples in juce_audio_devices_native_juce_WASAPI_windows_cpp:
Here is the APH code snippet on Mac where the max buffer size appears to be set to 2048 samples:
Array<int> getBufferSizesFromDevice() const
{
Array<int> newBufferSizes;
if (auto ranges = audioObjectGetProperties<AudioValueRange> (deviceID, {kAudioDevicePropertyBufferFrameSizeRange,
kAudioObjectPropertyScopeWildcard,
juceAudioObjectPropertyElementMain },
err2log()); ! ranges.empty())
{
newBufferSizes.add ((int) (ranges[0].mMinimum + 15) & ~15);
for (int i = 32; i <= 2048; i += 32)
{
for (auto range = ranges.rbegin(); range != ranges.rend(); ++range)
{
if (i >= range->mMinimum && i <= range->mMaximum)
{
newBufferSizes.addIfNotAlreadyThere (i);
break;
}
}
}
if (bufferSize > 0)
newBufferSizes.addIfNotAlreadyThere (bufferSize);
}
if (newBufferSizes.isEmpty() && bufferSize > 0)
newBufferSizes.add (bufferSize);
return newBufferSizes;
}
One can change: for (int i = 32; i <= 2048; i += 32) to 4096 and that works, but won’t work with 8192.
It seems kAudioDevicePropertyBufferFrameSizeRange max size is set to 4096.
Any ideas how to set the buffer size max value to 8192 samples?
A quick check in Reaper shows one can set the buffer size to 8192 samples as well as JRiver on the Mac. One can set the max buffer size in APH on Windows to 8192 samples along with the Linux version of APH. Not sure why the limitation on Mac?