Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Question Hot to reduce battery drain of AR app?

Discussion in 'AR' started by waldgeist, May 19, 2023.

  1. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    357
    We have an AR app that only uses a subset of AR features, i.e. world-tracking and anchors. However, battery drain is huge, the devices are getting hot, and users are complaining about it.

    So I've been looking for a way to optimize this. I found this old video from 2018:



    However, none of these things help much. I tested battery drain on both an iPhone 12 Pro Max and a Mi 9 over a period of 30 minutes app activity with a fully charged battery. Both devices only showed slight improvements, if I reduced the frame rate and screen resolution:

    * iPhone: battery level 89 instead of 88
    * Mi9: battery level 62 (identical)

    I also found some explanations that it would be good to disable plane tracking, but we're not using it.

    So I am a bit clueless how we could further improve this. Are there any websites / videos with more up-to-date insights out there?
     
  2. zulo3d

    zulo3d

    Joined:
    Feb 18, 2023
    Posts:
    510
    I'm using a Pixel 7 and it becomes hot after five minutes. I suspect most of the heat comes from the compositing of the camera feed and the rendered frame buffer and so there's not really anything we can do about it.

    Maybe there's room for improvement at the chip design stage where it's possible to have dedicated circuitry that can combine the frame buffers more efficiently.

    I think future AR devices are going to need large batteries and to be air cooled, which means they'll need to be a small box that's clipped onto a user's waist belt.

    The Sony Walkman returns!.
     
    waldgeist likes this.
  3. zulo3d

    zulo3d

    Joined:
    Feb 18, 2023
    Posts:
    510
    Also, scanning a large frame buffer 60 times a second for feature points with a CPU is going be very demanding. Probably more so than the compositing that I mentioned above. So make sure you're also lowering your camera's resolution and frame rate and not just your rendering frame rate.
     
    waldgeist likes this.
  4. waldgeist

    waldgeist

    Joined:
    May 6, 2017
    Posts:
    357
    Good point. How can this be achieved?
     
  5. zulo3d

    zulo3d

    Joined:
    Feb 18, 2023
    Posts:
    510
  6. andyb-unity

    andyb-unity

    Unity Technologies

    Joined:
    Feb 10, 2022
    Posts:
    776
    To set the camera configuration, set the
    ARCameraManager.currentConfiguration
    property. You can get a list of available configurations on your device from
    ARCameraManager.GetConfigurations(Allocator)


    Some sample code here: https://docs.unity3d.com/Packages/com.unity.xr.arkit@5.1/manual/whats-new.html#4k-video

    ARCameraManager scripting reference: https://docs.unity3d.com/Packages/c...tyEngine.XR.ARFoundation.ARCameraManager.html

    I've also made a note to improve docs for this in the AR Foundation manual.
     
    makaka-org, Dan4x8 and KyryloKuzyk like this.