EnableHMD function in Shipping packaged project crashing with Oculus Rift CV1

I’ve got a strange issue in a project that uses Oculus Rift CV1 and HTC .
It just happens with the Shipping build packaged with UE4.15.0 Binary version with build number 3299760.

When I try to use EnableHMD function in a shipping build which does not start in VR mode,
a crash occurs only if the Rift CV1 is plugged in.

I successfully reproduced this issue using the VR Template that comes with UE4.15.
It just needs some minor modifications to be able to crash.

Crash reproduction steps:

  1. Create a project using Virtual Reality Template
  2. Go to Project Settings → Maps & Modes → Set GameDefaultMap to HMDLocomotionMap
  3. Go to Project Settings → Packaging → Set BuildConfiguration to Shipping and check IncludeDebugFiles
  4. Edit HMDLocomotionPawn Blueprint → Add the InputEvent ‘H’ Key and connect to EnableHMD with Enabled boolean option checked. Figure 1:

  1. Package the project to Windows (64-bit)
  2. Make sure that Rift CV1 is plugged and its service is running
  3. Open the packaged build and type ‘H’
  4. Boom! The crash occurs… (my call stack is in the end of this question)

Observations:

The weird part happens in three independent occasions:

  • If you change the BuildConfiguration to Development, the EnableHmd function behaves as expected and does not crash the program.
  • If you check StartInVR option in Project Settings → Project → Description, the program starts in VR and it’s possible to toggle EnableHMD function normally using the code from Figure 2:

  • If you use HTC instead of Rift CV1, the program works without any problem.

Call stack from crash (step 8):

Access violation - code c0000005 (first/second chance not available)

UE4Game_Win64_Shipping!FRCPassPostProcessTonemap::Process()
UE4Game_Win64_Shipping!FRenderingCompositionGraph::RecursivelyProcess()
UE4Game_Win64_Shipping!FRenderingCompositePassContext::Process()
UE4Game_Win64_Shipping!FPostProcessing::Process()
UE4Game_Win64_Shipping!FDeferredShadingSceneRenderer::Render()
UE4Game_Win64_Shipping!FRelevancePacket::RenderThreadFinalize()
UE4Game_Win64_Shipping!TGraphTask<`FRendererModule::BeginRenderingViewFamily'::`14'::EURCMacro_FDrawSceneCommand>::ExecuteTask()
UE4Game_Win64_Shipping!FNamedTaskThread::ProcessTasksNamedThread()
UE4Game_Win64_Shipping!FNamedTaskThread::ProcessTasksUntilQuit()
UE4Game_Win64_Shipping!RenderingThreadMain()
UE4Game_Win64_Shipping!FRenderingThread::Run()
UE4Game_Win64_Shipping!FRunnableThreadWin::Run()

Hello gagallo7

I was able to reproduce this issue on our end. I have written up a report and I have submitted it to the developers for further consideration. I have also provided a link to the public tracker. Please feel free to use the link provided for future updates. Thank you for your time and information.

Link: Unreal Engine Issues and Bug Tracker (UE-42743)

Make it a great day

Thanks Rudy for checking my issue.

Hi I’m having some trouble with this issue. I’ve been struggling since 4.13 with this… I need to finalise this project within a couple of days… Is there any known workarounds? or should i somehow migrate to 4.12?

Hello foxhound101,

I do not have a workaround for this issue at this time.

Hi Rudy, thanks for yor reply. What would the workaround be? at the moment after some tests it seems it might not be the enable hmd that is causing the fatal error

Gee Since March, and marked as resolved? That does not make sense.

This is a current issue and my question is, are people able to package VR games for the Rift with this issue?
What part of my example project is causing this?

Sorry Rudy , I missread your comment, only noticed now that you said “not” :stuck_out_tongue:

Just to add: I mannaged to get my project packaged and working with the rift turnig on and of from menu to playback in the map. I upgraded the engine Version to 4.17.2. This seemed to fix everything and i haven’t had any problems like this since.

I’m in 4.16.3, is there any workaround for this?? I can’t upgrade engine version and I need this working :confused: