Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

centralize clock handling for pthread_cond_timedwait #877

Merged

Conversation

RossBencina
Copy link
Collaborator

@RossBencina RossBencina commented Jan 20, 2024

  • Ensure that the clock that is configured on the cond object is the one that is used to compute the wait deadline
  • Ensure that the most appropriate clock is selected on each platform based on availability CLOCK_BOOTTIME > CLOCK_MONOTONIC > CLOCK_REALTIME (on Mac use gettimeofday because other clock interfaces are either not available or broken).

Used directly or indirectly by pa_jack, pa_alsa, pa_asihpi

Resolves #795, #807.

@RossBencina RossBencina force-pushed the fix_pthread_cond_timedwait_timouts branch 9 times, most recently from 2229265 to 0ed8726 Compare January 20, 2024 07:53
@RossBencina RossBencina force-pushed the fix_pthread_cond_timedwait_timouts branch from 0ed8726 to d839034 Compare January 20, 2024 07:59
@RossBencina RossBencina added src-alsa ALSA Host API /src/hostapi/alsa src-jack JACK Audio Connection Kit Host API /src/hostapi/jack labels Jan 20, 2024
@RossBencina RossBencina requested a review from philburk January 20, 2024 08:50
src/os/unix/pa_pthread_util.c Outdated Show resolved Hide resolved
src/os/unix/pa_pthread_util.c Outdated Show resolved Hide resolved
src/os/unix/pa_pthread_util.c Outdated Show resolved Hide resolved
src/os/unix/pa_unix_util.c Outdated Show resolved Hide resolved
src/os/unix/pa_pthread_util.c Show resolved Hide resolved
src/os/unix/pa_pthread_util.c Outdated Show resolved Hide resolved
src/os/unix/pa_pthread_util.c Outdated Show resolved Hide resolved
@RossBencina RossBencina requested a review from philburk January 21, 2024 04:02
@RossBencina
Copy link
Collaborator Author

@s09bQ5 I've pushed some changes, does this PR fix #795 for you now?

…C std but one second worth of nsecs fits in signed 32-bit, so avoid long long for better portability.
@s09bQ5
Copy link

s09bQ5 commented Jan 21, 2024

Looks good to me now.

@RossBencina
Copy link
Collaborator Author

Note we don't yet have confirmation that this PR resolves #870

@RossBencina
Copy link
Collaborator Author

Waiting for confirmation from @nodemand that this PR is the version that fixes #870 for them.

@s09bQ5
Copy link

s09bQ5 commented Feb 17, 2024

And I can confirm that it fixes #795. Using JACK works now.

@RossBencina
Copy link
Collaborator Author

No longer gated by #870 (turns out to be unrelated).

@RossBencina RossBencina merged commit 4600d81 into PortAudio:master Feb 23, 2024
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
src-alsa ALSA Host API /src/hostapi/alsa src-jack JACK Audio Connection Kit Host API /src/hostapi/jack
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WaitCondition in JACK backend mixes up two clocks
3 participants