Skip to content

fix monotonic latency errors on MacOS - #1172

Merged
philburk merged 5 commits into
masterfrom
fix_latency_mac_1171
Sep 3, 2026
Merged

philburk merged 5 commits into
masterfrom
fix_latency_mac_1171

Conversation

@philburk

Copy link
Copy Markdown
Collaborator

Rounding errors were causing the new paqa_latency_monotonic.c test to fail.

Fixes #1171

@philburk
philburk requested a review from RossBencina August 21, 2026 01:54
@philburk philburk added this to the V19.8 milestone Aug 21, 2026
@philburk philburk self-assigned this Aug 21, 2026
Comment thread src/hostapi/coreaudio/pa_mac_core.c Outdated
PaSampleFormat hostInputSampleFormat, hostOutputSampleFormat;
UInt32 fixedInputLatency = 0;
UInt32 fixedOutputLatency = 0;
const double kLatencyEpsilon = 1e-10; /* Rounding error in frames. */

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is the epsilon rounding required to pass the test? Is there any rationale behind 1e-10?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Most of the tests pass with just the ceil() call. But there was one failure that needed this epsilon fix.
The reportedLatency was low by 1e-19.

So 1e-10 seems much smaller than the human scale and much larger than the scale of the rounding errors.

Comment thread src/hostapi/coreaudio/pa_mac_core.c Outdated
Comment thread src/hostapi/coreaudio/pa_mac_core.c Outdated
Comment thread src/hostapi/coreaudio/pa_mac_core.c Outdated
Rounding errors were causing the new paqa_latency_monotonic.c
test to fail.

Fixes #1171
This is needed to make the reported latency monotonic.

Fixes #1171
@philburk
philburk force-pushed the fix_latency_mac_1171 branch from cdb7603 to 8dfa796 Compare September 3, 2026 22:15
@philburk
philburk merged commit 07a60c5 into master Sep 3, 2026
36 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.

paqa_latency_monotonic failing on Mac OS due to small deltas

2 participants