Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to change BufferSize on Windows. #544

Open
CaseyB opened this issue Feb 21, 2021 · 2 comments
Open

Unable to change BufferSize on Windows. #544

CaseyB opened this issue Feb 21, 2021 · 2 comments

Comments

@CaseyB
Copy link

CaseyB commented Feb 21, 2021

I'm running into latency issues on Windows. When I iterate over the SupportedStreamConfigs I only get one option:

SupportedStreamConfigRange { channels: 4, min_sample_rate: SampleRate(48000), max_sample_rate: SampleRate(48000), buffer_size: Unknown, sample_format: F32 }

And when I try to change the buffer size to anything other than BufferSize::Default it tells me

The requested stream configuration is not supported by the device.

I'm kind of at a loss for where to go from here.

@downfall85
Copy link

Hello CaseyB,

I assume that you try to use WASAPI on Windows ? Right now, you can't choose the buffer size with this host, it's not implemented. By default, cpal try to get the smalest possible buffer. There is already on issue for that (#534). But you have to know that with WASAPI, you can't really choose the buffer size. You can ask for a buffer size and WASPI will try to give it to you but you have no warranty. you can check here : https://docs.microsoft.com/en-us/windows/win32/api/audioclient/nf-audioclient-iaudioclient-initialize (If the call succeeds, the method allocates a buffer that is a least this large). I did some test and the buffer size may vary over time. If you need precise buffer size, you should try Asio host. By the way, if you succed, I am interested since I can't get it to work (#539).

@YPares
Copy link

YPares commented Apr 11, 2024

In such case, is there a way to know ahead of time the buffer size that we will receive? Or a sensible upper bound for it? (I need it to implement de-interlacing of the channels)
Because the upper bound I get from the default config is just gigantic: buffer_size: Range { min: 0, max: 4294967295 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants