Repository navigation
frontend: start up as an ordinary task, not a real-time one - #33
Merged
Merged
Conversation
The main thread went real-time right after the settings were read and then ran to the first frame without a sleep. Under the 200 ms RLIMIT_RTTIME a PipeWire client passes on to the processes it starts (DSlot's shelf is one), the kernel's RT watchdog killed it with a bare SIGKILL between the settings and SDL_Init whenever that stretch took over 200 ms of CPU: on a slow clock, reproduced at 408 MHz on the RG DS+, and reported from the field on alpha3 as "DSperate stopped at once (signal 9)" with no crash line. The OffRealtime guard that already covered the ROM load now starts right after the scheduling latch, so start-up runs as an ordinary task; the workers take the latched policy themselves, and the guard still lifts, with a nap, where emulation begins. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
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.
The main thread goes real-time right after the settings are read and then runs to the first frame without a sleep. Under the 200 ms
RLIMIT_RTTIMEthat PipeWire's client module sets, and that any process started from a PipeWire client inherits (a launcher's shelf, for instance), the kernel's RT watchdog kills it with a bareSIGKILLbetween the settings andSDL_Initwhenever that stretch takes more than 200 ms of CPU. Nothing is logged unlesskernel.print-fatal-signalsis on, so from outside it looks like an instant signal 9 with no crash line.Reproduced on an RK3566 (Cortex-A55) with the clock capped at 408 MHz:
LimitRTTIME=200000kills DSperate 0.22 s after start, anddmesgshowsRT Watchdog Timeout (hard): dsperate. At full clock the same stretch takes 120 ms, so a device half as fast at that moment is enough. A field report on exactly this came in from a handheld running the fork.The fix moves the
OffRealtimeguard that already covers the ROM load (rt_budget.h) up to right afterlatch_worker_sched(), so start-up runs as an ordinary task. The workers take the latched policy themselves inplace_current_thread, and the guard still lifts, with a nap, where emulation begins. With it, the same 408 MHz run reachesSDL_Init, and a launch capped at 1.1 GHz reaches its first frame under the 200 ms budget. One visible change: threads started during start-up by SDL and PipeWire no longer inherit the real-time policy; PipeWire's module-rt sets its own.🤖 Generated with Claude Code