Android retrace problems

Stefan Dösinger stefandoesinger at gmail.com
Tue Dec 15 03:28:42 PST 2015


Hi,

I am trying to use apitrace on Android and ran into various problems,
some of which I could overcome, and some I am currently stuck at.

The main issue that is blocking me right now: Whenever I am trying to
run a trace on Android, eglretrace (on the phone / tablet) can't set
up EGL, with the following lines showing up in logcat:

E/BufferQueueProducer(  522): [SurfaceView] connect(P): already
connected (cur=1 req=1)
E/libEGL  (11722): eglCreateWindowSurface: native_window_api_connect
(win=0xb4929408) failed (0xffffffea) (already connected to another
API?)
E/libEGL  (11722): eglCreateWindowSurface:417 error 3003 (EGL_BAD_ALLOC)
W/Adreno-EGL(11722): <qeglDrvAPI_eglMakeCurrent:2971>: EGL_BAD_MATCH
E/libEGL  (11722): eglMakeCurrent:792 error 3009 (EGL_BAD_MATCH)

The exact lines depend on the hardware / driver, but
native_window_api_connect (win=xxx) failed (0xffffffea) (already
connected to another API?) always appears. So far I have tried this on
a Sony Xperia Z3c (Android 5.1.1, Qualcomm Adreno 330), Nexus 7
(5.1.1, Qualcomm Adreno 320) and a Nexus 10 (5.0, ARM Mali T604).
Sometimes apitrace detects and shows an error in eglCreateContext or
eglMakeCurrent. The trace continues running, but doesn't produce
anything useful because all draws just fail due to an invalid
framebuffer. After running the trace egltrace crashes.

The application I recorded the trace with is the standard contacts
app., but I also tried subwaysurf, with the same results. The trace
generally replays on the desktop (Nvidia blob version 352.63), though
subwaysurf is missing some vertex transformations, which doesn't
bother me too much at this point.

The other issue I couldn't fix yet is that I failed to record traces
on the Z3c. The traced applications don't show any sign of life at all
once the wrap property is set. This is a minor problem for me at the
moment.

Here's a list of problems I ran into that I could work around:

1) When making the retraceAPK goal it fails with this:

Error copying file
"/home/stefan/build/apitrace-android/libs/armeabi-v7a/libgnustl_shared.so"
to "/home/stefan/build/apitrace-android/build/android-build/libs/armeabi-v7a/".
retrace/CMakeFiles/copyAndroidStuff.dir/build.make:49: recipe for
target 'retrace/CMakeFiles/copyAndroidStuff' failed.

I manually created the source dirs and put
android-ndk-r10e/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi-v7a/libgnustl_shared.so
into it. Then the same problem occurs with an apitrace lib:

Error copying file
"/home/stefan/build/apitrace-android/libs/armeabi-v7a/libretrace.so"
to "/home/stefan/build/apitrace-android/build/android-build/libs/armeabi-v7a/".
retrace/CMakeFiles/copyAndroidStuff.dir/build.make:49: recipe for
target 'retrace/CMakeFiles/copyAndroidStuff' failed

The workaround was similar. I will file a bug report for this problem.

2) egltrace.so fails to load with an exception in libgnustl_shared.so.
Building it with a static libgnustl works. eglretrace.apk also works
with a static libgnustl if the explicit library load call is removed
from retrace/android/java/apitrace/github/io/eglretrace/RetraceActivity.java.
(For the above quantity of "works". static gnustl doesn't magically
fix the GL problems).

3) I have to start egltrace manually before tracing from the desktop.
Otherwise the two programs never talk to each other. Not much of an
issue, but I originally thought not starting it manually makes it work
better because it didn't crash. It turned out the trace doesn't start
at all :-) .

Cheers,
Stefan


More information about the apitrace mailing list