cancel
Showing results for 
Search instead for 
Did you mean: 

xrCreateSession: Activity is not yet in the ready state.

koujaku
Protege
I'm working on a Mixed Reality library called StereoKit, and I'm currently in the process of porting it to Android/Quest. I've made a fair bit of progress, and the native component of my library does in fact compile and run on the Quest 2!

However, my library is primarily consumed through C#, so now I'm working on loading up the library through Xamarin. I've got this working without OpenXR for flatscreen phone devices, but I'm still trying to figure out how to get this part working on the Quest. I'm currently at the state when OpenXR seems to initialize properly and my application begins to run, but OpenXR never transitions from the IDLE state to the READY state.

I do get this message from the log 'xrCreateSession: Activity is not yet in the ready state.' which I'm guessing might be the culprit, but I'm uncertain what would be causing this or how to fix it. From JNI, I initialize everything after the window is initialized, which works great. Under Xamarin, I initialize after a SurfaceView is created, but this is where I'm getting the Activity not ready message. Unfortunately, I'm not certain how equivalent these actions are, or what I might need to add to the SurfaceView to make it work better. Any tips or tricks, or an explanation for what might consist of a 'ready Activity'?

I can't link you to the code it seems, but I can paste some in here if anyone is interested in seeing it. It's on Github, in the StereoKit repo, sk_gpu branch. The Xamarin code is at Examples/StereoKitTest/StereoKitTest_Android/MainActivity.cs



1 REPLY 1

koujaku
Protege
Ok, so it looks like I was giving OpenXR the wrong Activity! I was trying to grab the active Activity through some arcane JNI calls, but it was returning some other activity instead of the one I wanted. From Xamarin, the correct link to the activity jobject is just 'this.Handle' from within your main Activity class.