Quantcast
Channel: Intel Developer Zone Articles
Viewing all articles
Browse latest Browse all 3384

Intel for Android* Developers Learning Series #11: OpenGL ES* Support, Performance, and Features for Android* on the Intel® Atom™ Processor

$
0
0

 

1. Introduction

The standard API for 3D graphics on Android is OpenGL ES, which is the most widely used 3D graphics API on all mobile devices today. Android uses OpenGL ES to accelerate both 2D and 3D graphics. In early releases of Android, OpenGL ES acceleration was somewhat optional, but as Android has evolved and screen sizes have grown, accelerated OpenGL ES has become an essential part of the Android graphics system.

The three versions of OpenGL ES are 1.0 and 1.1, which have been supported on Android from the beginning, and 2.0, which was added in Android 2.2. Today, Android developers can choose to use any version. Table 1 summarizes all of the major releases of Android to date and which releases have system images for the Intel® Atom™ processor built in.

ReleaseNameAPISupportsIntel® Atom™ Support
Android 1.5Cupcake3OpenGL ES 1.0 
Android 1.5Cupcake3OpenGL ES 1.0 
Android 1.6Donut4OpenGL ES 1.0, 1.1 
Android 2.0Eclair5OpenGL ES 1.0, 1.1 
Android 2.1Eclair7OpenGL ES 1.0, 1.1 
Android 2.2Froyo8OpenGL ES 1.0, 1.1, 2.0 
Android 2.3.3Gingerbread10OpenGL ES 1.0, 1.1, 2.0Yes
Android 3.0Honeycomb11OpenGL ES 1.0, 1.1, 2.0 
Android 3.1Honeycomb12OpenGL ES 1.0, 1.1, 2.0 
Android 3.2Honeycomb13OpenGL ES 1.0, 1.1, 2.0 
Android 4.0Ice Cream Sandwich14OpenGL ES 1.0, 1.1, 2.0 
Android 4.0.3Ice Cream Sandwich15OpenGL ES 1.0, 1.1, 2.0Yes
Android 4.1Jelly Bean16OpenGL ES 1.0, 1.1, 2.0Yes

Table 1: Summary of Android* Versions with Integrated OpenGL ES* and Intel® Atom™ Processor System Images

Android has been supported on the Intel Atom platform since Android 2.3.3, including OpenGL ES 1.0, 1.1, and 2.0. The support for OpenGL ES on Intel Atom processors is comprehensive and outperforms most other Android solutions due to a unique combination of features:

  • PowerVR SGX540 and SGX544MP2 GPUs (at 400 MHz and up)
  • Faster floating-point
  • x86 System Images for Android Virtual Device Emulation
  • Intel® Hardware Accelerated Execution Manager (Intel HAXM)
  • Intel® Graphics Performance Analyzers (Intel GPA)

Intel has partnered with Google and is committed to continue to provide outstanding support for the Android platform with ongoing releases of x86 system images, Intel HAXM, and Intel GPA for future versions of Android.

2. x86 System Images for Android Virtual Device Emulation

Every embedded developer knows how a virtual device emulator can speed up development of new application software. But using an Android Virtual Device (AVD) for an ARM system image is painfully slow because the AVD must emulate every ARM instruction on a Windows* or Linux* development system. It can take 5 minutes or longer just to boot Android on a typical ARM AVD. Intel has solved this problem with the Intel Hardware Accelerated Execution Manager (Intel HAXM). When this tool is installed and used with an Intel x86 Atom system image AVD, your application development will be greatly accelerated and you don’t even need Intel Atom hardware to get started.

Note that Google’s AVD emulation currently only supports OpenGL ES 1.0 and 1.1 development and not 2.0. This is a limitation of Google’s emulation software irrespective of the architecture of the CPU or GPU.

3.Intel® Graphics Performance Analyzers

Another important tool available to OpenGL ES app developers targeting Android on Intel Atom processors is Intel Graphics Performance Analyzers (Intel GPA). This suite of tools provides a real-time view of dozens of critical system metrics covering the CPU, GPU, and OpenGL ES. Intel GPA run on either a Windows or Ubuntu Linux development system and communicate with driver components running on the Android target device through the Android debug interface (adb). By running some experiments, developers can quickly spot bottlenecks in the graphics pipeline visually and identify the best opportunities for code optimization.

For more information and to download the latest version of Intel GPA (2012 R4) for Android development, see: http://software.intel.com/en-us/vcsource/tools/intel-gpa?cid=sem121p7972

4.Where to Get the OpenGL ES Drivers

Obtaining OpenGL ES drivers for the Intel Atom processors for Android is easy. They are already integrated into the x86 system images when you download an Android SDK that supports Intel Atom processors. Intel and Google developers have worked together to make Android application development just as easy for x86 devices as ARM devices, even if your app makes extensive use of OpenGL ES.

Android versions 2.3.3 (Gingerbread), 4.0.3 (Ice Cream Sandwich), and 4.1 (Jelly Bean) have full support for Intel Atom processors built in, including the drivers for OpenGL ES 1.1 and 2.0. Simply select one of these versions from the Android SDK Manager. Make sure the version you select lists “Intel x86 Atom System Image” as being included. Also, be sure to download and install the Intel Hardware Accelerated Execution Manager (Intel HAXM), which is listed in the SDK Manager under “Extras.” If you don't already have the Android SDK Manager installed, you can download it from:http://developer.android.com/sdk/index.html

Alternatively, you can download Intel x86 System Images directly from Intel’s site as well: http://software.intel.com/en-us/articles/android-ice-cream-sandwich-x86-emulator-image

5.The PowerVR* GPU

The Intel Atom processors feature the PowerVR graphics accelerators, which are the most widely used OpenGL ES accelerators in mobile devices today. PowerVR is a mature, proven design built on the Universal Scalable Shader Engine (USSE) architecture. However, not all PowerVR cores are created equal. The SGX540 series has twice the number of USSEs than SGX530 cores, and the SGX544MP2 core has quadruple, so the performance would be doubled or quadrupled, respectively, if the clock rates were the same. However, the Intel Atom processors also feature higher clock rates than other implementations, which provide even higher performance for OpenGL ES and ultimately a smoother user experience. Table 2 summarizes the PowerVR core families featured in Intel Atom processors.

Intel® Atom™ SeriesGPU CoreGPU Clock
Intel® Atom™ Z24XXPowerVR SGX 540400 MHz
Intel® Atom™ Z2580PowerVR SGX 544MP2TBA

Table 2: OpenGL ES* Accelerators in Intel® Atom™ processors for Android*

The USSE architecture in PowerVR can actually handle the unified shader model requirements of OpenGL 2.1 and DirectX* 10.1, but only the features that are exposed by OpenGL ES 1.1 and OpenGL ES 2.0, and their extensions, are available to Android developers.

6.Extensions to OpenGL ES

The OpenGL ES feature set is required to be mostly the same across platforms by the Khronos standard documents that define OpenGL ES 1.1 and 2.0. That is the purpose of a standardized API. However, GPU developers are permitted to expose special features of their GPU through extensions to OpenGL ES. The official online registry for OpenGL ES extensions maintained by Khronos where all extensions are documented is at: http://www.khronos.org/registry/gles

The most important extensions to OpenGL ES are available on most Android platforms, such as support for compressed textures and direct texture streaming, but there are many different formats for compressed textures in use today with OpenGL ES. The PowerVR core in Intel Atom processors offers the widest support for the various compressed texture formats.

Compressing textures is an important technique for 3D applications to reduce their memory requirements and improve performance, but the various formats in use are defined only by extensions and therefore vary for each platform. The most widely supported format is Ericsson Texture Compression (ETC1_RGB8), but it only supports 8 bit-per-pixel precision and has no support for per-pixel alpha. In addition to ETC1_RGB8, the PowerVR GPU also supports the PVRTC formats, which have some important advantages over ETC1_RGB8. The PVRTC formats support compressed textures with either 2 or 4 bits-per-pixel precision and with optional per-pixel alpha information. These features can significantly reduce the size of textures over the ETC1_RGB8 format and provide greater flexibility in creating alpha blending effects.

PowerVR cores and PVRTC are also used in all generations of the Apple iPhone*, iPod* Touch, and iPad* devices, so this provides some compatibility with Android on Intel Atom processors beyond the base OpenGL ES standard, which is important when developing apps across both the Android and iOS platforms. For more information, see “Texture compression support” at:

http://developer.android.com/guide/topics/graphics/opengl.html

Other important extensions to OpenGL ES provide for fast streaming of texture images between OpenGL ES and other parts of the Android system, like video frames from OpenMAX*, for example. Intel Atom processor drivers for OpenGL ES support these important extensions as well.

Android applications should never assume that any particular extension to OpenGL ES is available on any particular device. Instead, well-behaved apps will query OpenGL ES for a list of available extensions at runtime. The extension lists can be obtained from the OpenGL ES and EGL drivers with these calls:

glGetString(GL_EXTENSIONS);

eglQueryString(eglGetCurrentDisplay(), EGL_EXTENSIONS);

There is a useful app at the Google play site that will perform this query and display the returned list for any Android device it is run on: https://play.google.com/store/apps/details?id=com.realtechvr.glview

The OpenGL ES extensions that are available for Android vary significantly based upon the GPU core, not because of differences in the CPU architecture. Intel Atom processors provide essentially the same OpenGL ES extensions as any other Android platform with a PowerVR GPU, even though the Intel Atom processor has an x86 CPU architecture. In fact, the PowerVR core on Intel Atom processors supports more exclusive extensions to OpenGL ES than most other GPUs and some of these are quite useful. Of course, using these exclusive extensions will limit the portability of your application to Android devices with PowerVR cores. Extensions with names ending in “IMG” are likely to be exclusive to PowerVR, but this rule is not absolute. It’s best to test a range of Android devices yourself for the presence of the extensions you need with a tool like GLView.

Here are some examples of OpenGL ES Extensions Exclusive to PowerVR


glFramebufferTexture2DMultisampleIMG()
	glRenderbufferStorageMultisampleIMG()
	glMultiDrawArraysEXT()
	glMultiDrawElementsEXT()

7.Floating-Point Performance

It’s critical that both the CPU and GPU cores provide fast floating-point performance for OpenGL ES applications to perform well. Shader programs make extensive use of floating-point, which is executed on the GPU, but OpenGL ES application code typically requires a lot of floating-point calculation as well, which must be performed on the CPU in preparation for calls into OpenGL ES. This is another area where Intel Atom processors have a distinct advantage over ARM-based solutions because they have fast floating-point execution on both the CPU and GPU cores.

Systems that do not have floating-point hardware use fixed-point math instead with a disparate driver for OpenGL ES 1.1 called “Common-Lite.” But the system images Intel provides for Android include only the “Common” (floating-point) driver for OpenGL ES 1.1 because all Intel Atom processors have hardware floating-point built into both the CPU and GPU cores, so there is no need to ever use fixed-point. The Khronos standard for OpenGL ES 2.0 mandates floating-point only.

8.The Android Framework SDK

The Android SDK offers the easiest way to use OpenGL ES in your Android application by using the GLSurfaceView class. This class handles most of the initialization of the EGL, threading, and allocating a surface that OpenGL ES can render to and that Android can display. OpenGL ES can also render to a TextureView object that has some additional capabilities, like transformations and alpha blending, but requires more code to set up and use. The Android SDK provides support for OpenGL ES through bindings for Java* in these packages from Google and Khronos:

  • jvax.microedition.khronos.egl: The Khronos standard implementation
  • javax.microedition.khronos.opengles: The Khronos standard implementation
  • android.opengl: Updated to provide better performance

The three versions of the OpenGL ES API that can be used today on Android are: 1.0, 1.1, and 2.0. OpenGL ES 1.0 has been superseded by 1.1. OpenGL ES 2.0 offers greater flexibility through shader programming, but is not compatible with legacy code written for OpenGL ES 1.1. Table 3 summarizes the versions of the OpenGL ES API that can be used for application development and the classes that define them for Android.

OpenGL ES API VersionClasses
OpenGL ES 1.0android.opengl.GLES10
OpenGL ES 1.0android.opengl.GLES10Ext
OpenGL ES 1.1android.opengl.GLES11
OpenGL ES 1.0android.opengl.GLES11Ext
OpenGL ES 2.0android.opengl.GLES20

Table 3: OpenGL ES Support Classes in Android

The Intel Atom processor platform for Android provides full support for applications that use any of these versions of OpenGL ES through either the SDK or the NDK.

 

9.The Android NDK

The Native Development Kit (NDK) was developed by Google to help developers achieve better performance in their Android applications by bypassing the Dalvik VM and running C/C++ code natively. Google decided to make the NDK available to all Android developers because it simplifies the process of porting existing applications written in C/C++ and allows the best possible performance in applications that need it the most, like 3D games.

 

The Android NDK supports both OpenGL ES 1.1 and 2.0, and provides some example apps for both. Most applications using OpenGL ES are written in C/C++, and the NDK provides a mechanism for combining C/C++ code with an Android framework, which is based on Java. This is called the Java Native Interface (JNI) and it’s becoming the dominate approach for implementing apps that require fast graphics on Android. The NDK supports the JNI for Intel Atom processors beginning with release r6b, which you can download from: http://developer.android.com/sdk/ndk/index.html

10.Renderscript

Renderscript was first introduced in Android 3.0. It is another technology that Google developed to help accelerate computationally intensive algorithms, including graphics, by bypassing the Dalvik VM. But, unlike the NDK, Renderscript code is compiled at runtime on the Android device. Renderscript is designed to exploit multiple processors, but it currently only utilizes the processing cores available on the CPU and not the GPU. Google will probably improve Renderscript to utilize GPU cores in a future release and existing Renderscript code should be able to exploit that new power when it becomes available, hopefully without modification.

Renderscript abstracts the hardware it runs on so that app developers need not be concerned about the CPU architecture or even how many processors are actually available. But Renderscript does not use existing parallel computing standards to accomplish this, like GLSL or OpenCL*. It is instead a new language based on C99 with support for OpenGL ES built in. Renderscript’s abstraction guarantees that it will run on any Android device, including Intel Atom processors. For more information on Renderscript, see: http://android-developers.blogspot.com/2011/02/introducing-renderscript.html

11.Conclusion

The Intel Atom processor’s x86 architecture is not an issue when developing OpenGL ES applications for Android because the processor provides all of the same features developers expect of ARM-based solutions and more. The architecture of the GPU is much more important for assuring OpenGL ES compatibility across Android platforms and Intel Atom processor’s PowerVR core is the most widely used GPU in mobile devices today. The Intel Atom processor’s combination of best-in-class PowerVR cores with fast floating-point and superior support software for fast AVD emulation and graphics pipeline performance analysis provides the best overall solution for OpenGL ES applications on Android.

12. About the Author

Clay D. Montgomery is a leading developer of drivers and apps for OpenGL on embedded systems. His experience includes the design of graphics accelerator hardware, graphics drivers, APIs, and OpenGL applications across many platforms at STB Systems, VLSI Technology, Philips Semiconductors, Nokia, Texas Instruments, AMX, and as an independent consultant. He was instrumental in the development of some of the first OpenGL ES, OpenVG, and SVG drivers and applications for the Freescale i.MX and TI OMAP platforms and the Vivante, AMD, and PowerVR graphics cores. He has developed and taught workshops on OpenGL * ES development on embedded Linux and represented several companies in the Khronos Group.

OpenGL ES, OpenMAX and OpenVG are trademarks of the Khronos Group.

OpenCL and the OpenCL logo are trademarks of Apple Inc and are used by permission of Khronos.

DirectX is a trademark of Microsoft Corporation.

Copyright September 25, 2012, Intel Corporation


Viewing all articles
Browse latest Browse all 3384

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>