Skip to content

Read live inputs only as often as needed, and a graphics mode - #20

Merged
Adiakys merged 5 commits into
mainfrom
perf/adaptive-live-sampling
Nov 4, 2026
Merged

Adiakys merged 5 commits into
mainfrom
perf/adaptive-live-sampling

Conversation

@Adiakys

@Adiakys Adiakys commented Nov 3, 2026 •

Copy link
Copy Markdown
Owner

Live inputs were read, sent and drawn 60 times a second for every component, moving or not.

  • Kit: a device's axes are read once per sample. Each axis read asked the kernel for every axis of the device, one call per axis, and a sample read them once per pedal, once for the angle and again for the hats; the components of a base share the reading now.
  • SDK: a plugin sends input/state only when the inputs change (the protocol already allowed fewer states than the rate). simrig-cli watch keeps waiting on a still device after the first state.
  • App: components with axes only (base, pedals, handbrake) are read at 5 Hz after a second without moving, and at the live rate again on the first change; components with buttons, hats or a gear stay at the live rate, so no quick press falls between two readings.
  • Graphics mode in Settings, replacing Reduce motion: Reduced motion (no transitions, steering wheel and handbrake drawings still, numbers and pedal bars still live; 30 Hz), 30 Hz (default), 60 Hz. The live rate sets both how often the plugins read and how often the app draws. reduced_motion = true in gui.toml becomes the Reduced motion mode.

Measured with main merged (#19 included). Real rig (CSL DD, wheel, pedals, shifter, handbrake), still, CPU of one core: Fanatec plugin 1.9% → 1.0–1.4%, app 1.2% → 0.6%, generic USB plugin about 0.3%, no frames drawn.

Simulated rig, everything moving, window visible:

Mode fps App CPU App GPU
before (60 Hz, badge redrawing twice) 120 18% 14.5%
Reduced motion 30 9.9% 3.4%
30 Hz 30 10.0% 3.5%
60 Hz 60 18.1% 7.3%

@Adiakys
Adiakys merged commit 85fd495 into main Nov 4, 2026
1 of 2 checks passed
@Adiakys
Adiakys deleted the perf/adaptive-live-sampling branch November 4, 2026 00:01
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.

1 participant