godot_openxr
godot_openxr copied to clipboard
Need help for pico neo3 device
Pico support using openxr mobile sdk with guide here and SDK here So I try to run godot vr demo game on Pico neo3:
src/main/cpp/CMakeLists.txt
#set(OPENXR_MOBILE_ROOT_DIR "${CMAKE_SOURCE_DIR}/../thirdparty/oculus_mobile_sdk/OpenXR")
set(OPENXR_MOBILE_ROOT_DIR "${CMAKE_SOURCE_DIR}/../thirdparty/pico_openxr_sdk/")
src/main/AndroidManifest.xml
<meta-data android:name="pvr.app.type" android:value="vr" />
But I only got these error log when launching:
2022-02-20 11:22:47.292 12311-12311/org.godotengine.godotopenxrdemo.ovr I/Perf: Connecting to perf service.
2022-02-20 11:22:47.301 12311-12311/org.godotengine.godotopenxrdemo.ovr W/ActivityThread: notifyAppLaunchStatus org.godotengine.godotopenxrdemo.ovr org.godotengine.godotopenxrdemo.MainActivity
2022-02-20 11:22:47.336 12311-12311/org.godotengine.godotopenxrdemo.ovr I/GodotPluginRegistry: Initializing Godot plugin OpenXR
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr I/GodotPluginRegistry: Completed initialization for Godot plugin OpenXR
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: java.io.FileNotFoundException: _cl_
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.content.res.AssetManager.nativeOpenAsset(Native Method)
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.content.res.AssetManager.open(AssetManager.java:824)
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.content.res.AssetManager.open(AssetManager.java:801)
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at org.godotengine.godot.Godot.parseCommandLine(Godot.java:484)
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at org.godotengine.godot.Godot.getCommandLine(Godot.java:467)
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at org.godotengine.godot.Godot.onCreate(Godot.java:600)
2022-02-20 11:22:47.341 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at androidx.fragment.app.Fragment.performCreate(Fragment.java:2949)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at androidx.fragment.app.FragmentStateManager.create(FragmentStateManager.java:475)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:278)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at androidx.fragment.app.FragmentManager.executeOpsTogether(FragmentManager.java:2189)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at androidx.fragment.app.FragmentManager.removeRedundantOperationsAndExecute(FragmentManager.java:2100)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at androidx.fragment.app.FragmentManager.execSingleAction(FragmentManager.java:1971)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at androidx.fragment.app.BackStackRecord.commitNowAllowingStateLoss(BackStackRecord.java:311)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at org.godotengine.godot.FullScreenGodotApp.onCreate(FullScreenGodotApp.java:72)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.Activity.performCreate(Activity.java:7844)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.Activity.performCreate(Activity.java:7833)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1307)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3261)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3427)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:83)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2017)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.os.Handler.dispatchMessage(Handler.java:107)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.os.Looper.loop(Looper.java:214)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at android.app.ActivityThread.main(ActivityThread.java:7417)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at java.lang.reflect.Method.invoke(Native Method)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492)
2022-02-20 11:22:47.342 12311-12311/org.godotengine.godotopenxrdemo.ovr W/System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:935)
2022-02-20 11:22:47.390 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: Couldn't load file 'res://project.binary', error code 19.
2022-02-20 11:22:47.390 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: _load_settings_text_or_binary (core/project_settings.cpp:627) - Couldn't load file 'res://project.binary', error code 19.
2022-02-20 11:22:47.391 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: Failed to get modified time for: project.godot.
2022-02-20 11:22:47.391 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: _get_modified_time (drivers/unix/file_access_unix.cpp:310) - Method failed. Returning: 0
2022-02-20 11:22:47.396 897-12378/? I/PxrStreamingService: Call <pvrManagerCallBack> - onEventChange:key=activity_status value=activityOnResume:org.godotengine.godotopenxrdemo.ovr,org.godotengine.godotopenxrdemo.MainActivity
2022-02-20 11:22:47.396 894-12377/? I/PxrHmdService: Call <pvrManagerCallBack> - onEventChange:key=activity_status value=activityOnResume:org.godotengine.godotopenxrdemo.ovr,org.godotengine.godotopenxrdemo.MainActivity
2022-02-20 11:22:47.397 6602-6027/? I/PVRShell: OnActivityResumed, componentName = org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity, displayMode = 0, startMode = vr, isPUIApp = false, rotation = 1
2022-02-20 11:22:47.398 12311-12311/org.godotengine.godotopenxrdemo.ovr E/stereo: PackageName:org.godotengine.godotopenxrdemo.ovr type:null
2022-02-20 11:22:47.421 12311-12352/org.godotengine.godotopenxrdemo.ovr I/AdrenoGLES-0: QUALCOMM build : 70fbc48e4e, I30f6cedc70
Build Date : 06/15/21
OpenGL ES Shader Compiler Version: EV031.35.14.00
Local Branch :
Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.UM.8.12.C3.10.00.00.670.284
Remote Branch : NONE
Reconstruct Branch : NOTHING
2022-02-20 11:22:47.421 12311-12352/org.godotengine.godotopenxrdemo.ovr I/AdrenoGLES-0: Build Config : S P 8.0.12 AArch64
2022-02-20 11:22:47.421 12311-12352/org.godotengine.godotopenxrdemo.ovr I/AdrenoGLES-0: Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so
2022-02-20 11:22:47.421 12311-12352/org.godotengine.godotopenxrdemo.ovr I/AdrenoGLES-0: Driver Version : 0579.0
2022-02-20 11:22:47.427 12311-12352/org.godotengine.godotopenxrdemo.ovr I/AdrenoGLES-0: PFP: 0x016dd099, ME: 0x00000000
2022-02-20 11:22:47.435 12311-12311/org.godotengine.godotopenxrdemo.ovr E/VpsExtension: Failed to get binder for service "vendor.vpsservice"
2022-02-20 11:22:47.436 12311-12311/org.godotengine.godotopenxrdemo.ovr E/VpsExtension: Failed to get binder for service "vendor.vpsservice"
2022-02-20 11:22:47.444 12311-12374/org.godotengine.godotopenxrdemo.ovr I/godot: Godot Engine v3.4.stable.official.206ba70f4 - https://godotengine.org
2022-02-20 11:22:47.446 12311-12374/org.godotengine.godotopenxrdemo.ovr I/godot: OpenGL ES 2.0 Renderer: Adreno (TM) 650
2022-02-20 11:22:47.478 12311-12374/org.godotengine.godotopenxrdemo.ovr I/godot: OpenGL ES Batching: ON
2022-02-20 11:22:47.485 12311-12374/org.godotengine.godotopenxrdemo.ovr I/godot:
2022-02-20 11:22:47.486 12311-12374/org.godotengine.godotopenxrdemo.ovr I/libOpenSLES: Emulating old channel mask behavior (ignoring positional mask 0x3, using default mask 0x3 based on channel count of 2)
2022-02-20 11:22:47.502 12311-12374/org.godotengine.godotopenxrdemo.ovr W/AudioTrack: createTrack_l(118): AUDIO_OUTPUT_FLAG_FAST denied by server; frameCount 0 -> 1772
2022-02-20 11:22:47.598 1404-1437/? I/ActivityTaskManager: Displayed org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity: +784ms
2022-02-20 11:22:47.603 12311-12374/org.godotengine.godotopenxrdemo.ovr I/GodotInputHandler: === New Input Device: pvr-virtual-input-0
2022-02-20 11:22:47.604 12311-12374/org.godotengine.godotopenxrdemo.ovr I/GodotInputHandler: === New Input Device: pvr-virtual-input-1
2022-02-20 11:22:47.605 12311-12374/org.godotengine.godotopenxrdemo.ovr I/GodotInputHandler: === New Input Device: pvr-virtual-input-2
2022-02-20 11:22:47.606 12311-12374/org.godotengine.godotopenxrdemo.ovr I/GodotInputHandler: === New Input Device: pvr-virtual-input-3
2022-02-20 11:22:47.607 12311-12374/org.godotengine.godotopenxrdemo.ovr I/GodotInputHandler: === New Input Device: pvr-virtual-input-4
2022-02-20 11:22:47.709 2487-30988/? I/NestServer-Utils: getFocusedStackDisplayId: topActivity = ComponentInfo{org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity}
2022-02-20 11:22:47.717 2487-30988/? I/NestServer-Utils: getFocusedStackDisplayId: topActivity = ComponentInfo{org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity}
2022-02-20 11:22:47.732 12311-12311/org.godotengine.godotopenxrdemo.ovr I/GodotInputHandler: === New Input Device: pvr-virtual-input-1
2022-02-20 11:22:48.258 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: Cannot get path of node as it is not in a scene tree.
2022-02-20 11:22:48.258 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: get_path (scene/main/node.cpp:1587) - Condition "!is_inside_tree()" is true. Returned: NodePath()
2022-02-20 11:22:48.258 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: (Node not found: "" (relative to "").)
2022-02-20 11:22:48.258 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: get_node (scene/main/node.cpp:1326) - Condition "!node" is true. Returned: nullptr
2022-02-20 11:22:48.258 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: ViewportTexture: Path to node is invalid.
2022-02-20 11:22:48.258 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: setup_local_to_scene (scene/main/viewport.cpp:69) - Condition "!vpn" is true.
2022-02-20 11:22:48.265 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: Cannot get path of node as it is not in a scene tree.
2022-02-20 11:22:48.265 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: get_path (scene/main/node.cpp:1587) - Condition "!is_inside_tree()" is true. Returned: NodePath()
2022-02-20 11:22:48.265 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: (Node not found: "" (relative to "").)
2022-02-20 11:22:48.265 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: get_node (scene/main/node.cpp:1326) - Condition "!node" is true. Returned: nullptr
2022-02-20 11:22:48.265 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: ViewportTexture: Path to node is invalid.
2022-02-20 11:22:48.265 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: setup_local_to_scene (scene/main/viewport.cpp:69) - Condition "!vpn" is true.
2022-02-20 11:22:48.274 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: Cannot get path of node as it is not in a scene tree.
2022-02-20 11:22:48.274 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: get_path (scene/main/node.cpp:1587) - Condition "!is_inside_tree()" is true. Returned: NodePath()
2022-02-20 11:22:48.274 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: (Node not found: "" (relative to "").)
2022-02-20 11:22:48.274 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: get_node (scene/main/node.cpp:1326) - Condition "!node" is true. Returned: nullptr
2022-02-20 11:22:48.274 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: ViewportTexture: Path to node is invalid.
2022-02-20 11:22:48.274 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: setup_local_to_scene (scene/main/viewport.cpp:69) - Condition "!vpn" is true.
2022-02-20 11:22:48.291 12311-12374/org.godotengine.godotopenxrdemo.ovr W/PicoXR: context addr is 0x76ade4ceb8.
2022-02-20 11:22:48.330 12311-12374/org.godotengine.godotopenxrdemo.ovr E/PxrLoader: Error [GENERAL | xrEnumerateInstanceExtensionProperties | PxrLoader] : RuntimeInterface::LoadRuntime supports XR_KHR_LOADER_INIT_SUPPORT!
2022-02-20 11:22:48.330 12311-12374/org.godotengine.godotopenxrdemo.ovr E/PxrRuntime: xrNegotiateLoaderRuntimeInterface
2022-02-20 11:22:48.330 12311-12374/org.godotengine.godotopenxrdemo.ovr I/PxrLoader: Info [GENERAL | xrEnumerateInstanceExtensionProperties | PxrLoader] : RuntimeInterface::LoadRuntime succeeded loading runtime defined in manifest file using interface version 1 and OpenXR API version 1.0
2022-02-20 11:22:48.330 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: ERROR: OpenXR Runtime does not support OpenGL extension!
2022-02-20 11:22:48.330 12311-12374/org.godotengine.godotopenxrdemo.ovr E/godot: at: initialiseInstance (/mnt/data/workspace_godot/godot_openxr/src/openxr/OpenXRApi.cpp:1135) - OpenXR Runtime does not support OpenGL extension!
2022-02-20 11:22:48.339 12311-12374/org.godotengine.godotopenxrdemo.ovr I/godot: Deactivated LeftHandController
2022-02-20 11:22:48.339 12311-12374/org.godotengine.godotopenxrdemo.ovr I/godot: Deactivated RightHandController
2022-02-20 11:22:48.657 12311-12374/org.godotengine.godotopenxrdemo.ovr I/topenxrdemo.ov: System.exit called, status: 0
2022-02-20 11:22:48.657 12311-12374/org.godotengine.godotopenxrdemo.ovr I/AndroidRuntime: VM exiting with result code 0, cleanup skipped.
2022-02-20 11:22:48.669 1404-1734/? W/InputDispatcher: channel 'a7fa5bf org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity (server)' ~ Consumer closed input channel or an error occurred. events=0x9
2022-02-20 11:22:48.669 1404-1734/? E/InputDispatcher: channel 'a7fa5bf org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity (server)' ~ Channel is unrecoverably broken and will be disposed!
2022-02-20 11:22:48.670 1404-5504/? I/ActivityManager: Process org.godotengine.godotopenxrdemo.ovr (pid 12311) has died: fore TOP
2022-02-20 11:22:48.670 1404-1945/? I/WindowManager: WIN DEATH: Window{a7fa5bf u0 org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity}
2022-02-20 11:22:48.670 1404-1945/? W/InputDispatcher: Attempted to unregister already unregistered input channel 'a7fa5bf org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity (server)'
2022-02-20 11:22:48.679 1404-5504/? W/ActivityTaskManager: Force removing ActivityRecord{feecbdf u0 org.godotengine.godotopenxrdemo.ovr/org.godotengine.godotopenxrdemo.MainActivity t1506}: app died, no saved state
2022-02-20 11:22:48.735 2446-2597/? E/PvrFitServer_insertData: 1642163496116jrHOisl::org.godotengine.godotopenxrdemo.ovr::1000::0.0::0.0::0.0
2022-02-20 11:22:49.397 6602-6645/? I/Unity: VRShell------->OnActivityResumed = org.godotengine.godotopenxrdemo.ovr|org.godotengine.godotopenxrdemo.MainActivity|0|vr|false|1
Any advice?
Sounds like it needs to include parts of sdk, I know for Oculus it needs to link oculus' loader in. Cool to see Pico adopting OpenXR as well but I wish people would start supporting the Khronos loader so we didn't have to compile different versions of the plugin for each platform, kind defies the point of OpenXR :)
Wish I had time to dive into this because it would be interesting to see godot running on more Android platforms. @m4gr3d @ChristophHaag , do any of you have time to dive into this a bit more?
I would also like to see support for Pico. Hopefully I’ll find some time for looking into this soon.
@BastiaanOlij could you give some pointers as to what needs to be done and what to compile (especially regarding Godot 4). I'd like to dive into this.
@Sch1nken right now the plugin is based on Oculus' own OpenXR loader which means that on Android only Quest 2 is supported.
The way forward, what we're currently attempting with Godot 4, is to support the official Khronos OpenXR loader on Android and follow the standard. That should open up various XR platforms on Android but so far adoption seems to lag behind.
From what I've learned PICO seems to have gone down that same route as Meta, creating their own OpenXR loader and not fully adhering to the standard. I don't know if this is a temporary situation.
The problem that poses for us is that we need to create separate builds for each platform and potentially make platform specific changes in the core to support them. A big PITA.
Thanks for the thorough and quick response. I see the issues with having to support several different standars. I'm not familiar enough with the current code architecture for Godot XR (the core in Godot 4 that is). Some random thoughts:
- I was able to install and launch a Godot 4 Alpha 14 OpenXR Android APK on my Pico Neo 3. Although there were heavy artifacts, frame stutters, input didn't seem to work and the application never entered "vr mode". About the latter: I know from my own testing of dabbling into lower level Android/Pico programming, that the Pico needs some additional entries inside the AppManifest.xml. I'll check later if that helps alleviate some of those problems. (The Pico can run regular Android apps through a 2D-in-VR Viewport).
- Do we "need/want" universal APKs for several devices? I know even Unity struggles with mixed Oculus & Pico APKs. I wouldn't mind having to export an APK twice with different runtimes/loaders.
- I guess the OpenXR calls in Godot 4 are abstracted away (since one can select "Oculus" or "OpenXR" mode?).
- Are export templates in Godot 4 powerful enough to provide that option, or is modification to the core neccessary?
- Are plugins in Godot 4 to provide that option for the export dialogue?
I'm trying to gauge the best way to support several devices without heavy modification to the core.
Additionally: I should probably move this to the Godot repository?
@Sch1nken If all goes well code wise there shouldn't be much difference, the problem indeed lies with what is included within the manifest (which we can deal with) and that for Meta (and I assume Pico) we have to link in a proprietary loader library.
That last one is an issue because we can't include a non FOSS library in a FOSS project. We could get away with it in Godot 3 because there OpenXR is a plugin, but for Godot 4 it's now core functionality.
The whole point of OpenXR is that this should be avoided. Khronos provides a fully FOSS loader for OpenXR.
Meta had no choice as Khronos was not ready yet to offer a solution on Android when the Quest switched to using OpenXR. Hence Meta needed to create their own loader but as they followed the standard I am confident they will support the Khronos loader in the very near future as in theory they are interchangable.
Why Pico didn't just go for the Khronos loader, I don't know as it was available to them. I also heard that Pico did not follow the standard and you need different initialization code, but I am not sure if this is true. That said, Pico is pretty active so here too I think we'll soon find a resolve.
The first step for us is to provide support for the official Khronos loader and get Godot 4 up and running with Monado and HTC. That shouldn't be a lot of work, it just hasn't come to the top of my priority list yet (I'm actually planning on doing this soon).
After that there are two options.
- Meta/Pico finally adopt the Khronos loader, problem solved.
- We need to support the proprietary loaders which we will do by either enhancing the build script so you can switch between libraries being linked in, or we'll fork the engine and add that logic to a fork. Either case it will be specialized builds outside of the main FOSS code base.
What's the current status on this? @Sch1nken did you manage to get it working? I'm trying to get godot running on my pico 4