Measuring Input Latency on Linux: X11 vs. Wayland, VRR, and DXVK
6 hours ago
- #Wayland vs X11
- #Input Latency
- #Linux Gaming
- The author switched to Linux for gaming to achieve better FPS, frame pacing, and input latency, but lacked reliable measurement tools.
- To measure end-to-end system latency, the author built a device with a light sensor that detects screen changes after a simulated mouse click, inspired by open-source projects like OSLTT.
- The author tested three aspects: X11 vs Wayland input lag, Variable Refresh Rate (VRR) benefits, and the low-latency fork of DXVK (dxvk-low-latency).
- Results showed X11 had slightly lower latency than Wayland (0.14-0.22 ms difference), contrary to perceptions of Wayland being much worse.
- VRR consistently reduced latency (0.26-0.45 ms) and flattened latency distribution by allowing frames to scan out when ready.
- dxvk-low-latency provided small gains in capped scenarios (0.10-0.29 ms) but significantly smoothed frame pacing and reduced latency in uncapped tests (0.84 ms gain).
- XWayland added substantial latency (3.13 ms without dxvk-low-latency), but dxvk-low-latency mitigated this by 2.11 ms.
- Overall optimizations (X11, VRR, dxvk-low-latency) reduced median latency by 0.72 ms compared to default Wayland, with additional benefits in reducing jitter and handling real-world fluctuations.
- Other sources like David Ramiro and farnoy corroborated findings, noting native Wayland matches X11 latency while XWayland should be avoided.
- The author's setup used specific hardware (AMD Ryzen 7 5800X3D, NVIDIA RTX 4070 SUPER) and software (CachyOS, KDE Plasma), with results likely transferring to other setups, especially on lower refresh rate displays.