Skip to content

comma: queue touch events with their kernel time - #42

Open
sshane wants to merge 3 commits into
masterfrom
touch-event-queue
Open

sshane wants to merge 3 commits into
masterfrom
touch-event-queue

Conversation

@sshane

@sshane sshane commented Nov 16, 2026 •

Copy link
Copy Markdown

comma's PollInputEvents only keeps the last state of each finger, so openpilot (which polls it from a thread at 140 Hz) misses a fast second tap when the lift and the next touch land in one poll, loses moves between polls, and has to stamp events with its poll time. This queues every down/move/up at its SYN_REPORT with the kernel event time (CLOCK_MONOTONIC via EVIOCSCLOCKID, same clock as Python's time.monotonic()), readable with GetTouchEventCount() / GetTouchEvent(i) until the next poll, and reads the slots back after a SYN_DROPPED instead of applying a broken frame. The state API is unchanged, so older openpilot and the setup/updater zipapps work as before.

Order: this, then commaai/dependencies#123 (wheel), then the AGNOS comma-deps-raylib bump; commaai/openpilot#39388 uses it when the function exists and keeps the thread otherwise.

comma four, onroad-like load (route replay, camerad, plannerd, radard), touches injected through uinput at the panel's 103 Hz:

master this + openpilot 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

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