cpal icon indicating copy to clipboard operation
cpal copied to clipboard

[WASAPI] Using fixed buffer size when the only available output config shows 'Unknown' buffer size ?

Open the-drunk-coder opened this issue 4 years ago • 1 comments

I was trying to set a fixed buffer size on Windows/WASAPI, but as a result I only get the message that the device doesn't support this configuration, no matter which buffer size I try.

When checking the available configurations, the buffer size is set to Unknown. Does that mean it's generally impossible to set a fixed buffer size in this situation? Or does cpal just check against the available config and, seeing that there is none that supports the requested size, returns an error ?

I'm not super familiar with the windows audio world, so I'm not sure what the WASAPI capabilities are ...

the-drunk-coder avatar Jan 22 '21 08:01 the-drunk-coder

I'm running into issues with this as well. It doesn't look like CPAL currently supports Fixed buffer sizes on WASAPI. It looks like WASAPI itself supports fixed buffer sizes, so this should be possible to implement. Setting aside not being able to choose a buffer size, I'm not even able to get a constant buffer size - on my machine, for an output stream the first callback expects 1056 samples per channel, and every callback after that wants 480 per channel.

calvinkosmatka avatar Feb 01 '21 03:02 calvinkosmatka