OculusVR Plugin for Unreal Engine 4.26 release version

There is one specific question about OculusVR Plugin for Unreal Engine 4.26 release version.

There is a function call for game frame tick in ‘SendControllerEvents’, ‘OculusHMD->StartGameFrame_GameThread’

(\Engine\Plugins\Runtime\Oculus\OculusVR\Source\OculusInput\Private\OculusInput.cpp : 208).

It causes great load for 10-12ms every game frame right before UWorld_Tick. Sometimes it goes unacceptable higher and gets to values around 23-25ms per game frame. After all optimizations we’ve made which got us about 5-7ms of World Tick Time we still have a situation where we can get lagspikes because of that function.

We’ve tried to comment and compile code without it because research showed that this function being called in another update which happens during World Tick update. For example OnStartGameFrame (\Engine\Plugins\Runtime\Oculus\OculusVR\Source\OculusHMD\Private\OculusHMD.cpp : 778). It’s clear it has been placed here as a sort of backup call.

But in case with non-comented function call we have a situation with spikes.

With comment that calculation moves to scope of WorldTick, but there happens no such lagspikes and takes ~10ms within WorldTick.

It’s seems obvious that GameFrame update should not make that load on CPU, especially lagspikes through called function.
We have a thought that it could be a lag with updates between OculusVR Plugin and Oculus software to complete interaction with the Oculus HMD device, but there no any specific leads to prove that at the moment.

We would greatly appreciate any suggestions how to fix this issue while we will continue searching into the plugin.

StartGameFrame_GameThread() blocking for a long period of time seems to be the intended behavior, since it calls ovrp_WaitToBeginFrame(), which is supposed to block the game thread to sync with the next frame.

What’s odd is that it should only block until the frame start. Since it’s the call to the Oculus API that is blocking, it’s unlikely to be anything in the game itself causing it. There appears to be a lot of VR timing issues going around, and some of them are seemingly caused by issues with graphics card drivers.

It might be a good idea to check if the issue is consistent across other computers and graphics cards.