Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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-09

### Changed

- Reverted SemVer-breaking `DeviceBusy` error variant addition.

## [0.17.2] - 2026-02-08 [YANKED]

### Added

Expand Down Expand Up @@ -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
Expand Down
16 changes: 0 additions & 16 deletions src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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.")
}
}
Expand All @@ -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.
Expand All @@ -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.")
}
Expand All @@ -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
Expand All @@ -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.")
}
Expand Down
17 changes: 6 additions & 11 deletions src/host/alsa/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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
Expand Down