Add native SCHED_FIFO promotion for the Linux build without dbus#45
Open
HEnquist wants to merge 2 commits into
Open
Add native SCHED_FIFO promotion for the Linux build without dbus#45HEnquist wants to merge 2 commits into
HEnquist wants to merge 2 commits into
Conversation
The Linux build without the `dbus` feature previously fell through to the blanket fallback, where promotion was a no-op that returned Ok, so callers believed they had real-time priority when they did not. Give that build a real implementation: promote the current thread directly with pthread_setschedparam(SCHED_FIFO | SCHED_RESET_ON_FORK) at priority 10, restoring the saved policy on demotion. This needs no D-Bus daemon and works whenever the process may request real-time scheduling (root, CAP_SYS_NICE, or an RLIMIT_RTPRIO budget). The rtkit path and other platforms are untouched. - New rt_linux_native.rs with the native backend, wired into a dedicated cfg branch after the rtkit branch. - The requested priority defaults to 10 and can be overridden with the AUDIO_RT_PRIORITY environment variable (1-99). - Tests exercise the RLIMIT_RTPRIO boundary and the priority override; the fallback CI job raises RLIMIT_RTPRIO so promotion runs for real. - Docs: add a Platforms section and correct API docs that assumed D-Bus was the only Linux backend.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Give the Linux no-
dbusbuild a real implementation instead of a no-op:promote the current thread directly with
pthread_setschedparam(SCHED_FIFO).The rtkit path and other platforms are untouched. See #44 for the rationale.
rt_linux_native.rs, wired in via a dedicated cfg branch after the rtkit branchAUDIO_RT_PRIORITYenv var (1-99)SCHED_RESET_ON_FORKset, which anunprivileged thread cannot clear)
RLIMIT_RTPRIOboundary and the priority override; the fallback CIjob raises
RLIMIT_RTPRIOso promotion runs for realLinux backend