Mixedrealitytoolkit-unity: InputManager crashes Unity when VR disabled or HMD is not connected.

Created on 26 Sep 2017  路  25Comments  路  Source: microsoft/MixedRealityToolkit-Unity

It is very easy to reproduce:

  1. Create new project, add MRT from Dev_Unity_2017.2 branch
  2. Apply HoloLens project settings
  3. Add HoloLens Camera perfab
  4. Add InputManager prefab
  5. Save scene
  6. Click on Play button in Unity, that will crash Unity displaying Unity Bug Reporter window. Removing InputManager will allow to run this scene.

Confirmed with Unity 2017.2.0f1 & MRT Dev_Unity_2017.2 (built yesterday).

Immersive HMD

All 25 comments

Is developer mode enabled in os settings on your machine?

Yes it is. I can run Play mode on Unity 5.6.3.p4 with previous HTK without problems.

I can run Play mode on Unity 5.6.3.p4 with previous HTK without problems.

Well, the dev branch input system is fundamentally different. APIs and gaze vs pointer changes.

And your build settings target uwp?

2017-09-26_100927
Yes. As I said there is no problem to deploy to emulator/HoloLens device. Just on local machine is not working.

Gotta target the latest SDK 10.0.16257

Do you have a head mounted display plugged in?

Acer or HP mixed reality VR headset.

I tried with all SDKs and all crashes. About HMD I have it disconnected right now. But yes, I have HP and Mixed Reality Portal installed. I didn't try to deploy anything to HMD yet.

If you don't have the headset plugged in it'll crash unless you disable VR in player settings.

I disabled "Virtual Reality Supported" checkbox and it is still crashing. I changed target to "Any device" but it is not helping. But you are right it is somehow connected to HMD. I connected my HP and launch MR Portal. When I enabled VR again and pressed Play it run on my HMD and it doesn't crash!
Unfortunately there are some Unity errors:
Unsupported texture format 0x0 Thread is not attached to scripting runtime

Yeah, sounds like a unity bug. Be sure to log it if the crash window pops up again.

Pretty sure it has something to do with the new API surface.

We might also need to wrap the XR specific functionality, the input manager ought to work without the needing to enable VR.

I made a test on other machine that has no Mixed Reality Portal installed and where my HP was never connected. There is same issue on "Play" button hit. I send log to Unity.

Many thanks @StephenHodgson for your help!

In Unity log file there is only this error.
Unity.exe caused an Access Violation (0xc0000005) in module Unity.exe at 0033:418482e4.

I believe this is a Unity bug (sorry for only spotting this issue now).

Currently Unity will crash with the MRToolkit if either:

  • Active platform is not UWP
  • MR Portal is not launched in advance (it will timeout and crash otherwise)

We can prevent the first, by forcing the platform switch on hitting Play. The second is Unity's bag sadly.

I reported the same already in #988, so this issue is a duplicate.

Trying to determine if I'm running into the same issue. I first grabbed the latest of the dev branch, but then after seeing @jessemcculloch 's comment in slack about merging occurring, I grabbed the pre-release unitypackage. Both had this same issue...

I have a super simple scene. It appears that it crashes when the InputManager prefab is in the scene when I hit play. If I remove the InputManager all is well.

I'm running Creators Update (not RS3 / Fall Creators Update). I'm working with the HoloLens camera prefab and not the immersive headset, but I was trying to see if 2017.2 would work with the HoloLens yet.

So my issue may not be the same thing, but I did want to bring it up in case it is related.

@kewlniss pretty sure you need RS3 for the dev branch

hmm, so you are saying that to do HoloLens development the dev OS will have to have a particular version to use the MRTK? (assuming dev gets merged into master as-is)
Understand for Immersive headsets, but seems strange to break HoloLens devs workflow. (Won't be an issue for me in a couple weeks when RS3 is officially out, but may be an issue for others?)

You need RS3 for MR development. For HL, I don鈥檛 think it鈥檚 required (unless something has changed)

Use the releases tab for the latest stable version. The source is going through an overhaul tonight so there will be some teething problems for a few days (or come and dig in to help clean up ??)

The 2012.2 branch is mainly for MR/Immersive atm.

@kewlniss the hope is to get it so we can do any UWP platform in one go. But it takes time to fit it all together.

Oh, I totally understand that. Definitely appreciate all the work you in particular are doing here. I guess I'm just trying to understand what the path looks like if the current dev branch is getting merged into master. That certain folks should grab a particular release to use and not the latest from master?

That is correct, unless you'd like to help test.

@DDReaper @StephenHodgson I'll be happy to test anything on this version of the OS. Let me know how I can help! (Let me know what release to pull to see if it is working with the HoloLens, etc.) I've been fine staying on the main branch and 2017.1, but since the merge was taking place I assumed folks that only did HoloLens (most of my students) would be safe to use the master as that is how it has always been. Again, let me know what I can do to help test.

I'm on Win10 16278.rs3_release, Win10 SDK 16288. Unity 2017.20f1 and I get a crash when I hit play in editor. My platform is set to UWP. I'm developing for HoloLens and haven't ever connected a Mixed Reality device to my machine. Happens regardless if I have VR enabled or not. No problem building and running on HoloLens. The callstack looks like

Assertion failed on expression: 'NULL != this->ptr'
UnityEngine.XR.WSA.Input.InteractionManager:Initialize(IntPtr)
UnityEngine.XR.WSA.Input.InteractionManager:.cctor() (at C:\buildslave\unity\build\Runtime\VR\HoloLens\ScriptBindings\GestureSource.cs:410)
HoloToolkit.Unity.InputModule.InteractionSourceInputSource:OnEnableAfterStart() (at Assets\HoloToolkit\Input\Scripts\InputSources\InteractionSourceInputSource.cs:250)
HoloToolkit.Unity.InputModule.InteractionSourceInputSource:OnEnableAfterStart() (at Assets\HoloToolkit\Input\Scripts\InputSources\InteractionSourceInputSource.cs:237)
HoloToolkit.Unity.StartAwareBehaviour:Start() (at Assets\HoloToolkit\Utilities\Scripts\StartAwareBehaviour.cs:34)

[C:\buildslave\unity\build\PlatformDependent/Win/ComPtr.h line 84] 
(Filename: Assets/HoloToolkit/Input/Scripts/InputSources/InteractionSourceInputSource.cs Line: 250)

Not sure if I should start the above report as a separate issue? Let me know and I can create one.
For now I've wrapped the code in InteractionSourceInputSource.cs in #if !UNITY_EDITOR and I can now play in editor without crashing.

crash when runing the code InteractionManager.InteractionSourceUpdated += InteractionManager_InteractionSourceUpdated;

Problem still exists on Unity 2017.2.0f2 MRTP build that can be downloaded here:
https://forum.unity.com/threads/custom-build-2017-2-rc-mrtp-windows-mixed-reality-technical-preview.498253/

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dfields-msft picture dfields-msft  路  3Comments

reillydonovan picture reillydonovan  路  3Comments

markgrossnickle picture markgrossnickle  路  3Comments

overedge picture overedge  路  3Comments

jimstack picture jimstack  路  3Comments