Update environment_depth.rst with permissions info. Fix code typo.#424
Conversation
Picked up on a couple of typos discovered when following the Depth Map On CPU example. Clarified Android permission requirements for OpenXRMetaEnvironmentDepthExtensionWrapper.start_environment_depth().
| OpenXRMetaEnvironmentDepthExtensionWrapper.start_environment_depth() | ||
|
|
||
| This will only work if there is an active OpenXR session. You can connect to the ``OpenXRInterface.session_begun`` signal to run code right when the session starts. | ||
| This will only work if there is both an active OpenXR session, and relevant Android permissions have all been granted in advance of the call. Namely, explicitly, "dangerous" permission ``android.permission.CAMERA``, and runtime permission ``USE_SCENE``. The latter can be automatically requested via the extension settings, Project Settings > OpenXR > Extensions > Automatically Request Runtime Permissions, or explicitly in code like the camera one. |
There was a problem hiding this comment.
As far as I know, the CAMERA permission isn't needed for the depth API to work. We aren't requesting it in the sample project, and it's always worked for me
I'll double check what happens when first granting USE_SCENE when I have a chance. Recommending folks to take a look at OS.request_permission() and MainLoop.on_request_permissions_result could certainly make sense!
There was a problem hiding this comment.
Yeahhhh.... you can imagine my surprise at the
ERROR: Failed to create environment depth provider: XR_ERROR_NOT_PERMITTED_PASSTHROUGH_FB
(137) DEBUG: timer timed out
logs when trying to incorporate the Manual page example into my own test. I thought I was pretty thorough in eliminating the 'variables' before putting the PR in, but can now confirm CAMERA is not required.
Exhibit A & B:
ring_low_res.mp4
I guess I did a boob somewhere with my Permissions boiler-plate; the ongoing saga of The-Captain vs OS.android perms and the Quest. 😉 (godotengine/godot#105364)
Let me see if I / we can come up with a suitable update to this page again when I'm finished with my project for the day. Thanks - as always - Snopek. [Open to suggestions!!! 😁 ]
There was a problem hiding this comment.
Ahhhhhh. I think I know where my misconception came from; my permissions boilerplate, indeed. When I tweaked it so as not to ask for Camera - purely for diagnosis prior to this PR - an unexpected side-effect was that start_environment_depth() was called during the same frame the XR session fires up. If not deferred, or on a later frame... like naturally when user-intervention takes place... then this causes the app to bail out - which I mistook for lack of permissions.
All that aside... still don't know what to change the document to. 🤣
I think I'll just fix the typos and leave any talk of permission and service startup to the professionals.... BRB.
Just the typos. Opted not to amend or squash so the conversation can stay tracked for greater changes in future (new issue?)
m4gr3d
left a comment
There was a problem hiding this comment.
Can you squash the commits together.
|
Last time I looked, not from the web UI; I was only updating some docs here. Though I also thought the official repo could be / had been set as squash-on-merge? But no dramas. As soon as I'm at a dev-capable device online I'll pull a copy local and squash. Thanks. |
|
We can do squash-on-merge, just let us know which commit comment you'd like to go with. |
|
a923303 looks clean enough for what it is don't you think? Please-thanks. |

Picked up on a couple of typos discovered when I tried to actually follow the documented "Accessing the depth map on the CPU" example as a jumping off point for my project.
Clarified requirements for using Meta Environment Depth / OpenXRMetaEnvironmentDepthExtensionWrapper.start_environment_depth(); including necessary Android permissions.
With those in mind, veered away from the prior suggestion of triggering start_environment_depth() via the OpenXRInterface,session_began signal. As, surely, attempting to secure the permissions before the session has started will - at best - flood the logs with Condition "image_acquired" is true. Returning: true errors [<C++ Source> modules/openxr/openxr_api.cpp:175 @ acquire()]?
//sigh// The legacy of evolving Android permissions - with or without Godot! - is such a ballache! 😜