File tree Expand file tree Collapse file tree 3 files changed +12
-4
lines changed
Expand file tree Collapse file tree 3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 11# Unreleased
22
3+ - ALSA(process_output): pass ` silent=true ` to ` PCM.try_recover ` , so it doesn't write to stderr
4+
35# Version 0.15.3 (2024-03-04)
46
57- Add ` try_with_sample_rate ` , a non-panicking variant of ` with_sample_rate ` .
Original file line number Diff line number Diff line change 11[package ]
22name = " cpal"
3- version = " 0.15.3 "
3+ version = " 0.15.4 "
44description = " Low-level cross-platform audio I/O library in pure Rust."
55repository = " https://github.com/rustaudio/cpal"
66documentation = " https://docs.rs/cpal"
Original file line number Diff line number Diff line change @@ -834,9 +834,15 @@ fn process_output(
834834 loop {
835835 match stream. channel . io_bytes ( ) . writei ( buffer) {
836836 Err ( err) if err. errno ( ) == libc:: EPIPE => {
837- // buffer underrun
838- // TODO: Notify the user of this.
839- let _ = stream. channel . try_recover ( err, false ) ;
837+ // ALSA underrun or overrun.
838+ // See https://github.com/alsa-project/alsa-lib/blob/b154d9145f0e17b9650e4584ddfdf14580b4e0d7/src/pcm/pcm.c#L8767-L8770
839+ // Even if these recover successfully, they still may cause audible glitches.
840+
841+ // TODO:
842+ // Should we notify the user about successfully recovered errors?
843+ // Should we notify the user about failures in try_recover, rather than ignoring them?
844+ // (Both potentially not real-time-safe)
845+ _ = stream. channel . try_recover ( err, true ) ;
840846 }
841847 Err ( err) => {
842848 error_callback ( err. into ( ) ) ;
You can’t perform that action at this time.
0 commit comments