Search Unity

Bug App crashing when calling session.SetPlaybackDataset(path);

Discussion in 'AR' started by Intraterrestrial_, Aug 17, 2022.

  1. Intraterrestrial_

    Intraterrestrial_

    Joined:
    Jun 27, 2021
    Posts:
    20
    Hi i have managed to record a video using AR Core extensions but now i am trying to playback but when i call
    Code (CSharp):
    1. session.SetPlaybackDataset(path);
    the app crashes i have also try to call close() but now it throws me an error that says:
    'ArSession' does not contain a definition for 'close'
    so my code is as follows:
    Code (CSharp):
    1. public ARSession m_Session;
    2.     public void loadSceneMP4(string path){
    3.         if (m_Session.subsystem is ARCoreSessionSubsystem subsystem){
    4.             Debug.Log("loadSceneMP4 ---------");
    5.             var session = subsystem.session;
    6.             m_Session.enabled = false;
    7.             session.SetPlaybackDataset(path);
    8.             m_Session.enabled = true;
    9.             //session.Close();
    10.         }
    11.     }
    i try to comment the line when it calls .SetPlaybackDataset(path); and then it stopped crashing.
    i made a simple logcat and i get this:

    2022-08-16 21:20:48.144 9362-9385/? I/Unity: loadSceneMP4 llego aca
    ScreenR2:loadSceneMP4(String)
    UIEscenasObj:Start()
    2022-08-16 21:20:48.159 9362-9385/? E/CRASH: pid: 9362, tid: 9385, name: UnityMain >>> com.ar.armadillo <<<
    2022-08-16 21:20:48.662 9362-9385/? E/AndroidRuntime: FATAL EXCEPTION: UnityMain
    Process: com.ar.armadillo, PID: 9362
    java.lang.Error: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
    Version '2020.3.12f1 (b3b2c6512326)', Build type 'Release', Scripting Backend 'il2cpp', CPU 'arm64-v8a'
    Build fingerprint: 'samsung/dream2ltexx/dream2lte:9/PPR1.180610.011/G955FXXS5DSJ1:user/release-keys'
    Revision: '10'
    ABI: 'arm64'
    Timestamp: 2022-08-16 21:20:48-0600
    pid: 9362, tid: 9385, name: UnityMain >>> com.ar.armadillo <<<
    uid: 10290
    signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x0
    Cause: null pointer dereference
    x0 0000000000000000 x1 0000007100058000 x2 0000000000000000 x3 0000000000000003
    x4 000000000000015d x5 00000071b7798eed x6 00000071b779f8f4 x7 6872726452713fff
    x8 00000071b77a32a0 x9 3c5b3cdd683f1abb x10 000000000000015d x11 0000000000000000
    x12 0000007288635eb0 x13 e4654e95a88d83e3 x14 0000007288c65000 x15 0000007288e32000
    x16 0000007286d73bb8 x17 0000007286d09620 x18 0000000000000000 x19 0000007100058000
    x20 0000000000000000 x21 00000071e27ce000 x22 00000071b4bccf50 x23 0000000000000000
    x24 0000000000000000 x25 00000070d024f930 x26 00000071e1889588 x27 0000000000000006
    x28 0000007160005c68 x29 00000071e18874f0
    sp 00000071e18874a0 lr 00000071e1f9f710 pc 0000000000000000

    So i dont know what can it be
    i also tried changing from Mono to IL2CPP, also change to ARM64 but it didnt work,
    Also i changed manifest.json from packages directory in order to make it work as stated here
    https://forum.unity.com/threads/issue-with-ar-core-extensions-package.1321104/#post-8367942
    So maybe its a package version issue, because it didnt update (as long as i saw) it just worked somehow and then it compiled (thanks by the way to the guy who helped me)
    Thanks in advance
     
  2. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    1,062
  3. Intraterrestrial_

    Intraterrestrial_

    Joined:
    Jun 27, 2021
    Posts:
    20
    Last edited: Aug 17, 2022
  4. Intraterrestrial_

    Intraterrestrial_

    Joined:
    Jun 27, 2021
    Posts:
    20
    Ok i found the problem, i was using outdated code (depreceated) so the rigth was like this:
    Code (CSharp):
    1. public ARSession m_Session;
    2.     public void loadSceneMP4(string path){
    3.         //if (m_Session.subsystem is ARCoreSessionSubsystem subsystem){
    4.             //var session = subsystem.session;
    5.             m_Session.enabled = false;
    6.             //session.SetPlaybackDataset(path);
    7.          
    8.             Uri datasetUri = new System.Uri("file://"+path);
    9.             playbackManager.SetPlaybackDatasetUri(datasetUri);
    10.             m_Session.enabled = true;
    11.         //}
    12.     }
    I commented the old code