Search Unity

Cardboard Unity sdk cant stop tracking on Android

Discussion in 'AR/VR (XR) Discussion' started by gaoyu22, Jan 28, 2019.

  1. gaoyu22

    gaoyu22

    Joined:
    Nov 22, 2018
    Posts:
    7
    I cant find the answer for my "stop tracking on Android" so i post a issue here try to get your official response.

    I have the latest googlevr cardboard sdk for unity and i have finished most of the work. The problem is the hardware test found that the gyro is always running even though turning off the screen. The mobile phone is Huawei P10 which running on Android 8.1 and the gyro costs 150mA even though the cardboard app is suspended.

    I noticed that on ios or android ndk, you can use the api of pause or resuming tracking but i did not find that api at the unity sdk. So what i did try to solve the problem? i tried to switch to none vr mode(UnityEngine.XR.XRSettings.enabled = false) if the app lose focus but no help.

    Is gyro used by google vr still working(tracking) when the app is suspended(lose focus)?

    I want to get some help for controlling tracking on Android platform. if its a specific problem of different hardward or i did something wrong, please correct me. Thank you.
     
  2. gaoyu22

    gaoyu22

    Joined:
    Nov 22, 2018
    Posts:
    7
    UnityEngine.XR.XRSettings.enabled should control the active state of gyro i think. But in none vr mode, gyro still consumes much power and seems impossible to close it.

    Can i have some help about this problem? how to turn off the gyro tracking when the app is suspended?

    Thanks a lot!
     
  3. gaoyu22

    gaoyu22

    Joined:
    Nov 22, 2018
    Posts:
    7
    problem solved. my bad forgot to disable input gyro. it seems that unity dont pause gyro when losing focus.