Skip to content

asio-sys 0.3.0

Choose a tag to compare

@roderickvd roderickvd released this 06 Jun 20:41
· 9 commits to master since this release
baa3678

Added

  • Added Driver::latencies() to query input and output stream latencies
  • Added BufferPreference enum with the driver's preferred buffer size and valid-size constraints

Changed

  • Driver::add_message_callback and Driver::remove_message_callback replaced by Driver::add_event_callback and Driver::remove_event_callback
  • MessageCallback renamed to DriverEventCallback, and MessageCallbackId renamed to DriverEventCallbackId. DriverEventCallback wraps Fn(AsioDriverEvent) -> bool whereAsioDriverEvent is a new enum covering both asioMessage selector events and sampleRateDidChange notifications
  • CallbackId renamed to BufferCallbackId
  • Public-facing c_long fields and return types replaced with i32
  • Public-facing c_double parameters and return types replaced with f64
  • CallbackInfo::system_time is now u64 nanoseconds
  • AsioError::ASE_NoMemory renamed to AsioError::NoMemory
  • Extended BufferSizeRange with a preferred: BufferPreference field
  • AsioTime::reserved, AsioTimeInfo::reserved, AsioTimeCode::future fields made private.
  • asio_import module is now pub(crate); raw bindgen types are no longer public API
  • asio_message now dispatches kAsioResyncRequest and kAsioLatenciesChanged to callbacks
  • asio_message delegates kAsioSelectorSupported for unknown selectors to registered callbacks, so each host decides which capabilities it opts into
  • sample_rate_did_change now dispatches AsioDriverEvent::SampleRateChanged to registered callbacks when the reported rate differs from the last known rate

Fixed

  • Fixed TOCTOU race condition when creating streams concurrently
  • Fixed data race where channels, latencies, sample_rate, and related query methods could call ASIO concurrently during set_sample_rate's teardown/reload
  • Fixed Asio::load_driver to return LoadDriverError::LoadDriverFailed instead of panicking when the driver name contains a null byte
  • Fixed Driver::set_sample_rate to perform a dummy buffer cycle and driver reload when the driver does not apply the rate change immediately, as required by some drivers (e.g. Steinberg)
  • Fixed asio_message not advertising kAsioSelectorSupported itself as a supported selector
  • Fixed rust-analyzer errors on non-Windows targets by using stub instead of ASIO bindings

Removed

  • Removed unused SampleRate struct
  • Removed DriverState from the public API