Azure / azure-spatial-anchors-samples

Azure Spatial Anchors sample code
Other
293 stars 138 forks source link

InvalidOperationException: Error: Failed to create an OpenXR NeighborhoodData Stream #368

Open SimonDarksideJ opened 2 years ago

SimonDarksideJ commented 2 years ago

Description

We've been testing ASA on HoloLens with an Anchor system running, which has been fine. Anchors are created and ID's are generated.

However, We recently started testing in the desired pattern of having multiple devices in the same physical location and using a single anchor to locate content to be shared between devices in the same physical location.

This results in the error:

InvalidOperationException: Error: Failed to create an OpenXR NeighborhoodData Stream

Being generated on any device that initialises in the same location.

Steps to reproduce the issue

If the issue occurs in one of the ASA sample apps, please detail the steps required to reproduce it. Otherwise, provide details on how to reproduce it in your custom app.

  1. Create a Unity Solution using the ASA functions to simply start in a location and share an ID
  2. On the first headset, start up, create an anchor and make the ID sharable to a second device
  3. On the second device, start the solution and when "StartSessionAsync" is called
  4. See error

Expected behavior

Both devices should be able to use Anchors in the same location...

Screenshots

InvalidOperationException: Error: Failed to create an OpenXR NeighborhoodData Stream, Reason: Unknown XrResult.
  at Microsoft.Azure.SpatialAnchors.NativeLibraryHelpers.CheckStatus (System.IntPtr handle, Microsoft.Azure.SpatialAnchors.status value) [0x00000] in <00000000000000000000000000000000>:0 
  at Microsoft.Azure.SpatialAnchors.CloudSpatialAnchorSession.Start () [0x00000] in <00000000000000000000000000000000>:0 
  at Microsoft.Azure.SpatialAnchors.Unity.SpatialAnchorManager+<StartSessionAsync>d__42.MoveNext () [0x00000] in <00000000000000000000000000000000>:0 
  at System.Runtime.CompilerServices.AsyncTaskMethodBuilder.Start[TStateMachine] (TStateMachine& stateMachine) [0x00000] in <00000000000000000000000000000000>:0 
  at Microsoft.Azure.SpatialAnchors.Unity.SpatialAnchorManager.StartSessionAsync () [0x00000] in <00000000000000000000000000000000>:0 

Development information (please complete the following information)

AR Device information (please complete the following information):

Additional context

Add any other context about the problem here.

SimonDarksideJ commented 2 years ago

Ok, so this may be a non-issue, but something everyone should be aware of. The likely cause is OpenXR not being up to date.

One of the devices we were testing with it turns out had not been updated in a while, which then auto-updated overnight and now no longer causes the issue. But as it has updated we can not confirm 100% that this was the cause but it is highly likely.

However, the framework should NOT fail in such a way to create an untraceable issue, so an update is needed to ensure that it raises or handles the exception better in the ASA framework for a dependency such as OpenXR (considering how new it is to the HoloLens and the new OpenXR plugin).

This should be the required fix for this issue, better exception handling for OpenXR

Varnauld commented 2 years ago

Hello, Apologies for the delay - assigning to @darax (tracking [41155761]), thank you