Skip to content

ui: read every touch event with its kernel time - #39388

Open
sshane wants to merge 1 commit into
masterfrom
ui-touch-event-queue
Open

sshane wants to merge 1 commit into
masterfrom
ui-touch-event-queue

Conversation

@sshane

@sshane sshane commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator

On device, the touch thread polls raylib's touch state at 140 Hz, so a fast second tap is lost when the lift and the next touch land in one poll, moves between polls merge, and every event gets the poll time instead of the panel's. With commaai/raylib#42 the UI reads every touch event with its kernel time once per frame and doesn't start the thread; with older raylib (AGNOS before the bump, setup/updater zipapps) and on PC nothing changes.

Order: commaai/raylib#42, then commaai/dependencies#123 (wheel), then an AGNOS bump of comma-deps-raylib. No uv.lock bump here: there's no released wheel yet, and on device raylib comes from AGNOS.

comma four, onroad-like load (route replay, camerad, plannerd, radard), touches injected through uinput at the panel's 103 Hz, wheel from dependencies#123 on the PYTHONPATH:

master this PR
fast double taps (5-20 ms between), both seen 176 / 200 200 / 200
touch reports reaching the UI 88.3% (6885 / 7800) 100% (11700 / 11700)
event time error vs injection, p99 8.4 ms < 0.01 ms
fling velocity error, p99 11-17% 0.3%
touch to frame latency, p50 / p99 10.5 / 19.3 ms 8.3 / 16.5 ms
touch thread cpu 0.6% of a core no thread

@github-actions

Copy link
Copy Markdown
Contributor

Process replay diff report

Replays driving segments through this PR and compares the behavior to master.
Please review any changes carefully to ensure they are expected.

✅ 0 changed, 80 passed, 0 errors

@commaci-public

Copy link
Copy Markdown
Contributor

Model Replay: Small model

ref for commit 4c36399: https://raw.githubusercontent.com/commaai/ci-artifacts/refs/heads/model_replay_ui-touch-event-queue_tici/98395b7c5b27882e|0000002b--2686b5a2d0_model_tici_4c3639944e5bb778da5f07f697041e835ed8c7ab.zst
Model Replay Differences
All Model Replay Plots

@commaci-public

Copy link
Copy Markdown
Contributor

Model Replay: Big model (Chestnut)

ref for commit 4c36399: https://raw.githubusercontent.com/commaai/ci-artifacts/refs/heads/model_replay_ui-touch-event-queue_chestnut/98395b7c5b27882e|0000002b--2686b5a2d0_model_chestnut_4c3639944e5bb778da5f07f697041e835ed8c7ab.zst
Model Replay Differences
All Model Replay Plots

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants