Forums - Snapdragon Profiler Can't Capture Snapshot on Pixel XL

15 posts / 0 new
Last post
Snapdragon Profiler Can't Capture Snapshot on Pixel XL
wydavis
Join Date: 28 Apr 17
Posts: 4
Posted: Tue, 2017-05-02 14:59

Hello,

I'm having a problem getting a Snapshot from my Google Pixel XL using Snapdragon Profiler.

Problem:

When trying to capture a Snapshot, the snapshot is never captured, and an orange box is shown with the text "Retrieving Snapshot" indefinitely.

Repro steps:

Start Snapdragon Profiler.

Connect to phone.

Select "New Snapshot Capture"

Start my app on the device.

Select my app in the "Data Sources" menu. (I also tried many other apps, there was no difference)

Select "Snapshot" button.

(Tried with and without this step:) Cause a redraw in my app by pressing things.

Result:

Orange box with "Retrieving Snapshot" appears and stays indefinitely. No snapshot is ever retrieved.

Configuration:

Windows 10, build 15063.138

Snapdragon Profiler v1.6.1.2242017

ADB v1.0.36

Google Pixel XL, unlocked, Android 7.1.2

 

Any ideas? My setup works fine with my other Android devices.

 

Thanks!

Wyatt

  • Up0
  • Down0
eshaw Moderator
Join Date: 12 May 16
Location: San Diego
Posts: 142
Posted: Wed, 2017-05-03 09:45

Hi Wyatt,

Can you check if your application has the following attributes in it's manifest:

android.permission.READ_EXTERNAL_STORAGE

android.permission.WRITE_EXTERNAL_STORAGE

Eric

  • Up0
  • Down0
wydavis
Join Date: 28 Apr 17
Posts: 4
Posted: Wed, 2017-05-03 11:09

Hi Eric,

Thanks for your reply! Yes, my app's manifest has both of those attributes.

Thanks,

Wyatt

  • Up0
  • Down0
wydavis
Join Date: 28 Apr 17
Posts: 4
Posted: Wed, 2017-05-03 14:49

More info:

I was able to repro the failure on a Nexus 6 running Android 7.0 build NBD91X. All devices that have failed are running 7.0+ and have OpenGL ES 3.2, whereas all the devices that don't fail are running an older Android than 7.0 and have OpenGL ES 3.1.

Also, here is the logcat output after initiating a Snapshot:

 

05-03 14:39:12.387  1121  1828 D QCOM PowerHAL: LAUNCH HINT: OFF
05-03 14:39:12.411 16309 16385 I SDPCore : GLES_DP: GfxConnection: Successfully connected to port 20817
05-03 14:39:12.420 16309 16568 I SDPCore : GLES_DP: Sending QSTREAM Token 0x1020002
05-03 14:39:12.438 16309 16568 I SDPCore : GLES_DP: GfxConnection: state is ready.
05-03 14:39:12.438 16309 16568 I SDPCore : GLES_DP: Moving ESXConnectionState from state 1 to state 2
05-03 14:39:12.550 16309 16309 I SDPCore : GLES_DP: App 'com.wydavis.myapp' is ready.
05-03 14:39:12.550 16309 16309 I SDPCore : GLES_DP: GfxConnection: App [com.wydavis.myapp] Pid [16484] ready to profile
05-03 14:39:12.550 16309 16309 I SDPCore : GLES_DP: Sending QSTREAM Token 0x4020044
05-03 14:39:12.550 16309 16309 I SDPCore : GLES_DP: Sending QSTREAM Token 0x4020044
05-03 14:39:12.557   498   498 W SurfaceFlinger: couldn't log to binary event log: overflow.
05-03 14:39:13.451   499   606 D audio_hw_primary: disable_audio_route: usecase(1) reset and update mixer path: low-latency-playback speaker
05-03 14:39:13.453   499   606 D hardware_info: hw_info_append_hw_type : device_name = speaker
05-03 14:39:13.453   499   606 D audio_hw_primary: disable_snd_device: snd_device(2: speaker)
05-03 14:39:15.220 16307 16307 I SDPCore : Provider 'GGPMDataProvider' listening for files @ tcp://*:6521
05-03 14:39:15.220 16307 16307 I SDPCore : Provider 'GGPMDataProvider' listening for options @ tcp://*:6522
05-03 14:39:20.381 10773 16630 I EventLogSendingHelper: Sending log events.
05-03 14:39:24.025 16310 16310 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
05-03 14:39:24.025 16310 16310 I SDPCore : QGL_DP: m_gfxConnection->IsQGL() == true
05-03 14:39:24.025 16310 16310 I SDPCore : QGL_DP: m_gfxConnection->AppReady() == false
05-03 14:39:24.029 16309 16309 I SDPCore : Metric activated: API Trace
05-03 14:39:24.030 16309 16309 I SDPCore : GLES_DP: Sending QSTREAM Token 0x4020040
05-03 14:39:24.030 16309 16309 I SDPCore : GLES_DP: Sending QSTREAM Token 0x4020003
05-03 14:39:24.030 16309 16309 I SDPCore : GLES_DP: Sending QSTREAM Token 0x902000B
05-03 14:39:24.030 16309 16309 I SDPCore : GLES_DP: Sending QSTREAM Token 0x1020006
05-03 14:39:24.030 16309 16309 I SDPCore : GLES_DP: Sending QSTREAM Token 0x102000E
05-03 14:39:24.030 16309 16309 I SDPCore : Metric deactivated: API Trace
05-03 14:39:24.330 16641 16641 W atrace  : type=1400 audit(0.0:2678): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:update_engine:s0 tclass=binder permissive=0
05-03 14:39:24.331   497   497 E SELinux : avc:  denied  { find } for service=netd pid=16641 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:netd_service:s0 tclass=service_manager permissive=0
05-03 14:39:24.333 16641 16641 W atrace  : type=1400 audit(0.0:2679): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:fingerprintd:s0 tclass=binder permissive=0
05-03 14:39:24.333 16641 16641 W atrace  : type=1400 audit(0.0:2680): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:per_mgr:s0 tclass=binder permissive=0
05-03 14:39:24.336   497   497 E SELinux : avc:  denied  { find } for service=android.service.gatekeeper.IGateKeeperService pid=16641 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:gatekeeper_service:s0 tclass=service_manager permissive=0
05-03 14:39:25.004 16309 16309 I SDPCore : GLES_DP: Sending QSTREAM Token 0x102000F
05-03 14:39:25.033 16310 16310 I SDPCore : QGL_DP: Trying to end a capture from QGL DP on a non-esx device, or are not currently capturing
05-03 14:39:25.260 16650 16650 W atrace  : type=1400 audit(0.0:2681): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:update_engine:s0 tclass=binder permissive=0
05-03 14:39:25.262   497   497 E SELinux : avc:  denied  { find } for service=netd pid=16650 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:netd_service:s0 tclass=service_manager permissive=0
05-03 14:39:25.263 16650 16650 W atrace  : type=1400 audit(0.0:2682): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:fingerprintd:s0 tclass=binder permissive=0
05-03 14:39:25.267 16650 16650 W atrace  : type=1400 audit(0.0:2683): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:per_mgr:s0 tclass=binder permissive=0
05-03 14:39:25.267   497   497 E SELinux : avc:  denied  { find } for service=android.service.gatekeeper.IGateKeeperService pid=16650 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:gatekeeper_service:s0 tclass=service_manager permissive=0
05-03 14:39:26.290 16650 16650 I atrace  : Dumping trace
05-03 14:39:26.517 16650 16650 W atrace  : type=1400 audit(0.0:2684): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:update_engine:s0 tclass=binder permissive=0
05-03 14:39:26.518   497   497 E SELinux : avc:  denied  { find } for service=netd pid=16650 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:netd_service:s0 tclass=service_manager permissive=0
05-03 14:39:26.523 16650 16650 W atrace  : type=1400 audit(0.0:2685): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:fingerprintd:s0 tclass=binder permissive=0
05-03 14:39:26.523 16650 16650 W atrace  : type=1400 audit(0.0:2686): avc: denied { call } for scontext=u:r:shell:s0 tcontext=u:r:per_mgr:s0 tclass=binder permissive=0
05-03 14:39:26.526   497   497 E SELinux : avc:  denied  { find } for service=android.service.gatekeeper.IGateKeeperService pid=16650 uid=2000 scontext=u:r:shell:s0 tcontext=u:object_r:gatekeeper_service:s0 tclass=service_manager permissive=0
05-03 14:39:40.398 10773 13147 W GmsLocationProvider: Error removing location updates: 16
05-03 14:40:32.525  8002  8736 I PlayCommon: [414] com.google.android.play.a.g.e(202): Preparing logs for uploading
05-03 14:40:32.526  8002  8736 I PlayCommon: [414] com.google.android.play.a.g.e(206): No file ready to send
05-03 14:41:06.490  1712  1712 V zz      : AbstractWeatherManager.get() is stopped; ignoring
05-03 14:41:10.230  2212  4641 I ClearcutLoggerApiImpl: disconnect managed GoogleApiClient
05-03 14:41:15.991 15510 15602 V NativeCrypto: SSL shutdown failed: ssl=0x7e390ba000: I/O error during system call, Broken pipe
05-03 14:41:21.147  2510 17065 I EventLogChimeraService: Aggregate from 1493845812914 (log), 1493845812914 (data)
--------- beginning of system
05-03 14:41:24.813  1121  2115 D ConnectivityService: reportNetworkConnectivity(100, false) by 10018
05-03 14:41:24.814  1121  2447 D NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: Forcing reevaluation for UID 10018
05-03 14:41:24.862  1121 17077 D NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_DNS OK 30ms, connectivitycheck.gstatic.com=172.217.3.163
05-03 14:41:24.878  1121 17076 D NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_DNS OK 42ms, www.google.com=172.217.3.196
05-03 14:41:25.002  1121 17077 D NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_HTTP http://connectivitycheck.gstatic.com/generate_204 time=134ms ret=204 headers={null=[HTTP/1.1 204 No Content], Content-Length=[0], Date=[Wed, 03 May 2017 21:41:25 GMT], X-Android-Received-Millis=[1493847684995], X-Android-Response-Source=[NETWORK 204], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1493847684986]}
05-03 14:41:25.184  1121 17076 D NetworkMonitor/NetworkAgentInfo [WIFI () - 100]: PROBE_HTTPS https://www.google.com/generate_204 time=301ms ret=204 headers={null=[HTTP/1.1 204 No Content], Alt-Svc=[quic=":443"; ma=2592000; v="37,36,35"], Content-Length=[0], Date=[Wed, 03 May 2017 21:41:25 GMT], X-Android-Received-Millis=[1493847685182], X-Android-Response-Source=[NETWORK 204], X-Android-Selected-Protocol=[http/1.1], X-Android-Sent-Millis=[1493847685077]}
05-03 14:41:25.190  1121  1434 D ConnectivityService: NetworkAgentInfo [WIFI () - 100] validation passed
05-03 14:41:25.199  1121 17081 D WifiNetworkHistory: saving network history: "MYWIFI"NONE gw: null Network Selection-status: NETWORK_SELECTION_ENABLED ephemeral=false choice:null link:0 status:0 nid:0 hasEverConnected: true
05-03 14:41:25.199  1121 17081 V WifiNetworkHistory: writeKnownNetworkHistory write config "MYWIFI"NONE
05-03 14:41:26.397  2510 17067 W PlatformStatsUtil: Could not retrieve Usage & Diagnostics setting. Giving up.
05-03 14:41:41.587 16309 16390 E SDPCore : GLES_DP: GfxConnection: Error getting QSTREAMBufferHeader or invalid buffer sent!
05-03 14:41:41.587 16309 16390 I SDPCore : GLES_DP: Moving ESXConnectionState from state 2 to state 0
 
  • Up0
  • Down0
BenM
Join Date: 12 May 16
Posts: 29
Posted: Thu, 2017-05-04 10:10

Hi Wyatt,

Just to verify, your app manifest also has the android.permission.INTERNET enabled as well?  Also, can you check if your app permissions have been altered in the application settings?  I have seen cases before where depending on the specific version of the NDK that the apk was compiled against, the 'default' permissions sometimes differ, affecting the read/write global storage permissions.

Thanks,

Ben

  • Up0
  • Down0
wydavis
Join Date: 28 Apr 17
Posts: 4
Posted: Thu, 2017-05-04 13:06

Thanks Ben. You are correct, the permissions in the application settings were disabled. I enabled them, but the problem persists. Here is the full list of permissions:

    requested permissions:

      android.permission.WRITE_SETTINGS

      android.permission.WRITE_PROFILE

      android.permission.INTERNET

      android.permission.ACCESS_NETWORK_STATE

      android.permission.ACCESS_COARSE_LOCATION

      android.permission.ACCESS_FINE_LOCATION

      android.permission.WRITE_EXTERNAL_STORAGE

      android.permission.READ_EXTERNAL_STORAGE

      com.qti.permission.PROFILER

      android.permission.ACCESS_WIFI_STATE

      android.permission.CHANGE_WIFI_STATE

      android.permission.RECEIVE_BOOT_COMPLETED

    install permissions:

      android.permission.RECEIVE_BOOT_COMPLETED: granted=true

      android.permission.INTERNET: granted=true

      android.permission.WRITE_PROFILE: granted=true

      android.permission.CHANGE_WIFI_STATE: granted=true

      android.permission.ACCESS_NETWORK_STATE: granted=true

      android.permission.ACCESS_WIFI_STATE: granted=true

    runtime permissions:

      android.permission.ACCESS_FINE_LOCATION: granted=true

      android.permission.READ_EXTERNAL_STORAGE: granted=true

      android.permission.ACCESS_COARSE_LOCATION: granted=true

     android.permission.WRITE_EXTERNAL_STORAGE: granted=true

 

However we are getting closer. If I take a Snapshot immediately after loading the application, the Snapshot succeeds. If I wait for more than a second, the Snapshot never completes... Hope this helps in spurring more ideas of the cause :).

 

-Wyatt

*/
  • Up0
  • Down0
BenM
Join Date: 12 May 16
Posts: 29
Posted: Thu, 2017-05-04 16:06

Hey Wyatt,

Glad you can get one snapshot at least, so that likely rules out any additional permission issues.

The Snapshot feature works when the application hits what we call a "frame delimiter", which is normally a call to eglSwapBuffers / glFinish / etc.  We use these to start and stop the actual capture for a single "frame".  Does your application call eglSwapBuffers at the end of each rendering cycle?  If your application makes a different call at the beginning or end of each logical frame, we can likely handle that too, but you may need to let Profiler know of the alternate call to use instead.  To do this, in the Options view, select your process in the left combo-box, and "GL Frame Delimiters" in the right combo-box.  Below should be a list of calls you can enable/disable to be used as "frame delimiters".

We also use the notion of "frame delimiters" to try to figure out the most "active" gl context within the application.  From the sounds of it, your application is not continuously rendering, but will only update after user interaction?  If this is correct, I'm wondering if forcing a few updates before requesting the snapshot, and then forcing a few more updates after the snapshot has been requested will help?

Are you creating multiple gl contexts in your app?  If so, does each gl context operate within a unique/dedicated thread? ...and how often is each gl context active? (by active, this means hitting enabled "frame delimiters").

Thanks,

Ben

  • Up0
  • Down0
jmurchison
Join Date: 25 Jun 17
Posts: 2
Posted: Sun, 2017-06-25 23:16

I'm experiencing the exact same issues as the original poster.  I also tried to use the Adreno Profiler and it sits in a similar state waiting for the snapshot to begin.

Was there ever a resolution for this error?

  • Up0
  • Down0
BenM
Join Date: 12 May 16
Posts: 29
Posted: Mon, 2017-06-26 09:29

Most of the errors similar to those experienced above are a result of either frame-delimiter settings, or app permissions.... or a combination of the two.  If you are still experiencing the same issues despite following the recommendations above, I would suggest experimenting with different frame delimiter-settings should all of the app permissions appear correct.

The frame delimiter settings for your app can be found in the Snapdragon Profiler "Options" view.  You will need to select your running process you wish to snapshot in the combo-box on the left, as well as the "GL Frame Delimiters" option in the combo-box to the right (all within the "Options" view).  Depending on what specific calls your application makes while running, you may want to try setting "GLClear" and/or "GLFlush" to "True".  Newer versions of our driver will have a "UseAutoFrameDelimiter" option available, which is highly recommended to leave set to "True", as it will generally eliminate the need for users to manually make these decisions.

Let us know if anything changes for the better after experimenting with the above.

-Ben

  • Up0
  • Down0
jmurchison
Join Date: 25 Jun 17
Posts: 2
Posted: Mon, 2017-06-26 23:53

Thanks for the speedy response.

I managed to get this all working today, thought I'd post my findings just in case others come across this issue.

I'm working on a mobile VR app right now, so I'd been trying to profile it in Daydream mode.  In Daydream (and also Cardboard by the looks of it) it doesn't prompt you for permissions, so I had to manually go into the app permissions in settings to turn on the Camera and Media permissions in the app.  This got it working properly in Cardboard mode, but Daydream still wasn't working.

For Daydream to work correctly I had to go into the GL Delimiters section for the app I'm working on, and turn GLFlush to true.  This then allowed me to capture frames while running in Daydream mode.

 

  • Up0
  • Down0
BenM
Join Date: 12 May 16
Posts: 29
Posted: Tue, 2017-06-27 07:01

Thank you for posting the methods you used, and I'm glad you found a way to get it working for you!

We are continuously working on ways to make this process easier and less-involved for users, as we know that having to expeiment with all of the settings and changes above is certainly less than ideal.

-Ben

  • Up0
  • Down0
lingllting
Join Date: 14 Aug 17
Posts: 4
Posted: Tue, 2017-08-15 01:13

I had another problem on Pixel XL.  When I pressed the "Take snapshot" button, the small "Working on" window appeard at the bottom-right position, and then the Snapdragon Profiler crashed. 

  • Up0
  • Down0
kalin.eh
Join Date: 19 Oct 17
Posts: 4
Posted: Thu, 2017-10-19 16:26

I had this crash too - changing the frame delimiter did not help. The frame display does show briefly and mousing over cursor seems to update things briefly before the crash.

  • Up0
  • Down0
kalin.eh
Join Date: 19 Oct 17
Posts: 4
Posted: Thu, 2017-10-19 16:26

I had this crash too - changing the frame delimiter did not help. The frame display does show briefly and mousing over cursor seems to update things briefly before the crash.

  • Up0
  • Down0
kalin.eh
Join Date: 19 Oct 17
Posts: 4
Posted: Thu, 2017-10-19 16:27

I had this crash too - changing the frame delimiter did not help. The frame display does show briefly and mousing over cursor seems to update things briefly before the crash.

  • 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.