ARKitSession() doesn't always start

We have a random issue that when ARKitSession.run() is called, monitorSessionEvents() receives .paused and it never transitions to .running If we exit Immersive Space and do ARKitSesssion.run() again it works fine. Unfortunately this is very difficult to manage in the flow of our App.

Hello @rcpdesigns,

Can you provide a focused sample project that reproduces the behavior you are observing?

I will see if the Object Placement Sample Project exhibits the same issue.

One question we have is what order should the monitoring tasks be kicked off?

We have a Task that does for await event in arkitSession.events We have another that does for await anchorUpdate in worldTracking.anchorUpdates These are started before ARKitSession.run()

Perhaps these should be started after??

Are you calling ARKitSession.run() after the user has entered the immersive space or before?

The order of calls should not affect the eventual state changes. But a DataProvider will only go to .running, when your app is immersive. That said you can run your session in either state. Once you are immersive, it should transition to .running.

After on the load of the Immersive View

More information. I just had ARKit stay in .pause and while await openImmersiveSpace(id: "OurSpace") returned .opened: there were no graphics visible. I took the AVP off, waited 5 second, put it back on, entered my passcode and our App resumed with graphics in place and ARKit in .running As such I believe the problem might not be ARKit failing to start running but rather Immersive Space saying it is open but it isn't. Either is a problem of course but ImmersiveSpace saying it is open but actually isn't is a bigger problem as it is hard to detect. I will create FB but a minimal sample is going to be difficult. I did try updating to 1.2 beta 4 but I still see the issue. I would say once out of 30 times. Feels like a race condition but I have no idea what I might be able to change to alleviate the issue.

ARKitSession() doesn't always start
 
 
Q