Passthrough error warning

Godot Version

Godot 4.7

Question

So I'm using the Passthrough feature for my project and got it to work. The main issue is that hundreds of warning messages show up per second in the error log stating “Cannot start passthrough before passthrough handle is created”. Does anyone know the cause of this or a way to turn it off?

I think that warning comes from the Meta vendors plugin, it fires when something tries to start passthrough before the OpenXR session has created the passthrough handle. Getting hundreds per second means whatever is enabling passthrough is retrying every frame instead of once.

How are you enabling it? If you’re calling start_passthrough (or setting the environment blend mode) in _process or _ready, that’s the likely source. The session isn’t ready yet at _ready time, so the call fails, and if it’s in _process it just fails again every frame. The clean pattern is to connect to the OpenXRInterface session_begun signal and enable passthrough once in there, after that the handle exists and the calls succeed.

Also worth checking that your godot_openxr_vendors plugin version matches your Godot version, the wrappers are version paired and a mismatched plugin can leave extension setup half initialized.

I start it with just a button I made, so it’s not in either the _ready or _process functions.

I tried a lot of things later like checking the export templates, deleting some of the folders in the OpenXR folder, restarting Godot and the headset. I downloaded another project that had it working and tried to compare the settings. I’m not sure which of the things opened up more options, but I think the most important parts were to make sure that in the “XR/OpenXR/meta” pathway in project settings that the enablers for “Passthrough” and “Composite Layer Setting” were both available. after that it worked fine, though I would still like to know for sure why

My guess would be the enablers in the Meta section control which OpenXR extensions get requested when the OpenXR instance is created at startup. With the Passthrough one disabled, the extension is never requested, so the plugin never creates a passthrough handle when the session begins so there was nothing to start.

That could also explain the per frame spam even though your code only ran once from a button. Pressing the button set a persistent “passthrough should be on” state (the environment blend mode). The XR render loop checks that state every frame and kept trying to start passthrough to honor it, failing each time because the handle didn’t exist. So the retry loop was the plugin’s render loop, not your code. Once the enabler was on, the handle existed at session start and the exact same button code worked.

I already had the “Passthrough” option available and enabled. What I didn’t have shown up before was the “Composition Layer Setting” option in the project settings, and I tried so many things that I’m not sure which of them did the trick into bringing it up

Ah ok, couple things to try to get Composition Layer Settings back.

First, the Meta extension settings in Project Settings are only visible when Advanced Settings is toggled on and the vendors plugin docs call this out for both the Passthrough and Composition Layer Settings entries.

Second, if updating the vendors plugin was among the things you tried, the composition layer settings for the main projection layer were only added to Project Settings in plugin v5.1, so on an older version that entry simply doesn’t exist yet.

Aaaahh, so v5.1 might have been the reason. I transferred the project from an older version so it might have had an older version of OpenXR. I also deleted some folders that had templates and downloaded 5.1. Thanks