----------- EDIT ---------------
I was able to get it to work by disabling OpenXR and enabling Windows Mixed Reality plugin.
This will be a temporary fix but, I would prefer not to use a plugin that is depricated.
When I went back to OpenXR the spatial mapping continued throwing the exception listed below.
Edit ----------- Okay I realized the spatial mapping is continuously restarting but keeps throwing this error with mirage.dll
Msg:[SpectrumCapabilityId_Surfaces]
analog\input\mirage\publicapi\spatialsurfaceobserverstatics.cpp(22)\Windows.Mirage.dll!00007FFDD1B32AD4: (caller: 00007FFDD20DC6A0) ReturnHr(71) tid(1a30) 80070005 Access is denied.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: winrt::hresult_access_denied at memory location 0x0000003697BFEFC0.
[MROpenXR][Error ][08:21:21.227244][tid:1a30] MicrosoftOpenXRPlugin_Failure XRResult=XR_ERROR_RUNTIME_FAILURE ErrorMessage=extensions.xrComputeNewSceneMSFT(sceneObserver, &computeInfo)
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: msxr::XrResultException at memory location 0x0000003697BFF4C0.
[MROpenXR][Error ][08:21:21.233187][tid:1a30] MicrosoftOpenXRPlugin_AnyException exception=UnknownFailure
The thread 0x1a30 has exited with code 0 (0x0).
Exception thrown at 0x00007FFDD9FA491C (KernelBase.dll) in Holo2_Attempt3.exe: WinRT originate error - 0x80070005 : 'RequestAccessAsync not called or disallowed for this resource'.
analog\input\mirage\publicapi\spatialsurfaceobserver.cpp(51)\Windows.Mirage.dll!00007FFDD1BC1D20: (caller: 00007FFDD1B32A88) ReturnHr(72) tid(15f8) 80070005 Access is denied.
XR-Plugin Management OpenXR Settings I installed Windows Mixed Reality to see if it would help, but it was not working before I installed the legacy plugin.
I have setup a unity project with MRTK 2 for the HoloLens 2. I am using Unity 2020.3.25 I am using Visual Studio 2019 16.9.6 I used Microsoft Mixed Reality Feature Tools and installed the following:
- Mixed Reality Toolkit Foundation 2.7.3
- Mixed Reality Toolkit Stanard Assets 2.7.3
- Mixed Reality Toolkit Extensions 2.73
- Mixed Reality OpenXR plugin 1.2.1
I have ran the toolkit configuration and have no errors or warnings and am currently using OpenXR My Build Settings
I can compile in Unity no errors, I open the deployment solution in Visual Studio 2019 and can compile without any errors.
I can deploy to the HoloLens without any errors.
However, once the app starts running on the HoloLens 2, I start getting runtime exceptions and the spatial mapping does not appear.
I have updated my HoloLens 2, so it should be up-to-date.
Input, hand gestures seem to work fine. I just do not have an spatial mapping capabilities.
I am using the default profiles recommended in the tutorials. I have allowed all permissions on the HoloLens for my application just to make sure it wasn't being blocked.
It is really important I get this platform up and running with spatial mapping, any help would be greatly appreciated. I have written no code, I just have a cube and a sphere in the scene, I am trying to see the visualized spatial mapping.
Thank you in advance. BT
Here are the first set of exceptions:
…
Exception thrown at 0x00007FFDD9FA491C (KernelBase.dll) in Holo2_Attempt3.exe: WinRT originate error - 0x80070490 : 'Element not found.'.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: Microsoft::CoreUI::Messaging::MessagingValidationException::Holder$ at memory location 0x0000005715DFCF90.
onecoreuap\drivers\mobilepc\sensors\convergence\common\pnpmanager\pnpmanager.cpp(574)\Windows.Devices.Sensors.dll!00007FFDB541B0B8: (caller: 00007FFDB54029C4) Exception(1) tid(1040) 80070002 The system cannot find the file specified.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: wil::ResultException at memory location 0x0000005715DFD370.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
onecoreuap\drivers\mobilepc\sensors\convergence\api\winrt\public\internal\simpleorientation.cpp(127)\Windows.Devices.Sensors.dll!00007FFDB540FB90: (caller: 00007FFDB5402278) Exception(2) tid(1040) 80070490 Element not found.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: wil::ResultException at memory location 0x0000005715DFD660.
onecoreuap\xbox\devices\api\winrt\pnpapiwrapper.cpp(385)\Windows.Gaming.Input.dll!00007FFDD13C7ED4: (caller: 00007FFDD13CC7D4) ReturnHr(17) tid(518) 8685C003 Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: [rethrow] at memory location 0x0000000000000000.
Exception thrown at 0x00007FFDD9FA491C (KernelBase.dll) in Holo2_Attempt3.exe: WinRT originate error - 0x80070005 : 'RequestAccessAsync not called or disallowed for this resource'.
analog\input\mirage\publicapi\spatialsurfaceobserver.cpp(51)\Windows.Mirage.dll!00007FFDD1BC1D20: (caller: 00007FFDD1B32A88) ReturnHr(2) tid(18cc) 80070005 Access is denied.
Msg:[SpectrumCapabilityId_Surfaces]
analog\input\mirage\publicapi\spatialsurfaceobserverstatics.cpp(22)\Windows.Mirage.dll!00007FFDD1B32AD4: (caller: 00007FFDD20DC6A0) ReturnHr(3) tid(18cc) 80070005 Access is denied.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: winrt::hresult_access_denied at memory location 0x00000057190FF5B0.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: msxr::XrResultException at memory location 0x00000057190FFBD0.
[MROpenXR][Error ][19:51:20.023011][tid:18cc] MicrosoftOpenXRPlugin_Failure XRResult=XR_ERROR_RUNTIME_FAILURE ErrorMessage=extensions.xrComputeNewSceneMSFT(sceneObserver, &computeInfo)
[MROpenXR][Error ][19:51:20.028603][tid:18cc] MicrosoftOpenXRPlugin_AnyException exception=UnknownFailure
The thread 0x18cc has exited with code 0 (0x0).
'Holo2_Attempt3.exe' (Win32): Loaded 'C:\Windows\system32\Windows.Web.dll'.
Exception thrown at 0x00007FFDD9FA491C (KernelBase.dll) in Holo2_Attempt3.exe: WinRT originate error - 0x80070005 : 'RequestAccessAsync not called or disallowed for this resource'.
analog\input\mirage\publicapi\spatialsurfaceobserver.cpp(51)\Windows.Mirage.dll!00007FFDD1BC1D20: (caller: 00007FFDD1B32A88) ReturnHr(4) tid(898) 80070005 Access is denied.
Msg:[SpectrumCapabilityId_Surfaces]
analog\input\mirage\publicapi\spatialsurfaceobserverstatics.cpp(22)\Windows.Mirage.dll!00007FFDD1B32AD4: (caller: 00007FFDD20DC6A0) ReturnHr(5) tid(898) 80070005 Access is denied.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: winrt::hresult_access_denied at memory location 0x00000057190FF6A0.
[MROpenXR][Error ][19:51:23.027257][tid:898] MicrosoftOpenXRPlugin_Failure XRResult=XR_ERROR_RUNTIME_FAILURE ErrorMessage=extensions.xrComputeNewSceneMSFT(sceneObserver, &computeInfo)
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: msxr::XrResultException at memory location 0x00000057190FFBA0.
[MROpenXR][Error ][19:51:23.032936][tid:898] MicrosoftOpenXRPlugin_AnyException exception=UnknownFailure
The thread 0x898 has exited with code 0 (0x0).
Exception thrown at 0x00007FFDD9FA491C (KernelBase.dll) in Holo2_Attempt3.exe: WinRT originate error - 0x80070005 : 'RequestAccessAsync not called or disallowed for this resource'.
analog\input\mirage\publicapi\spatialsurfaceobserver.cpp(51)\Windows.Mirage.dll!00007FFDD1BC1D20: (caller: 00007FFDD1B32A88) ReturnHr(6) tid(5bc) 80070005 Access is denied.
Msg:[SpectrumCapabilityId_Surfaces]
analog\input\mirage\publicapi\spatialsurfaceobserverstatics.cpp(22)\Windows.Mirage.dll!00007FFDD1B32AD4: (caller: 00007FFDD20DC6A0) ReturnHr(7) tid(5bc) 80070005 Access is denied.
Exception thrown at 0x00007FFDD9FA491C in Holo2_Attempt3.exe: Microsoft C++ exception: winrt::hresult_access_denied at memory location 0x00000057190FF340.
[MROpenXR][Error ][19:51:26.027702][tid:5bc] MicrosoftOpenXRPlugin_Failure XRResult=XR_ERROR_RUNTIME_FAILURE ErrorMessage=extensions.xrComputeNewSceneMSFT(sceneObserver, &computeInfo)