diff --git a/CHANGELOG.md b/CHANGELOG.md index fdf08ece8..df4db45a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). -## [0.17.2] - 2026-02-08 +## [0.17.3] - 2026-02-17 + +### Changed + +- Reverted SemVer-breaking `DeviceBusy` error variant addition. + +## [0.17.2] - 2026-02-08 [YANKED] ### Added @@ -1059,6 +1065,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Initial commit. +[0.17.3]: https://github.com/RustAudio/cpal/compare/v0.17.2...v0.17.3 [0.17.2]: https://github.com/RustAudio/cpal/compare/v0.17.1...v0.17.2 [0.17.1]: https://github.com/RustAudio/cpal/compare/v0.17.0...v0.17.1 [0.17.0]: https://github.com/RustAudio/cpal/compare/v0.16.0...v0.17.0 diff --git a/Cargo.toml b/Cargo.toml index 6ff7b9487..4a0e84b3b 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "cpal" -version = "0.17.2" +version = "0.17.3" description = "Low-level cross-platform audio I/O library in pure Rust." repository = "https://github.com/RustAudio/cpal" documentation = "https://docs.rs/cpal" diff --git a/src/error.rs b/src/error.rs index 4e4d1f6a9..016d7cdba 100644 --- a/src/error.rs +++ b/src/error.rs @@ -122,9 +122,6 @@ pub enum SupportedStreamConfigsError { /// The device no longer exists. This can happen if the device is disconnected while the /// program is running. DeviceNotAvailable, - /// The device is temporarily busy. This can happen when another application or stream - /// is using the device. Retrying after a short delay may succeed. - DeviceBusy, /// We called something the C-Layer did not understand InvalidArgument, /// See the [`BackendSpecificError`] docs for more information about this error variant. @@ -136,7 +133,6 @@ impl Display for SupportedStreamConfigsError { match self { Self::BackendSpecific { err } => err.fmt(f), Self::DeviceNotAvailable => f.write_str("The requested device is no longer available. For example, it has been unplugged."), - Self::DeviceBusy => f.write_str("The requested device is temporarily busy. Another application or stream may be using it."), Self::InvalidArgument => f.write_str("Invalid argument passed to the backend. For example, this happens when trying to read capture capabilities when the device does not support it.") } } @@ -156,9 +152,6 @@ pub enum DefaultStreamConfigError { /// The device no longer exists. This can happen if the device is disconnected while the /// program is running. DeviceNotAvailable, - /// The device is temporarily busy. This can happen when another application or stream - /// is using the device. Retrying after a short delay may succeed. - DeviceBusy, /// Returned if e.g. the default input format was requested on an output-only audio device. StreamTypeNotSupported, /// See the [`BackendSpecificError`] docs for more information about this error variant. @@ -172,9 +165,6 @@ impl Display for DefaultStreamConfigError { Self::DeviceNotAvailable => f.write_str( "The requested device is no longer available. For example, it has been unplugged.", ), - Self::DeviceBusy => f.write_str( - "The requested device is temporarily busy. Another application or stream may be using it.", - ), Self::StreamTypeNotSupported => { f.write_str("The requested stream type is not supported by the device.") } @@ -195,9 +185,6 @@ pub enum BuildStreamError { /// The device no longer exists. This can happen if the device is disconnected while the /// program is running. DeviceNotAvailable, - /// The device is temporarily busy. This can happen when another application or stream - /// is using the device. Retrying after a short delay may succeed. - DeviceBusy, /// The specified stream configuration is not supported. StreamConfigNotSupported, /// We called something the C-Layer did not understand @@ -218,9 +205,6 @@ impl Display for BuildStreamError { Self::DeviceNotAvailable => f.write_str( "The requested device is no longer available. For example, it has been unplugged.", ), - Self::DeviceBusy => f.write_str( - "The requested device is temporarily busy. Another application or stream may be using it.", - ), Self::StreamConfigNotSupported => { f.write_str("The requested stream configuration is not supported by the device.") } diff --git a/src/host/alsa/mod.rs b/src/host/alsa/mod.rs index 71d738633..71147c69c 100644 --- a/src/host/alsa/mod.rs +++ b/src/host/alsa/mod.rs @@ -358,10 +358,9 @@ impl Device { Err((_, libc::ENOENT)) | Err((_, libc::EPERM)) | Err((_, libc::ENODEV)) - | Err((_, LIBC_ENOTSUPP)) => return Err(BuildStreamError::DeviceNotAvailable), - Err((_, libc::EBUSY)) | Err((_, libc::EAGAIN)) => { - return Err(BuildStreamError::DeviceBusy) - } + | Err((_, LIBC_ENOTSUPP)) + | Err((_, libc::EBUSY)) + | Err((_, libc::EAGAIN)) => return Err(BuildStreamError::DeviceNotAvailable), Err((_, libc::EINVAL)) => return Err(BuildStreamError::InvalidArgument), Err((e, _)) => return Err(e.into()), Ok(handle) => handle, @@ -459,12 +458,11 @@ impl Device { Err((_, libc::ENOENT)) | Err((_, libc::EPERM)) | Err((_, libc::ENODEV)) - | Err((_, LIBC_ENOTSUPP)) => { + | Err((_, LIBC_ENOTSUPP)) + | Err((_, libc::EBUSY)) + | Err((_, libc::EAGAIN)) => { return Err(SupportedStreamConfigsError::DeviceNotAvailable) } - Err((_, libc::EBUSY)) | Err((_, libc::EAGAIN)) => { - return Err(SupportedStreamConfigsError::DeviceBusy) - } Err((_, libc::EINVAL)) => return Err(SupportedStreamConfigsError::InvalidArgument), Err((e, _)) => return Err(e.into()), Ok(pcm) => pcm, @@ -615,9 +613,6 @@ impl Device { Err(SupportedStreamConfigsError::DeviceNotAvailable) => { return Err(DefaultStreamConfigError::DeviceNotAvailable); } - Err(SupportedStreamConfigsError::DeviceBusy) => { - return Err(DefaultStreamConfigError::DeviceBusy); - } Err(SupportedStreamConfigsError::InvalidArgument) => { // this happens sometimes when querying for input and output capabilities, but // the device supports only one