From cf17ed5a7009138bc0313b794b997d8bfb70fb9f Mon Sep 17 00:00:00 2001 From: HEnquist Date: Wed, 9 Sep 2020 08:45:41 +0200 Subject: [PATCH] Show reason for retrying playback and capture --- src/alsadevice.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/alsadevice.rs b/src/alsadevice.rs index 3fc8db89..6b6a01e3 100644 --- a/src/alsadevice.rs +++ b/src/alsadevice.rs @@ -103,8 +103,8 @@ fn play_buffer(buffer: &[u8], pcmdevice: &alsa::PCM, io: &alsa::pcm::IO) -> } let _frames = match io.writei(&buffer[..]) { Ok(frames) => frames, - Err(_err) => { - warn!("Retrying playback"); + Err(err) => { + warn!("Retrying playback, error: {}", err); pcmdevice.prepare()?; let delay = Duration::from_millis(5); thread::sleep(delay); @@ -123,8 +123,8 @@ fn capture_buffer(buffer: &mut [u8], pcmdevice: &alsa::PCM, io: &alsa::pcm::IO frames, - Err(_err) => { - warn!("retrying capture"); + Err(err) => { + warn!("Retrying capture, error: {}", err); pcmdevice.prepare()?; io.readi(buffer)? } @@ -413,7 +413,7 @@ fn get_nbr_capture_bytes( buf: &mut Vec, ) -> usize { let capture_bytes_new = if let Some(resampl) = &resampler { - trace!("Resamper needs {} frames", resampl.nbr_frames_needed()); + trace!("Resampler needs {} frames", resampl.nbr_frames_needed()); resampl.nbr_frames_needed() * params.channels * params.store_bytes_per_sample } else { capture_bytes