awtterpip / bevy_oxr

Apache License 2.0
218 stars 37 forks source link

Pico 4 support #60

Open ZAZPRO opened 9 months ago

ZAZPRO commented 9 months ago

Unfortunately I am not very experienced but would be happy to help.

I have modified xr.rs example, to move it into separate directory and remove any oculus mentioning from the code and manifest and added required one as stated here.

Also have added libopenxr_loader.so as required.

App builds successfully, but I get infinite loading when I try to launch it.

Here is a logcat error log:

12-18 01:35:25.182 5791 5791 E _openxr_androi: Not starting debugger since process cannot load the jdwp agent. 12-18 01:35:25.184 5791 7401 E libprocessgroup: AddTidToCgroup failed to write '7401'; fd=42: Permission denied 12-18 01:35:25.184 5791 7401 E libprocessgroup: Failed to add task into cgroup 12-18 01:35:25.184 5791 7403 E libprocessgroup: AddTidToCgroup failed to write '7403'; fd=42: Permission denied 12-18 01:35:25.184 5791 7403 E libprocessgroup: Failed to add task into cgroup --------- beginning of system 12-18 01:35:25.203 5791 7410 E libprocessgroup: AddTidToCgroup failed to write '7410'; fd=42: Permission denied 12-18 01:35:25.203 5791 7410 E libprocessgroup: Failed to add task into cgroup 12-18 01:35:25.232 5791 7418 E PxrLoader: Error [GENERAL | xrEnumerateInstanceExtensionProperties | PxrLoader] : RuntimeInterface::LoadRuntime supports XR_KHR_LOADER_INIT_SUPPORT! 12-18 01:35:25.232 5791 7418 E PxrRuntime: xrNegotiateLoaderRuntimeInterface 12-18 01:35:25.233 5791 7418 E PxrConfigServiceClient: getConfigurationServiceBinder binder is not null 12-18 01:35:25.280 5791 7418 E PxrRuntime: sdk_boundary_EnableSeethroughDelayLog=0 12-18 01:35:25.280 5791 7418 E PxrRuntime: sdk_boundary_ReportSeethroughDelayData=1 12-18 01:35:25.281 5791 7418 E PxrRuntime: getPackageManagerInfo : {"app_fps":0,"eyebufferHeight":0,"eyebufferWidth":0} 12-18 01:35:25.281 5791 7418 E PxrRuntime: oxr_instance_create ,package_name org.bevyengine.demo_openxr_android,eyebuffer (0,0),packageFps 0, isGLTileRender 0

Would be happy to help and answer any questions.

SafariMonkey commented 9 months ago

I don't have a Pico device or the time right now to delve into this, but FYI you don't necessarily need to remove all mention of Oculus, which looking at the code I take to mean the Oculus controller profile. The Oculus controller profile might well work on Pico.

In order for others to identify potential problems, it may also help to push a branch to a fork with your changes, and link it here.

ZAZPRO commented 9 months ago

Thanks a lot for your answer. I do expect that I am the only one with the device.

You were right about oculus stuff, in the code that meant oculus controller. I have made this decision, because their SDK has mentioned their own controller extension here and I wanted just to render something as a start.

As I have not succeeded in getting anything, I have assumed that my own branch / fork is useless.

ZAZPRO commented 9 months ago

Unfortunately, I could not make even OpenXR's helloXR example work, same problem - infinite loading. So that's definitely my fault here.

tshirtman commented 9 months ago

I have both a Quest3 and a Pico4, i know pico also supports openxr and i built/ran their example some times ago, though didn't really get further than that. For now i'm mostly trying to make sense of the project (and i'm pretty new to rust), once it's clearer what is implementation and what is example code, maybe integrating & testing pico4 support will be possible.

Schmarni-Dev commented 7 months ago

you should only need the pico openxr loader and maybe edit the manifest file of your application

ZAZPRO commented 7 months ago

you should only need the pico openxr loader and maybe edit the manifest file of your application

Here are the changes I did, that you can see in the fork. https://github.com/ZAZPRO/bevy_oxr I did also use pico sdk libopenxr_loader (but it is in the gitignore)

Schmarni-Dev commented 7 months ago

hm, if i understand correctly from the Cargo.toml changes pico needs the runtime broker, which iirc xbuild doesn't support the required fields to add the needed stuff to the resulting manifest

ZAZPRO commented 7 months ago

hm, if i understand correctly from the Cargo.toml changes pico needs the runtime broker, which iirc xbuild doesn't support the required fields to add the needed stuff to the resulting manifest

The fields that I state at manifest.yml or Cargo.toml are added into the AndroidManifest.xml for the final .apk file. Same for libopenxr_loader.so. It is there in the final .apk file too.

Not sure what kind of runtime broker is required.

Schmarni-Dev commented 2 months ago

this should work with #147, that should also remove any special setup for the bevy_openxr_android crate. if anyone wants to try this on pico