bobo bobo - 18 days ago 8
C++ Question

Unreal lose tracking of VR headset after launching an external VR exe application

I created a VR experience in Unreal Engine, and inside the VR world, there is a button which can open an external exe, which is also a VR experence. It's like a VR menu room (Unreal application) and a mini VR game (not created by Unreal and is an external exe). When you play the mini game, Unreal VR menu is still open at the back.

I tried different ways to open external exe, such as:

FPlatformProcess::CreateProc

FMonitoredProcess

FInteractiveProcess


They can all successfully launch external exe, but the problem is, when the external exe is done playing and closed, the Unreal VR menu application will lose vision tracking of Oculus. This problem only happens if the external exe is a VR application. I tried to launch a regular exe, such as browser, and there is no lose tracking problem when I "alt tab" to jump back to Unreal VR application.

This is what I got from output log:


LogHMD: Vision Tracking Acquired

LogHMD: Lost Vision Tracking


Is this a bug of Unreal? Is there any way which can let Oculus retracked by Unreal after running an external VR exe?

Many thanks!

Answer

Oculus drivers should only handle one process at a time, so whenever that new application is starting, Unreal should give up its connection to the service because someone else is requesting the HMD to render those VR frames now. As a dedicated output, both applications issuing frames at the same time can't be a good thing.

Regarding your context, I suggest you try invoking the "Stereo On" Console Command to re-enable your HMD, though you might want to also try the Oculus specific "HMD Enable" command before hand.

Personal concern: Keeping that menu in the background must be consuming resources as well and, in VR, that's an optimization issue you might have to address eventually.