Does renderstate override work with Pandaboard

Hi,



I have a pandaboard and I would like to use the new override feature. I have Android running on the Pandaboard with counters and timing data. In the PVTTune frontend, renderstate override is disabled.



Please let me know if this is not supported in the pandaboard. Which devices can I use to get this feature?



Thanks

Karthik

Hi Karthik,



This should work on the Pandaboard. It does require some configuration though.

It was an oversight to not document this feature sufficiently in our 3.1 SDK. Our 3.2 SDK will include verbose documentation for this.



Renderstate Override works by passing your application’s EGL/GL calls through the PVRTrace recorder libraries. PVRPerfServer communicates with the libraries to alter the render state and capture OpenGL ES stats (e.g. the number of vertices submitted, the CPU cost of processing the GL calls etc).

In this mode of operation, the PVRTrace libraries are only being used as a pass through rather than capturing your EGL/GL data, which means there is minimal performance impact of enabling the “Renderstate Override” feature.



Here are the steps you need to take to enable Renderstate Override:

  1. Run PVRPerfServer on the target
  2. Install the PVRTrace libraries to the target and enable recording

    (guidelines for installation & setup are in “PVRTrace.User Manual”)
  3. Add “Profile = 1” to your pvrtrace.cfg to enable the PVRPerfServerPVRTrace recording library interaction
  4. Run your application on the target
  5. Connect to the target with PVRTune & analyse
  6. Disable PVRTrace recording when you’re done



    Let us know if you encounter any problems. Apologies again for this feature not being better documented in our current release.



    Thanks,

    Joe

Hi Karthik,



I’d overlooked that you’re running Android. On Android we provide PVRTraceApp, which makes this mode easier to enable :slight_smile:

Here are the steps for Android:


  1. Ensure your application’s AndroidManifest.xml contains:


  2. Install PVRPerfServer ([SDK_ROOT]PVRTuneDeveloperPVRPerfServerAndroidGUIarmeabi_armeabi-v7a_x86_mipsPVRPerfServerDeveloper.apk) & PVRTraceApp ([SDK_ROOT]PVRTraceRecorderInstallerAndroid_armeabi_armeabi-v7a_x86_mipsPVRTraceApp.apk)
  3. Run PVRPerfServer
  4. In PVRTraceApp, click “Install” - NOTE: The version of Android you’re running must be rooted for this to work!
  5. In PVRTraceApp, click either “Profile an application” (only enable Renderstate Override for a specific app) or “Start profiling” (enable Renderstate Override globally)
  6. Connect to the target with PVRTune & analyse
  7. Disable profiling in PVRTraceApp when you’re done

Hi Joe,



Thanks for your answer. Unfortunately, I am facing problems when installing the PVRTrace Libraries onto the pandaboard.



It looks like the TraceApp cant get root on the panda board. I have tried various different versions of su binary to no avail. I understand that this is not within your remit, so I will continue plodding.



Thanks again for your help.



Cheers

Karthik

If the PVRTraceApp can’t get root access, then you can install the Android PVRTrace libraries manually. The PVRTrace User Manual explains how to do this in "Appendix B. Manual Android Installation"



If you set up a few scripts to install the files, enable and disable the PVRTrace recording, this approach isn’t too bad :slight_smile:



Cheers,

Joe

I have made some progress but looks like there are some more obstacles. I copied the trace libraries manually and I am now able to do the following


  1. Record an offline trace and load it in the PVRTraceGUI.


  2. Use the PVRPerfServer to connect to PVRTuneDeveloper without tracing enabled.



    I am unable to get the following,


  3. Connect PVRTrace in an online mode. I get message in logcat stating the following,



    I/PVRTrace(I)( 2816): Waiting for Client…

    I/PVRTrace(I)( 2816): Client Disconnected… try to connect

    I/PVRTrace(I)( 2816): Client Disconnected… fail to connect



    I have tried adb port forwarding and it doesn’t work. I have also tried using the WiFi to connect to the board. That also doesnt work. Would you know what port it listens to? Should the PerfServer be started on the target?





    What is the flow to get renderstate override? Is PVRPerfServer needed at all? I tried the following


  4. Set up tracing libs
  5. Launch PVRPerfServer and set the port
  6. Launch the app
  7. Launch PVRTuneDeveloper



    It still comes up with the same error as above.



    Any ideas?



    Thanks

    Karthik






Hi,



Can you share your pvrtrace.cfg file with us?



For the PVRTune profiling mode, your pvrtrace.cfg file should just specify where the host libraries are ad also include the “Profile = 1”.

From the output you’ve given, it sounds like you’ve enabled the PVRTraceGUI remote recording.



The steps you’re taking look fine otherwise.



Joe

Hi Joe,



Thanks for your response. My pvrtrace.cfg file was causing the problem :slight_smile: It was,



EglLibraryPath = /system/vendor/lib/egl/libEGL_POWERVR_SGX540_120.so

Es1LibraryPath = /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so

Es2LibraryPath = /system/vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so

Profile = 1

TraceFile = /mnt/sdcard/trace.pvrt

RecordData = 0

StartFrame = 0

EndFrame = 200

Network = 1

NetworkWait = 1

SaveFileToDisk = 0

NetworkBufferSize = 65535





changed it to

EglLibraryPath = /system/vendor/lib/egl/libEGL_POWERVR_SGX540_120.so

Es1LibraryPath = /system/vendor/lib/egl/libGLESv1_CM_POWERVR_SGX540_120.so

Es2LibraryPath = /system/vendor/lib/egl/libGLESv2_POWERVR_SGX540_120.so

Profile = 1




and does the trick.



As a side note,



I have been trying out the various options and it looks like “Force Flat Color Shader” Doesnt work.



Cheers

Karthik

Another question - Does PVRTune work with the Galaxy S4(9500) stock version?

Hi Karthik,


I have been trying out the various options and it looks like "Force Flat Color Shader" Doesnt work.


I take it all of the other options work though? The Force Flat option has to compile a flat shader version of all of your shaders. Potentially there's a bug in the code for this feature...
If you use Renderstate Override with any of the Examples from our SDK (e.g. OGLES2IntroducingPOD), do you see the same problem? FYI, you'll need to add the INTERNET permission to the AndroidManifest.xml of any of our Examples before building & performing this test.

Another question - Does PVRTune work with the Galaxy S4(9500) stock version?

Yes - PVRTune works with the stock firmware for this device. Almost all PowerVR Android devices support PVRTune out of the box :)

Cheers,
Joe