Skip to content

Commit 51f0b85

Browse files
authored
chore: revert SemVer-breaking DeviceBusy error variant (#1102)
1 parent 5cceb49 commit 51f0b85

4 files changed

Lines changed: 15 additions & 29 deletions

File tree

CHANGELOG.md

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ All notable changes to this project will be documented in this file.
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8-
## [0.17.2] - 2026-02-08
8+
## [0.17.3] - 2026-02-17
9+
10+
### Changed
11+
12+
- Reverted SemVer-breaking `DeviceBusy` error variant addition.
13+
14+
## [0.17.2] - 2026-02-08 [YANKED]
915

1016
### Added
1117

@@ -1059,6 +1065,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
10591065

10601066
- Initial commit.
10611067

1068+
[0.17.3]: https://github.com/RustAudio/cpal/compare/v0.17.2...v0.17.3
10621069
[0.17.2]: https://github.com/RustAudio/cpal/compare/v0.17.1...v0.17.2
10631070
[0.17.1]: https://github.com/RustAudio/cpal/compare/v0.17.0...v0.17.1
10641071
[0.17.0]: https://github.com/RustAudio/cpal/compare/v0.16.0...v0.17.0

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "cpal"
3-
version = "0.17.2"
3+
version = "0.17.3"
44
description = "Low-level cross-platform audio I/O library in pure Rust."
55
repository = "https://github.com/RustAudio/cpal"
66
documentation = "https://docs.rs/cpal"

src/error.rs

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -122,9 +122,6 @@ pub enum SupportedStreamConfigsError {
122122
/// The device no longer exists. This can happen if the device is disconnected while the
123123
/// program is running.
124124
DeviceNotAvailable,
125-
/// The device is temporarily busy. This can happen when another application or stream
126-
/// is using the device. Retrying after a short delay may succeed.
127-
DeviceBusy,
128125
/// We called something the C-Layer did not understand
129126
InvalidArgument,
130127
/// See the [`BackendSpecificError`] docs for more information about this error variant.
@@ -136,7 +133,6 @@ impl Display for SupportedStreamConfigsError {
136133
match self {
137134
Self::BackendSpecific { err } => err.fmt(f),
138135
Self::DeviceNotAvailable => f.write_str("The requested device is no longer available. For example, it has been unplugged."),
139-
Self::DeviceBusy => f.write_str("The requested device is temporarily busy. Another application or stream may be using it."),
140136
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.")
141137
}
142138
}
@@ -156,9 +152,6 @@ pub enum DefaultStreamConfigError {
156152
/// The device no longer exists. This can happen if the device is disconnected while the
157153
/// program is running.
158154
DeviceNotAvailable,
159-
/// The device is temporarily busy. This can happen when another application or stream
160-
/// is using the device. Retrying after a short delay may succeed.
161-
DeviceBusy,
162155
/// Returned if e.g. the default input format was requested on an output-only audio device.
163156
StreamTypeNotSupported,
164157
/// See the [`BackendSpecificError`] docs for more information about this error variant.
@@ -172,9 +165,6 @@ impl Display for DefaultStreamConfigError {
172165
Self::DeviceNotAvailable => f.write_str(
173166
"The requested device is no longer available. For example, it has been unplugged.",
174167
),
175-
Self::DeviceBusy => f.write_str(
176-
"The requested device is temporarily busy. Another application or stream may be using it.",
177-
),
178168
Self::StreamTypeNotSupported => {
179169
f.write_str("The requested stream type is not supported by the device.")
180170
}
@@ -195,9 +185,6 @@ pub enum BuildStreamError {
195185
/// The device no longer exists. This can happen if the device is disconnected while the
196186
/// program is running.
197187
DeviceNotAvailable,
198-
/// The device is temporarily busy. This can happen when another application or stream
199-
/// is using the device. Retrying after a short delay may succeed.
200-
DeviceBusy,
201188
/// The specified stream configuration is not supported.
202189
StreamConfigNotSupported,
203190
/// We called something the C-Layer did not understand
@@ -218,9 +205,6 @@ impl Display for BuildStreamError {
218205
Self::DeviceNotAvailable => f.write_str(
219206
"The requested device is no longer available. For example, it has been unplugged.",
220207
),
221-
Self::DeviceBusy => f.write_str(
222-
"The requested device is temporarily busy. Another application or stream may be using it.",
223-
),
224208
Self::StreamConfigNotSupported => {
225209
f.write_str("The requested stream configuration is not supported by the device.")
226210
}

src/host/alsa/mod.rs

Lines changed: 6 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -358,10 +358,9 @@ impl Device {
358358
Err((_, libc::ENOENT))
359359
| Err((_, libc::EPERM))
360360
| Err((_, libc::ENODEV))
361-
| Err((_, LIBC_ENOTSUPP)) => return Err(BuildStreamError::DeviceNotAvailable),
362-
Err((_, libc::EBUSY)) | Err((_, libc::EAGAIN)) => {
363-
return Err(BuildStreamError::DeviceBusy)
364-
}
361+
| Err((_, LIBC_ENOTSUPP))
362+
| Err((_, libc::EBUSY))
363+
| Err((_, libc::EAGAIN)) => return Err(BuildStreamError::DeviceNotAvailable),
365364
Err((_, libc::EINVAL)) => return Err(BuildStreamError::InvalidArgument),
366365
Err((e, _)) => return Err(e.into()),
367366
Ok(handle) => handle,
@@ -459,12 +458,11 @@ impl Device {
459458
Err((_, libc::ENOENT))
460459
| Err((_, libc::EPERM))
461460
| Err((_, libc::ENODEV))
462-
| Err((_, LIBC_ENOTSUPP)) => {
461+
| Err((_, LIBC_ENOTSUPP))
462+
| Err((_, libc::EBUSY))
463+
| Err((_, libc::EAGAIN)) => {
463464
return Err(SupportedStreamConfigsError::DeviceNotAvailable)
464465
}
465-
Err((_, libc::EBUSY)) | Err((_, libc::EAGAIN)) => {
466-
return Err(SupportedStreamConfigsError::DeviceBusy)
467-
}
468466
Err((_, libc::EINVAL)) => return Err(SupportedStreamConfigsError::InvalidArgument),
469467
Err((e, _)) => return Err(e.into()),
470468
Ok(pcm) => pcm,
@@ -615,9 +613,6 @@ impl Device {
615613
Err(SupportedStreamConfigsError::DeviceNotAvailable) => {
616614
return Err(DefaultStreamConfigError::DeviceNotAvailable);
617615
}
618-
Err(SupportedStreamConfigsError::DeviceBusy) => {
619-
return Err(DefaultStreamConfigError::DeviceBusy);
620-
}
621616
Err(SupportedStreamConfigsError::InvalidArgument) => {
622617
// this happens sometimes when querying for input and output capabilities, but
623618
// the device supports only one

0 commit comments

Comments
 (0)