Standalone VR (Quest 2) crashes on map change - UE 5.3.2/OpenXR

I’ve been pulling my hair out for days trying to figure out this one out.

I’ve created a simple VR game using Open XR/Vulkan that consists of 3 maps; Introduction, Exterior, and Outcomes.

When using VR Preview, the game works perfectly and I can go from the start in the Introduction Map all the way through all the levels to the Outcomes map.

However, when I package the game for Android to an APK and sideload it onto the Quest 2, whenever Open Level (either by Object Reference or By Name) is called, the map loads and then about 1 or 2 seconds later, it crashes straight to the Oculus Launcher.

Just so that I could be sure it wasn’t a memory issue on the headset, I added a 4th map, called Transition, where I run some basic blueprints to figure out which map the load next based on a variable in the Game Instance. In VR Preview, this works great. And, you guessed it, in the standalone build on the Q2, I get the same crash.

The debug log that I pulled from the Quest 2 headset is stating;

[ 72]LogHMD: Error: Unexpected error on xrBeginFrame. Error code was XR_ERROR_CALL_ORDER_INVALID.

I can’t really find anyone else encountering this issue. I’ve looked through the Open XR documentation to see if I could gain any insight on the error, and all I could come up with is that xrBeginFrame is being called but there is no corresponding successful call to xrWaitFrame (source).

I’m at a complete loss. From the debug log, it looks like the level being opened is firing OnBegin before the level is finished loading, but this could just be the way its logged?

I also tried setting up async loading for the map and the assets, but since I’m not using streaming levels, the Load Stream Level node fails (so you can ignore this from the log, unless this is whats bricking it?).

I’ve also gone and set the starting map to be the Introduction, Exterior, Outcomes, or Transition, and the first map always loads perfectly fine. It’s always the second map being loaded that causes the crash.

Below is the debug log from when Open Level gets called to the end of the log.

Debug log from Q2 headset
[2024.04.17-08.28.09:141][ 72]LogNet: Browse: /Game/TransitionMap?Name=Player
[2024.04.17-08.28.09:141][ 72]LogLoad: LoadMap: /Game/TransitionMap?Name=Player
[2024.04.17-08.28.09:141][ 72]LogWorld: BeginTearingDown for /Game/VRTemplateMap
[2024.04.17-08.28.09:144][ 72]LogWorld: UWorld::CleanupWorld for VRTemplateMap, bSessionEnded=true, bCleanupResources=true
[2024.04.17-08.28.09:149][ 72]LogHMD: Error: Unexpected error on xrBeginFrame. Error code was XR_ERROR_CALL_ORDER_INVALID.
[2024.04.17-08.28.09:149][ 72]LogSlate: InvalidateAllWidgets triggered.  All widgets were invalidated
[2024.04.17-08.28.09:220][ 72]LogStreaming: Display: 0.128 ms for processing 3476 objects in RemoveUnreachableObjects(Queued=0, Async=0). Removed 673 (1170->497) packages and 928 (1795->867) public exports.
[2024.04.17-08.28.09:220][ 72]LogAudio: Display: Audio Device unregistered from world 'None'.
[2024.04.17-08.28.09:270][ 72]LogSlate: Slate User Unregistered.  User Index 8
[2024.04.17-08.28.09:270][ 72]LogSlate: Slate User Destroyed.  User Index 8, Is Virtual User: 1
[2024.04.17-08.28.09:289][ 72]LogUObjectHash: Compacting FUObjectHashTables data took   1.17ms
[2024.04.17-08.28.09:301][ 72]LogStreaming: Display: FlushAsyncLoading(72): 1 QueuedPackages, 0 AsyncPackages
[2024.04.17-08.28.09:332][ 72]LogAudio: Display: Audio Device (ID: 1) registered with world 'TransitionMap'.
[2024.04.17-08.28.09:333][ 72]LogWorldSubsystemInput: UEnhancedInputDeveloperSettings::bEnableWorldSubsystem is false, the world subsystem will not be created!
[2024.04.17-08.28.09:333][ 72]LogChaos: FPhysicsSolverBase::AsyncDt:-1.000000
[2024.04.17-08.28.09:335][ 72]LogAIModule: Creating AISystem for world TransitionMap
[2024.04.17-08.28.09:336][ 72]LogLoad: Game class is 'VRGameMode_C'
[2024.04.17-08.28.09:337][ 72]LogWorld: Bringing World /Game/TransitionMap.TransitionMap up for play (max tick rate 0) at 2024.04.17-16.28.09
[2024.04.17-08.28.09:337][ 72]LogWorld: Bringing up level for play took: 0.000963
[2024.04.17-08.28.09:338][ 72]LogOnline: Warning: OSS: FOnlineSubsystemGooglePlayModule was disabled
[2024.04.17-08.28.09:342][ 72]LogSlate: New Slate User Created. Platform User Id 8, User Index 8, Is Virtual User: 1
[2024.04.17-08.28.09:342][ 72]LogSlate: Slate User Registered.  User Index 8, Is Virtual User: 1
[2024.04.17-08.28.09:344][ 72]LogBlueprintUserMessages: [TransitionMap_C_15] pre-loading assets for level: Exterior
[2024.04.17-08.28.09:344][ 72]LogLevel: Warning: Failed to find streaming level object associated with '/Game/VRTemplateMap'
[2024.04.17-08.28.09:344][ 72]LogBlueprintUserMessages: [TransitionMap_C_15] pre-loading exterior level
[2024.04.17-08.28.09:344][ 72]LogLevel: Warning: Failed to find streaming level object associated with '/Game/Exterior_Map'
[2024.04.17-08.28.09:345][ 72]LogLoad: Took 0.203970 seconds to LoadMap(/Game/TransitionMap)
[2024.04.17-08.28.09:554][ 72]LogBlueprintUserMessages: [TransitionMap_C_15] Interior level unloaded
[2024.04.17-08.28.09:554][ 72]LogBlueprintUserMessages: [TransitionMap_C_15] Garbage collection complete
[2024.04.17-08.28.09:554][ 72]LogBlueprintUserMessages: [TransitionMap_C_15] Exterior level has loaded

1 Like

Hello there, I had the same issue creating a VR program with UE 5.1.1, I looked some post stating that version might be the problem but I see that problem persists in UE 5.3.2.

Did you find any solution?

Sorry bad english.

Hi everyone,

I’m encountering the exact same issue in Unreal Engine 5.3.2 with the Quest 3. I’ve created a VR application with multiple maps. The error appearing in the logs is:

vbnet

LogHMD: Error: Unexpected error on xrBeginFrame. Error code was XR_ERROR_CALL_ORDER_INVALID.

I’ve tried several solutions, such as adjusting OpenXR settings and using transition maps, but the problem persists. In VR Preview mode, everything works perfectly, but the error occurs when running the app on the device.

Has anyone found a solution or has any idea how to resolve this issue? Any help would be greatly appreciated.

Thanks in advance!