Expand description
When a capture is due a frame, shared by the X11 and Wayland backends. The frame pacing every capture backend shares: when a display is due a frame, and how far a change that just happened may bring the next one forward.
A capture renders on its frame timer, and something that actually happened – input the compositor processed, a frame a host delivered, a region the X server reports damaged – may render one ahead of that timer. Input’s pull spends from a budget that refills slowly, so input faster than the cadence raises the output rate by no more than the refill; a change the screen or a host reports spends only what its own late frames paid back, so it moves the cadence onto the frames it reports without raising the rate. Either way a change arriving on its own schedule is published as it lands rather than up to a period later.
The X11 captures, which the X server’s damage reports wake, pace in windows instead
(FramePace::windowed): one frame a period, a change taking its period’s frame as it lands,
as the NvFBC driver pushes frames, and a change landing in a period a frame already took
sent as an extra frame from a budget that refills slowly, so a source drawing at the cadence
keeps its own periods.
Structs§
- Frame
Pace - A capture’s frame pacing: the last frame it rendered, and how far a pull may still bring the next one forward.
Enums§
- Tick
Trigger - What asks a display for a frame: its frame timer, fresh input, a frame the host just delivered under host capture, or a region the X server reports damaged. All but the timer say something has actually changed, and so may pull the cadence’s phase forward.
Constants§
- EXTRA_
CAP 🔒 - The extra frames a capture paced in windows holds in reserve.
- EXTRA_
MIN_ 🔒FRACTION - The share of a period after the last frame from which a change landing in a window a frame
already took may be sent as an extra frame (
FramePace::windowed). - EXTRA_
REFILL 🔒 - The share of an extra frame each period adds to that reserve: the sustained rate rises above the configured one by at most this share. A slower refill leaves a source at the cadence locked behind a keystroke’s extra frame for longer (a 60 Hz animation with a keystroke every 0.7 s waited 7.6 ms a frame at the median at 1/64, 12.5 ms at 1/128).
- INPUT_
BORROW_ 🔒REFILL - The share of wall time that accrues as time an input pull may bring frames forward by. A frame pulled forward by some time is one the cadence earns that much later, so the sustained rate can rise above the configured one by at most this share.
- INPUT_
TICK_ 🔒MIN_ FRACTION - The share of a frame period that has to pass before input or a host frame may pull the next frame forward.
- PACED_
INPUT_ 🔒MAX_ FRACTION - PACED_
INPUT_ 🔒MIN_ FRACTION - The input spacings, as shares of the frame period, that count as pacing at the cadence: a client at the cadence give or take its jitter. A faster client is borrowing frames and a slower one is content the timer paces, and the timer keeps its period behind either.
- STILL_
PERIODS 🔒 - The periods without a reported change after which the screen counts as still
(
FramePace::still): more than the timer waits after a change’s frame. - TIMER_
GRACE_ 🔒AFTER_ PULL - The share of a frame period the timer waits beyond a whole one after an input frame while the input paces itself at the cadence, so input arriving a little slower than the timer still renders its own frames instead of landing just behind a timer frame and waiting a period.
- TIMER_
TICK_ 🔒MIN_ FRACTION - The share of a frame period the timer’s tick may run early by, absorbing its wakeup jitter.
- WINDOW_
EARLY_ 🔒FRACTION - The share of a frame period before the next window opens in which a change, paced in windows, takes that window’s frame at once rather than waiting for it to open. One frame a window still holds the rate at the cadence; a source drawing at the cadence whose frames end just short of the boundary otherwise waits for it every frame (a 60 fps full-screen animation on Xvfb waited 0.8 ms a frame on average, in some phases of its clock against the windows’).