Update alsa and nix dependencies

Also fixes the build.
This commit is contained in:
est31 2021-10-31 23:34:53 +01:00
parent b26f8be21f
commit 8e616c3dd9
2 changed files with 8 additions and 13 deletions

View file

@ -28,8 +28,8 @@ parking_lot = "0.11"
lazy_static = "1.4" lazy_static = "1.4"
[target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))'.dependencies] [target.'cfg(any(target_os = "linux", target_os = "dragonfly", target_os = "freebsd"))'.dependencies]
alsa = "0.5" alsa = "0.6"
nix = "0.21" nix = "0.23"
libc = "0.2.65" libc = "0.2.65"
parking_lot = "0.11" parking_lot = "0.11"
jack = { version = "0.7.0", optional = true } jack = { version = "0.7.0", optional = true }

View file

@ -242,12 +242,8 @@ impl Device {
.map_err(|e| (e, e.errno())); .map_err(|e| (e, e.errno()));
let handle = match handle_result { let handle = match handle_result {
Err((_, Some(nix::errno::Errno::EBUSY))) => { Err((_, nix::errno::Errno::EBUSY)) => return Err(BuildStreamError::DeviceNotAvailable),
return Err(BuildStreamError::DeviceNotAvailable) Err((_, nix::errno::Errno::EINVAL)) => return Err(BuildStreamError::InvalidArgument),
}
Err((_, Some(nix::errno::Errno::EINVAL))) => {
return Err(BuildStreamError::InvalidArgument)
}
Err((e, _)) => return Err(e.into()), Err((e, _)) => return Err(e.into()),
Ok(handle) => handle, Ok(handle) => handle,
}; };
@ -306,11 +302,10 @@ impl Device {
.map_err(|e| (e, e.errno())); .map_err(|e| (e, e.errno()));
let handle = match handle_result { let handle = match handle_result {
Err((_, Some(nix::errno::Errno::ENOENT))) Err((_, nix::errno::Errno::ENOENT)) | Err((_, nix::errno::Errno::EBUSY)) => {
| Err((_, Some(nix::errno::Errno::EBUSY))) => {
return Err(SupportedStreamConfigsError::DeviceNotAvailable) return Err(SupportedStreamConfigsError::DeviceNotAvailable)
} }
Err((_, Some(nix::errno::Errno::EINVAL))) => { Err((_, nix::errno::Errno::EINVAL)) => {
return Err(SupportedStreamConfigsError::InvalidArgument) return Err(SupportedStreamConfigsError::InvalidArgument)
} }
Err((e, _)) => return Err(e.into()), Err((e, _)) => return Err(e.into()),
@ -735,7 +730,7 @@ fn poll_descriptors_and_prepare_buffer(
let status = stream.channel.status()?; let status = stream.channel.status()?;
let avail_frames = match stream.channel.avail() { 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) return Ok(PollDescriptorsFlow::XRun)
} }
res => res, res => res,
@ -818,7 +813,7 @@ fn process_output(
} }
loop { loop {
match stream.channel.io_bytes().writei(buffer) { 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 // buffer underrun
// TODO: Notify the user of this. // TODO: Notify the user of this.
let _ = stream.channel.try_recover(err, false); let _ = stream.channel.try_recover(err, false);