From 34ffc531376376e4ffd669f9f4c6b9fcc9053fe7 Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Mon, 9 Feb 2026 21:40:45 +0100 Subject: [PATCH 1/3] chore: revert SemVer-breaking DeviceBusy error variant --- CHANGELOG.md | 7 +++++++ src/error.rs | 16 ---------------- src/host/alsa/mod.rs | 17 ++++++----------- 3 files changed, 13 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index fdf08ece8..ce9bae8c3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ 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.3] - 2026-02-09 + +### Changed + +- Reverted SemVer-breaking `DeviceBusy` error variant addition. + ## [0.17.2] - 2026-02-08 ### 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/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 From c44ad1f5b2937ac27f4c27d8b144c9ceea4741c6 Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Mon, 9 Feb 2026 21:50:30 +0100 Subject: [PATCH 2/3] docs: mark 0.17.2 as yanked in CHANGELOG --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ce9bae8c3..85a3ead71 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Reverted SemVer-breaking `DeviceBusy` error variant addition. -## [0.17.2] - 2026-02-08 +## [0.17.2] - 2026-02-08 [YANKED] ### Added From 5f91c7982bbc941dcf431709798209bf18665f7b Mon Sep 17 00:00:00 2001 From: Roderick van Domburg Date: Tue, 17 Feb 2026 20:10:29 +0100 Subject: [PATCH 3/3] chore: prepare for v0.17.3 release --- CHANGELOG.md | 2 +- Cargo.toml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 85a3ead71..df4db45a3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,7 +5,7 @@ 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.3] - 2026-02-09 +## [0.17.3] - 2026-02-17 ### Changed 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"