Skip to content

Clamp the default buffer size to what the device supports - #914

Open
benface wants to merge 1 commit into
RustAudio:masterfrom
benface:fix/clamp-buffer-size-to-device-range
Open

Clamp the default buffer size to what the device supports#914
benface wants to merge 1 commit into
RustAudio:masterfrom
benface:fix/clamp-buffer-size-to-device-range

Conversation

@benface

@benface benface commented Aug 6, 2026

Copy link
Copy Markdown

from_device picks a 50 ms buffer without checking what the device accepts. My AirPods only take 15–960 frames, so it asks for 2048, and cpal 0.18 refuses a fixed size outside the supported range — the stream never opens.

open_default_sink then walks the other devices and takes the first that opens. On my machine that's a virtual output from a screen recorder, so the audio plays somewhere nobody can hear. That part surprised me more than the failure itself.

The range is already in default_config, so this clamps to it. OutputConfig::from in the speakers API does the same thing, just spelled out over four match arms.

Might be #900 as well — same "worked on crates.io, unsupported device on master" shape, on Windows.

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

Successfully merging this pull request may close these issues.

1 participant