From 8e616c3dd9e7f5887aaa284a14b68e816dc1b099 Mon Sep 17 00:00:00 2001 From: est31 Date: Sun, 31 Oct 2021 23:34:53 +0100 Subject: [PATCH] Update alsa and nix dependencies Also fixes the build. --- Cargo.toml | 4 ++-- src/host/alsa/mod.rs | 17 ++++++----------- 2 files changed, 8 insertions(+), 13 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 232c475..fcb11de 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -28,8 +28,8 @@ parking_lot = "0.11" lazy_static = "1.4" [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))'.dependencies] -alsa = "0.5" -nix = "0.21" +alsa = "0.6" +nix = "0.23" libc = "0.2.65" parking_lot = "0.11" jack = { version = "0.7.0", optional = true } diff --git a/src/host/alsa/mod.rs b/src/host/alsa/mod.rs index 908d63c..5505bcc 100644 --- a/src/host/alsa/mod.rs +++ b/src/host/alsa/mod.rs @@ -242,12 +242,8 @@ impl Device { .map_err(|e| (e, e.errno())); let handle = match handle_result { - Err((_, Some(nix::errno::Errno::EBUSY))) => { - return Err(BuildStreamError::DeviceNotAvailable) - } - Err((_, Some(nix::errno::Errno::EINVAL))) => { - return Err(BuildStreamError::InvalidArgument) - } + Err((_, nix::errno::Errno::EBUSY)) => return Err(BuildStreamError::DeviceNotAvailable), + Err((_, nix::errno::Errno::EINVAL)) => return Err(BuildStreamError::InvalidArgument), Err((e, _)) => return Err(e.into()), Ok(handle) => handle, }; @@ -306,11 +302,10 @@ impl Device { .map_err(|e| (e, e.errno())); let handle = match handle_result { - Err((_, Some(nix::errno::Errno::ENOENT))) - | Err((_, Some(nix::errno::Errno::EBUSY))) => { + Err((_, nix::errno::Errno::ENOENT)) | Err((_, nix::errno::Errno::EBUSY)) => { return Err(SupportedStreamConfigsError::DeviceNotAvailable) } - Err((_, Some(nix::errno::Errno::EINVAL))) => { + Err((_, nix::errno::Errno::EINVAL)) => { return Err(SupportedStreamConfigsError::InvalidArgument) } Err((e, _)) => return Err(e.into()), @@ -735,7 +730,7 @@ fn poll_descriptors_and_prepare_buffer( let status = stream.channel.status()?; let avail_frames = match stream.channel.avail() { - Err(err) if err.errno() == Some(nix::errno::Errno::EPIPE) => { + Err(err) if err.errno() == nix::errno::Errno::EPIPE => { return Ok(PollDescriptorsFlow::XRun) } res => res, @@ -818,7 +813,7 @@ fn process_output( } loop { match stream.channel.io_bytes().writei(buffer) { - Err(err) if err.errno() == Some(nix::errno::Errno::EPIPE) => { + Err(err) if err.errno() == nix::errno::Errno::EPIPE => { // buffer underrun // TODO: Notify the user of this. let _ = stream.channel.try_recover(err, false);