Android internalsEgor ElizarovSPbSU 2012
2
Legal info
Android internals by Egor Elizarov is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License
You are free to – copy, distribute, display, and perform the work
– make derivative works Under the following conditions
– Attribution. You must give the original author credit
– Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under a license identical to this one
All pictures and trademarks are the property of their respective owners. Use of these trademarks and pictures is subject to owners permissions.
Corrections, suggestions, contributions and translations are welcome!
Egor Elizarov SPbSU 20123
Lecture 8
System start up
Media subsystem
yegor.yelizarov(at)gmail.com
http://vk.com/android_internalsRev: 1.1Last update: 06/01/2012
Egor Elizarov SPbSU 20124
Previous time
Graphic subsystem role
Main “players”
Renderscript
Double buffering
2D/3D acceleration
Egor Elizarov SPbSU 20125
Linux start up flow
Egor Elizarov SPbSU 20126
Android init
● Simple “toolbox” to execute boot script
● Android init language (system/core/init/readme.txt)
● Contains tools like chown, chmod, mount, etc.
● Differs from Android toolbox (system/core/toolbox/)
Egor Elizarov SPbSU 20127
Android Init Language
● Action – named sequence of commands to be executed on trigger
● Service – named program to be launched
● Command – simple routines from “toolbox”
● Triggers – strings can be used to match certain kind of events
● Options – modifiers to service (ex: user, group)
Egor Elizarov SPbSU 20128
Init.rc example
Egor Elizarov SPbSU 20129
Android start up flow
Egor Elizarov SPbSU 201210
Final system start up
● Remount system (Ex: /data, /system partitions)
● Fix permissions
● Start services and daemons (Ex: mediaserver, rild)
● Setup properties
● Start Zygote and system server (initialize java services)
Egor Elizarov SPbSU 201211
Add new command to init
Egor Elizarov SPbSU 201212
Media subsystem
● Provides media API
● Provides audio/video processing features
● Restricts access to media and devices
● Use HW acceleration if possible
● Code: frameworks/base/media
Egor Elizarov SPbSU 201213
Media services
Egor Elizarov SPbSU 201214
Java/middleware interaction
Egor Elizarov SPbSU 201215
Standart media player
Egor Elizarov SPbSU 201216
Simple stagefright flow
Egor Elizarov SPbSU 201217
Stagefright add new decoder
Egor Elizarov SPbSU 201218
HW acceleration
● HW accelerated codecs
● Khronos OpenMAX IL – codec level API
● Khronos OpenMAX AL – player level API
● Rendering can be done through DMA
Egor Elizarov SPbSU 201219
HW acceleration scheme
Egor Elizarov SPbSU 201220
My masters thesis (before)
*
* rowboat-donut branch
Egor Elizarov SPbSU 201221
My masters thesis (after)
* rowboat-donut-dsp branch
*
Egor Elizarov SPbSU 201222
Audio
Egor Elizarov SPbSU 201223
Camera
Egor Elizarov SPbSU 201224
Content restrictions
Egor Elizarov SPbSU 201225
Next Time
● Power Management
● Sensors
● Input subsystem
● Data storage
Egor Elizarov SPbSU 201226
Useful links
● http://vk.com/android_internals
● http://elinux.org/Android_Booting
● $(ANDROID_ROOT)/system/core/init/readme.txt
● http://freepine.blogspot.com/2010/01/overview-of-stagefrighter-player.html
● http://khronos.org
Egor Elizarov SPbSU 201227
Useful links (2)
● http://rxwen.blogspot.com/2010/01/understanding-android-media-framework.html
● http://se.math.spbu.ru/SE/diploma/2010/Elizarov_Egor_544.pdf
● http://dl.google.com/io/2009/pres/Mastering_the_Android_Media_Framework.pdf
● http://www.netmite.com/android/mydroid/development/pdk/docs/audio_sub_system.htm
28
Thanks to
Sergey Matyukevich for review and advices (www.linkedin.com/pub/sergey-matyukevich/31/889/769)
Nikolay F. Fominykh for review and advices
Vladimir Barinov for review and advices (http://www.linkedin.com/pub/vladimir-barinov/2a/18a/bab)