Skip to content

feat: extend hardware latency reporting to more hosts#1129

Merged
roderickvd merged 6 commits intomasterfrom
fix/hardware-latency
Mar 20, 2026
Merged

feat: extend hardware latency reporting to more hosts#1129
roderickvd merged 6 commits intomasterfrom
fix/hardware-latency

Conversation

@roderickvd
Copy link
Member

@roderickvd roderickvd commented Mar 17, 2026

Currently, playback - callback underreports host latency on several hosts because the hardware pipeline delay isn't included.

This PR fixes it using each host's native API:

  • CoreAudio: adds kAudioDevicePropertyLatency + kAudioDevicePropertySafetyOffset
  • WASAPI: adds GetStreamLatency() (hardware latency beyond the buffer)
  • ASIO: adds ASIOGetLatencies() (hardware latency beyond the buffer)
  • JACK: uses CycleTimes::next_usecs directly instead of estimating from current_usecs + buffer_duration
  • WebAudio: adds AudioContext.baseLatency + outputLatency

Supersedes #964
Fixes #773

This comment was marked as resolved.

@roderickvd
Copy link
Member Author

I see some ❤️ - please test and report back! Your test runs are much appreciated.

@roderickvd roderickvd force-pushed the fix/hardware-latency branch from 22fbfd2 to 9bc5015 Compare March 19, 2026 20:52
@roderickvd roderickvd changed the title feat: add hardware latency reporting to ASIO, CoreAudio, JACK, WASAPI and WebAudio feat: extend hardware latency reporting to more hosts Mar 19, 2026

This comment was marked as resolved.

@roderickvd
Copy link
Member Author

No feedback and this looks good code-wise after a few iterations, so I'm going to merge it and hopefully give it a little more exposure. Please open an issue if you find any.

@roderickvd roderickvd merged commit 2622b29 into master Mar 20, 2026
31 checks passed
@roderickvd roderickvd deleted the fix/hardware-latency branch March 20, 2026 20:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Can you get the system latency?

2 participants