CreateSessionAsync() intermittently never returns
Opened this issue · 5 comments
Description
We've been experiencing issues in our app where occasionally the ASA setup flow would never return from SpatialAnchorManager.CreateSessionAsync(). We made an editable copy of the ASA Core package so we could add some extra logging in and we tracked the issue down to the call to Windows.Perception.Spatial.SpatialAnchorExporter.RequestAccessAsync();
which is called when validating the configuration. This function will await forever.
It appears to be some kind of race condition or timing-based issue as depending on what Unity version we use, it triggers at a slightly different frequency, going from 10% up to 50% of the time. Furthermore, we can't reproduce it in a standalone test app, only in our own app, but given how constrained the problem function is it's hard to conclude there is something specific in our app which is causing the problem.
As a workaround, we've commented out the spatial perception permission check and we no longer suffer the issue anymore.
We use ASA for synchronising multiple users in the same room, but because we're a distributed team we don't regularly get to test the feature so we can't say for sure when this issue started happening. Anecdotally, our users have reported more issues with ASA recently despite the app in the store not changing for 2 months. It's not conclusive, but it may indicate an OS update that causes this to happen more frequently.
Development information
- Development Platform\Version: Unity 2020.3.19 & 2020.3.35
- Azure Spatial Anchors SDK version: 2.11.0 & 2.12.0
AR Device information
- Device: HoloLens 2
- OS: 10.0.20348.1506
Hi, Edd. May I have a few questions based on your information?
- About the "editable copy of the ASA Core package", how do you make the package editable and how do you edit it?
- Could you please share the "extra logging" which help you "tracked the issue down to the call to Windows.Perception.Spatial.SpatialAnchorExporter.RequestAccessAsync()"
- Is it possible for you to share the test app project with us for investigation purpose?
Thank you very much.
- We just copied the package from the Library/PackageCache folder into another directory and added it to the Unity package manager using the "Add package from disk..." option.
- We just added a Debug.Log line for every line inside CreateSessionAsync so we know which line it was called then it doesn't return. Then when it didn't return from EnsureValidConfiguration we added line for in every inside that and so on until we found it was
Windows.Perception.Spatial.SpatialAnchorExporter.RequestAccessAsync()
that never returns. - Unfortunately, the test app doesn't trigger the issue only our app.
@WikkidEdd Hi, Edd. As I mentioned in Issue 356. I spent several attempts to build and run the ASABug app on my HL2, unfortunately I never got a chance to reproduce it successfully.
We just released a new version of SDK 2.13.0.
Could you try this new version of SDK to see if the problem still persists please?
Thank you very much.
Hello @WikkidEdd - similarly for this issue, was the update in July helpful? If not, please let us know along with any additional details that may be helpful for us to investigate further, thank you