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
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
Hi Eric,
Thanks for your reply! Yes, my app's manifest has both of those attributes.
Thanks,
Wyatt
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:
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
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
*/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
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?
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
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.
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
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.
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.
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.
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.