mordentral / VRExpPluginExample

VRE Example Template
https://www.vreue4.com
MIT License
217 stars 84 forks source link

Ensure condition failed: Scene->GetShadingPath() != EShadingPath::Mobile (Oculus 4.25.4) #4

Closed Tokusei closed 3 years ago

Tokusei commented 3 years ago

Hi, I am using the example project on branch VRExpPluginExample-4.25-Locked with the Oculus branch of UE4. I've set up the android packaging settings according to the Oculus plugin helper window (1.55.0) Packing and deploying to the device works OK on an empty map.

MotionControllerMap seems to have an actor which is causing the crash. According to this thread the issue is as follows:

I have been experiencing this crash too. I think I have narrowed it down to the late update being done for the HMD and controllers, in our scenario at least.

The late update is setting the transform, causing them to be flagged as needing a reflection capture update but something about doing the level load means it is not being updated before ComputeRelevance is called.

It only affects things nested under the motion controller component or the camera that is tracking to the HMD. As a workaround I enabled DisableLowLatencyUpdate in the motion controllers (to stop the late update of the transform) and removed the anything we had nested under the camera (disabling it for the HMD would be more involved).

The 4.25.4 Oculus branch is the recommended version to package to the device, And there is not ETA for 4.26, Any guidance regarding which Actor/BP is causing the crash is appreciated

Tokusei commented 3 years ago

I have tried disabling the low latency update flag on the L/R controller components of the VR Pawn, As well as added a delay node between loading the map and spawning the pawn, However there is still a crash

Random crash when packaging:

Assertion failed: !Export.ClassIndex.IsNull() [File:D:/GIT/OculusUnrealEngine/UnrealEngine/Engine/Source/Runtime/CoreUObject/Private/UObject/SavePackage.cpp] [Line: 4888] Export SKEL_GraspingHand_Left_C /Game/VRExpansion/Vive/Testing/GraspingHand/GraspingHand_Left.Default__SKEL_GraspingHand_Left_C class is not mapped when saving /Game/VRExpansion/Vive/Testing/GraspingHand/GraspingHand_Left

Crash when running on device:


LogPlayLevel:   01-23 13:57:52.610 10391 10424 D UE4     :    Function /Game/VRExpansion/Vive/BP_Teleport_Controller.BP_Teleport_Controller_C:ReceiveBeginPlay
LogPlayLevel:   01-23 13:57:52.610 10391 10424 D UE4     :    Function /Game/VRExpansion/Vive/BP_Teleport_Controller.BP_Teleport_Controller_C:ExecuteUbergraph_BP_Teleport_Controller
LogPlayLevel:   01-23 13:57:52.610 10391 10424 D UE4     :    Function /Game/VRExpansion/Vive/BP_Teleport_Controller.BP_Teleport_Controller_C:SetupRoomScaleOutline
LogPlayLevel:   01-23 13:57:52.610 10391 10424 D UE4     :
LogPlayLevel:   01-23 13:57:52.611 10391 10424 D UE4     : [2021.01.23-05.57.52:611][132]sg.ResolutionQuality = "100"
LogPlayLevel:   01-23 13:57:52.611 10391 10424 D UE4     : [2021.01.23-05.57.52:611][132]r.ScreenPercentage = "100"
LogPlayLevel:   01-23 13:57:52.611 10391 10424 D UE4     : [2021.01.23-05.57.52:611][132]vr.PixelDensity = "1"
LogPlayLevel:   01-23 13:57:52.614 10391 10424 D UE4     : [2021.01.23-05.57.52:614][132]LogSlate: Took 0.000337 seconds to synchronously load lazily loaded font '../../../Engine/Content/Slate/Fonts/Roboto-Regular.ttf' (155K)
LogPlayLevel:   01-23 13:57:52.620 10391 10519 D UE4     : [2021.01.23-05.57.52:620][133]LogProfilingDebugging: Allocated a 1024 x 1024 texture for HMD canvas layer
LogPlayLevel:   01-23 13:57:57.610 10391 10426 D UE4     : [GameActivity] Used memory: 467850
LogPlayLevel:   01-23 13:57:59.188 10391 10424 D UE4     : [2021.01.23-05.57.59:188][596]LogSlate: New Slate User Created.  User Index 8, Is Virtual User: 1
LogPlayLevel:   01-23 13:57:59.188 10391 10424 D UE4     : [2021.01.23-05.57.59:188][596]LogSlate: Slate User Registered.  User Index 8, Is Virtual User: 1
LogPlayLevel:   01-23 13:57:59.191 10391 10458 D UE4     : [2021.01.23-05.57.59:191][596]LogRHI: AndroidOpenGL: Using a maximum of 510 occlusion queries.
LogPlayLevel:   01-23 13:58:07.786 10391 10426 D UE4     : [GameActivity] Used memory: 472783
LogPlayLevel:   01-23 13:58:08.265 10391 10519 D UE4     : Ensure condition failed: Scene->GetShadingPath() != EShadingPath::Mobile [File:D:/GIT/OculusUnrealEngine/UnrealEngine/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp] [Line: 2098]
LogPlayLevel:   01-23 13:58:08.265 10391 10519 D UE4     :
LogPlayLevel:   --------- beginning of crash
LogPlayLevel:   01-23 13:58:09.720 10391 10391 D UE4     : [GameActivity] onPause: stop memory reporter runnable
LogPlayLevel:   01-23 13:58:09.720 10391 10391 D UE4     : [GameActivity] Unregistering sensor listeners
LogPlayLevel:   01-23 13:58:09.721 10391 10425 D UE4     : Case APP_CMD_PAUSE
LogPlayLevel:   01-23 13:58:09.721 10391 10425 D UE4     : [2021.01.23-05.58.09:721][190]LogAndroid: Case APP_CMD_PAUSE
LogPlayLevel:   01-23 13:58:09.721 10391 10425 D UE4     : LogAndroidEvents::EnqueueAppEvent : 6, [width=-1, height=-1], tid = 10425, APP_EVENT_STATE_ON_PAUSE
LogPlayLevel:   01-23 13:58:09.721 10391 10425 D UE4     : [2021.01.23-05.58.09:721][190]LogAndroid: event thread, suspending app, acquiring HW window lock.
LogPlayLevel:   01-23 13:58:09.721 10391 10425 D UE4     : LogAndroidEvents::EnqueueAppEvent : 15, [width=-1, height=-1], tid = 10425, APP_EVENT_RUN_CALLBACK
LogPlayLevel:   01-23 13:58:09.721 10391 10425 D UE4     : [2021.01.23-05.58.09:721][190]LogAndroid: AndroidEGL::  SuspendApp_EventThread, waiting for event manager to process. tid: 10425```
mordentral commented 3 years ago

You don't "have" to use the oculus branch, though they were the ones that made the latest engine changes for late updates and that was ported to 4.26.

Looks like the skeleton for the left grasping hand isn't being packaged though from the packaging warning.

Tokusei commented 3 years ago

Ok, I will try using 4.26, The reason I tried using the oculus branch was because is has some engine modifications for fast packaging/deployment on android which are not available in 4.26, And the OculusVR plugin is more recent on that branch, not sure if there will be any conflicts with changes in 4.26 for the plugin.

Tokusei commented 3 years ago

Hi, I am getting the same crash in 4.26 on Quest2 it will package and run an empty map, but if I set it to SteamVRGameMode, It will crash when the pawn spawns. Because I am using the launcher 4.26 there is no stack trace but it has the same behaviour, if I add a delay node, it wont crash until the pawn spawns, probably the late update bug

mordentral commented 3 years ago

Well there isn't much I can do about an engine level bug in late updates. The actual handling of them is embedded, if you can debug it and there is another cause then I can likely do something about it. But a shading path ensure isn't generally going to be something I can fix plugin side.

Tokusei commented 3 years ago

Ok, It seems like this is occurring on Quest2 using the Android renderer, However like I mentioned previously, an empty map seems to be loading so I need to narrow down the function call in the pawnBP which is causing the crash, even if it's an engine-level bug. Behaviour is unexpected. After adding a delay node to the pawn spawn it will spawn it, if I move the motion controllers withing the first few frames of spawning it will sometimes crash, other times its relatively stable

LogPlayLevel: Warning:   02-04 16:52:13.802 21195 21222 D UE4     : [2021.02.04-08.52.13:802][240]LogCharacterMovement: Warning: GetSimulationTimeStep() - Max iterations 8 hit while remaining time 0.070639 > MaxSimulationTimeStep (0.050) for 'Vive_PawnCharacter_C_2147482151', movement 'Walking'
LogPlayLevel:   02-04 16:52:14.002 21195 22980 D UE4     : Ensure condition failed: Scene->GetShadingPath() != EShadingPath::Mobile [File:C:/GIT/OculusUnrealEngine/UnrealEngine/Engine/Source/Runtime/Renderer/Private/SceneVisibility.cpp] [Line: 2098]
mordentral commented 3 years ago

Just make a bare pawn with motion controllers, the only thing the Vive pawn does different for this case is that it uses the camera fade for when spawning in. Doesn't sound like it is the fade, sounds like it is indeed the late update code they added.

Tokusei commented 3 years ago

Hi, I will test that. However, It looks like it is stable in 4.26.1 (was bugged in 4.26.0) probably related to these two fixes Fixed! UE-103387 Oculus Quest: Vulkan ensure occurs when running a project on Quest Fixed! UE-103058 Quest 2: 2D scene capture causes app to crash if lighting is not rebuilt

Also, Oculus just published a 4.26 branch, I will check that one and see if I can integrate the fix, however the UE codes are not showing on the bug tracker and may need to dig through the engine commits