Configstore HAL in Android Porting Architecture - General Questions and Answers

I am currently working on porting Android O to a new chipset.
When I was understanding the porting architecture section of AOSP form source.android.com website I had some doubts for which I need some clarity
1. Is it good enough to use the default implementation of Configstore HAL itself for Porting? Or under which situations we should make changes to ConfigStore HAL?
2. Why is it common to all modules. i.e why Configstore HAL is not specific to a module like audio, bluetooth, camera etc.
3. Why does Configstore HAL has the implementation only for SurfaceFlinger?
4. Is there any device specific implementation for Configstore HAL?

Related

Modifying a native shared library

Hi,
I'm trying to modify the internal native Skia libraries and I'm facing some difficulties. Below is related to Donut r2 (branch donut-release2).
I cloned the relevant branch of Skia and the projects it depends on from the git repository. Initially I tried cloning and modifying the build.git project, but I couldn't figure out how to force it into building specific projects instead of the whole platform.
Then I built manually with the NDK, but this didn't make it because the Skia project requires pthread library (strange, thought thread functions are in libcutils in Android...). When commenting out the -ldpthread in the make, the built library is about 5 times normal size, strangely, and doesn't work (NOTE that I haven't applied any modifications yet).
Can you please help me? I need to make a valid stock-identical build of the Skia shared libraries libsgl.so and libskiagl.so in order to apply modifications to the source..
Thank you

Android NDK r3 and OpenGL ES 2.0!

Android Games WILL be improved thanks to NDK r3 and OpenGL ES 2.0
Developers on the Android platform have already been pushing the boundaries of Android gaming. Even Quake 3 has been seen running on the Android platform. Things can only get better with today’s announcement.
The Android Developers Blog today announced the availability of the NDK r3 that will let android developers directly access OpenGL ES 2.0 features.
Applications targeting Android 2.0 (API level 5) or higher can now directly access OpenGL ES 2.0 features. This brings the ability to control graphics rendering through vertex and fragment shader programs, using the GLSL shading language.
A new trivial sample, named “hello-gl2″, demonstrates how to render a simple triangle using both shader types.
With access to these enhanced OpenGL ES features game graphics should be greatly improved and we should start to see an awesome future for Android gaming. Obviously, we still need developers to take advantage of the new API and have the hardware powerful enough to use it, but everything is getting real close to serious gaming on Android.
Source: Android Developers Blog
Source: AndroidSPIN
-----
What is the Android NDK?
The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications.
Android applications run in the Dalvik virtual machine. The NDK allows you to implement parts of your applications using native-code languages such as C and C++. This can provide benefits to certain classes of applications, in the form of reuse of existing code and in some cases increased speed.
The NDK provides:
* A set of tools and build files used to generate native code libraries from C and C++ sources
* A way to embed the corresponding native libraries into application package files (.apks) that can be deployed on Android devices
* A set of native system headers and libraries that will be supported in all future versions of the Android platform, starting from Android 1.5
* Documentation, samples, and tutorials
This release of the NDK supports the ARMv5TE machine instruction set and provides stable headers for libc (the C library), libm (the Math library), OpenGL ES (3D graphics library), the JNI interface, and other libraries, as listed in the section below.
The NDK will not benefit most applications. As a developer, you will need to balance its benefits against its drawbacks; notably, using native code does not result in an automatic performance increase, but does always increase application complexity. Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on. Simply re-coding a method to run in C usually does not result in a large performance increase. The NDK can, however, can be an effective way to reuse a large corpus of existing C/C++ code.
Please note that the NDK does not enable you to develop native-only applications. Android's primary runtime remains the Dalvik virtual machine.
Contents of the NDK
Development tools
The NDK includes a set of cross-toolchains (compilers, linkers, etc..) that can generate native ARM binaries on Linux, OS X, and Windows (with Cygwin) platforms.
It provides a set of system headers for stable native APIs that are guaranteed to be supported in all later releases of the platform:
* libc (C library) headers
* libm (math library) headers
* JNI interface headers
* libz (Zlib compression) headers
* liblog (Android logging) header
* OpenGL ES 1.1 and OpenGL ES 2.0 (3D graphics libraries) headers
* A Minimal set of headers for C++ support
The NDK also provides a build system that lets you work efficiently with your sources, without having to handle the toolchain/platform/CPU/ABI details. You create very short build files to describe which sources to compile and which Android application will use them — the build system compiles the sources and places the shared libraries directly in your application project.
Important: With the exception of the libraries listed above, native system libraries in the Android platform are not stable and may change in future platform versions. Your applications should only make use of the stable native system libraries provided in this NDK.
Documentation
The NDK package includes a set of documentation that describes the capabilities of the NDK and how to use it to create shared libraries for your Android applications. In this release, the documentation is provided only in the downloadable NDK package. You can find the documentation in the <ndk>/docs/ directory. Included are these files:
* INSTALL.TXT — describes how to install the NDK and configure it for your host system
* OVERVIEW.TXT — provides an overview of the NDK capabilities and usage
* ANDROID-MK.TXT — describes the use of the Android.mk file, which defines the native sources you want to compile
* APPLICATION-MK.TXT — describes the use of the Application.mk file, which describes the native sources required by your Android application
* HOWTO.TXT — information about common tasks associated with NDK development.
* SYSTEM-ISSUES.TXT — known issues in the Android system images that you should be aware of, if you are developing using the NDK.
* STABLE-APIS.TXT — a complete list of the stable APIs exposed by headers in the NDK.
* CPU-ARCH-ABIS.TXT — a description of supported CPU architectures and how to target them.
* CHANGES.TXT — a complete list of changes to the NDK across all releases.
Additionally, the package includes detailed information about the "bionic" C library provided with the Android platform that you should be aware of, if you are developing using the NDK. You can find the documentation in the <ndk>/docs/system/libc/ directory:
* OVERVIEW.TXT — provides an overview of the "bionic" C library and the features it offers.
Sample applications
The NDK includes sample Android applications that illustrate how to use native code in your Android applications. For more information, see Using the Sample Applications.
Click to expand...
Click to collapse
You can download the Android NDK: here
just waiting for it ! Good job!
Kind of makes sense now why the binary 3D driver broke from 1.6->2.0
and i most care about whether our G1 are supported ?!
huhaifan1 said:
and i most care about whether our G1 are supported ?!
Click to expand...
Click to collapse
well if the rumors about every single android device being upgraded to 2.1 in the US are true then id think so. we already have partial 3D working, so i think with this release the devs will be able to make it work
Except the chip in the G1 is not built for 2.0.
IMHO, if you'll see 2.0 drivers on the G1 (or Hero) it'll be software. But I'd love to be proven wrong, so please do.
Chainfire said:
Except the chip in the G1 is not built for 2.0.
IMHO, if you'll see 2.0 drivers on the G1 (or Hero) it'll be software. But I'd love to be proven wrong, so please do.
Click to expand...
Click to collapse
from what ive read on androidspin and phandroid, some phones will receive a slimmer 2.1 that doesnt support lwp OTA. some devs have found ways to use software libs and kernel edits to use partial 3D acceleration in some 2.1 roms. Firerat and Case_ managed to get 3D and Youtube HD working on Canon's Roms. The next OpenEclair should have fully working 3D, lwps, and video according to wesgarner, so i think that this upcoming release mentioned in the article will provide more tools for our devs to use on the G1.
but when EXACTLY - like DATE - are they coming!?
chim4ira312 said:
but when EXACTLY - like DATE - are they coming!?
Click to expand...
Click to collapse
The NDK is available now, maybe the devs should look into it:
http://developer.android.com/intl/de/sdk/ndk/index.html
What is the Android NDK?
The Android NDK is a toolset that lets you embed components that make use of native code in your Android applications.
Android applications run in the Dalvik virtual machine. The NDK allows you to implement parts of your applications using native-code languages such as C and C++. This can provide benefits to certain classes of applications, in the form of reuse of existing code and in some cases increased speed.
The NDK provides:
* A set of tools and build files used to generate native code libraries from C and C++ sources
* A way to embed the corresponding native libraries into application package files (.apks) that can be deployed on Android devices
* A set of native system headers and libraries that will be supported in all future versions of the Android platform, starting from Android 1.5
* Documentation, samples, and tutorials
This release of the NDK supports the ARMv5TE machine instruction set and provides stable headers for libc (the C library), libm (the Math library), OpenGL ES (3D graphics library), the JNI interface, and other libraries, as listed in the section below.
The NDK will not benefit most applications. As a developer, you will need to balance its benefits against its drawbacks; notably, using native code does not result in an automatic performance increase, but does always increase application complexity. Typical good candidates for the NDK are self-contained, CPU-intensive operations that don't allocate much memory, such as signal processing, physics simulation, and so on. Simply re-coding a method to run in C usually does not result in a large performance increase. The NDK can, however, can be an effective way to reuse a large corpus of existing C/C++ code.
Please note that the NDK does not enable you to develop native-only applications. Android's primary runtime remains the Dalvik virtual machine.
Contents of the NDK
Development tools
The NDK includes a set of cross-toolchains (compilers, linkers, etc..) that can generate native ARM binaries on Linux, OS X, and Windows (with Cygwin) platforms.
It provides a set of system headers for stable native APIs that are guaranteed to be supported in all later releases of the platform:
* libc (C library) headers
* libm (math library) headers
* JNI interface headers
* libz (Zlib compression) headers
* liblog (Android logging) header
* OpenGL ES 1.1 and OpenGL ES 2.0 (3D graphics libraries) headers
* A Minimal set of headers for C++ support
The NDK also provides a build system that lets you work efficiently with your sources, without having to handle the toolchain/platform/CPU/ABI details. You create very short build files to describe which sources to compile and which Android application will use them — the build system compiles the sources and places the shared libraries directly in your application project.
Important: With the exception of the libraries listed above, native system libraries in the Android platform are not stable and may change in future platform versions. Your applications should only make use of the stable native system libraries provided in this NDK.
Documentation
The NDK package includes a set of documentation that describes the capabilities of the NDK and how to use it to create shared libraries for your Android applications. In this release, the documentation is provided only in the downloadable NDK package. You can find the documentation in the <ndk>/docs/ directory. Included are these files:
* INSTALL.TXT — describes how to install the NDK and configure it for your host system
* OVERVIEW.TXT — provides an overview of the NDK capabilities and usage
* ANDROID-MK.TXT — describes the use of the Android.mk file, which defines the native sources you want to compile
* APPLICATION-MK.TXT — describes the use of the Application.mk file, which describes the native sources required by your Android application
* HOWTO.TXT — information about common tasks associated with NDK development.
* SYSTEM-ISSUES.TXT — known issues in the Android system images that you should be aware of, if you are developing using the NDK.
* STABLE-APIS.TXT — a complete list of the stable APIs exposed by headers in the NDK.
* CPU-ARCH-ABIS.TXT — a description of supported CPU architectures and how to target them.
* CHANGES.TXT — a complete list of changes to the NDK across all releases.
Additionally, the package includes detailed information about the "bionic" C library provided with the Android platform that you should be aware of, if you are developing using the NDK. You can find the documentation in the <ndk>/docs/system/libc/ directory:
* OVERVIEW.TXT — provides an overview of the "bionic" C library and the features it offers.
Sample applications
The NDK includes sample Android applications that illustrate how to use native code in your Android applications. For more information, see Using the Sample Applications.
Click to expand...
Click to collapse
This doesn't at all in any way say that we're getting 2.0 drivers for the G1. All it's saying is that phones with 2.0 will be able to directly access ES2.0 functions.
Which, really, has absolutely nothing to do with the driver issue we face. Unless you can point out something I missed.
Gary13579 said:
This doesn't at all in any way say that we're getting 2.0 drivers for the G1. All it's saying is that phones with 2.0 will be able to directly access ES2.0 functions.
Which, really, has absolutely nothing to do with the driver issue we face. Unless you can point out something I missed.
Click to expand...
Click to collapse
sorry i probably misunderstood the article =/
im still not very experienced with android development, i thought this would help the devs a little bit with getting 3d working (since theyre already doing that without official drivers)
I did indeed get a humongous boner on reading this earlier. It was enhanced by 3D.
My favorite part about this is the new ability to use openGL in apps! That means the entire face of our OS is going to change.
...and speaking of OS... Qualcom/htc just released a new radio for the G1. The G1 To this day holds over 50% of the android installed user base. There is no doubt the G1 will live beyond 1.X
bleah writing games in opengl es 1.0 was hard enough...
Gary13579 said:
This doesn't at all in any way say that we're getting 2.0 drivers for the G1. All it's saying is that phones with 2.0 will be able to directly access ES2.0 functions.
Which, really, has absolutely nothing to do with the driver issue we face. Unless you can point out something I missed.
Click to expand...
Click to collapse
agreed
the binary still needs to be available
as far as I can see with have two
the open source one
/system/lib/egl/libGLES_android.so
and the proprietary
/system/lib/egl/libGLES_qcom.so
the quoted text in the OP is basically stating that an Android developer will now be able to mix in a little c/c++ to get direct native access to opengl es
functions
Firerat said:
agreed
the binary still needs to be available
as far as I can see with have two
the open source one
/system/lib/egl/libGLES_android.so
and the proprietary
/system/lib/egl/libGLES_qcom.so
the quoted text in the OP is basically stating that an Android developer will now be able to mix in a little c/c++ to get direct native access to opengl es
functions
Click to expand...
Click to collapse
sorry guys like i said i misunderstood =/ i was hoping the NDK would provide some help but i now see its pretty much for apps, facepalm >_<;
edited the title to avoid further confusion lol
speedysilwady said:
edited the title to avoid further confusion lol
Click to expand...
Click to collapse
Was just about to do that, thanks .
I'm sure we'll get drivers eventually, either hacked or official. Just a matter of time.
Gary13579 said:
Was just about to do that, thanks .
I'm sure we'll get drivers eventually, either hacked or official. Just a matter of time.
Click to expand...
Click to collapse
haha no problem, glad to see i have a moderator type mentality. lol
yeah im sure we will, theyre already partially working, so its only a matter of time hopefully
What Chainfire said is that there is no hardware support for OpenGl ES 2.0 in msm720x chips. (refs here, sorry couldn't find official spec datasheet).
So even if 2.0 is supported, it will only be through software drivers implementation, which means really slow rendering.
spocky12 said:
What Chainfire said is that there is no hardware support for OpenGl ES 2.0 in msm720x chips. (refs here, sorry couldn't find official spec datasheet).
So even if 2.0 is supported, it will only be through software drivers implementation, which means really slow rendering.
Click to expand...
Click to collapse
Thats right.
But most Games will probably/hopefully still be written for OpenGL1.1. (Because of the userbase whatsoever)
For a start, but to focus at the future, too bad, the G1 will get old sooner

Nexus S Camera HAL Source Code?

I'm working on a project where I need to modify the driver for the Nexus S front facing Camera. The driver source code is implemented in drivers/media/video/s5ka3dfx.c. From looking at the driver implementation, it appears the driver is conforming to the V4L2 API. However, it is unclear to me how the driver interfaces with the rest of the Android stack. Somethere there needs to be a Hardware Abstraction Layer, containing the implmentation of the pure virtual CameraHardwareInterface class (which is declared in "platform_frameworks_base/include/CameraHardwareInterface.h").
I have been unsuccessful in finding the source code for this Hardware Abstraction Layer. Since the android source page is dreaming of electric sheep at the moment, does anyone know of any alternative locations to find the source code for the Nexus S Camera HAL?

[Q] OpenGL ES source files

Hello everybody,
I am trying to build the OpenGL SO lib from android sources (libGLESv2.so) and i would like a little bit more understanding of the internal mechanism of Android OpenGL ES and the flow.
Please correct me where i am wrong:
I know that in windows a developer includes gl.h and static link to OpenGL32(64).lib (which in turn dynamically link to OpenGL32.dll (probably there is a way to dynamic linke to OpenGL32.dll by the developer but that's not important).
The developer is exposed to the declaration of OpenGL API's but the implementation which i assume to be HW dependent.
The same scenario, Android: assuming developer import .opengl.GLES20 and calls the following method: GLES20.glTexEnvf(....
I would like to know what's going on behind the scenes in android (maybe Linux is better for an Android beginner).
the implementation which reside in opengl/java/android/opengl/GLES20.java source calls the native C function glTexEnvf which unlike windows we have it's implementation which reside in opengl/libagl.
Is it true?
In any case what is the GLES2_dbg library in /libs/GLES20_dbg? i can see there some kind of debug implementation with python scripts... are they to compile OpenGL debug version?
What are the .in files and gl2.cpp file in /libs/GLES20?
Where are the HW calls? does each GPU vendor sends his libGLESv2 implementation for HW calls as i saw the libGLESv2_adreno200.so in my xperia arc?
Please help me understand the flow. If you have a link which explain this structure even in Linux it will be great.
Nir

Camera2 API

How to get Camera2 API on OnePlus One (bacon) ?
This includes changes in different abstraction levels in android: Driver part, kernel part (yes?), HAL part. But HAL itself has closed code, and can't be modified without source access. To do changes in HAL needed for Camera 2 API, we need source codes. But HAL's are always closed compiled binary blobs, provided by manufacturer.
So, no way my friend.

Categories

Resources