awtterpip / bevy_oxr

Apache License 2.0
249 stars 39 forks source link

Failed loading libopenxr_loader.so on Meta Quest 3 #161

Closed ChristianSchott closed 1 month ago

ChristianSchott commented 1 month ago

Hi, sorry if this is a dumb question, I am pretty new to cross-platform building with Rust.

I have tried building and running the example/android app for Quest3 using x run --device [...] --release, which worked fine, but inside the headset I am stuck on a black loading screen, and the only way out seems to be to restart the headset. (this is likely a duplicate of !137)

Looking in the logs, I assume that this is the root cause of the problem: Failed to initialize openxr: OpenXR loading error: dlopen failed: library "libopenxr_loader.so" not found

However, the provided build script did seem to work properly, and I assumed that xbuild would automatically package the runtime_libs into the build.

image

Does anyone know what is going wrong here?

Great work btw! I have already played around with it a bit, running on the desktop and connecting via Link.

Full Log [1/3] Fetch precompiled artifacts info: component 'rust-std' for target 'aarch64-linux-android' is up to date [1/3] Fetch precompiled artifacts [91ms] [2/3] Build rust `bevy_openxr_android` [EDIT: removed some warnings] Finished `release` profile [optimized] target(s) in 0.33s [2/3] Build rust `bevy_openxr_android` [401ms] [3/3] Create aab [2640ms] C:\Users\Chris\Documents\Git\bevy_oxr\target\x\release\android\bev...ab: 1 file pushed, 0 skipped. 31.8 MB/s (23122057 bytes in 0.693s) Success Starting: Intent { act=android.intent.action.MAIN cmp=org.bevyengine.example_openxr_android/android.app.NativeActivity } pid of org.bevyengine.example_openxr_android is 5458 --------- beginning of main 5458 5458 E _openxr_androi: Not starting debugger since process cannot load the jdwp agent. 5458 5458 D CompatibilityChangeReporter: Compat change id reported: 171979766; UID 10008; state: ENABLED 5458 5458 W System : ClassLoader referenced unknown path: 5458 5458 V GraphicsEnvironment: ANGLE Developer option for 'org.bevyengine.example_openxr_android' set to: 'default' 5458 5458 V GraphicsEnvironment: ANGLE GameManagerService for org.bevyengine.example_openxr_android: false 5458 5458 V GraphicsEnvironment: Neither updatable production driver nor prerelease driver is supported. 5458 5458 D CompatibilityChangeReporter: Compat change id reported: 175409949; UID 10008; state: DISABLED 5458 5458 D CompatibilityChangeReporter: Compat change id reported: 175409951; UID 10008; state: ENABLED 5458 5458 D CompatibilityChangeReporter: Compat change id reported: 175409956; UID 10008; state: DISABLED 5458 5458 D CompatibilityChangeReporter: Compat change id reported: 175409950; UID 10008; state: DISABLED 5458 5458 D NetworkSecurityConfig: No Network Security Config specified, using platform default 5458 5458 D CompatibilityChangeReporter: Compat change id reported: 175409952; UID 10008; state: DISABLED 5458 5458 D NetworkSecurityConfig: No Network Security Config specified, using platform default 5458 5458 I VrosSpatialAudio: init with null 5458 5458 W android_main: type=1400 audit(0.0:100): avc: denied { read } for name="cpu.cfs_quota_us" dev="cgroup" ino=46 scontext=u:r:untrusted_app:s0:c8,c256,c512,c768 tcontext=u:object_r:cgroup:s0 tclass=file permissive=0 app=org.bevyengine.example_openxr_android 5458 5488 I event C:\Users\Chris\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_diagnostic-0.14SystemInfo { os: "Android 12 Quest 3", kernel: "5.10.198-01553-ge399b8f74d20", cpu: "not available", core_count: "6", memory: "7.6 GiB" } 5458 5488 E event crates\bevy_openxr\src\openxr\init.rs:170: Failed to initialize openxr: OpenXR loading error: dlopen failed: library "libopenxr_loader.so" not found 5458 5488 D vulkan : searching for layers in '/data/app/~~Gs237Q-5foOotbraIEu1PA==/org.bevyengine.example_openxr_android-VD9vhia20L5R5uYwWBORsA==/lib/arm64' 5458 5488 D vulkan : searching for layers in '/data/app/~~Gs237Q-5foOotbraIEu1PA==/org.bevyengine.example_openxr_android-VD9vhia20L5R5uYwWBORsA==/base.apk!/lib/arm64-v8a' 5458 5488 W Adreno-AppProfiles: Could not find QSPM HAL service. Skipping adreno profile processing. 5458 5488 I AdrenoVK-0: ===== BEGIN DUMP OF OVERRIDDEN SETTINGS ===== 5458 5488 I AdrenoVK-0: ===== END DUMP OF OVERRIDDEN SETTINGS ===== 5458 5458 W android_main: type=1400 audit(0.0:101): avc: denied { read } for name="cpu.cfs_period_us" dev="cgroup" ino=47 scontext=u:r:untrusted_app:s0:c8,c256,c512,c768 tcontext=u:object_r:cgroup:s0 tclass=file permissive=0 app=org.bevyengine.example_openxr_android 5458 5458 W android_main: type=1400 audit(0.0:102): avc: denied { read } for name="cpu.cfs_quota_us" dev="cgroup" ino=10 scontext=u:r:untrusted_app:s0:c8,c256,c512,c768 tcontext=u:object_r:cgroup:s0 tclass=file permissive=0 app=org.bevyengine.example_openxr_android 5458 5458 W android_main: type=1400 audit(0.0:103): avc: denied { read } for name="cpu.cfs_period_us" dev="cgroup" ino=11 scontext=u:r:untrusted_app:s0:c8,c256,c512,c768 tcontext=u:object_r:cgroup:s0 tclass=file permissive=0 app=org.bevyengine.example_openxr_android 5458 5488 I AdrenoVK-0: QUALCOMM build : 445fc2bdf5, I545b8eff08 5458 5488 I AdrenoVK-0: Build Date : 08/01/24 5458 5488 I AdrenoVK-0: Shader Compiler Version : E031.47.01.00 5458 5488 I AdrenoVK-0: Local Branch : 5458 5488 I AdrenoVK-0: Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.VENDOR.12.3.11.00.00.934.442 5458 5488 I AdrenoVK-0: Remote Branch : NONE 5458 5488 I AdrenoVK-0: Reconstruct Branch : NOTHING 5458 5488 I AdrenoVK-0: Build Config : S P 12.1.6 AArch64 5458 5488 I AdrenoVK-0: Driver Path : /vendor/lib64/hw/vulkan.adreno.so 5458 5488 I AdrenoVK-0: Driver Version : 0786.0 5458 5488 I AdrenoVK-0: PFP : 0x01511175 5458 5488 I AdrenoVK-0: ME : 0x00000000 5458 5488 I AdrenoVK-0: Application Name : wgpu 5458 5488 I AdrenoVK-0: Application Version : 0x00000001 5458 5488 I AdrenoVK-0: Engine Name : wgpu-hal 5458 5488 I AdrenoVK-0: Engine Version : 0x00000002 5458 5488 I AdrenoVK-0: Api Version : 0x00403000 5458 5488 I AdrenoGLES-0: QUALCOMM build : 445fc2bdf5, I545b8eff08 5458 5488 I AdrenoGLES-0: Build Date : 08/01/24 5458 5488 I AdrenoGLES-0: OpenGL ES Shader Compiler Version: E031.47.01.00 5458 5488 I AdrenoGLES-0: Local Branch : 5458 5488 I AdrenoGLES-0: Remote Branch : refs/tags/AU_LINUX_ANDROID_LA.VENDOR.12.3.11.00.00.934.442 5458 5488 I AdrenoGLES-0: Remote Branch : NONE 5458 5488 I AdrenoGLES-0: Reconstruct Branch : NOTHING 5458 5488 I AdrenoGLES-0: Build Config : S P 12.1.6 AArch64 5458 5488 I AdrenoGLES-0: Driver Path : /vendor/lib64/egl/libGLESv2_adreno.so 5458 5488 I AdrenoGLES-0: Driver Version : 0786.0 5458 5488 I AdrenoGLES-0: Process Name : org.bevyengine.example_openxr_android 5458 5488 I AdrenoGLES-0: PFP: 0x01511175, ME: 0x00000000 5458 5488 W Adreno-AppProfiles: Could not find QSPM HAL service. Skipping adreno profile processing. 5458 5488 I AdrenoUtils: : Reading chip ID through GSL 5458 5488 I event C:\Users\Chris\.cargo\registry\src\index.crates.io-6f17d22bba15001f\bevy_render-0.14.1\sAdapterInfo { name: "Adreno (TM) 740", vendor: 20803, device: 1124403968, device_type: IntegratedGpu, driver: "Qualcomm Technologies Inc. Adreno Vulkan Driver", driver_info: "Driver Build: 445fc2bdf5, I545b8eff08, 1722513308\nDate: 08/01/24\nCompiler Version: E031.47.01.00\nDriver Branch: \n", backend: Vulkan } bba15001f\winit-0.30.5\src\plaTODO: forward onStart notification to application

Edit: after unpacking the .apk(/.aab) I noticed that the libopenxr_loader.so is indeed missing, so I guess the problem is with xbuild not including the runtime_libs properly?

ChristianSchott commented 1 month ago

Seems like the latest official release of xbuild is outdated (https://github.com/rust-mobile/xbuild/issues/151). Installing xbuild from git directly resolves the issue cargo install --git https://github.com/rust-mobile/xbuild.git. Now the libopenxr_loader.so is packaged into the .apk.

Maybe this is useful to someone..