# EnableHMD function in Shipping packaged project crashing with Oculus Rift CV1

**URL:** <https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299>\
**Category:** XR Development\
**Tags:** rift, unreal-engine, shipping-build, crash, bug-report, question\
**Created:** [March 8, 2017, 12:25pm UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299 "2017-03-08T12:25:28Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![gagallo7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gagallo7](https://forums.unrealengine.com/u/gagallo7)\
**Post date:** [March 8, 2017, 12:25pm UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/1 "2017-03-08T12:25:28Z")

</div>

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:

 ![129121-enablehmd+snippet.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/5/6/9/5690705c7bf6e8e48eb8139c1b7ecca83e87bc42.png)

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:

 ![129122-enablehmd+with+flipflop.png](https://d3kjluh73b9h9o.cloudfront.net/original/4X/b/e/5/be501d6d32b6b83069e7fd1ff8fc311ae65ee395.png)

- 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()

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [March 9, 2017, 9:59pm UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/2 "2017-03-09T21:59:36Z")

</div>

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)](https://issues.unrealengine.com/issue/UE-42743)

Make it a great day

---

<div class="post-metadata">

**Author:** ![gagallo7](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@gagallo7](https://forums.unrealengine.com/u/gagallo7)\
**Post date:** [March 10, 2017, 5:02pm UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/3 "2017-03-10T17:02:35Z")

</div>

Thanks Rudy for checking my issue.

---

<div class="post-metadata">

**Author:** ![foxhound101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@foxhound101](https://forums.unrealengine.com/u/foxhound101)\
**Post date:** [September 18, 2017, 5:17pm UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/4 "2017-09-18T17:17:49Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e729f54e](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e729f54e](https://forums.unrealengine.com/u/anonymous_user_e729f54e)\
**Post date:** [September 18, 2017, 6:12pm UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/5 "2017-09-18T18:12:31Z")

</div>

Hello foxhound101,

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

---

<div class="post-metadata">

**Author:** ![foxhound101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@foxhound101](https://forums.unrealengine.com/u/foxhound101)\
**Post date:** [September 19, 2017, 7:12am UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/6 "2017-09-19T07:12:11Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![KyperGamer](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@KyperGamer](https://forums.unrealengine.com/u/KyperGamer)\
**Post date:** [November 9, 2017, 6:17am UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/7 "2017-11-09T06:17:23Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![foxhound101](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@foxhound101](https://forums.unrealengine.com/u/foxhound101)\
**Post date:** [November 15, 2017, 7:45am UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/8 "2017-11-15T07:45:03Z")

</div>

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

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.

---

<div class="post-metadata">

**Author:** ![Jovimaca](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@Jovimaca](https://forums.unrealengine.com/u/Jovimaca)\
**Post date:** [September 14, 2018, 10:54am UTC](https://forums.unrealengine.com/t/enablehmd-function-in-shipping-packaged-project-crashing-with-oculus-rift-cv1/387299/9 "2018-09-14T10:54:35Z")

</div>

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