jakedowns / Into3D

Into3D for Nreal AR Devices
https://poweredonsoftware.com
4 stars 0 forks source link

Locked Screen Mode Improvements #6

Open jakedowns opened 1 year ago

jakedowns commented 1 year ago
Scott-Klein commented 1 year ago

Somebody on this thread here found a dirty way to keep the game process running by commenting out some or all of the calls to pause in the activity, this goes against everything I know about android, being that you can't run a paused activity, but this could lead to running the player with the screen off, saving tonnes of battery Worth investigating, and I'm going to be doing experiments tonight. https://forum.unity.com/threads/application-runinbackground-is-not-working-on-android.117723/

jakedowns commented 1 year ago

thanks for sharing this @Scott-Klein this is interesting. I did find that when i lock the screen when my app is playing video, it'll keep the audio going

if i tap the screen, i see (and can interact with) my app instead of the lock screen, which means FLAG_SHOW_WHEN_LOCKED is working

however, on the Nreal headset, I see the lock screen.

If there's some way to overcome that aspect, that would be really cool

Scott-Klein commented 1 year ago

We'll need to ask Nreal to support an official SDK method of keeping the headset alive / shutting down controller tracking. I've been digging a lot through their scripts and think they should just offer these as battery saving enhancements. Although in my video player I get pretty good battery life with dimmed screen and using IL2CPP to build. I've also aggressively turned off so many different unity graphics settings given that I'm just using an unlit texture to display. I can get 30 minutes of play time for around 10-11 % battery, which is already very fair.

On Tue, Dec 6, 2022 at 10:34 AM Jake Downs @.***> wrote:

thanks for sharing this @Scott-Klein https://github.com/Scott-Klein this is interesting. I did find that when i lock the screen when my app is playing video, it'll keep the audio going

if i tap the screen, i see my app instead of the lock screen, which means FLAG_SHOW_WHEN_LOCKED is working

however, on the Nreal headset, I see the lock screen.

If there's some way to overcome that aspect, that would be really cool

— Reply to this email directly, view it on GitHub https://github.com/jakedowns/Into3D/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGECX3D6CSSTFPXPAF47NSLWLZ3YVANCNFSM6AAAAAASSNAOXA . You are receiving this because you were mentioned.Message ID: @.***>

-- Regards,

Scott Klein

jakedowns commented 1 year ago

ooh, i'm also using unlit texture, but that's a good point, i'll need to make sure i don't have any other extraneous render settings. thanks for pointing that out

Scott-Klein commented 1 year ago

You can actually turn EVERYTHING down to minimum and not impact the video, even resolution scaling 1/16 quality, doesn't seem to impact the vlc player texture out. You can delete the default scene spotlight, turn global illumination lighting off, which should itself save about 10% of the render frame time, or at least it does on my device. The scripts themselves shouldn't need much optimization, doing some profiling reveals that most of the frametime is eaten up in the render calls. Even at 60fps, you can warm up the device to the point that it throttles the processors of the samsungs, causing unity to crash! IL2CPP makes the most difference though, and just use arm64, don't take any chances with 32 bit, none of the Nreal compatible phones are 32 bit only anyway.

On Tue, Dec 6, 2022 at 10:57 AM Jake Downs @.***> wrote:

ooh, i'm also using unlit texture, but that's a good point, i'll need to make sure i don't have any other extraneous render settings. thanks for pointing that out

— Reply to this email directly, view it on GitHub https://github.com/jakedowns/Into3D/issues/6, or unsubscribe https://github.com/notifications/unsubscribe-auth/AGECX3DUUEVC2IW7HQGCUGDWLZ6O7ANCNFSM6AAAAAASSNAOXA . You are receiving this because you were mentioned.Message ID: @.***>

-- Regards,

Scott Klein