You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
alsa: update to alsa-rs 0.11 and fix device access issues (#1085)
* chore(alsa): bump alsa-rs to 0.11
* feat(alsa): add Debug derives
* feat(alsa): improve error handling
* fix(alsa): suppress raw ALSA errors during enumeration on Linux
* fix(alsa): remove device handle caching to fix duplex config queries
Remove handle caching introduced in #506. The caching held devices open
during enumeration, which prevented querying both input and output configs
on duplex devices (EBUSY errors) and blocked other applications from
accessing the devices.
For the rare hardware where rapid open/close is problematic (like some
NVIDIA HDMI cards), applications can now implement retry logic using the
new DeviceBusy error variant, which separates retriable errors (EBUSY,
EAGAIN) from permanent failures (ENOENT, EPERM, etc).
* feat(alsa): properly check and free ALSA global config
When the last Host is dropped, free the global ALSA config cache via
alsa::config::update_free_global. This reduces Valgrind errors.
* chore(alsa): raise MSRV to 1.82
* chore: bump overall MSRV to 1.78 and update CI
Fixes:
- #384
- #615
- #634
/// The device no longer exists. This can happen if the device is disconnected while the
123
123
/// program is running.
124
124
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,
125
128
/// We called something the C-Layer did not understand
126
129
InvalidArgument,
127
130
/// See the [`BackendSpecificError`] docs for more information about this error variant.
@@ -133,6 +136,7 @@ impl Display for SupportedStreamConfigsError {
133
136
matchself{
134
137
Self::BackendSpecific{ err } => err.fmt(f),
135
138
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."),
136
140
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.")
0 commit comments