I know I can get openGL function calls by ADB(adb shell dumpsys gfxinfo) and Android Device Monitor. But I want to get them in a lower level(framework or driver...?). What should I supposed to do?
You can use a profiler tool from the vendor of the GPU used by the phone :
Mali: Mali Graphics Debugger
Adreno: Adreno GPU Profiler or the newer SnapDragon Profiler
Nvidia: Nvidia PerfHUD
My preference goes to Adreno GPU profiler and PerfHUD, in my experience they are the most stable and they do not need to root the device.
Those tools are really usefull, you can:
view all GL commands, shaders, textures etc.
edit shaders while app is running
get interesting performance metrics (ex: finding the heaviest draw calls)
and many more things
Related
I need to use the CPU to simulate the GPU, implementing the interface call of OpenGL ES.
I learned that both Mesa3D and SwiftShader can be implemented. However, I found out that SwiftShader can be used in the Android emulator, but it does not work on the physical android device without GPU.
Why is it possible to choose GPU software simulation (Mesa, SwiftShader) on the Android emulator, but not on the physical android device without GPU?
So, what is the difference between an Android emulator and a physical android device without GPU?
Can you give me some suggestion?
sorry for this question..
I'm using for my android app OpenGL ES 1.0 on Samsung Galaxy S3 Mini (CPU:1 GHz Dual-core ARM Cortex-A9, GPU: ARM Mali-400MP (single-core)).
OpenGL ES 1.0 use GPU during rendering? I need to enable or is done automatically?
Thanks.
Besides the fact that this question does not show any research from your side, it all depends on the initialization of EGL.
Normally you specify which features you need (number of bits in the buffers, AntiAliasing enabled or not, etc). Based on these features OpenGL will select the most appropriate driver for you. If you don't select any exotic features, your rendering will be accelerated.
Have you read OpenGL android developer documents?
I am looking for a safe way to detect whether the current GPU belongs to the current high end profile (such as Motorola's Atrix or Galaxy s2) so I can, in run-time, enable some more sophisticated visual effects in my game.
Has anyone successfully done anything similar? I though about detecting dual-core CPU, which would usually come with a good GPU, but I don't have enough devices to test if it is going to work OK on most situations.
Get available processors:
http://docs.oracle.com/javase/1.5.0/docs/api/java/lang/Runtime.html#availableProcessors()
If those "more sophisticated visual effects" require OpenGL ES extensions, you can simply test for the presence of those extensions.
If they do not, it would probably be better in the long run to simply allow the user to configure their graphics setup. Otherwise, if a new GPU comes out, it won't be on your hard-coded list of GPUs and thus they'll get low-quality graphics.
Android being above a Linux kernel, did you consider reading sequentially and parsing the /proc/cpuinfo file ?
Since I'm making an application not a game, I need to auto configure what is best. For the size of the textures I test for heap size and used heap. Also small textures if running in software mode (PixelFlinger).
If it has good amount of heap free and 2 cpus then I run the 3d engine in OpenGL 2.0 with AA. So far this works great with the amount of devices we have.
Note: I have noticed that some phone roms report 1 cpu free when there is 2.
I am developing an OpenGL application and testing it on Xperia 10 Mini (Android 2.1). After launching it and using it for some time the phone reboots (every time).
I have tried saving logcat to separate file, with no findings and also adb bugreport (I am not sure what to look for in that one. I found only some wlan related kernel Oops).
I am suspicious of opengl texture management or concurency. Here I am looking for any advice on how to debug the application and also for some tips on where to look for the problem.
Check your app for a memory leak. My second guess would be to check which OpenGL ES Version you are using (GL10 vs. GL20). The latter is not (fully) supported on Android 2.1 AFAIK.
I am trying to set up an Android emulator to do some playing around with OpenGL ES on it, but I am stymied by the fact that, every time I run my program on it, it unceremoniously grenades itself. The problem (at least the first nasty red error line in the log) is a missing package called libhgl.so. This is the OpenGL driver file required for running OpenGL ES on Android devices, but for some reason, my emulator doesn't have it. Does anyone know where I can get drivers for the emulator, or how to get an emulator that already has them?
In this link:
http://osdir.com/ml/android-porting/2009-06/msg00282.html
it says:
libEGL.so and libGLESv2.so implements EGL and OpenGL ES through
libhgl.so and libagl.so. That is, libhgl.so and libagl.so are
dlopen()ed by libEGL.so. All EGL and OpenGL ES calls will finally call
into libhgl.so and/or libagl.so.
and here:
http://osdir.com/ml/android-porting/2009-06/msg00288.html
libagl.so is an pure software impl. For your accelerated impl., you
need to provide libhgl.so so that libEGL.so will be able to use it. It
is expected that libhgl.so implements and exports both eglXXX and glXXX
symbols.
I guess that indicates that the missing file will only exist on the device itself, but that the app should run with the software driver on the emulator. The numerous screenshots on the web of OpenGL apps on the Android emulator also indicates that OpenGL should work fine on the emulator. Any other possible reasons why you are not able to get OpenGL going?
The logic of loading EGL user space driver is at frameworks/native/opengl/libs/EGL/Loader.cpp. Basically there are three cases:
Running with emulator in software rendering mode
Running with emulator in OpenGL mode. This is where libhgl.so is loaded for earlier version of Android.
Running with actual device.
The emulator coming with ADT does not work well for case 2. But emulators are improved over recent years. You can use latest Android Studio which has a better emulator or leapdroid at http://www.leapdroid.com/