Forums - Nexus 6P + Unity App: Stuck Retrieving Snapshot

8 posts / 0 new
Last post
Nexus 6P + Unity App: Stuck Retrieving Snapshot
jceipek
Join Date: 26 Oct 16
Posts: 2
Posted: Sun, 2016-12-04 22:27

I'm trying to optimize some shaders for a GPU-bound Google Daydream application built using Unity. I can get the "realtime" and "trace capture" modes of the Snapdragon Profiler to work, but when I press the "Snapshot" button, the Snapdragon Profiler (1.5.4.10212016) hangs on "Retrieving Snapshot." How can I get the Snapshot feature to work for Unity apps on the Nexus 6P?

--------------------------------------------------------

More info:

I have replicated this problem with a completely empty Unity project (Unity version 5.4 and 5.5) and with Google's HeadsetDemo DemoScene (Unity version 5.4.2f2-GVR12), built with "Development Build" checked.

I have tried using ADB version 1.0.36 and 1.0.32.

The phone I am using is a Nexus 6P running Android version 7.0, which I assume should work with Snapshot Capture mode since it has a Snapdragon 810 processor.

The OS I am using is macOS 10.12.1, but I have also tried using a Windows 10 machine with the same results.

These are the steps I'm using:

  1. Open Snapdragon profiler
  2. Connect to a device -> Select Nexus 6P -> Connect
  3.     On the device: Open "SnapdragonTest" app
  4. New Snapshot Capture
  5. Select com.MyCompanyName.SnapdragonTest as a data source
  6. Click Process->GPU General->Clocks
  7. Click the Snapshot button
  8.     On the device, the test app freezes for a few seconds (the app I actually want to profile never resumes)
  9. Snapdragon Profiler now says "Retrieving Snapshot" indefinitely (I once left it running for about 30 minutes)

This is what `adb logcat` reports around the time that I click the Snapshot button:

01-13 01:12:00.988 21281 21328 I SDPCore : Metric activated: API Trace
01-13 01:12:00.990 21281 21328 I SDPCore : GLES_DP: Sending QSTREAM Token 0x102000A
01-13 01:12:00.992 21281 21328 I SDPCore : GLES_DP: Sending QSTREAM Token 0x4020040
01-13 01:12:00.992 21281 21328 I SDPCore : GLES_DP: Sending QSTREAM Token 0x4020003
01-13 01:12:00.992 21281 21328 I SDPCore : GLES_DP: Sending QSTREAM Token 0x902000B
01-13 01:12:00.992 21281 21328 I SDPCore : GLES_DP: Sending QSTREAM Token 0x1020006
01-13 01:12:00.992 21281 21328 I SDPCore : GLES_DP: Sending QSTREAM Token 0x102000E
01-13 01:12:00.992 21281 21328 I SDPCore : Metric deactivated: API Trace
01-13 01:12:00.992 21281 21328 I SDPCore : GLES_DP: GfxConnection: App [com.google.vr.vrcore] Pid [4022] ready to profile
01-13 01:12:00.993 21281 21337 I SDPCore : QGL_DP: Trying to start a capture from QGL DP on a non-vulkan driver device, or don't have a QGL app connected
01-13 01:12:00.993 21281 21337 I SDPCore : QGL_DP: m_gfxConnection->IsQGL() == true
01-13 01:12:00.993 21281 21337 I SDPCore : QGL_DP: m_gfxConnection->AppReady() == false
01-13 01:12:01.037 21511 21511 W UnityMain: type=1400 audit(0.0:273): avc: denied { write } for name="tmp" dev="dm-2" ino=65410 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
01-13 01:12:01.185   409   409 E SELinux : avc:  denied  { find } for service=netd pid=21826 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:netd_service:s0 tclass=service_manager permissive=0
01-13 01:12:01.181 21826 21826 W atrace  : type=1400 audit(0.0:274): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:ims:s0 tclass=binder permissive=0
01-13 01:12:01.191 21826 21826 W atrace  : type=1400 audit(0.0:275): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:fingerprintd:s0 tclass=binder permissive=0
01-13 01:12:01.194   409   409 E SELinux : avc:  denied  { find } for service=android.service.gatekeeper.IGateKeeperService pid=21826 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:gatekeeper_service:s0 tclass=service_manager permissive=0
01-13 01:12:01.997 21281 21337 I SDPCore : QGL_DP: Trying to end a capture from QGL DP on a non-esx device, or are not currently capturing
01-13 01:12:02.005 21281 21328 I SDPCore : GLES_DP: Sending QSTREAM Token 0x102000A
01-13 01:12:02.139   409   409 E SELinux : avc:  denied  { find } for service=netd pid=21828 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:netd_service:s0 tclass=service_manager permissive=0
01-13 01:12:02.134 21828 21828 W atrace  : type=1400 audit(0.0:276): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:ims:s0 tclass=binder permissive=0
01-13 01:12:03.650   533   627 I ThermalEngine: ACTION: GPU - Setting GPU[0] to 450000000
01-13 01:12:05.391 21479 21586 W GVR     : [vr/gvr/render/scanline_racer.cc:688] Missed vsync by 4318434us (CPU load is too high)
01-13 01:12:05.503  3903 21844 E AppUsageEventWatcher: wrong time range: [1466538248406, 1059125498)
01-13 01:12:05.524 21511 21511 W UnityMain: type=1400 audit(0.0:277): avc: denied { write } for name="tmp" dev="dm-2" ino=65410 scontext=u:r:untrusted_app:s0:c512,c768 tcontext=u:object_r:shell_data_file:s0 tclass=dir permissive=0
01-13 01:12:08.040 19662 19662 I ServiceManager: Waiting for service AtCmdFwd...
01-13 01:12:09.040 19662 19662 I ServiceManager: Waiting for service AtCmdFwd...
01-13 01:12:09.658   533   627 I ThermalEngine: ACTION: GPU - Setting GPU[0] to 390000000
01-13 01:12:10.042 19662 19662 I ServiceManager: Waiting for service AtCmdFwd...

I'm not sure if I need to change any settings on the phone (it already has USB debugging turned on and has "Enable developer logs" checked in Google VR settings) or in Snapdragon Profiler. One thing I'm particularly unsure of is what EGL or GL Delimiter I should be using. I've tried using  the default EGLSwapBuffers as well as setting that to False while setting GLFlush to True. In "Trace Capture" mode, I can see regular blocks of graphics commands that end with "eglSwapBuffersWithDamageKHR". I can also see "IB1 Start Markers" and "Flush Markers", but I'm not sure what any of those mean -- I'm not very familiar with graphics APIs.

Thanks in advance for any ideas or suggestions you might have!

  • Up0
  • Down0
jasonworks
Join Date: 22 Dec 16
Posts: 5
Posted: Thu, 2016-12-22 14:41

Were you able to resolve?  I'm getting the same issue with Pixel XL.

  • Up0
  • Down0
musclyhc
Join Date: 17 Nov 14
Posts: 1
Posted: Mon, 2017-01-02 20:24

I have the same issue with a UE4 game.

  • Up0
  • Down0
jceipek
Join Date: 26 Oct 16
Posts: 2
Posted: Tue, 2017-01-03 01:16

@jasonworks, I still haven't found a solution, unfortunately.

  • Up0
  • Down0
jlloyd
Join Date: 21 Nov 16
Posts: 1
Posted: Tue, 2017-01-10 03:04

I have the same issue, except I am trying to take a snapshot on a Nexus 5X.

I have tried various versions of Unity, but none of them are able to retreive a snapshot.  

I have in the past been able to take snapshots of Unity games on this same device (different PC at an old job).

  • Up0
  • Down0
jasonworks
Join Date: 22 Dec 16
Posts: 5
Posted: Thu, 2017-01-12 14:59

It looks like the resolution may be a lack of permission settings in the manifest.

It turns out that for basic applications you need...
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
The default in Unity is...
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>
 
Switching the Write Access from Internal to External (SDCard) resolved the profiling issues that I was having with my basic application by removing the reference to maxSdkVersion.
 
 
Let me know if that resolves the issue for you.
  • Up0
  • Down0
jasonworks
Join Date: 22 Dec 16
Posts: 5
Posted: Thu, 2017-01-12 15:02

It looks like the resolution may be a lack of permission settings in the manifest.

It turns out that for basic applications you need...
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
 
The default in Unity is...
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18"/>
 
In ther PropertySettings, switching the Write Access from Internal to External (SDCard) resolved the profiling issues that I was having with my basic application.
 
Let me know if that resolves the issue for you.
  • Up0
  • Down0
Carlos Dominguez Moderator
Join Date: 27 Jul 15
Location: San Diego
Posts: 110
Posted: Thu, 2017-01-19 10:31

Thank you for this valuable information. We have been able to reproduce this issue and it seems this will be a new requirement for applications to use Snapdragon Profiler with Android N devices. We are looking into our alternatives to overcome this limitation but for the time being we will reflect your findings on our documentation. Thanks again for looking into this!

  • Up0
  • Down0
or Register

Opinions expressed in the content posted here are the personal opinions of the original authors, and do not necessarily reflect those of Qualcomm Incorporated or its subsidiaries (“Qualcomm”). The content is provided for informational purposes only and is not meant to be an endorsement or representation by Qualcomm or any other party. This site may also provide links or references to non-Qualcomm sites and resources. Qualcomm makes no representations, warranties, or other commitments whatsoever about any non-Qualcomm sites or third-party resources that may be referenced, accessible from, or linked to this site.