android internals 08 - system start up, media subsystem (rev_1.1)

28
Android internals Egor Elizarov SPbSU 2012

Upload: egor-elizarov

Post on 07-Dec-2014

5.320 views

Category:

Education


6 download

DESCRIPTION

Course: Android Internals Lecture 8: System start up, Media subsystem

TRANSCRIPT

Page 1: Android internals 08 - System start up, Media subsystem (rev_1.1)

Android internalsEgor ElizarovSPbSU 2012

Page 2: Android internals 08 - System start up, Media subsystem (rev_1.1)

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!

Page 3: Android internals 08 - System start up, Media subsystem (rev_1.1)

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

Page 4: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 20124

Previous time

Graphic subsystem role

Main “players”

Renderscript

Double buffering

2D/3D acceleration

Page 5: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 20125

Linux start up flow

Page 6: Android internals 08 - System start up, Media subsystem (rev_1.1)

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/)

Page 7: Android internals 08 - System start up, Media subsystem (rev_1.1)

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)

Page 8: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 20128

Init.rc example

Page 9: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 20129

Android start up flow

Page 10: Android internals 08 - System start up, Media subsystem (rev_1.1)

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)

Page 11: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201211

Add new command to init

Page 12: Android internals 08 - System start up, Media subsystem (rev_1.1)

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

Page 13: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201213

Media services

Page 14: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201214

Java/middleware interaction

Page 15: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201215

Standart media player

Page 16: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201216

Simple stagefright flow

Page 17: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201217

Stagefright add new decoder

Page 18: Android internals 08 - System start up, Media subsystem (rev_1.1)

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

Page 19: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201219

HW acceleration scheme

Page 20: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201220

My masters thesis (before)

*

* rowboat-donut branch

Page 21: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201221

My masters thesis (after)

* rowboat-donut-dsp branch

*

Page 22: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201222

Audio

Page 23: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201223

Camera

Page 24: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201224

Content restrictions

Page 25: Android internals 08 - System start up, Media subsystem (rev_1.1)

Egor Elizarov SPbSU 201225

Next Time

● Power Management

● Sensors

● Input subsystem

● Data storage

Page 26: Android internals 08 - System start up, Media subsystem (rev_1.1)

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

Page 27: Android internals 08 - System start up, Media subsystem (rev_1.1)

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

Page 28: Android internals 08 - System start up, Media subsystem (rev_1.1)

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)