Skip to content
Merged
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
11 changes: 9 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,20 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **ALSA**: Polling errors trigger underrun recovery instead of looping.
- **ALSA**: Try to resume from hardware after a system suspend.
- **ASIO**: `Device::driver`, `asio_streams`, and `current_callback_flag` are no longer `pub`.
- **ASIO**: Timestamps now include driver-reported hardware latency.
- **CoreAudio**: Timestamps now include device latency and safety offset.
- **JACK**: Timestamps now use the precise hardware deadline.
- **Linux/BSD**: Default host now is, in order from first to last available: PipeWire, PulseAudio, ALSA.
- **WASAPI**: Timestamps now include hardware pipeline latency.
- **WebAudio**: Timestamps now include base and output latency.
- **WebAudio**: Initial buffer scheduling offset now scales with buffer duration.

### Fixed

- Reintroduce `audio_thread_priority` feature.
- Fix numeric overflows in calls to create `StreamInstant` in ASIO, CoreAudio and JACK.
- **AAudio**: Fix thread lock when a stream is dropped before it fully starts.
- **AAudio**: Fix invalid capture and playback timestamps.
- **ALSA**: Fix capture stream hanging or spinning on overruns.
- **ALSA**: Fix non-monotonic `StreamInstant` during stream startup.
- **ALSA**: Fix spurious timestamp errors during stream startup.
Expand All @@ -46,8 +54,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **ASIO**: Fix device enumeration and stream creation failing when called from spawned threads.
- **CoreAudio**: Fix undefined behaviour and silent failure in loopback device creation.
- **Emscripten**: Fix build failure introduced by newer `wasm-bindgen` versions.
- **AAudio**: Fix thread lock when a stream is dropped before it fully starts.
- **AAudio**: Fix invalid capture and playback timestamps.
- **JACK**: Fix input capture timestamp using callback execution time instead of cycle start.

## [0.17.3] - 2026-02-18

Expand Down
6 changes: 6 additions & 0 deletions asio-sys/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ 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).

## [Unreleased]

### Added
- Added `Driver::latencies()`

## [0.2.6] - 2026-02-18

### Fixed
Expand Down Expand Up @@ -82,6 +87,7 @@ Initial release.
- Support for MSVC toolchain on Windows
- Basic error types: `AsioError`, `LoadDriverError`

[Unreleased]: https://github.com/RustAudio/cpal/compare/asio-sys-v0.2.6...HEAD
[0.2.6]: https://github.com/RustAudio/cpal/compare/asio-sys-v0.2.5...asio-sys-v0.2.6
[0.2.5]: https://github.com/RustAudio/cpal/compare/asio-sys-v0.2.4...asio-sys-v0.2.5
[0.2.4]: https://github.com/RustAudio/cpal/compare/asio-sys-v0.2.3...asio-sys-v0.2.4
Expand Down
7 changes: 7 additions & 0 deletions asio-sys/asio_stub_bindings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,13 @@ pub unsafe extern "C" fn ASIOGetChannels(_ins: *mut c_long, _outs: *mut c_long)
0
}
#[no_mangle]
pub unsafe extern "C" fn ASIOGetLatencies(
_in_latency: *mut c_long,
_out_latency: *mut c_long,
) -> ASIOError {
0
}
#[no_mangle]
pub unsafe extern "C" fn ASIOGetChannelInfo(_info: *mut ASIOChannelInfo) -> ASIOError {
0
}
Expand Down
1 change: 1 addition & 0 deletions asio-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,7 @@ fn create_bindings(cpal_asio_dir: &PathBuf) {
.allowlist_function("ASIOGetChannels")
.allowlist_function("ASIOGetChannelInfo")
.allowlist_function("ASIOGetBufferSize")
.allowlist_function("ASIOGetLatencies")
.allowlist_function("ASIOGetSamplePosition")
.allowlist_function("ASIOOutputReady")
.allowlist_function("get_sample_rate")
Expand Down
13 changes: 13 additions & 0 deletions asio-sys/src/bindings/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -458,6 +458,19 @@ impl Driver {
Ok(channel)
}

/// Get the input and output hardware latency in frames.
pub fn latencies(&self) -> Result<(c_long, c_long), AsioError> {
let mut input_latency: c_long = 0;
let mut output_latency: c_long = 0;
unsafe {
asio_result!(ai::ASIOGetLatencies(
&mut input_latency,
&mut output_latency
))?;
}
Ok((input_latency, output_latency))
}

/// Get the min and max supported buffersize of the driver.
pub fn buffersize_range(&self) -> Result<(c_long, c_long), AsioError> {
let buffer_sizes = asio_get_buffer_sizes()?;
Expand Down
Loading
Loading