googlevr / gvr-android-sdk

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

Cardboard ignoring current_device_params #47

Closed yolanother closed 8 years ago

yolanother commented 8 years ago

On some of my devices cardboard is ignoring the values from current_device_params. My ADB log reads: Successfully read device params from external storage. But if I get the active CardboardDeviceParams with CardboardView.getCardboardDeviceParams() I get all default options seen below

D/TAG (14795): Unmodified Screen params: { D/TAG (14795): width: 1920, D/TAG (14795): height: 1080, D/TAG (14795): x_meters_per_pixel: 7.9375E-5, D/TAG (14795): y_meters_per_pixel: 7.9375E-5, D/TAG (14795): border_size_meters: 0.003, D/TAG (14795): } D/TAG (14795): Unmodified Device params: { D/TAG (14795): vendor: Google, Inc., D/TAG (14795): model: Cardboard v1, D/TAG (14795): inter_lens_distance: 0.06, D/TAG (14795): vertical_alignment: BOTTOM, D/TAG (14795): vertical_distance_to_lens_center: 0.035, D/TAG (14795): screen_to_lens_distance: 0.042, D/TAG (14795): left_eye_max_fov: { D/TAG (14795): left: 40.0, D/TAG (14795): right: 40.0, D/TAG (14795): bottom: 40.0, D/TAG (14795): top: 40.0, D/TAG (14795): }, D/TAG (14795): distortion: { D/TAG (14795): coefficients: [0.441, 0.156], D/TAG (14795): }, D/TAG (14795): magnet: true, D/TAG (14795): }

On the devices where this is working: D/TAG ( 6249): Unmodified Screen params: { D/TAG ( 6249): width: 1920, D/TAG ( 6249): height: 1200, D/TAG ( 6249): x_meters_per_pixel: 8.9122805E-5, D/TAG ( 6249): y_meters_per_pixel: 8.943662E-5, D/TAG ( 6249): border_size_meters: 0.003, D/TAG ( 6249): } D/TAG ( 6249): Unmodified Device params: { D/TAG ( 6249): vendor: Custom Vendor, D/TAG ( 6249): model: Custom Model, D/TAG ( 6249): inter_lens_distance: 0.06, D/TAG ( 6249): vertical_alignment: BOTTOM, D/TAG ( 6249): vertical_distance_to_lens_center: 0.043, D/TAG ( 6249): screen_to_lens_distance: 0.04, D/TAG ( 6249): left_eye_max_fov: { D/TAG ( 6249): left: 120.0, D/TAG ( 6249): right: 120.0, D/TAG ( 6249): bottom: 120.0, D/TAG ( 6249): top: 120.0, D/TAG ( 6249): }, D/TAG ( 6249): distortion: { D/TAG ( 6249): coefficients: [0.19, 0.19], D/TAG ( 6249): }, D/TAG ( 6249): magnet: false, D/TAG ( 6249): }

smdol commented 8 years ago

Which phones (and versions of Android) show the problem for you?

yolanother commented 8 years ago

Android L. NVIDIA Shield TV

smdol commented 8 years ago

Is this an app you built? Definitely make sure your manifest asks for permission to read external storage, if you don't have that already.

yolanother commented 8 years ago

App I built and other sample apps as well. I'm seeing the message saying that the config file was read successfully. I have seen the failure message on other projects that don't have permission to read external storage.

smdol commented 8 years ago

OK, you might want to look through adb not for your app, but for when you actually scan the QR code within the Cardboard app. See if there are any messages about failing to save the data to storage, or network problems if it tries to unroll a shortened URI.

yolanother commented 8 years ago

Do you have a suggestion for what tags I should be watching for? I'm currently monitoring HeadMountedDisplayManager which is where the "Successfully read device params from external storage." came from.

yolanother commented 8 years ago

Here is a full log from an unmodified CardboardSample:

I/ActivityManager(  610): Start proc 21484:com.google.vrtoolkit.cardboard.samples.treasurehunt/u0a69 for activity com.google.vrtoolkit.cardboard.samples.treasurehunt/.MainActivity
I/art     (21484): Debugger is no longer active
V/NFC     (21484): this device does not have NFC support
E/PhoneParams(21484): Error parsing param record: incorrect sentinel.
I/HeadMountedDisplayManager(21484): Successfully read device params from external storage
D/CardboardViewNativeImpl(21484): NativeProxy not found
D/CardboardViewNativeImpl(21484): Loading native library vrtoolkit
D/CardboardViewNativeImpl(21484): Native library loaded
W/art     (21484): Attempt to remove local handle scope entry from IRT, ignoring
W/art     (21484): Attempt to remove local handle scope entry from IRT, ignoring
W/art     (21484): Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[14,tid=21509,Native,Thread*=0x64434100,peer=0x12d100a0,"Thread-2137"]
W/art     (21484): Attempt to remove local handle scope entry from IRT, ignoring
W/art     (21484): Attempt to remove local handle scope entry from IRT, ignoring
E/PhoneParams(21484): Error parsing param record: incorrect sentinel.
D/OpenGLRenderer(21484): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
I/OpenGLRenderer(21484): Initialized EGL, version 1.4
D/OpenGLRenderer(21484): Enabling debug mode 0
V/RenderScript(21484): 0x64416400 Launching thread(s), CPUs 4
I/MainActivity(21484): onSurfaceCreated
I/MainActivity(21484): onSurfaceChanged
W/System.err(21484): java.lang.SecurityException: Permission denied (missing INTERNET permission?)
W/System.err(21484):    at java.net.InetAddress.lookupHostByName(InetAddress.java:451)
W/System.err(21484):    at java.net.InetAddress.getAllByNameImpl(InetAddress.java:252)
W/System.err(21484):    at java.net.InetAddress.getAllByName(InetAddress.java:215)
W/System.err(21484):    at com.android.okhttp.HostResolver$1.getAllByName(HostResolver.java:29)
W/System.err(21484):    at com.android.okhttp.internal.http.RouteSelector.resetNextInetSocketAddress(RouteSelector.java:232)
W/System.err(21484):    at com.android.okhttp.internal.http.RouteSelector.next(RouteSelector.java:124)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpEngine.connect(HttpEngine.java:272)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpEngine.sendRequest(HttpEngine.java:211)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:382)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.connect(HttpURLConnectionImpl.java:106)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getOutputStream(HttpURLConnectionImpl.java:217)
W/System.err(21484):    at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getOutputStream(DelegatingHttpsURLConnection.java:218)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getOutputStream(HttpsURLConnectionImpl.java:25)
W/System.err(21484): Caused by: android.system.GaiException: android_getaddrinfo failed: EAI_NODATA (No address associated with hostname)
W/System.err(21484):    at libcore.io.Posix.android_getaddrinfo(Native Method)
W/System.err(21484):    at libcore.io.ForwardingOs.android_getaddrinfo(ForwardingOs.java:55)
W/System.err(21484):    at java.net.InetAddress.lookupHostByName(InetAddress.java:438)
W/System.err(21484):    ... 12 more
W/System.err(21484): Caused by: android.system.ErrnoException: android_getaddrinfo failed: EACCES (Permission denied)
W/System.err(21484):    ... 15 more
W/System.err(21484): java.lang.NullPointerException: Attempt to invoke interface method 'void com.android.okhttp.internal.http.Transport.writeRequestHeaders(com.android.okhttp.Request)' on a null object reference
W/System.err(21484):    at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:611)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:388)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponseCode(HttpURLConnectionImpl.java:500)
W/System.err(21484):    at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getResponseCode(DelegatingHttpsURLConnection.java:105)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getResponseCode(HttpsURLConnectionImpl.java:25)
W/System.err(21484): java.lang.NullPointerException: Attempt to invoke interface method 'void com.android.okhttp.internal.http.Transport.writeRequestHeaders(com.android.okhttp.Request)' on a null object reference
W/System.err(21484):    at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:611)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:388)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getHeaderFieldKey(HttpURLConnectionImpl.java:170)
W/System.err(21484):    at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getHeaderFieldKey(DelegatingHttpsURLConnection.java:202)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getHeaderFieldKey(HttpsURLConnectionImpl.java:25)
W/System.err(21484): java.lang.NullPointerException: Attempt to invoke interface method 'void com.android.okhttp.internal.http.Transport.writeRequestHeaders(com.android.okhttp.Request)' on a null object reference
W/System.err(21484):    at com.android.okhttp.internal.http.HttpEngine.readResponse(HttpEngine.java:611)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.execute(HttpURLConnectionImpl.java:388)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getResponse(HttpURLConnectionImpl.java:332)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpURLConnectionImpl.getHeaderField(HttpURLConnectionImpl.java:148)
W/System.err(21484):    at com.android.okhttp.internal.http.DelegatingHttpsURLConnection.getHeaderField(DelegatingHttpsURLConnection.java:174)
W/System.err(21484):    at com.android.okhttp.internal.http.HttpsURLConnectionImpl.getHeaderField(HttpsURLConnectionImpl.java:25)
E/nvwsi   (21484): failed to get fences from file

And here is a full log with internet permission added:

I/ActivityManager(  610): Start proc 24555:com.google.vrtoolkit.cardboard.samples.treasurehunt/u0a69 for activity com.google.vrtoolkit.cardboard.samples.treasurehunt/.MainActivity
E/art     (24555): Failed sending reply to debugger: Broken pipe
I/art     (24555): Debugger is no longer active
V/NFC     (24555): this device does not have NFC support
E/PhoneParams(24555): Error parsing param record: incorrect sentinel.
I/HeadMountedDisplayManager(24555): Successfully read device params from external storage
D/CardboardViewNativeImpl(24555): NativeProxy not found
D/CardboardViewNativeImpl(24555): Loading native library vrtoolkit
D/CardboardViewNativeImpl(24555): Native library loaded
W/art     (24555): Attempt to remove local handle scope entry from IRT, ignoring
W/art     (24555): Attempt to remove local handle scope entry from IRT, ignoring
W/art     (24555): Attempt to remove local handle scope entry from IRT, ignoring
W/art     (24555): Native thread exiting without having called DetachCurrentThread (maybe it's going to use a pthread_key_create destructor?): Thread[14,tid=24576,Native,Thread*=0x64435500,peer=0x12d100a0,"Thread-2142"]
W/art     (24555): Attempt to remove local handle scope entry from IRT, ignoring
E/PhoneParams(24555): Error parsing param record: incorrect sentinel.
D/OpenGLRenderer(24555): Use EGL_SWAP_BEHAVIOR_PRESERVED: true
I/OpenGLRenderer(24555): Initialized EGL, version 1.4
D/OpenGLRenderer(24555): Enabling debug mode 0
V/RenderScript(24555): 0x64416400 Launching thread(s), CPUs 4
I/MainActivity(24555): onSurfaceCreated
I/MainActivity(24555): onSurfaceChanged
E/nvwsi   (24555): failed to get fences from file
yolanother commented 8 years ago

Interesting I ran with my new config through an old version of cardboard-java sdk, turned off write_external_storage, and ran it with the new version and it worked. Then I did it with write_external_storage granted and it still worked, so I'm not sure what was causing things to break for me. I'll update if I am still broken once I have time to do more testing.