Editing Wayland latency tuning

Jump to navigation Jump to search

Warning: You are not logged in. Your IP address will be publicly visible if you make any edits. If you log in or create an account, your edits will be attributed to your username, along with other benefits.

The edit can be undone. Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.

Latest revision Your text
Line 1: Line 1:
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.
+
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.
  
 
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.
 
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.
Line 5: Line 5:
 
== Sway ==
 
== 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.
+
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.
 
 
=== 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 and later 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.
 

Please note that all contributions to Looking Glass may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see Looking Glass:Copyrights for details). Do not submit copyrighted work without permission!

Cancel Editing help (opens in new window)