Changes

Jump to navigation Jump to search

Input lag

354 bytes added, 11:16, 12 October 2023
m
Ways to reduce input lag
*Wired controller/input device (just for minimizing possible negative factors, just like using wired connection for router and client device)
 *Linux OS in KMS mode<ref>https://wiki.archlinux.org/index.php/kernel_mode_setting</ref><ref>https://github.com/libretro/RetroArch/wiki/KMS-mode</ref> OR Windows OS with [http://geedorah.com/eiusdemmodi/forum/viewtopic.php?pid=1009#p1009 CRT Emudriver] (You but you need compatible GPU for this) and use .**Use exclusive fullscreen for Windows 8+ if available (Not . Reason for this is borderless windowed, or windowed fullscreen) because in Windows 8 and later, due to [[Wikipedia:Windows_Display_Driver_Model#WDDM_1.2|WDDM 1.2+]] the desktop composition cannot be disabled manually, so your only hope to avoid the compositing lag penalty is to play in exclusive fullscreen mode. 
*Use [[Display FAQ#CRT TVs|CRT TV]] OR [[Display_FAQ#CRT_monitors|VGA CRT]] with analog input/output. If your GPU only support digital output then use [https://old.reddit.com/user/ahayriSG/comments/16q18h6/highend_dacs_for_crts/ high-end DAC/Digital-to-Analog converters]. [https://youtu.be/WIDeNItt69s?t=1885 HDMI ones generally pretty bad]. See [https://hardforum.com/threads/24-widescreen-crt-fw900-from-ebay-arrived-comments.952788/ this thread] for more information about high-end DACs.
**If you don't have a CRT, you can mitigate input lag on LCDs by setting the display to game mode if available (this will turns off some post-processing effects) and also set resolution to native panel resolution (for preventing possible low quality hardware display scaler or [https://www.youtube.com/watch?v=Qdp7VfLXnB4&t=279s GPU scaling] delay)
**If you have a "Gaming" monitor you can also turn on "Overdrive" if available for overclocking/applies overvoltage to pixels making them react faster (Pixel response time) which results in less ghosting. That said, increasing pixel overdrive may cause inverse ghosting as the increased voltage can cause the pixels to [https://www.rtings.com/monitor/tests/motion/motion-blur-and-response-time#test_4246 overshoot] the colors. See [[#External_Links|these websites and reviews]] to learn information about your display devices capabilities and performance.
 
*Turn off digital image processing options from nvidia control panel etc. including post-processing effects such as [[Shader_Presets|shader chain/preset]] from applications if you're using heavy/intensive one.
 
*Always [https://youtu.be/7DPqtPFX4xo?t=72 make sure your GPU underutilized] for preventing [https://images.nvidia.com/content/images/article/system-latency-optimization-guide/nvidia-latency-optimization-guide-pc-latency.png render queue bottleneck] which causes considerable amount of input lag. Also never use in-game [https://youtu.be/L07t_mY2LEU?t=530 vertical sync] because sometimes it includes Triple buffering which is negatively affect input lag. Use alternatives for capping your framerate such as in-game frame capping or "Nvidia Max Frame Rate". However you could use [https://youtu.be/7DPqtPFX4xo?t=650 NVIDIA Reflex feature '''instead of capping your framerate and underutilizing your GPU'''], but not all [https://www.nvidia.com/en-gb/geforce/technologies/reflex/supported-products/ games supports this feature].
**But if you have a G-SYNC monitor another option for you is using V-SYNC option '''from Nvidia Control Panel''' with Low Latency Mode: ULTRA setting. According to Nvidia;
*Some graphics drivers enforce excessive frame buffering, which may be eliminated with GPU commands. RetroArch's [[Vsync#Hard_GPU_Sync|Synchronization Fences/Hard Sync]] for OpenGL does this. If using Vulkan, be sure to set the [https://arm-software.github.io/vulkan_best_practice_for_mobile_developers/samples/performance/swapchain_images/swapchain_images_tutorial.html max swapchain images] parameter to 2, though weaker GPUs, especially Intel iGPUs, can struggle with this, particularly if using shaders or increasing rendering resolution.
 
*A relatively new lag-mitigating technique known as [https://github.com/higan-emu/emulation-articles/tree/master/input/run-ahead Run-Ahead] has recently been implemented in several emulators and frontends, which leverages spare performance overhead to run one or more instances of the emulator ahead of the regular instance, then uses save state rollback to lay that instance over what you see, effectively cutting a whole frame or more of input lag. Most games, even on real hardware on a CRT, have at least one hard-coded frame between executing an action on the controller and said action being reflected on screen, so setting Run-Ahead to 1 frame cuts out that superfluous frame and thus is usually considered safe, but setting it to 2 or more can result in dropped frames and perceived video stutter (though some games can benefit from 2 or more frames, particularly a lot of 5th-gen games). This is also quite processor-heavy, as every extra Run-Ahead frame requires a whole extra instance of the emulator, easily doubling or tripling CPU load, and some emulators are currently not able to use Run-Ahead at all. That said, combined with all the other lag reduction techniques on a sufficiently powerful system, Run-Ahead in theory can actually result in less input lag than even real hardware.
**Another option for lag-mitigating technique known as Preemptive Frames. See [https://www.youtube.com/watch?v=NDYqRoyOKI4 this video] for information.
 
''It cannot be understated how much system requirements increase the more lag reduction measures are employed. A computer or device that would normally be able to run an emulator or core at full speed with ease can suddenly find itself chugging with said measures implemented, especially once Run-Ahead and Frame Delay come into play, which may necessitate foregoing some of them. Some ways to alleviate the load and unlock more lag mitigation potential include making sure performance options are enabled, turning on speed hacks or dynarecs if applicable (to the extent that they don't hamper the game significantly, that is), or switching to faster, less accurate emulator/cores altogether, as the less CPU intensive an emulator is, the more performance overhead is left over for lag reduction. An example would be switching from bsnes to SNES9X, which trades cycle accuracy and compatibility with a handful of games for far greater performance and thus more room to reduce input lag. Also, as implied before, if you have to choose between Run-Ahead and Frame Delay, you should almost always choose Run-Ahead. Of course, if your system is powerful enough to run the most accurate emulators along with all the input lag reduction techniques all at once, go ahead and do so.''
 
*Some emulator frontends like [[RetroArch]] or [[GroovyMAME]] have the option named "[https://www.libretro.com/index.php/retroarch-1-9-13-automatic-frame-delay/ Frame Delay]" to delay the processing of emulation for a few milliseconds until right before the given frame period is over, which causes inputs to be polled quickly before your display refreshes instead at the beginning of the 16.7ms (for 60 fps) frame period. The amount of time you can use Frame Delay without dropping frames is dependent on the performance of the emulator on your machine. Predictive waiting may also be forced with any DirectX based program through [https://community.pcgamingwiki.com/files/file/897-gedosato/ GeDoSaTo]. Also you can use [https://www.libretro.com/index.php/retroarch-1-9-13-automatic-frame-delay/ Automatic Frame Delay] instead of manually giving a value for Frame Delay.
*There are some emulators have the option named "threaded presentation" OR "backend multithreading" for Vulkan video renderer backend and some people claim that this technique adds a frame of input lag. (e.g. [https://github.com/libretro/flycast/issues/738 Flycast_libretro], [https://old.reddit.com/r/RetroArch/comments/vwktz2/pcsx2_turned_off_vsync_to_reduce_input_lag_but/ifqkbux/ LRPS2]). This option has actually existed for some time in various emulators that implemented Vulkan renderer backend. What it actually does is when the CPU wants to make something draw it has to issue a "draw call" which takes up CPU time, on old APIs this was nearly all done on one thread, the reason for that is different threads can't access other threads data (quickly) if it's being updated and because of how it used to be done, you needed to synchronise threads a lot and that meant that using lots of threads ended up not always being too helpful, in Vulkan because the person using the API is more explicit about how they want their memory and what have you allocated and used it's easier to submit "draw calls" on multiple threads so it (usually) performs better because it's designed to avoid the issues of older APIs.<ref>[https://old.reddit.com/r/DolphinEmulator/comments/ckfes1/back_end_multithreading_with_vulkan_how_much_of_a/evrbv2h/ sdrawkcabdaertseb's comment about vulkan threaded presentation]</ref>
[[File:Vsync ''Realistically, Frame Delay is the last thing to configure, after all other sync and Predictive Waitingbuffer settings and Run-Ahead frames have been configured for your system's performance, as it gives the least lag reduction bang for your CPU load buck. It is possible on systems with performance much higher than is required to run at full speed.png]]''
Realistically*There are some emulators have the option named "threaded presentation" OR "backend multithreading" for Vulkan video renderer backend and some people claim that this technique adds a frame of input lag. (e.g. [https://github.com/libretro/flycast/issues/738 Flycast_libretro], Frame Delay [https://old.reddit.com/r/RetroArch/comments/vwktz2/pcsx2_turned_off_vsync_to_reduce_input_lag_but/ifqkbux/ LRPS2]). This option has actually existed for some time in various emulators that implemented Vulkan renderer backend. What it actually does is when the last thing CPU wants to make something draw it has to configureissue a "draw call" which takes up CPU time, after on old APIs this was nearly all done on one thread, the reason for that is different threads can't access other sync threads data (quickly) if it's being updated and buffer settings because of how it used to be done, you needed to synchronise threads a lot and Run-Ahead frames that meant that using lots of threads ended up not always being too helpful, in Vulkan because the person using the API is more explicit about how they want their memory and what have been configured for your systemyou allocated and used it's performance, as easier to submit "draw calls" on multiple threads so it (usually) performs better because it gives 's designed to avoid the least lag reduction bang for your CPU load buckissues of older APIs.<ref>[https://old. It is possible on systems with performance much higher than is required to run at full speedreddit.com/r/DolphinEmulator/comments/ckfes1/back_end_multithreading_with_vulkan_how_much_of_a/evrbv2h/ sdrawkcabdaertseb's comment about vulkan threaded presentation]</ref>
It cannot be understated how much system requirements increase the more lag reduction measures are employed*If you have a variable refresh rate supported monitor you could also use these settings: Latest MAME versions "[https://shmups.system11.org/viewtopic. A computer or device that would normally be able to run an emulator or core at full speed with ease can suddenly find itself chugging with said measures implemented, especially once Runphp?t=65615 -Ahead lowlatency]" flag and Frame Delay come into play, which may necessitate foregoing some of themRetroArch's [https://www.libretro. Some ways to alleviate the load and unlock more lag mitigation potential include making sure performance options are enabled, turning on speed hacks or dynarecs if applicable (to the extent that they don't hamper the game significantly, that is), or switching to faster, less accurate emulatorcom/cores altogether, as the less CPU intensive an emulator is, the more performance overhead is left over for lag reductionindex. An example would be switching from bsnes php/upcoming-retroarch-1-7-4-sync-to SNES9X, which trades cycle accuracy and compatibility with a handful of games -exact-content-frame-rate-ideal-for far greater performance and thus more room to reduce input lag. Also, as implied before, if you have to choose between Run-Ahead and g-syncfreesync-users/ Sync To Exact Content Frame Delay, you should almost always choose Run-Ahead. Of course, if your system is powerful enough to run the most accurate emulators along with all the input lag reduction techniques all at once, go ahead and do soRate].
==References==
11,846
edits

Navigation menu