Changes

Jump to navigation Jump to search

Wayland latency tuning

2,097 bytes added, 19:26, 30 August 2021
no edit summary
On Wayland, frame latency can be reduced by making the compositor render as late as possible before a vblank. This allows the compositor to show the latest frame available, just in time for the screen refresh. This guide describes how to configure this for certain compositors. This will improve your experience for all applications, not just Looking Glass.
Looking Glass can also be made to render right before the compositor renders, further reducing latency. This is what the <code>win:jitRender</code> setting does on Wayland. The timing of this is also controlled by the compositor, and thus the configuration is compositor-specific.
== Sway ==
On Sway, this is controlled by the <code>max_render_time</code> setting. The <code>max_render_time</code> setting on the output controls how many millisecond the compositor renders before the vblank. Setting <code>max_render_time</code> on the window controls how many milliseconds the compositor tells windows to render. Both must be set for optimal latency. === Screen latency tuning === The goal is to set the smallest value for <code>max_render_time</code> that does not result in frame dropping. For this test, you must be able to tell if a frame is dropping. If you cannot tell this visually, you can open [https://testufo.com/ UFO test] in a browser running on native Wayland. The frame rate reported by this test will be lower than the screen refresh rate if there is frame dropping. We will assume your display is called <code>DP-1</code>. You should change the name if it is different. If you have multiple monitors, this process must be repeated for every monitor. We start by running <code>swaymsg output DP-1 max_render_time 1</code>. If there is frame dropping, increase the value of <code>max_render_time</code> by 1 and try again until frame dropping stops. This is the optimal setting for <code>max_render_time</code>. Once you find this value, open up your sway config file (usually <code>~/.config/sway/config</code>), and add the line <code>output DP-1 max_render_time t</code>, with <code>t</code> replaced by the optimal value obtained previously. === Looking Glass latency tuning (B5-only) === Tuning the latency for Looking Glass follows a very similar process: # Close the Looking Glass client.# Run <code>swaymsg 'for_window [app_id="looking-glass-client"] max_render_time 1'</code>.# Run the Looking Glass client with the <code>win:showFPS win:jitRender</code> option. If you have multiple monitors, you want to move to window to the monitor with the highest resolution.# If the FPS value displayed is lower than the screen refresh rate, close the client and restart from step 2, but increment the value of <code>max_render_time</code> by 1.# Once this is done, open up your sway config file (usually <code>~/.config/sway/config</code>), and add the line <code>for_window [app_id="looking-glass-client"] max_render_time t</code>, with <code>t</code> replaced by the optimal value obtained previously.
21

edits

Navigation menu