File tree 3 files changed +12
-4
lines changed
3 files changed +12
-4
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
2
3
+ - ALSA(process_output): pass ` silent=true ` to ` PCM.try_recover ` , so it doesn't write to stderr
4
+
3
5
# Version 0.15.3 (2024-03-04)
4
6
5
7
- Add ` try_with_sample_rate ` , a non-panicking variant of ` with_sample_rate ` .
Original file line number Diff line number Diff line change 1
1
[package ]
2
2
name = " cpal"
3
- version = " 0.15.3 "
3
+ version = " 0.15.4 "
4
4
description = " Low-level cross-platform audio I/O library in pure Rust."
5
5
repository = " https://github.com/rustaudio/cpal"
6
6
documentation = " https://docs.rs/cpal"
Original file line number Diff line number Diff line change @@ -834,9 +834,15 @@ fn process_output(
834
834
loop {
835
835
match stream. channel . io_bytes ( ) . writei ( buffer) {
836
836
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 ) ;
840
846
}
841
847
Err ( err) => {
842
848
error_callback ( err. into ( ) ) ;
You can’t perform that action at this time.
0 commit comments