# \[Android & PVRTrace\] Cannot record a trace

**URL:** <https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956>\
**Category:** PowerVR Insider\
**Tags:** pvrtrace, pvrhub\
**Created:** [December 4, 2013, 11:36pm UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956 "2013-12-04T23:36:34Z")\
**Posts on this page:** 10\
**Page:** 1

<div class="post-metadata">

**Author:** ![bydavy-2](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/bydavy-2/32/217_2.png) [@bydavy-2](https://forums.imgtec.com/u/bydavy-2)\
**Post date:** [December 4, 2013, 11:36pm UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/1 "2013-12-04T23:36:34Z")

</div>

Hi,  
  
  
  
I tried the rooted and non rooted approach to record a trace on disk.  
  
I’m gonna focus on the non rooted approach as it’s the one closest to work.  
  
The trace file is created, it has a size of 192B and is useless as It doesn’t record the trace (basically it writes just the header of the file).  
  
  
  
What am I doing wrong ?  
  
  
  
I have the following “pvrtrace.cfg” file in “/sdcard”:

> [host]  
> EglLibraryPath = /system/lib/libEGL.so  
> Es1LibraryPath = /system/lib/libGLESv1\_CM.so  
> Es2LibraryPath = /system/lib/libGLESv2.so  
>   
> [record]  
> TraceFile = /sdcard/record.pvrt  
> RecordData = 1  
> StartFrame = 0  
> EndFrame = 9999  
> SaveFrameBuffer = 0  
> SaveFileToDisk = 1  
> Network = 0  
> DebugInfo = 1

  
  
And I have the following logcat messages:  

> 12-04 15:30:20.992 I/PVRTrace(I)﹕ The current working directory is /  
> 12-04 15:30:20.992 I/PVRTrace(I)﹕ Config file found: /sdcard/pvrtrace.cfg  
> 12-04 15:30:20.992 I/PVRTrace(I)﹕ Config File HostEs1LibPath: /system/lib/libGLESv1\_CM.so  
> 12-04 15:30:20.992 I/PVRTrace(I)﹕ Config File HostEs2LibPath: /system/lib/libGLESv2.so  
> 12-04 15:30:20.992 I/PVRTrace(I)﹕ Config File HostEs3LibPath:  
> 12-04 15:30:20.992 I/PVRTrace(I)﹕ Processes excluded from recording: com.powervr.PVRHub  
> 12-04 15:30:20.992 I/PVRTrace(I)﹕ Opening trace file to record: /sdcard/record.pvrt  
> 12-04 15:30:21.031 D/dalvikvm﹕ No JNI\_OnLoad found in /system/lib/libEGL\_PVRTRACE.so 0x40ce8798, skipping init  
> 12-04 15:30:21.031 D/dalvikvm﹕ No JNI\_OnLoad found in /system/lib/libGLESv2\_PVRTRACE.so 0x40ce8798, skipping init  
> 12-04 15:30:21.031 D/dalvikvm﹕ No JNI\_OnLoad found in /system/lib/libPVRTrace.so 0x40ce8798, skipping init

  
  
The trace file "/sdcard/record.pvrt" contains:  

> PVRTrace??  
> 3.2@2654748PAndroidLinux 3.0.31-fh-04822-gdd7b078-dirty #113 SMP PREEMPT Mon Nov 25 15:50:53com.test.app'!?????????????

  
  
My device:  

> Android: 4.0.3 (aka API 15)  
> Kernel: Linux localhost 3.0.31-fh-04822-gdd7b078-dirty #113 SMP PREEMPT Mon Nov 25 15:50:53 PST 2013 armv7l GNU/Linux  
> CPU: omap 4470  
> GPU: POWERVR\_SGX544\_112  
> GPU driver: Version SGX\_DDK\_Android sgxddk 19 1.9.RC2@2139099 (release) omap4430\_android, System Version String SGX revision = 1.1.2

  
  
FYI:  
I've followed the official docs of PVRTrace and this post https://www.imgtec.com/index.php/powervr-developers/pvrtrace-and-rootless-recording-on-android

---

<div class="post-metadata">

**Author:** ![guillemv](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/guillemv/32/177_2.png) [@guillemv](https://forums.imgtec.com/u/guillemv)\
**Post date:** [December 9, 2013, 9:34am UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/2 "2013-12-09T09:34:04Z")

</div>

Hi,  
  
  
  
This error looks to me like an issue with permissions writing to the SD card. Does your app have permissions to write to the SD card?  
  
  
  
Just add to the AndroidManifest.xml:  
  
``  
  
  
  
Cheers,  
  
Guillem

---

<div class="post-metadata">

**Author:** ![bydavy-2](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/bydavy-2/32/217_2.png) [@bydavy-2](https://forums.imgtec.com/u/bydavy-2)\
**Post date:** [December 9, 2013, 5:21pm UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/3 "2013-12-09T17:21:38Z")

</div>

I have set :  
  
`

`  
  
  
  
The sd card permission is right as the file is created (192B) and I have around 2GB left on the sd card.

---

<div class="post-metadata">

**Author:** ![bydavy-2](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/bydavy-2/32/217_2.png) [@bydavy-2](https://forums.imgtec.com/u/bydavy-2)\
**Post date:** [December 12, 2013, 5:29pm UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/4 "2013-12-12T17:29:25Z")

</div>

Any idea ?

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [December 13, 2013, 4:33pm UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/5 "2013-12-13T16:33:09Z")

</div>

Hi,  
  
  
  
As a test, can you set the “TraceFile =” pvrtrace.cfg flag to point to your application’s /data/data/ directory?  
  
  
  
Thanks,  
  
Joe

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [January 3, 2014, 3:36pm UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/6 "2014-01-03T15:36:24Z")

</div>

Hi,  
  
  
  
Have you made any progress with this? A colleague spotted something unusual in your log.  
  
`12-04 15:30:21.031 D/dalvikvm﹕ No JNI_OnLoad found in /system/lib/libEGL_PVRTRACE.so 0x40ce8798, skipping init`  
  
You should not be linking to libEGL\_PVRTRACE.so in this location. It seems like you may be statically loading the .so incorrectly. Your static linking code should be something like:  
  
`System.load("/data/data/[appNameHere]/lib/libEGL_PVRTRACE.so");`  
  
  
  
Can you review your code and let us know if this the cause of the problem?  
  
  
  
Thanks,  
  
Joe

---

<div class="post-metadata">

**Author:** ![bydavy-2](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/bydavy-2/32/217_2.png) [@bydavy-2](https://forums.imgtec.com/u/bydavy-2)\
**Post date:** [January 15, 2014, 12:49am UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/7 "2014-01-15T00:49:20Z")

</div>

Hi Joe,  
  
  
  
It seems that the approach you are suggesting is the one for non-rooted devices (as .so are packages in the app). I tried it and it doesn’t help.  
  
  
  
`01-14 17:44:35.539 D/dalvikvm﹕ Trying to load lib /data/data/[myAppPackage]/lib/libPVRTrace.so 0x40ce95e0
01-14 17:44:35.546 I/PVRTrace(I)﹕ The current working directory is /
01-14 17:44:35.546 I/PVRTrace(I)﹕ Config file found: /sdcard/pvrtrace.cfg
01-14 17:44:35.546 I/PVRTrace(I)﹕ Config File HostEs1LibPath: /data/data/[myAppPackage]/lib/libGLESv1_CM_PVRTRACE.so
01-14 17:44:35.546 I/PVRTrace(I)﹕ Config File HostEs2LibPath: /data/data/[myAppPackage]/lib/libGLESv2.so
01-14 17:44:35.546 I/PVRTrace(I)﹕ Config File HostEs3LibPath:
01-14 17:44:35.546 I/PVRTrace(I)﹕ Processes excluded from recording: com.powervr.PVRHub
01-14 17:44:35.546 I/PVRTrace(I)﹕ Opening trace file to record: /sdcard/[myAppPackage].pvrt
01-14 17:44:35.554 D/dalvikvm﹕ Added shared lib /data/data/[myAppPackage]/lib/libPVRTrace.so 0x40ce95e0
01-14 17:44:35.554 D/dalvikvm﹕ No JNI_OnLoad found in /data/data/[myAppPackage]/lib/libPVRTrace.so 0x40ce95e0, skipping init
01-14 17:44:35.554 D/dalvikvm﹕ Trying to load lib /data/data/[myAppPackage]/lib/libEGL_PVRTRACE.so 0x40ce95e0
01-14 17:44:35.554 D/dalvikvm﹕ Added shared lib /data/data/[myAppPackage]/lib/libEGL_PVRTRACE.so 0x40ce95e0
01-14 17:44:35.554 D/dalvikvm﹕ No JNI_OnLoad found in /data/data/[myAppPackage]/lib/libEGL_PVRTRACE.so 0x40ce95e0, skipping init
01-14 17:44:35.554 D/dalvikvm﹕ Trying to load lib /data/data/[myAppPackage]/lib/libGLESv1_CM_PVRTRACE.so 0x40ce95e0
01-14 17:44:35.554 D/dalvikvm﹕ Added shared lib /data/data/[myAppPackage]/lib/libGLESv1_CM_PVRTRACE.so 0x40ce95e0
01-14 17:44:35.554 D/dalvikvm﹕ No JNI_OnLoad found in /data/data/[myAppPackage]/lib/libGLESv1_CM_PVRTRACE.so 0x40ce95e0, skipping init
01-14 17:44:35.554 D/dalvikvm﹕ Trying to load lib /data/data/[myAppPackage]/lib/libGLESv2_PVRTRACE.so 0x40ce95e0
01-14 17:44:35.554 D/dalvikvm﹕ Added shared lib /data/data/[myAppPackage]/lib/libGLESv2_PVRTRACE.so 0x40ce95e0
01-14 17:44:35.554 D/dalvikvm﹕ No JNI_OnLoad found in /data/data/[myAppPackage]/lib/libGLESv2_PVRTRACE.so 0x40ce95e0, skipping init`  
  
  
  
And for you information here are the list of files in /data/data/[myAppPackage]/lib  
  
`
127|root@android:/data/data/[myAppPackage]/lib # ls -al
-rwxr-xr-x system system 17484 2014-02-14 16:56 libEGL_PVRTRACE.so
-rwxr-xr-x system system 29772 2014-02-14 17:56 libGLESv1_CM_PVRTRACE.so
-rwxr-xr-x system system 46156 2014-02-14 17:56 libGLESv2_PVRTRACE.so
-rwxr-xr-x system system 820764 2014-02-14 17:56 libPVRTrace.so`  
  
  
  
Those .so I usedare the one for “Android\_armeabi-v7a”. Which is as far as I know the right architecture of my device.

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [January 15, 2014, 8:33am UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/8 "2014-01-15T08:33:36Z")

</div>

Hi,  
  
  
  
I cant see any errors or warnings from the PVRTrace libraries in your logs (FYI, the “No JNI\_OnLoad” messages can be ignored). Can you clarify what problem you’re hitting with your current setup? Is the PVRT file not being generated, or is it just very small (like you’d mentioned previously)?  
  
  
  
Thanks,  
  
Joe

---

<div class="post-metadata">

**Author:** ![bydavy-2](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/bydavy-2/32/217_2.png) [@bydavy-2](https://forums.imgtec.com/u/bydavy-2)\
**Post date:** [January 15, 2014, 4:33pm UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/9 "2014-01-15T16:33:30Z")

</div>

As mentioned previously, the file is very small (192 bytes) and so contains nothing useful (it even crashes PVRTracePlayback).  
  
To me it sounds like the file is prepared, the header is written but for what ever reason PVRTrace gives up and don’t record/save traces to the file.

---

<div class="post-metadata">

**Author:** ![JoeDavis](https://sea1.discourse-cdn.com/flex015/user_avatar/forums.imgtec.com/joedavis/32/71_2.png) [@JoeDavis](https://forums.imgtec.com/u/JoeDavis)\
**Post date:** [January 24, 2014, 4:21pm UTC](https://forums.imgtec.com/t/android-pvrtrace-cannot-record-a-trace/1956/10 "2014-01-24T16:21:17Z")

</div>

Hi,  
  
  
  
Usually when the header is the only part written to the file, it means library linking has failed for some reason, or the application has hit a bug in the recorder libraries. When trace recording is enabled, does your application render anything to the screen, or does it lock up/crash?  
  
  
  
Can you share an example APK with us (preferably one without the recorder libraries, and other with them compiled in)? If you need somewhere to upload the files to, please [file a ticket here](https://pvrsupport.imgtec.com/) so we can share FTP credentials with you.  
  
  
  
Thanks,  
  
Joe
