TGD on Nexus 9 (non-rooted)

Hi,

So I’ve been trying to get TGD to work with a stock unrooted Nexus 9 running Lollipop 5.0.1, and I’ve gone through all the steps necessary to link against libTegra_gfx_debugger.a instead of -lEGL and -lGLESv2, and bring in the libNvPmApi.Core.so and libTegra_gfx_debugger.so files into the APK.

I can certainly see from the Logcat output that something is going on with the new APK (I’ve removed any identifying tags:

04-07 12:22:47.185: I/TegraGfxDebugger(22419): [**.so] Initializing dispatch tables for process: **
04-07 12:22:47.185: I/TegraGfxDebugger(22419): [**.so] Initializing process for Tegra Graphics Debugger: **
04-07 12:22:47.185: I/TegraGfxDebugger(22419):  -- Checking for global interposer...
04-07 12:22:47.185: I/TegraGfxDebugger(22419):  -- Checking for statically linked debugger...
04-07 12:22:47.189: I/TegraGfxDebugger(22419):  -- Attempting to load the Tegra Graphics Debugger from the application's lib folder: /data/app/**/lib/arm/libTegra_gfx_debugger.so
04-07 12:22:47.215: I/TegraGfxDebugger(22419):  -- Statically linked debugger detected
04-07 12:22:47.215: I/TegraGfxDebugger(22419): Starting GTI initialization...
04-07 12:22:47.215: I/TegraGfxDebugger(22419): Mid GTI-initialization call to dlopen(/vendor/lib/egl/libEGL_tegra.so, 0); Not redirecting.
04-07 12:22:47.224: I/TegraGfxDebugger(22419): Mid GTI-initialization call to dlopen(/system/lib/egl/libEGL_tegra.so, 0); Not redirecting.
04-07 12:22:47.224: I/TegraGfxDebugger(22419):  -- Detected static linkage method
04-07 12:22:47.224: I/TegraGfxDebugger(22419):  -- Loading system EGL library: /vendor/lib/libEGL.so
04-07 12:22:47.225: V/GLSUser(13427): [AppCertService] DeviceKey is turned off
04-07 12:22:47.226: I/TegraGfxDebugger(22419):  -- Bootstrapping real EGL addresses
04-07 12:22:47.230: I/TegraGfxDebugger(22419):  -- Creating null EGL context
04-07 12:22:47.232: I/TegraGfxDebugger(22419):  -- Bootstrapping null EGL context
04-07 12:22:47.232: I/TegraGfxDebugger(22419): GTI initialization complete
04-07 12:22:47.232: I/TegraGfxDebugger(22419):  -- Dispatching GL to Tegra Graphics Debugger: EGL=0xe1d6ef4c OpenGL=0xe1d6181c OpenGLExt=0xe1d63c6c

So to me, all this suggests that the app’s ready to go. However I cannot attach to it in the TGD (it’s greyed out, and double-clicking on it just says ‘failed to connect’ or words to that effect.)

FYI, here’s what I’ve got in my makefile:

include $(CLEAR_VARS)

APP_PLATFORM					:= android-10
LOCAL_MODULE 					:= libtegra
LOCAL_PATH					:= $(LIB_PATH)
LOCAL_SRC_FILES 				:= libTegra_gfx_debugger.a

include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)

APP_PLATFORM					:= android-10
LOCAL_MODULE 					:= libtegra2
LOCAL_PATH					:= $(LIB_PATH)
LOCAL_SRC_FILES 				:= libTegra_gfx_debugger.so

include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)

APP_PLATFORM					:= android-10
LOCAL_MODULE 					:= libtegra3
LOCAL_PATH					:= $(LIB_PATH)
LOCAL_SRC_FILES 				:= libNvPmApi.Core.so

include $(PREBUILT_SHARED_LIBRARY)

###Other source files here...###

LOCAL_WHOLE_STATIC_LIBRARIES	+= libtegra
LOCAL_WHOLE_SHARED_LIBRARIES	:= libtegra2 libtegra3

Any ideas?

(Sorry for double post)

Further to this, I tried using the HelloGL2JNI example from the NDK (r10c), with the above changes as described, and that also does not want to connect with the TGD. There must be something I’m missing.

Hi,
have your application defined gl api somewhere? for ndk samples, please confirm ndk_path/sources/android/ndk_helper/gl3stub.c that it not introduce any api call. also confirm ndk_path/sources/android/ndk_helper/Android.mk that EGL and GLESv2 removed from LOCAL_EXPORT_LDLIBS

thanks

Hi Jerry,

I can confirm that there are no mentions of either gl3stub.c, EGL or GLESv2 in the makefile. Here’s what I have for my modified HelloGL2JNI project:

LOCAL_PATH:= $(call my-dir)

include $(CLEAR_VARS)

APP_PLATFORM					:= android-10
LOCAL_MODULE 					:= libtegra
LOCAL_SRC_FILES 				:= libTegra_gfx_debugger.a

include $(PREBUILT_STATIC_LIBRARY)

include $(CLEAR_VARS)

APP_PLATFORM					:= android-10
LOCAL_MODULE 					:= libtegra2
LOCAL_SRC_FILES 				:= libTegra_gfx_debugger.so

include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)

APP_PLATFORM					:= android-10
LOCAL_MODULE 					:= libtegra3
LOCAL_SRC_FILES 				:= libNvPmApi.Core.so

include $(PREBUILT_SHARED_LIBRARY)

include $(CLEAR_VARS)

LOCAL_MODULE    := libgl2jni
LOCAL_CFLAGS    := -Werror
LOCAL_SRC_FILES := gl_code.cpp
LOCAL_LDLIBS    := -llog

LOCAL_WHOLE_STATIC_LIBRARIES := libtegra
LOCAL_WHOLE_SHARED_LIBRARIES := libtegra2 libtegra3

include $(BUILD_SHARED_LIBRARY)

not sure why, can you share your modified project with us?