HoloLens and MR Device Dev Advisory Jan-2018

I’ve come to accept that doing HoloLens and MR Device development means working with constant issues. As long as I can stay on top of what these issues are, I feel less like pulling out my hair. And I’m not just a member of the hair club for men – I also want to help you avoid hair loss with monthly updates.

I’m currently doing HoloLens development with VS 2017 v15.3.3, Unity 2017.2.0f3, MRTK 2017.1.2, and W10 17074 (Insider Build).

shared_buffer

This month saw the release of Unity 2017.3.0f3, which introduced a fix but also some new bugs. The fix is to the HoloLens stabilization issues introduced in December’s Unity 2017.2.1 release which caused holograms to be jittery. In Unity 2017.3.0f3, a new player setting in the editor called shared depth buffer fixes this. Just expand the Windows Mixed Reality node under XR Settings and check off Enable Depth Buffer Sharing. On the other hand, this seems to conflict with the stabilization logic in the MRTK, so you may see some jumpiness (but no jitteriness!) so you’ll want to remove that older logic from your code.

2017.3.0f3 also introduced problems with WWW (Unity’s older internet communication class). Basically, it doesn’t work when running in UWP anymore (though it does on other platforms and in the editor), so if your code or any assets you may be depending on for internet communication depend on WWW, you’ll have issues.

If you are using older stable builds of the MR Toolkit (up to 2017.1.2), you’ll start getting warnings and errors in 2017.2.0f03 and above about outdated APIs. Unity introduces API changes with each monthly release. The UnityEngine.VR.WSA namespace, for instance, is now UnityEngine.XR.WSA (sometimes the Unity editor will automatically fix this  for you when you migrate a project but often it doesn’t). In a couple of cases (like in the HandGuidance class) you’ll notice that the InteractionManager APIs have changed.

UnityEngine.XR.WSA.Input.InteractionManager.SourceLost += InteractionManager_SourceLost;
            UnityEngine.XR.WSA.Input.InteractionManager.SourceUpdated += InteractionManager_SourceUpdated;
            UnityEngine.XR.WSA.Input.InteractionManager.SourceReleased += InteractionManager_SourceReleased;

becomes:

UnityEngine.XR.WSA.Input.InteractionManager.InteractionSourceLost += InteractionManager_SourceLost;
            UnityEngine.XR.WSA.Input.InteractionManager.InteractionSourceUpdated += InteractionManager_SourceUpdated;
            UnityEngine.XR.WSA.Input.InteractionManager.InteractionSourceReleased += InteractionManager_SourceReleased;

The signature of the event handlers also change. Just follow Visual Studio Intellisense’s notes on how to fix the signatures.

HoloLens and MR Device Dev Advisory

indie_trap

 

[Update 10/17/17: I’m currently doing HoloLens development with VS 2017 v5.3.3, Unity 2017.1.2f1, MRTK 2017.1.2, and W10 17010. (This is one version of Windows 10 past what is recommended.) Unity 2017.2 for WMR development. There’s a new release of Visual Studio 2017 5.4 that I haven’t installed, yet. I am using Unity 2017.3.0 beta 5 for WebGL work.]

[Update 9/8/17: I’m currently having success in HoloLens development with Visual Studio 2017 (15.3.3), Unity 2017.1.0p5 (x64), SDK 14393, and HTK v1.2017.1.1 . This allows me to deploy Release builds, Unity C# Projects, and lets me debug remotely (my breakpoints are getting hit) from the regular File | Build Settings window. From the HoloToolkit Build and Deploy window, checking Unity C# Project throws an error. (To work around this, I am using two different deployment folders, one for debugging and one for non-debugging deployments.) I don’t think it matters, but I’m on Windows 10 insider build 16281. Will update if anything changes.]

[Update 9/7/17: Unity 2017.2.0b10 is definitely no go for HoloLens development. It just tries to run from the tile window and then goes black screen. Probably necessary for Immersive MR development, though.]

Sometimes it’s hard to know when to move forward and when to go backwards. If you are developing with Microsoft Mixed Reality products today (by which I mean on or around September 5th, 2017) you may need to do both.

Because common tools consisting of Visual Studio, Unity 3D and the open source Mixed Reality Toolkit (formerly the HoloToolkit) are used for both, and because we are at a point where multiple tools are being released at a rapid rate, conflicts are bound to happen, unfortunately.

For HoloLens development, it is best to roll back to the last working version of the tools you had. If you aren’t sure what those were, then I’d recommend using Visual Studio 2015 update 3, Unity 3D 5.6.3 patch 2 and HoloToolkit 1.5.8.0.

For immersive mixed reality, you want the latest of everything. As of today, that means Unity 2017.2.0b10 (and then b11 when that comes out). You will need Visual Studio 2017 update 3 (15.3) and finally you will need to be on the latest Windows Insider Build of Windows 10 from the fast ring (for instance build 16281, which has some very nice updates to the MR Portal).

These are the versions I could get working consistently. Other combinations, for HoloLens development, could potentially raise the following issues (though your mileage may vary – if so, please let me know in the comments):

  • unable to create Master builds, dev or release okay
  • apps deploy successfully but crash before the splash screen
  • unable to use remote debugging on your deployed app – get a dll missing error or “Please ensure that target device has developer mode enabled” error
  • IL weaving issues (this occurs for Visual Studio update 3 (15.3.3) and is fixed in patch 2017.1.0p5 as well as 5.6.3.0p2 (if you are using Visual Studio 2015 update 3)
  • Unable to create Unity C# Project builds (for debugging)

MR development with the wrong tool combination has raised some of these issues, such as the C# Project builds and IL weaving. In addition, there may be clipping issues if you don’t have the latest tools.

buildsetting

Note: You don’t really need Visual Studio 2017 for HoloLens development. Use VS 2015, instead. You only require VS 2017 if you are developing for Windows SDK 10.0.15063 or above. The HoloLens device, however, still runs on windows build 14393. When you export your solution from Unity, just be sure to change the UWP SDK property in Build Settings from its default value “Latest installed” to “10.0.14393.0”.

Note 2: You cannot currently publish your immersive MR app to the Windows Store. Just hold tight for now. It’s being worked out.

Quick recap: for now, you need different tool versions for HoloLens and Immersive MR Headset development. Use older tools for HoloLens but the latest and greatest for MR Headsets.

I will try to keep this updated as facts on the ground change.