googlevr / gvr-android-sdk

Google VR SDK for Android
http://developers.google.com/vr/android/
Other
3.28k stars 1.28k forks source link

Screen too dim #450

Closed ajavamind closed 7 years ago

ajavamind commented 7 years ago

With T-Mobile's latest update to Android 7.0 for the Samsung S8 phone recently, my GVR app using v1.70.0 dims the screen brightness and there is no way to increase it, that I am aware. GVR seems to override the system Settings for Display brightness and auto-brightness chosen by the user. Is there any way API to change this behavior?

jdduke commented 7 years ago

This can occur when entering VR mode, when the screen enables low persistence mode and enforces certain brightness values. Typically the brightness is set to a level that is deemed consistent across Daydream devices. If your app is purely a Cardboard app, you might consider disabling VR mode, but if it supports Daydream, unfortunately there's no way around this at the moment.

ajavamind commented 7 years ago

The app is Cardboard only. I tried using AndroidCompat.setVrModeEnabled(this, false) to disable VR mode but it still dims the screen on the S8 despite being Cardboard only.

jdduke commented 7 years ago

Do you have enableVrMode in your Activity manifest?

ajavamind commented 7 years ago

No. The Samsung S6 and S7 phones have Android 7 updates from T-Mobile and do not exhibit dim screen issue, only the S8.

ajavamind commented 7 years ago

Is there any way to disable low persistence mode which seems to be cause of problem with the S8? My answer to this question was to disable Google VR Services (version 1.7.161000338. Then my Cardboard only app screen brightness did NOT dim anymore. I would suggest @jdduke, please reopen this bug.

threesn commented 7 years ago

I had the same issue with a cardboard-only app built with Unity. With Google VR services enabled on the S8, calling AndroidCompat.setVrModeEnabled(this, false) after switching to VR solved the screen brightness issue!

baroquedub commented 6 years ago

@threesn Thanks David, that could possibly solve my problem as I'm in Unity too... how do you call AndroidCompat.setVrModeEnabled(this, false) ?

I'm using 2017.2 and can't see AndroidCompat under UnityEngine.XR.XRSettings.

I'm using this to switch to VR:

IEnumerator SwitchToVR() {
    string[] DaydreamDevices = new string[] { "daydream", "cardboard" };
    XRSettings.LoadDeviceByName(DaydreamDevices);

    // Must wait one frame after calling XRSettings.LoadDeviceByName().
    yield return null;

    // Now it's ok to enable VR mode.
    XRSettings.enabled = true;
    UnityEngine.XR.XRSettings.eyeTextureResolutionScale = GlobalVars.vrRenderScale;
}

Ideally I'd like it to work for either Daydream or Cardboard.

(Was not seeing this on my Android 7.0 Samsung S6 but now a problem on my shiny new S9 running Oreo)