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

Feature Request: read default buffer size from Stream, and/or query device's preferred buffer size #942

Open
j-n-f opened this issue Jan 25, 2025 · 1 comment

Comments

@j-n-f
Copy link

j-n-f commented Jan 25, 2025

With ASIO the driver will report a preferred buffer size, and I'm guessing this is what gets used when the default buffer size is chosen. It'd be nice to know what this value is before starting a stream.

Alternatively, one can use BufferSize::Fixed, but would need a way to query what that preferred buffer size is for some Host and Device.

Something like:

enum PreferredBufferSize {
    /// Device doesn't provide this information
    Unknown,
    /// Device can provide this information
    Fixed(usize),
}

let preferred_input_size = device.preferred_input_buffer_size();
@j-n-f
Copy link
Author

j-n-f commented Feb 1, 2025

Small correction: it seems like the "default" buffer size is just whatever buffer size the device is already set to. This may be device/driver specific behaviour.

What I'm looking for is the buffer size the device reports as optimal, where the driver doesn't have to split/combine blocks (i.e. usually the same as the device's internal buffer size).

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

1 participant