rodio icon indicating copy to clipboard operation
rodio copied to clipboard

Playback stuttering

Open vyfor opened this issue 1 year ago • 4 comments

Hello, I'm facing noticeable audio stutters whenever I switch between applications (e.g. by Alt+Tabbing). When the same issue occurred in cpal, I simply set the buffer size to be a Fixed(4096) and that fixed the problem. However, I'm not quite sure if I can do the same in rodio. Here's how I tried to do it:

let default_config = device.default_output_config()?;
let config = SupportedStreamConfig::new(
    default_config.channels(),
    default_config.sample_rate(),
    SupportedBufferSize::Range {
        min: BUFFER_SIZE,
        max: BUFFER_SIZE,
    },
    default_config.sample_format(),
);
let (_, _) = OutputStream::try_from_device_config(&device, config)?;

But no matter how low or high I set the BUFFER_SIZE, I still experience the stutters. Running on Windows 10.

vyfor avatar Jul 04 '24 18:07 vyfor

#512 seems to fix the issue.

vyfor avatar Jul 04 '24 19:07 vyfor

#512 seems to fix the issue.

good to know! We might have to change the default then. If we do that now audio latency will increase (cant imagine 4096 is a problem for anyone) but to be sure I wanna wait till after applying #512. And I'am waiting with #512 till I have time to work through some other breaking changes so we can bundle them in one release and add a migration guide to that.

yara-blue avatar Jul 04 '24 20:07 yara-blue

Is your system under high cpu load when it stutters?

yara-blue avatar Jul 06 '24 20:07 yara-blue

Is your system under high cpu load when it stutters?

As far as I tested, I haven't experienced such issues.

vyfor avatar Jul 07 '24 05:07 vyfor