We recently ran into an input latency issue, even in an empty level the input latency is about 115ms
[Image Removed]
I searched for a solution on multiple forums, on UDN and in the Epic documentation and most of the time i saw that i need to change some console variables to improve the latency at the cost of some performance drop. So i tested with :
- r.FinishCurrentFrame=1
- rhi.SyncInterval=1
- r.GTSyncType=1
- r.OneFrameThreadLag=0
And indeed i have better results.
[Image Removed]
But it’s still somewhat high, about 4 frames of latency. The thing is i know for sure that 2 months ago we had around 35ms of latency without even changing these console variables, i don’t really know why it’s happening and i don’t know where to start searching to find the source of the issue besides the fact that in between we updated the engine to 5.5.4.
So if someone has any insights to where i can start investigating, it would be greatly appreciated !
Thanks in advance for your responces, Egan L.
Hi,
Which engine version did you upgrade from? There have been several latency and syncing-related updates in the 5.5 release and preview, and earlier. If you just updated a minor version of 5.5 though I would be quite surprised to see such a dramatic change in reported input latency. It would also be helpful to know what your target platform is.
I am assuming the documentation you are referencing is Epic’s Low Latency Frame Syncing docs, but just in case you were looking at other documentation, you can find those docs here.
What stands out to me the most is the dramatic reduction in the game thread time between the screenshots. Are those console variables the only changes in the project between those two screenshots? My assumption would be that the game thread reduction time would contribute far more to the reduced latency than those variable changes (my assumption also being that I would be very surprised for those variable changes to be the cause of such a reduction in game thread time).
In terms of other settings to tweak:
- r.GTSyncType 2 could allow for lower latency.
- Reducing rhi.SyncSlackMS should reduce latency, but there is a balance here between low latency and resilience to hitches, which a higher value can help with by lengthening the engine pipeline. The ideal value here will be project dependent.
- You may also wish to look into enabling NVIDIA Reflex.
Thanks,
Hayden
Hello Hayden,
We updated from 5.5.2 to 5.5.4, but it may not be related i just wanted to point out that in case it could ring a bell regarding some changes that has been done, if that’s not the case we can exclude that it come from an engine update. Currently we are testing on Windows target.
I was actually talking about this exact doc you shared in addition to various forum and UDN posts like these :
The console variables are the only changes in the project between my two screenshots, here is what i did :
- Launched the editor
- Loaded a light level
- Played in it and recorded the input latency
- Closed the editor
- Added the mentionned console variables in DefaultEngine.ini
- Launched the editor again
- Loaded the same level
- Played in it and recorded the input latency again
I was aware of r.GTSyncType 2 but setting it to 2 didn’t lower the latency so i kept it to 1. I was also aware of rhi.SyncSlackMS (beeing at 10 by default) but for some reason, putting that console variable to 0 make the input latency skyrocket to almost 1000ms (by doing stat UNIT, because i didn’t felt 1 second of latency between my inputs and what’s happening on the screen) so that was really weird. Didn’t check on Nvidia reflex, will check it out.
Thank you for your answer !
Hello,
I actually found something interesting regarding this issue, i tried recording the input latency on other devices and i don’t have the same result.
This PC is new and it’s on this one that i recorded the 115ms of input latency :
- i9-14900KF
- RTX 4070 SUPER
- 64Go of RAM
- Wired controller
- Wireless headset
My old device (i was using 2 months ago so when we were still on 5.5.2) doesn’t have this issue, i’m still at a smooth 35ms of input latency :
- I7 9700K
- RTX 2070
- 64Go of RAM
- Wired controller
- Wired headset
I asked several people on my team to test that on the same empty map as i did my testing and they have different results depending on their setup too (from 40ms to 115ms). So could it be simply coming from our hardware or the material we are using ?
Hi,
To my knowledge there weren’t any changes made between 5.5.2 and 5.5.4 that specifically affected input latency. That’s not to say that there were not changes that affected the performance of one or more threads, but that being said the vast majority of changes made in this period were crash and other bug fixes.
I would be more inclined to see if there were any changes made to your projects code base in that time. It would also be worth seeing that you are on the most recent GPU driver for your machine.
Going back to the difference in Game Thread time between the two screenshots, it might be worth digging into this further, since I would assume that the large proportion of the GT time in the first screenshot in relation to the frame time plus how the various syncing settings were configured for thread overlap would be contributing to the input latency. I would recommend starting with AB testing each of the input latency related console variables that have been discussed here so far. If you’re not already familiar with the process of AB testing you would, for example, use:
abtest r.oneframethreadlag 0 1
To cycle through the testing of two value, and after enough samples you can run:
abtest stop
This will notably give you the difference in frame time, and how likely the difference is due to random noise, and not strictly input latency. But if you temporarily uncap the framerate I believe this will still give useful results, since in the first screenshot it looks like you are bound by your GT performance. This should let you have some confidence in the cause of your GT time reduction coming from setting these variables.
Of course, it would also be valuable to run Insights to further investigate any bottlenecks here.
Thanks,
Hayden
Hi,
There could definitely be some difference in latency due to hardware, though I would first be interested in ruling out any different results due to software. Since you are using NVIDIA GPUs, I would encourage you to check for consistency among:
- The same kind of driver, i.e. Game Ready or Studio
- The driver version
- The settings under Manage 3D Settings in the NVIDIA Control Panel
Each of these can have quite a dramatic impact on variations in performance, and indeed latency as well.
Thanks,
Hayden