Closed nilsk123 closed 4 years ago
I have confirmed the same happens on 2019.2.21f1, both for ARMV7 and ARM64.
@DavidMohrhardt
I have narrowed this down to a specific scenario:
Steps to reproduce:
Once every so often the second additive scene load seems to work ok, but other than that it's perfectly reproducible.
So the most obvious solution would be to destroy the inactive ARSession (or the object to which it's attached), however:
https://github.com/Unity-Technologies/arfoundation-samples/issues/412
The session is a global object so having two session components sees them both managing the same global session. So what is likely happening during the scene loading and unloading, is a situation where you have a deactivated session that instantiates, then you load an active one that activates, you destroy the global session, then you attempt to activate the global session which was previously destroyed. This is just a first guess and needs investigation.
The recommended workflow is to load a single session scene then activate that and all other scenes should not have session components on them.
Relevant Docs: In ARSession section https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@1.0/api/UnityEngine.XR.ARFoundation.ARSession.html
Controls the lifecycle and configuration options for an AR session. There is only one active session. If you have multiple ARSession components, they all talk to the same session and will conflict with each other.
The destroy session bug is reproducible as a standalone bug, without loading second sessions.
Just attach one in a scene and destroy it.
The matchframerate bug might be because of what you said however. The reason we have two sessions at that stage is because we can't destroy the session we queried availability with
The session is a global object so having two session components sees them both managing the same global session. So what is likely happening during the scene loading and unloading, is a situation where you have a deactivated session that instantiates, then you load an active one that activates, you destroy the global session, then you attempt to activate the global session which was previously destroyed. This is just a first guess and needs investigation.
The recommended workflow is to load a single session scene then activate that and all other scenes should not have session components on them.
Relevant Docs: In ARSession section https://docs.unity3d.com/Packages/com.unity.xr.arfoundation@1.0/api/UnityEngine.XR.ARFoundation.ARSession.html
Controls the lifecycle and configuration options for an AR session. There is only one active session. If you have multiple ARSession components, they all talk to the same session and will conflict with each other.
I can confirm this bug still happens when only 1 arsession is present..
Closing in favor of:
https://github.com/Unity-Technologies/arfoundation-samples/issues/414
Hi,
When reloading a scene that has an ARSession in it I get a hard crash on Android devices. I've reproduced this across android versions and devices, crashlog is attached. It seems to happen in the getMatchFramerateEnabled function
This is using the latest unity version 2019.3.1.f1, and the latest packages, manifest below. Above two packages come from internal scoped registry and are unrelated.
This happens on both mono and il2cpp builds.
"dependencies": { "com.***.networkingtoolkit": "1.1.0", "com.***.placeablestoolkit": "1.1.6", "com.ptc.vuforia.engine": "8.6.10", "com.unity.2d.sprite": "1.0.0", "com.unity.2d.tilemap": "1.0.0", "com.unity.editorcoroutines": "0.1.0-preview.1", "com.unity.ext.nunit": "1.0.0", "com.unity.ide.vscode": "1.1.4", "com.unity.mobile.android-logcat": "1.0.0", "com.unity.test-framework": "1.1.11", "com.unity.textmeshpro": "2.0.1", "com.unity.ugui": "1.0.0", "com.unity.vectorgraphics": "2.0.0-preview.12", "com.unity.xr.arcore": "3.1.0-preview.4", "com.unity.xr.arfoundation": "3.1.0-preview.4", "com.unity.xr.arkit": "3.1.0-preview.4", "com.unity.xr.legacyinputhelpers": "2.0.6", "com.unity.xr.management": "3.0.6", "com.unity.modules.ai": "1.0.0", "com.unity.modules.androidjni": "1.0.0", "com.unity.modules.animation": "1.0.0", "com.unity.modules.assetbundle": "1.0.0", "com.unity.modules.audio": "1.0.0", "com.unity.modules.cloth": "1.0.0", "com.unity.modules.director": "1.0.0", "com.unity.modules.imageconversion": "1.0.0", "com.unity.modules.imgui": "1.0.0", "com.unity.modules.jsonserialize": "1.0.0", "com.unity.modules.particlesystem": "1.0.0", "com.unity.modules.physics": "1.0.0", "com.unity.modules.physics2d": "1.0.0", "com.unity.modules.screencapture": "1.0.0", "com.unity.modules.terrain": "1.0.0", "com.unity.modules.terrainphysics": "1.0.0", "com.unity.modules.tilemap": "1.0.0", "com.unity.modules.ui": "1.0.0", "com.unity.modules.uielements": "1.0.0", "com.unity.modules.umbra": "1.0.0", "com.unity.modules.unityanalytics": "1.0.0", "com.unity.modules.unitywebrequest": "1.0.0", "com.unity.modules.unitywebrequestassetbundle": "1.0.0", "com.unity.modules.unitywebrequestaudio": "1.0.0", "com.unity.modules.unitywebrequesttexture": "1.0.0", "com.unity.modules.unitywebrequestwww": "1.0.0", "com.unity.modules.vehicles": "1.0.0", "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", "com.unity.modules.xr": "1.0.0" }
Projectsettings:
`%YAML 1.1 %TAG !u! tag:unity3d.com,2011: --- !u!129 &1 PlayerSettings: m_ObjectHideFlags: 0 serializedVersion: 20 productGUID: eecdc55fc5bef4edca40dfc985e3ade6 AndroidProfiler: 0 AndroidFilterTouchesWhenObscured: 0 AndroidEnableSustainedPerformanceMode: 0 defaultScreenOrientation: 0 targetDevice: 2 useOnDemandResources: 0 accelerometerFrequency: 60 companyName: productName: defaultCursor: {fileID: 0} cursorHotspot: {x: 0, y: 0} m_SplashScreenBackgroundColor: {r: 0.13725491, g: 0.12156863, b: 0.1254902, a: 1} m_ShowUnitySplashScreen: 0 m_ShowUnitySplashLogo: 0 m_SplashScreenOverlayOpacity: 1 m_SplashScreenAnimation: 0 m_SplashScreenLogoStyle: 0 m_SplashScreenDrawMode: 0 m_SplashScreenBackgroundAnimationZoom: 1 m_SplashScreenLogoAnimationZoom: 1 m_SplashScreenBackgroundLandscapeAspect: 1 m_SplashScreenBackgroundPortraitAspect: 1 m_SplashScreenBackgroundLandscapeUvs: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 m_SplashScreenBackgroundPortraitUvs: serializedVersion: 2 x: 0 y: 0 width: 1 height: 1 m_SplashScreenLogos: [] m_VirtualRealitySplashScreen: {fileID: 0} m_HolographicTrackingLossScreen: {fileID: 0} defaultScreenWidth: 1024 defaultScreenHeight: 768 defaultScreenWidthWeb: 960 defaultScreenHeightWeb: 600 m_StereoRenderingPath: 0 m_ActiveColorSpace: 0 m_MTRendering: 1 m_StackTraceTypes: 010000000100000001000000010000000100000001000000 iosShowActivityIndicatorOnLoading: -1 androidShowActivityIndicatorOnLoading: -1 iosUseCustomAppBackgroundBehavior: 0 iosAllowHTTPDownload: 1 allowedAutorotateToPortrait: 1 allowedAutorotateToPortraitUpsideDown: 0 allowedAutorotateToLandscapeRight: 0 allowedAutorotateToLandscapeLeft: 1 useOSAutorotation: 1 use32BitDisplayBuffer: 1 preserveFramebufferAlpha: 0 disableDepthAndStencilBuffers: 0 androidStartInFullscreen: 1 androidRenderOutsideSafeArea: 1 androidUseSwappy: 0 androidBlitType: 0 defaultIsNativeResolution: 1 macRetinaSupport: 1 runInBackground: 1 captureSingleScreen: 0 muteOtherAudioSources: 0 Prepare IOS For Recording: 0 Force IOS Speakers When Recording: 0 deferSystemGesturesMode: 0 hideHomeButton: 0 submitAnalytics: 1 usePlayerLog: 1 bakeCollisionMeshes: 0 forceSingleInstance: 0 useFlipModelSwapchain: 1 resizableWindow: 0 useMacAppStoreValidation: 0 macAppStoreCategory: public.app-category.games gpuSkinning: 1 xboxPIXTextureCapture: 0 xboxEnableAvatar: 0 xboxEnableKinect: 0 xboxEnableKinectAutoTracking: 0 xboxEnableFitness: 0 visibleInBackground: 1 allowFullscreenSwitch: 1 fullscreenMode: 1 xboxSpeechDB: 0 xboxEnableHeadOrientation: 0 xboxEnableGuest: 0 xboxEnablePIXSampling: 0 metalFramebufferOnly: 0 xboxOneResolution: 0 xboxOneSResolution: 0 xboxOneXResolution: 3 xboxOneMonoLoggingLevel: 0 xboxOneLoggingLevel: 1 xboxOneDisableEsram: 0 xboxOnePresentImmediateThreshold: 0 switchQueueCommandMemory: 0 switchQueueControlMemory: 16384 switchQueueComputeMemory: 262144 switchNVNShaderPoolsGranularity: 33554432 switchNVNDefaultPoolsGranularity: 16777216 switchNVNOtherPoolsGranularity: 16777216 vulkanNumSwapchainBuffers: 3 vulkanEnableSetSRGBWrite: 0 m_SupportedAspectRatios: 4:3: 1 5:4: 1 16:10: 1 16:9: 1 Others: 1 bundleVersion: 1.0.1 preloadedAssets:
crashlog.txt