Skip to content

fix(au): round the host's sample time instead of truncating it - #27

Merged
unohee merged 1 commit into
masterfrom
fix/au-round-host-sample-time
Oct 31, 2026
Merged

unohee merged 1 commit into
masterfrom
fix/au-round-host-sample-time

Conversation

@unohee

@unohee unohee commented Oct 31, 2026

Copy link
Copy Markdown
Collaborator

AU hosts report the timeline as f64 samples (transportStateProc outCurrentSampleInTimeLine, AudioTimeStamp::mSampleTime). REAPER can report an integer position as a value just below it, and sample_pos as i64 then gives the sample before: de-leak-rt logged a jump target of 11775 where REAPER moved back to 11776, and a running position one sample early in 632 of 1266 buffers (Intrect-io/de-leak-rt docs/VERIFY-0.2.3-SHIPPED.md, Linear AUD-2503).

  • New Transport::samples_from_host_time(f64) -> Option<i64>: round, then the existing f64_to_i64 guard (NaN/inf → None instead of 0 / saturation).
  • AU wrapper: position, loop range and the mSampleTime fallback go through it.
  • Unit test in context::process; cargo check --lib --features au on macOS (M1 Max) passes.

Based on e39670f (the rev de-leak-rt pins) so de-leak-rt 0.2.4 can take this fix alone. Merge with a merge commit so fd96420 stays reachable from master.

transportStateProc and AudioTimeStamp report the timeline as f64 samples, and
a host can report an integer position as a value just below it (REAPER AU:
11775 where it moved back to 11776, and a running position one sample early
every few buffers). `as i64` truncated it to the sample before. Round through
the new Transport::samples_from_host_time, which also maps NaN and infinity to
no position instead of 0 / i64::MAX. Loop ranges get the same conversion.
@unohee
unohee merged commit 93f576b into master Oct 31, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant