# OS 1.3.0-dev1 no longer working with OpenXR in Godot

**URL:** <https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020>\
**Category:** OpenXR\
**Tags:** development\
**Created:** [June 2, 2023, 2:51pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020 "2023-06-02T14:51:17Z")\
**Posts on this page:** 17\
**Page:** 1

<div class="post-metadata">

**Author:** ![laplante.sean](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@laplante.sean](https://forum.magicleap.cloud/u/laplante.sean)\
**Post date:** [June 2, 2023, 2:51pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/1 "2023-06-02T14:51:17Z")

</div>

The 1.2.0 OS works fine with my Godot application but the same APK installed in 1.3.0-dev1 has no display. The app launches and my debug messages say that OpenXR initialized fine, but nothing is on the display.

**Unity Editor version** (if applicable): n/a  
**Godot Editor version** : 4.0.3 stable  
**Godot OpenXR Loader** : 1.0.0  
**ML2 OS version** : 1.3.0-dev1  
**MLSDK version** : n/a

I've attached my full log output (huge) below but I will highlight what I think are the most relevant errors (there's a lot of repeat errors).

First, my app does log that OpenXR was initialized: `PRISM-XR: OpenXR initialised successfully` which is not true on ML2 OS versions prior to OpenXR support being added. So my app thinks OpenXR should be working.

The first error that repeats a bunch:

```auto
06-02 14:27:53.593 9264 9291 E godot : USER ERROR: Vulkan Debug Report: object - 131611476538768
06-02 14:27:53.593 9264 9291 E godot : Validation Error: [VUID-VkPushConstantRange-stageFlags-parameter] Object 0: handle = 0x77b32f4eb590, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x22a9262e | vkCreatePipelineLayout: value of pCreateInfo->pPushConstantRanges[0].stageFlags contains flag bits that are not recognized members of VkShaderStageFlagBits The Vulkan spec states: stageFlags must be a valid combination of VkShaderStageFlagBits values (https://www.khronos.org/registry/vulkan/specs/1.3-extensions/html/vkspec.html#VUID-VkPushConstantRange-stageFlags-parameter)
06-02 14:27:53.593 9264 9291 E godot : at: _debug_report_callback (drivers/vulkan/vulkan_context.cpp:300)

```

It's worth noting that I see the error above in OS version 1.2.0 as well where my application works fine.

The next error is not the same as ones I've noticed on OS 1.2.0:

```auto
06-02 14:27:54.809 9264 9298 E godot : USER ERROR: Vulkan Debug Report: object - 131611476570456
06-02 14:27:54.809 9264 9298 E godot : Validation Error: [VUID-VkPresentInfoKHR-pImageIndices-01296] Object 0: handle = 0x77b32f4f3158, type = VK_OBJECT_TYPE_QUEUE; | MessageID = 0xc7aabc16 | vkQueuePresentKHR(): pSwapchains[0] images passed to present must be in layout VK_IMAGE_LAYOUT_PRESENT_SRC_KHR or VK_IMAGE_LAYOUT_SHARED_PRESENT_KHR but is in VK_IMAGE_LAYOUT_UNDEFINED. The Vulkan spec states: Each element of pImageIndices must be the index of a presentable image acquired from the swapchain specified by the corresponding element of the pSwapchains array, and the presented image subresource must be in the VK_IMAGE_LAYOUT_PRESENT_SRC_KHR layout at the time the operation is executed on a VkDevice (https://github.com/KhronosGroup/Vulkan-Docs/search?q=)VUID-VkPresentInfoKHR-pImageIndices-01296)
06-02 14:27:54.809 9264 9298 E godot : at: _debug_report_callback (drivers/vulkan/vulkan_context.cpp:300)

```

It helps to filter on lines that contain "godot". Lines with "PRISM-XR" are debug logs from my application: [logcat-prism.txt](https://forum.magicleap.cloud/uploads/short-url/lkydGGdgNQx3gR2bVxERrYZd97C.txt) (13.9 MB)

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [June 2, 2023, 4:32pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/3 "2023-06-02T16:32:59Z")

</div>

Hi @laplante.sean Thank you for your post. We don't officially support Godot yet, though it does work with Magic Leap 2. However we do have internal developers who are working with 4.0.1. That may help if you are able to switch to that version.

We are currently looking at support for Godot.

---

<div class="post-metadata">

**Author:** ![laplante.sean](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@laplante.sean](https://forum.magicleap.cloud/u/laplante.sean)\
**Post date:** [June 5, 2023, 11:46am UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/4 "2023-06-05T11:46:55Z")

</div>

I just downgraded to Godot 4.0.1 and that did not fix the issue. I get the same behavior (no display) and the same error messages.

Edit: this ticket was just closed and you marked an incorrect solution. 4.0.1 did NOT fix the issue. Please see above, I have the same issue on godot 4.0.1 as I have in 4.0.3. Something must have broken compatibility with the latest ML2 OS release.

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [June 5, 2023, 1:29pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/5 "2023-06-05T13:29:57Z")

</div>

Closed on June 5, 2023, 1:29pm UTC



---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [June 5, 2023, 1:36pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/6 "2023-06-05T13:36:24Z")

</div>

Hi there, like we said above we do not yet officially support Godot for Magic Leap 2. Closing the ticket for this reason. Thank you for your post.

---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [June 5, 2023, 1:36pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/7 "2023-06-05T13:36:34Z")

</div>

Opened on June 5, 2023, 1:36pm UTC



---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [June 5, 2023, 1:37pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/8 "2023-06-05T13:37:23Z")

</div>

Closed on June 5, 2023, 1:37pm UTC



---

<div class="post-metadata">

**Author:** ![kdowney](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/kdowney/32/481_2.png) [@kdowney](https://forum.magicleap.cloud/u/kdowney)\
**Post date:** [June 5, 2023, 2:24pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/9 "2023-06-05T14:24:37Z")

</div>

Opened on June 5, 2023, 2:24pm UTC



---

<div class="post-metadata">

**Author:** ![mrushton](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@mrushton](https://forum.magicleap.cloud/u/mrushton)\
**Post date:** [June 5, 2023, 2:26pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/10 "2023-06-05T14:26:33Z")

</div>

@laplante.sean as mentioned we haven't gotten to the point of general availability and openXR support on our platform for Godot. With that said let me look into this issue and I will try to provide a workaround or some scoping on a fix.

Thank you for your patience and letting us know about it, since we have reproduced this internally ill need some time to analyze.

---

<div class="post-metadata">

**Author:** ![mrushton](https://avatars.discourse-cdn.com/v4/letter/m/c67d28/32.png) [@mrushton](https://forum.magicleap.cloud/u/mrushton)\
**Post date:** [June 6, 2023, 3:12pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/11 "2023-06-06T15:12:26Z")

</div>

@laplante.sean the Debug messages from the validation layers, though loud, actually are not enforcing.

When using 1.3.0-dev1 with Godot 4.03 on a simple test cube app I am able to see content rendering but the same logs in the error except the following from your own app:  
`USER ERROR: PRISM-XR: DisplayManager: Got error code 0 from gateway`

Not sure if this is a custom DisplayServer you wrote but I can confirm Godot isn't inherently broke, we will work on making the validation layers less spammy soon but I am unsure why your app is breaking currently given our test apps work.

Without understanding what your app is I would try to work back from each piece to narrow down the point of failure which could be come from something on the system but isn't specific to OpenXR.

---

<div class="post-metadata">

**Author:** ![laplante.sean](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@laplante.sean](https://forum.magicleap.cloud/u/laplante.sean)\
**Post date:** [June 8, 2023, 12:56pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/12 "2023-06-08T12:56:14Z")

</div>

Thanks so much for the update!

Is there any chance you could upload your test cube app here so I can reference how you're setting up the scene just to make sure I didn't miss anything?

If not, a snippet of `gdscript` code from how you initialize the scene and the godot `.project` file settings would be a good start to make sure I'm not missing something simple. Also, which version of the Godot OpenXR loaders are you using? I'm using v1.0.0 from [here](https://github.com/GodotVR/godot_openxr_loaders/releases)

The `PRISM-XR` message about the display manager can be ignored. That's app specific stuff and despite how it sounds, it has nothing to do with what the AR display of the headset.

---

<div class="post-metadata">

**Author:** ![laplante.sean](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@laplante.sean](https://forum.magicleap.cloud/u/laplante.sean)\
**Post date:** [September 8, 2023, 2:18pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/13 "2023-09-08T14:18:57Z")

</div>

Hey, It's been a bit. I'm finally getting back to this.

I'm running the latest ML2 official firmware now and building with Godot 4.1.1. I'm still not able to get anything rendering. I'm working with a similar "simple test cube" example so there's nothing complicated at all.

Just curious if you could share your test cube project with me. I think it would help a bunch. I'd be able to quickly see if any settings were different or if I'm missing something simple, or if it's simply just that I need to rollback to Godot 4.03.

---

<div class="post-metadata">

**Author:** ![etucker](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/etucker/32/842_2.png) [@etucker](https://forum.magicleap.cloud/u/etucker)\
**Post date:** [September 14, 2023, 5:37pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/14 "2023-09-14T17:37:18Z")

</div>

1. Ensure your environment is setup for exporting to Android [Exporting for Android — Godot Engine (latest) documentation in English](https://docs.godotengine.org/en/latest/tutorials/export/exporting_for_android.html)
2. Unzip the zip file anywhere. This zip contains the [Godot OpenXR Loader v1.1.0 Android plugin for Godot 4.1.1-stable](https://github.com/GodotVR/godot_openxr_loaders/releases/tag/1.1.0-stable)
3. Open the project with [Godot 4.1.1-stable](https://downloads.tuxfamily.org/godotengine/4.1.1/)
4. In the editor, click on Project → Install Android Build Template, then click on Install

There are two ways to export, install, and run

- Click on the Remote Debug option (top right corner of the editor, next to Run Current Scene) and choose Ml Magic Leap 2.

OR

- In the editor, click on Project → Export …, choose the Android preset, then click Export Project…
- Then in the terminal (assuming you have access to `adb shell`)

# Install

adb install org.godotengine.godotcube411stable.apk

# Launch

adb shell am start -n org.godotengine.godotcube411stable/com.godot.game.GodotApp

Finally, to uninstall

adb uninstall org.godotengine.godotcube411stable

> **[Release Godot OpenXR Loaders v1.1.0 · GodotVR/godot\_openxr\_vendors](https://github.com/GodotVR/godot_openxr_vendors/releases/tag/1.1.0-stable)**
>
> This is a maintenance release of the loaders plugin with a few small updates:
> 
> Update Meta OpenXR loader to version 54
> Update PICO OpenXR loader to version 2.2.0
> Bump dependencies versions to match...

add `com.magicleap.permission.HAND_TRACKING` to the `Custom Permissions` section in the Android export preset

---

<div class="post-metadata">

**Author:** ![laplante.sean](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@laplante.sean](https://forum.magicleap.cloud/u/laplante.sean)\
**Post date:** [September 14, 2023, 6:56pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/15 "2023-09-14T18:56:00Z")

</div>

Awesome thanks for the reply. I don't see the attachment though. Is there supposed to be a `godotcube` project zip attached or is that something I can get from somewhere. I don't see it at any of the links.

---

<div class="post-metadata">

**Author:** ![etucker](https://sea1.discourse-cdn.com/flex019/user_avatar/forum.magicleap.cloud/etucker/32/842_2.png) [@etucker](https://forum.magicleap.cloud/u/etucker)\
**Post date:** [September 14, 2023, 7:32pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/16 "2023-09-14T19:32:01Z")

</div>

Oops my apologies. Forgot to attach the zip.  
[godotcube411stable.zip](https://forum.magicleap.cloud/uploads/short-url/k9xFcnBxUuVFijcLFnUM7aZs6xY.zip) (10.2 MB)

---

<div class="post-metadata">

**Author:** ![laplante.sean](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@laplante.sean](https://forum.magicleap.cloud/u/laplante.sean)\
**Post date:** [September 14, 2023, 8:43pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/17 "2023-09-14T20:43:47Z")

</div>

Thanks so much! I will check this out tomorrow on my headset and see if I can find the difference between the projects.

---

<div class="post-metadata">

**Author:** ![laplante.sean](https://avatars.discourse-cdn.com/v4/letter/l/e274bd/32.png) [@laplante.sean](https://forum.magicleap.cloud/u/laplante.sean)\
**Post date:** [September 18, 2023, 1:29pm UTC](https://forum.magicleap.cloud/t/os-1-3-0-dev1-no-longer-working-with-openxr-in-godot/2020/18 "2023-09-18T13:29:22Z")

</div>

Alright! I got it. Thanks again! I don't know if I ever would have figured this out because it's such a minor thing. On Godot's current official [docs for setting up OpenXR](https://docs.godotengine.org/en/stable/tutorials/xr/setting_up_xr.html) they have this line:

```auto
# Turn off v-sync!
DisplayServer.window_set_vsync_mode(DisplayServer.VSYNC_DISABLED)

```

And that is in fact what breaks it on the Magic Leap 2. If I add that line - no display. If I remove that line - everything works. Now, it's important to note that this was **not** true prior to ML2 OS version 1.3.x since I've had that line in the project since the beginning.

There were a few other differences between our projects that I found interesting as well. I'll highlight them here:

1. `OpenXR > Reference Space` is set to `stage` (the default) but I found in versions prior to 1.3.X that I could suppress one of the very noisy Vulkan errors by setting it to `local` instead. This seems to not matter though since I've tried it with both now and it works either way.
2. The project is using the `mobile` renderer. This could be a change to Godot since when I started working this project I was on 4.0, but when I started this project I needed to set the renderer to forward+ instead of mobile in order for it to properly use Vulkan. That is no longer the case - the mobile renderer works now - which is nice.

Thanks again!  
Sean
