googlevr / gvr-unity-sdk

Google VR SDK for Unity
http://developers.google.com/vr/unity/
Other
2.71k stars 1.09k forks source link

IOS. Unity 5.6 + GVR 1.4 native GVR - setting DefaultDeviceProfile does not work #568

Closed otri closed 7 years ago

otri commented 7 years ago

I cannot get the DefaultDeviceProfile to stick Using release of GVR 1.4 on Unity 5.6.0f3, with VR enabled and Cardboard API added.

The app always initializes to using Default Cardboard. This works fine in Unity 5.5.0f3 and GoogleVR 1.4, without native GVR integration.

switch viewer - default cardboard

Also... I would like to be able to override the Cardboard currently active Device Profile and hide the settings gear if I plug my iPhone into a known headset, so user does not have to do any steps. Is there some way I can set the DeviceProfile at runtime?

settings gear

miraleung commented 7 years ago

If the number of the GVR SDK in the Podfile is 1.20, could you please see if this issue can be repro'd after pod-updating it to 1.40 (instructions in the README)?

otri commented 7 years ago

It's certainly GVR SDK 1.40.

Updated GvrViewer.cs lines 381 to report the setter error:

    if (DefaultDeviceProfile != null) {
      if( device.SetDefaultDeviceProfile(DefaultDeviceProfile) == false ) {
        Debug.LogWarning("Failed to set DefaultDeviceProfile, on device:" + device.ToString());
      }
    }

I get a consistent warning:

Failed to set DefaultDeviceProfile, on device:Gvr.Internal.iOSDevice

miraleung commented 7 years ago

GvrViewer.cs will be going away as of 1.50, and this codepath shouldn't be running for Unity 5.6.

otri commented 7 years ago

Okay, is there an alternative way for specifying a headset profile when plugging or attaching in some way to a known headset? I'd like to eliminate user error if possible, and a guaranteed optical match to a physically attached headset would be best.

miraleung commented 7 years ago

The GVR Unity SDK exposes only the available methods from the GVR NDK / SDK; could you please try filling an issue in gvr-android-sdk?

miraleung commented 7 years ago

We are investigating internally on the Default profile initialization and setting the headset profile, thanks for the report.

peterept commented 7 years ago

Any update on this? Is there a work-around to load a different profile with Unity3d + GoogleVR SDK?

otri commented 7 years ago

@miraleung Hoping there's some movement on this one. We need to set a GoogleVR Default headset profile for our headset, or we'll have to stop supporting it completely.

miraleung commented 7 years ago

Yes, this method has been added in the last release; please take a look at Assets/GoogleVR/Scripts/GvrCardboardHelpers.cs.

otri commented 7 years ago

Thanks Mira! Will give it a shot here shortly. And will close the issue if all is well.

guitarrapc commented 7 years ago

Great tip! BTW, is there any way to check what DeviceProfile currently sat? I mean I do want to set default DeviceProfile only if there are no other device profiler has been sat before my app.

Seems no way to check it. https://github.com/googlevr/gvr-android-sdk/blob/master/libraries/headers/vr/gvr/capi/include/gvr.h

otri commented 7 years ago

Yeah, good point. I would open a separate issue. These properties are important to know and override for streamlining the user experience with a specific piece of hardware.

I can confirm this issue is closed as of GoogleVR 1.70.