High callback rate not supported for macos
If i were to put a output device params as something like this
let out_device_params = OutputDeviceParameters {
sample_rate: 44000
channels_count: 2,
channel_sample_count: 1,
};
it would work very well with pulseaudio(i.e in linux), but with macos it seems the callback isn't called "fast enough" i.e it doesn't call it 44000 times in this case
This crate may not support output with very low latency, simply because it uses more or less high level OS APIs under the hood. 2 sample buffer is definitely some extreme values, given the fact that it stands for just ~22 microseconds. Instead, you should prefer having reasonably large buffer, for example 1/10th of sample rate will be 100ms which is already decently low latency for most applications.
I agree that very low buffer sizes as 1 samples could not be expected to work properly, but something like 64 to 256 samples should be ok.
Interestingly, I can get much lower buffer sizes with my old Intel MacPro running High Sierra than using a M2 Mac mini on macOS Sonoma with the same code. Something must have been changed in the scheduling of the OS with the newer versions.