SlideShare une entreprise Scribd logo
1  sur  11
Télécharger pour lire hors ligne
Power Management from Linux Kernel to
                   Android
                黃俊維                                         王博榮
              R97944026                                    R97942139
         資訊網路與多媒體所                                     電信工程研究所




1. Introduction
    For normal desktop computer, power management (PM) is used to reduce power
consumption and reduce cooling requirements. Lower power consumption means
lower heat dissipation, which increases system stability, and less energy use, which
saves money and reduces the impact on the environment. For mobile device and
embedded system device, it’s much more important because the battery power is very
limited. Nowadays, android phone and iPhone are more and more pervasive. There
are more and more sensors and I/O in mobile device that can be used to improve the
effectiveness of PM. The PM needs to be tuned for new mobile device’s need. In this
survey, we want to not only know the power management system used before, but
also want to compare them with the design of Android PM.



2. How does power management system work?
    One power management standard for computers is ACPI, which supersedes APM.
All recent (consumer) computers have ACPI support. Why ACPI has more advantage
than APM? We’ll write a brief introduction both of them and compare the difference.


APM (Advanced Power Management)
    APM consists of one or more layers of software that support power management
in computers with power manageable hardware. APM defines the hardware
independent software interface between hardware-specific power management
software and an operating system power management policy driver.       It masks the
details of the hardware, allowing higher-level software to use APM without any
knowledge of the hardware interface.
The APM software interface specification defines a layered cooperative
environment in which applications, operating systems, device drivers and the APM
BIOS work together to reduce power consumption.          In brief, APM can extend the
life of system batteries and thereby increases productivity and system availability.


ACPI (Advanced Configuration & Power Interface)
    The ACPI specification was developed to establish industry common interfaces
enabling robust operating system (OS)-directed motherboard device configuration and
power management of both devices and entire systems. Different from APM, ACPI
allows control of power management from within the operating system. The previous
industry standard for power management, APM, is controlled at the BIOS level. APM
is activated when the system becomes idle. The longer the system idles, the less
power it consumes (e.g. screen saver vs. sleep vs. suspend). In APM, the operating
system has no knowledge of when the system will change power states.
There are several software components that ACPI has:

     A subsystem which controls hardware states and functions that may have
     previously been in the BIOS configuration
     These states include:

          Thermal control

          Motherboard configuration

          Power states (sleep, suspend)

     a policy manager, which is software that sits on top of the operating system and
     allows user input on the system policies

     The ACPI also has device drivers those control/monitor devices such as a laptop
     battery, SMBus (communication/transmission path) and EC (embedded
     controller).
Figure 2.1   CPI architecture




Figure 2.2   CPI power state transition diagram
Table 2.1       comparison between APM and ACPI

APM                                           ACPI




o. Control resides in BIOS.                   o. Control divided between BIOS and OS
o. Uses activity timeouts to determine when   o. Decisions managed through the OS.
to power down a device                        Enables sophisticated power policy for
o. Bios rarely used in embedded systems       general-purpose computers with standard
                                                      purpose
o. Makes power-management decisions
               management                     usage patterns and hardware
without informing OS or individual            o. No knowledge of device-specific
                                                                        specific
applications                                  scenarios (e.g. Need to provide predictable
o. No knowledge off add-in cards or new
                        in                    response times or to respond to critical
devices (e.g. USB, IEEEE 1394)                events over extended period)
                                              o. More power state means more spe
                                                                             specific
                                              adjustment to save power.




                         Figure 2.3       ACPI Monitor Usages
We can either use “acpi -V” or look in each of the acpi files individually for
information about our system. Check in the /proc/acpi directory for various things of
importance. If you want to check your battery we can read the following file like this:
cat/proc/acpi/battery/BAT1/state.


3. The Concept of Android power management
     First of all, Android OS design is based on Linux kernel. Linux has its own
power management that we have described in previous section. The following
diagram (Figure 3.1) shows the main components of the Android OS.




                         Figure 3.1      Android architecture


     Android inherits many kernel components from Linux including power
management component. Original power management of Linux is designed for
personal computers, so there are some power saving status such as suspend and
hibernation. However, these mechanisms of Linux PM do not satisfied and suitable
for mobile devices or embedded systems. Mobile devices such as cell phones are not
as same as PCs that have unlimited power supply. Because mobile devices have a
hard constraint of limited battery power capacity, they need a special power
management mechanism. Therefore, Android has an additional methodology for
power saving.
The implementation of Android power management was sitting on top of Linux
Power Management. Nevertheless, Android has a more aggressive Power
Management policy than Linux, in which app and services must request CPU resource
                       Linux,
with "wake locks" through the Android application framework and native Linux
libraries in order to keep power on otherwise, Android will shut down the CPU
              rder               on,             droid                    CPU.




                         Figure 3.2 Android Power Management.
                         F


    Refer to Figure 3.2 Android try not to modify the Linux kernel and it
              igure 3.2,
implements an applications framework on top of the kernel called Android Power
Management Applications Framework. The Android PM Fra
                                                  Framework is like a driver
                                                          k           driver.
It is written by Java which connects to Android power driver through JNI. However,
                                         ndroid
what is JNI? JNI (Java Native Interface) is a framework that allows Java code running
in a Java Virtual Machine (JVM) to call native C applications and libraries Through
                                                                  libraries.
JNI, the PM framework written by Java can call function from libraries written by C
                                                                                  C.
    Android PM has a simple and aggressive mechanism called “Wake lock The
                                                                  locks”.
PM supports several types of “Wake lock . Applications and components need to get
                                   locks”.
“Wake lock” to keep CPU on. If there is no active wake locks, CPU will turn off.
Android supports different types of “Wake locks” (Table 3.1).
Table 3.1    Different wake locks of Android PM.

         Wake Lock Type

         ACQUIRE_CAUSES_WAKEUP

         FULL_WAKE_LOCK

         ON_AFTER_RELEASE

         PARTIAL_WAKE_LOCK

         SCREEN_BRIGHT_WAKE_LOCK

         SCREEN_DIM_WAKE_LOCK


    Currently Android only supports screen, keyboard, buttons backlight, and the
brightness of screen. Because of full usage of CPU capability, it does not support
suspend and standby mode. The following diagram shows how Android PM works.
Through the framework, user space applications can use “PowerManger” class to
control the power state of the device. We will introduce more details about how to
implement them in applications later.




      Figure 3.3      Andnroid Power Mangement Architecture with wake locks.
Figure 3.4     A finite state machine of Android PM.


    Figure 3.4 shows that the full state machine. There are three states: “SLEEP”,
“NOTIFICATION”, and “AWAKE”. The scenario is: While a user application
acquire full wake lock or touch screen/keyboard activity event, the machine will enter
or keep in the “AWAKE”. If timeout happen or power key pressing, the machine will
enter “NOTIFICATION”. While partial wake locks acquiring, it will keep in
“NOTIFICATION”. While all partial locks released, the machine will go into
“SLEEP”. In “SLEEP” mode, it will transit if all resource awake. This state machine
make power saving of Android more feasible for mobile devices.
    Finally, the main concept of Android PM is through wake locks and time out
mechanism to switch state of system power, so that system power consumption will
decrease. The Android PM Framework provides a software solution to accomplish
power saving for mobile devices. The following diagram (Figure 3.5) shows the
overall architecture of Android PM.
Figure 3.5 The overall architecture of Android PM.


4. Android PM Implementation
   Android PM Framework provides a service for user space applications through the
class PowerManger to achieve power saving. Hence, the app must get an instance of
PowerManger in order to enforce its power requirements. The flow of exploring
Wake locks are here:
    1.   Acquire handle to the PowerManager service by calling Context.getSystemService().

    2.   Create a wake lock and specify the power management flags for screen, timeout, etc.

    3.   Acquire wake lock.

    4.   Perform operation such as play MP3.

    5.   Release wake lock.



    Here we provide an example code of PM. We will put the wake locks code on the
function of onCreate() which will initialize first while the program start. And then
release locks on the function of onDestroy() method. Then, we can control different
type wake locks to accept different timeout or power saving mechanisms after
finishing the implement.
5. Conclusion
     Power saving is an important issue for mobile devices, and there are many ways
to implement. How to design a PM for mobile device need is a good question.
Android builds up its user space level solution in order to maintain Linux fundamental
support and increase flexibilities. Android PM already supports some power saving
type for modern diverse embedded systems.
     The number of wake locks type might be not enough for diverse power
consuming I/O devices. For example, WiFi antenna is a main power consumption
device. Android doesn't automatically turn off WiFi if user is not using.
     There are two main points that we think PM can be improved. First, Nowadays,
CPU can enter into more states for power saving and usability purpose. There could
be more types of wake lock to set the power saving mode specifically.
     Second, the old PM system usually sense the keyboard or touch screen activity to
judge whether should enter power saving mode or not. We purpose a new concept that
sensors can be used to shorten the length of device timeout. For example, if the
mobile device has light sensor, we can use it to tune the brightness of LCD and
keyboard. Furthermore, we can use motion sensor to detect user's behavior. To sum
up, PM is very important for mobile device but it still have room for improvements.


References
1.   Robin Kravets, P. Krishnan, Power management techniques for mobile
     communication, international Conference on Mobile Computing and
     Networking.
2.   Dynamic power management for embedded systems IBM and MontaVista
     Software Version 1.1, November 19, 2002
3.   Robin Kravets , P. Krishnan , Application-driven power management for mobile
     communication.
4.   Andreas Weissel, Frank Bellosa, Process cruise control: event-driven clock
     scaling for dynamic power management.
5.   APM V1.2 spec.
6.   ACPI, http://www.lesswatts.org/projects/acpi/index.php
7.   Android Project - Power Management,
     http://www.netmite.com/android/mydroid/development/pdk/docs/power_manage
     ment.html
8.   Steve Guo, Android Power Management
9.   Matt Hsu, Jim Huang, Power Management from Linux Kernel to Android, 0xlab,
     2009.

Contenu connexe

Tendances

Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using SeleniumWeifeng Zhang
 
Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeterWira Santos
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELinaro
 
Advanced Captive Portal - pfSense Hangout June 2017
Advanced Captive Portal - pfSense Hangout June 2017Advanced Captive Portal - pfSense Hangout June 2017
Advanced Captive Portal - pfSense Hangout June 2017Netgate
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debuggingAshish Agrawal
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practiceChris Simmonds
 
Ship quality mobile apps with speed [Webinar]
Ship quality mobile apps with speed [Webinar]Ship quality mobile apps with speed [Webinar]
Ship quality mobile apps with speed [Webinar]BrowserStack
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessNanik Tolaram
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoCMacpaul Lin
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverNanik Tolaram
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesChris Simmonds
 
iOS Bootloader
iOS BootloaderiOS Bootloader
iOS Bootloadermowd8574
 

Tendances (20)

Automated Web Testing Using Selenium
Automated Web Testing Using SeleniumAutomated Web Testing Using Selenium
Automated Web Testing Using Selenium
 
Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)Embedded Android : System Development - Part II (Linux device drivers)
Embedded Android : System Development - Part II (Linux device drivers)
 
Automation - Apache JMeter
Automation - Apache JMeterAutomation - Apache JMeter
Automation - Apache JMeter
 
Android 10
Android 10Android 10
Android 10
 
LAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEELAS16-504: Secure Storage updates in OP-TEE
LAS16-504: Secure Storage updates in OP-TEE
 
Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)Embedded Android : System Development - Part II (HAL)
Embedded Android : System Development - Part II (HAL)
 
Linux PV on HVM
Linux PV on HVMLinux PV on HVM
Linux PV on HVM
 
Advanced Captive Portal - pfSense Hangout June 2017
Advanced Captive Portal - pfSense Hangout June 2017Advanced Captive Portal - pfSense Hangout June 2017
Advanced Captive Portal - pfSense Hangout June 2017
 
Android crash debugging
Android crash debuggingAndroid crash debugging
Android crash debugging
 
Maven
MavenMaven
Maven
 
Project ACRN hypervisor introduction
Project ACRN hypervisor introduction Project ACRN hypervisor introduction
Project ACRN hypervisor introduction
 
Read-only rootfs: theory and practice
Read-only rootfs: theory and practiceRead-only rootfs: theory and practice
Read-only rootfs: theory and practice
 
Ship quality mobile apps with speed [Webinar]
Ship quality mobile apps with speed [Webinar]Ship quality mobile apps with speed [Webinar]
Ship quality mobile apps with speed [Webinar]
 
Squid server
Squid serverSquid server
Squid server
 
Linux Booting Steps
Linux Booting StepsLinux Booting Steps
Linux Booting Steps
 
Learning AOSP - Android Booting Process
Learning AOSP - Android Booting ProcessLearning AOSP - Android Booting Process
Learning AOSP - Android Booting Process
 
U boot porting guide for SoC
U boot porting guide for SoCU boot porting guide for SoC
U boot porting guide for SoC
 
Learning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device DriverLearning AOSP - Android Linux Device Driver
Learning AOSP - Android Linux Device Driver
 
Booting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot imagesBooting Android: bootloaders, fastboot and boot images
Booting Android: bootloaders, fastboot and boot images
 
iOS Bootloader
iOS BootloaderiOS Bootloader
iOS Bootloader
 

En vedette

Android power management, current and future trends
Android power management, current and future trendsAndroid power management, current and future trends
Android power management, current and future trendsSoumya Kanti Datta
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Androidnatdefreitas
 
Android System Design And Power Management
Android System Design And Power ManagementAndroid System Design And Power Management
Android System Design And Power ManagementNilay Mishra
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limitsDroidcon Berlin
 
How to Lower Android Power Consumption Without Affecting Performance
How to Lower Android Power Consumption Without Affecting PerformanceHow to Lower Android Power Consumption Without Affecting Performance
How to Lower Android Power Consumption Without Affecting Performancerickschwar
 
Android Platform Overview - Azercell Barama
Android Platform Overview - Azercell BaramaAndroid Platform Overview - Azercell Barama
Android Platform Overview - Azercell BaramaRamin Orujov
 
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...Egor Elizarov
 
Android Accessibility - The missing manual
Android Accessibility - The missing manualAndroid Accessibility - The missing manual
Android Accessibility - The missing manualTed Drake
 
Seminar android presentation
Seminar android presentationSeminar android presentation
Seminar android presentationShruti Maheshwari
 
Android seminar report
Android seminar reportAndroid seminar report
Android seminar reportdgpune
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in AndroidOpersys inc.
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentationconnectshilpa
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating systemSalma Begum
 

En vedette (20)

Power management android
Power management androidPower management android
Power management android
 
Android power management, current and future trends
Android power management, current and future trendsAndroid power management, current and future trends
Android power management, current and future trends
 
An Introduction To Android
An Introduction To AndroidAn Introduction To Android
An Introduction To Android
 
Android System Design And Power Management
Android System Design And Power ManagementAndroid System Design And Power Management
Android System Design And Power Management
 
Android programming -_pushing_the_limits
Android programming -_pushing_the_limitsAndroid programming -_pushing_the_limits
Android programming -_pushing_the_limits
 
How to Lower Android Power Consumption Without Affecting Performance
How to Lower Android Power Consumption Without Affecting PerformanceHow to Lower Android Power Consumption Without Affecting Performance
How to Lower Android Power Consumption Without Affecting Performance
 
Android Platform Overview - Azercell Barama
Android Platform Overview - Azercell BaramaAndroid Platform Overview - Azercell Barama
Android Platform Overview - Azercell Barama
 
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
Android internals 09 - Sensors, Power Management, Input subsystem, Data stora...
 
Android Accessibility - The missing manual
Android Accessibility - The missing manualAndroid Accessibility - The missing manual
Android Accessibility - The missing manual
 
Seminar android presentation
Seminar android presentationSeminar android presentation
Seminar android presentation
 
Android seminar report
Android seminar reportAndroid seminar report
Android seminar report
 
Android Platform Architecture
Android Platform ArchitectureAndroid Platform Architecture
Android Platform Architecture
 
Mobile operating systems
Mobile operating systemsMobile operating systems
Mobile operating systems
 
Android IPC Mechanism
Android IPC MechanismAndroid IPC Mechanism
Android IPC Mechanism
 
Scheduling in Android
Scheduling in AndroidScheduling in Android
Scheduling in Android
 
Efficient Android Threading
Efficient Android ThreadingEfficient Android Threading
Efficient Android Threading
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Android seminar-presentation
Android seminar-presentationAndroid seminar-presentation
Android seminar-presentation
 
Android ppt
Android pptAndroid ppt
Android ppt
 
Presentation on Android operating system
Presentation on Android operating systemPresentation on Android operating system
Presentation on Android operating system
 

Similaire à Android 电源管理 power_management_(英文版)

Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29Varun Mahajan
 
Industrial monitoring and control system using android application
Industrial monitoring and control system using android applicationIndustrial monitoring and control system using android application
Industrial monitoring and control system using android applicationAvinash Vemula
 
Density based traffic light controlling (2)
Density based traffic light controlling (2)Density based traffic light controlling (2)
Density based traffic light controlling (2)hardik1240
 
Embedded System Design for Iris Recognition System.
Embedded System Design for Iris Recognition System.Embedded System Design for Iris Recognition System.
Embedded System Design for Iris Recognition System.Lakshmi Sarvani Videla
 
Automatic solar LED street light automation by using RTC and I2C protocols d...
Automatic solar LED street light automation by using RTC and I2C protocols  d...Automatic solar LED street light automation by using RTC and I2C protocols  d...
Automatic solar LED street light automation by using RTC and I2C protocols d...PRASHANTH RAO
 
Embedded Systems Implementation and Applications
Embedded Systems Implementation and ApplicationsEmbedded Systems Implementation and Applications
Embedded Systems Implementation and ApplicationsKaushik Padmanabhan
 
computer organization and architecture notes
computer organization and architecture notescomputer organization and architecture notes
computer organization and architecture notesUpasana Talukdar
 
Embeddedsystem 110412132957-phpapp02
Embeddedsystem 110412132957-phpapp02Embeddedsystem 110412132957-phpapp02
Embeddedsystem 110412132957-phpapp02ishan111
 
lec 1Embedded System Design ppt.pptx
lec 1Embedded System Design ppt.pptxlec 1Embedded System Design ppt.pptx
lec 1Embedded System Design ppt.pptxdhanashribiradar2
 
Android training course
Android training courseAndroid training course
Android training courseAdarsh Pandey
 

Similaire à Android 电源管理 power_management_(英文版) (20)

PowerManagement
PowerManagementPowerManagement
PowerManagement
 
Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29Hibernation in Linux 2.6.29
Hibernation in Linux 2.6.29
 
Matter new
Matter newMatter new
Matter new
 
Industrial monitoring and control system using android application
Industrial monitoring and control system using android applicationIndustrial monitoring and control system using android application
Industrial monitoring and control system using android application
 
Density based traffic light controlling (2)
Density based traffic light controlling (2)Density based traffic light controlling (2)
Density based traffic light controlling (2)
 
Lesson 3 Operating System Functions
Lesson 3 Operating System FunctionsLesson 3 Operating System Functions
Lesson 3 Operating System Functions
 
Embedded System Design for Iris Recognition System.
Embedded System Design for Iris Recognition System.Embedded System Design for Iris Recognition System.
Embedded System Design for Iris Recognition System.
 
Vinod report es 1
Vinod report es   1Vinod report es   1
Vinod report es 1
 
[IJET-V2I3P18] Authors: Mr. B. N. Patil , Mr. Sandesh Sonar , Mr. Pavankumar ...
[IJET-V2I3P18] Authors: Mr. B. N. Patil , Mr. Sandesh Sonar , Mr. Pavankumar ...[IJET-V2I3P18] Authors: Mr. B. N. Patil , Mr. Sandesh Sonar , Mr. Pavankumar ...
[IJET-V2I3P18] Authors: Mr. B. N. Patil , Mr. Sandesh Sonar , Mr. Pavankumar ...
 
Vinod report es 1
Vinod report es   1Vinod report es   1
Vinod report es 1
 
J2ME
J2MEJ2ME
J2ME
 
Automatic solar LED street light automation by using RTC and I2C protocols d...
Automatic solar LED street light automation by using RTC and I2C protocols  d...Automatic solar LED street light automation by using RTC and I2C protocols  d...
Automatic solar LED street light automation by using RTC and I2C protocols d...
 
Linux_swspnd_v0.3_pub1
Linux_swspnd_v0.3_pub1Linux_swspnd_v0.3_pub1
Linux_swspnd_v0.3_pub1
 
Embedded Systems Implementation and Applications
Embedded Systems Implementation and ApplicationsEmbedded Systems Implementation and Applications
Embedded Systems Implementation and Applications
 
computer organization and architecture notes
computer organization and architecture notescomputer organization and architecture notes
computer organization and architecture notes
 
J2ME
J2MEJ2ME
J2ME
 
Embeddedsystem 110412132957-phpapp02
Embeddedsystem 110412132957-phpapp02Embeddedsystem 110412132957-phpapp02
Embeddedsystem 110412132957-phpapp02
 
lec 1Embedded System Design ppt.pptx
lec 1Embedded System Design ppt.pptxlec 1Embedded System Design ppt.pptx
lec 1Embedded System Design ppt.pptx
 
gcce-uapm-slide-20131001-1900
gcce-uapm-slide-20131001-1900gcce-uapm-slide-20131001-1900
gcce-uapm-slide-20131001-1900
 
Android training course
Android training courseAndroid training course
Android training course
 

Dernier

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusZilliz
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWERMadyBayot
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingEdi Saputra
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Bhuvaneswari Subramani
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Angeliki Cooney
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Zilliz
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Victor Rentea
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityWSO2
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 

Dernier (20)

Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
Biography Of Angeliki Cooney | Senior Vice President Life Sciences | Albany, ...
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
Modular Monolith - a Practical Alternative to Microservices @ Devoxx UK 2024
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Android 电源管理 power_management_(英文版)

  • 1. Power Management from Linux Kernel to Android 黃俊維 王博榮 R97944026 R97942139 資訊網路與多媒體所 電信工程研究所 1. Introduction For normal desktop computer, power management (PM) is used to reduce power consumption and reduce cooling requirements. Lower power consumption means lower heat dissipation, which increases system stability, and less energy use, which saves money and reduces the impact on the environment. For mobile device and embedded system device, it’s much more important because the battery power is very limited. Nowadays, android phone and iPhone are more and more pervasive. There are more and more sensors and I/O in mobile device that can be used to improve the effectiveness of PM. The PM needs to be tuned for new mobile device’s need. In this survey, we want to not only know the power management system used before, but also want to compare them with the design of Android PM. 2. How does power management system work? One power management standard for computers is ACPI, which supersedes APM. All recent (consumer) computers have ACPI support. Why ACPI has more advantage than APM? We’ll write a brief introduction both of them and compare the difference. APM (Advanced Power Management) APM consists of one or more layers of software that support power management in computers with power manageable hardware. APM defines the hardware independent software interface between hardware-specific power management software and an operating system power management policy driver. It masks the details of the hardware, allowing higher-level software to use APM without any knowledge of the hardware interface.
  • 2. The APM software interface specification defines a layered cooperative environment in which applications, operating systems, device drivers and the APM BIOS work together to reduce power consumption. In brief, APM can extend the life of system batteries and thereby increases productivity and system availability. ACPI (Advanced Configuration & Power Interface) The ACPI specification was developed to establish industry common interfaces enabling robust operating system (OS)-directed motherboard device configuration and power management of both devices and entire systems. Different from APM, ACPI allows control of power management from within the operating system. The previous industry standard for power management, APM, is controlled at the BIOS level. APM is activated when the system becomes idle. The longer the system idles, the less power it consumes (e.g. screen saver vs. sleep vs. suspend). In APM, the operating system has no knowledge of when the system will change power states. There are several software components that ACPI has: A subsystem which controls hardware states and functions that may have previously been in the BIOS configuration These states include: Thermal control Motherboard configuration Power states (sleep, suspend) a policy manager, which is software that sits on top of the operating system and allows user input on the system policies The ACPI also has device drivers those control/monitor devices such as a laptop battery, SMBus (communication/transmission path) and EC (embedded controller).
  • 3. Figure 2.1 CPI architecture Figure 2.2 CPI power state transition diagram
  • 4. Table 2.1 comparison between APM and ACPI APM ACPI o. Control resides in BIOS. o. Control divided between BIOS and OS o. Uses activity timeouts to determine when o. Decisions managed through the OS. to power down a device Enables sophisticated power policy for o. Bios rarely used in embedded systems general-purpose computers with standard purpose o. Makes power-management decisions management usage patterns and hardware without informing OS or individual o. No knowledge of device-specific specific applications scenarios (e.g. Need to provide predictable o. No knowledge off add-in cards or new in response times or to respond to critical devices (e.g. USB, IEEEE 1394) events over extended period) o. More power state means more spe specific adjustment to save power. Figure 2.3 ACPI Monitor Usages
  • 5. We can either use “acpi -V” or look in each of the acpi files individually for information about our system. Check in the /proc/acpi directory for various things of importance. If you want to check your battery we can read the following file like this: cat/proc/acpi/battery/BAT1/state. 3. The Concept of Android power management First of all, Android OS design is based on Linux kernel. Linux has its own power management that we have described in previous section. The following diagram (Figure 3.1) shows the main components of the Android OS. Figure 3.1 Android architecture Android inherits many kernel components from Linux including power management component. Original power management of Linux is designed for personal computers, so there are some power saving status such as suspend and hibernation. However, these mechanisms of Linux PM do not satisfied and suitable for mobile devices or embedded systems. Mobile devices such as cell phones are not as same as PCs that have unlimited power supply. Because mobile devices have a hard constraint of limited battery power capacity, they need a special power management mechanism. Therefore, Android has an additional methodology for power saving.
  • 6. The implementation of Android power management was sitting on top of Linux Power Management. Nevertheless, Android has a more aggressive Power Management policy than Linux, in which app and services must request CPU resource Linux, with "wake locks" through the Android application framework and native Linux libraries in order to keep power on otherwise, Android will shut down the CPU rder on, droid CPU. Figure 3.2 Android Power Management. F Refer to Figure 3.2 Android try not to modify the Linux kernel and it igure 3.2, implements an applications framework on top of the kernel called Android Power Management Applications Framework. The Android PM Fra Framework is like a driver k driver. It is written by Java which connects to Android power driver through JNI. However, ndroid what is JNI? JNI (Java Native Interface) is a framework that allows Java code running in a Java Virtual Machine (JVM) to call native C applications and libraries Through libraries. JNI, the PM framework written by Java can call function from libraries written by C C. Android PM has a simple and aggressive mechanism called “Wake lock The locks”. PM supports several types of “Wake lock . Applications and components need to get locks”. “Wake lock” to keep CPU on. If there is no active wake locks, CPU will turn off. Android supports different types of “Wake locks” (Table 3.1).
  • 7. Table 3.1 Different wake locks of Android PM. Wake Lock Type ACQUIRE_CAUSES_WAKEUP FULL_WAKE_LOCK ON_AFTER_RELEASE PARTIAL_WAKE_LOCK SCREEN_BRIGHT_WAKE_LOCK SCREEN_DIM_WAKE_LOCK Currently Android only supports screen, keyboard, buttons backlight, and the brightness of screen. Because of full usage of CPU capability, it does not support suspend and standby mode. The following diagram shows how Android PM works. Through the framework, user space applications can use “PowerManger” class to control the power state of the device. We will introduce more details about how to implement them in applications later. Figure 3.3 Andnroid Power Mangement Architecture with wake locks.
  • 8. Figure 3.4 A finite state machine of Android PM. Figure 3.4 shows that the full state machine. There are three states: “SLEEP”, “NOTIFICATION”, and “AWAKE”. The scenario is: While a user application acquire full wake lock or touch screen/keyboard activity event, the machine will enter or keep in the “AWAKE”. If timeout happen or power key pressing, the machine will enter “NOTIFICATION”. While partial wake locks acquiring, it will keep in “NOTIFICATION”. While all partial locks released, the machine will go into “SLEEP”. In “SLEEP” mode, it will transit if all resource awake. This state machine make power saving of Android more feasible for mobile devices. Finally, the main concept of Android PM is through wake locks and time out mechanism to switch state of system power, so that system power consumption will decrease. The Android PM Framework provides a software solution to accomplish power saving for mobile devices. The following diagram (Figure 3.5) shows the overall architecture of Android PM.
  • 9. Figure 3.5 The overall architecture of Android PM. 4. Android PM Implementation Android PM Framework provides a service for user space applications through the class PowerManger to achieve power saving. Hence, the app must get an instance of PowerManger in order to enforce its power requirements. The flow of exploring Wake locks are here: 1. Acquire handle to the PowerManager service by calling Context.getSystemService(). 2. Create a wake lock and specify the power management flags for screen, timeout, etc. 3. Acquire wake lock. 4. Perform operation such as play MP3. 5. Release wake lock. Here we provide an example code of PM. We will put the wake locks code on the function of onCreate() which will initialize first while the program start. And then release locks on the function of onDestroy() method. Then, we can control different type wake locks to accept different timeout or power saving mechanisms after finishing the implement.
  • 10. 5. Conclusion Power saving is an important issue for mobile devices, and there are many ways to implement. How to design a PM for mobile device need is a good question. Android builds up its user space level solution in order to maintain Linux fundamental support and increase flexibilities. Android PM already supports some power saving type for modern diverse embedded systems. The number of wake locks type might be not enough for diverse power consuming I/O devices. For example, WiFi antenna is a main power consumption device. Android doesn't automatically turn off WiFi if user is not using. There are two main points that we think PM can be improved. First, Nowadays, CPU can enter into more states for power saving and usability purpose. There could be more types of wake lock to set the power saving mode specifically. Second, the old PM system usually sense the keyboard or touch screen activity to judge whether should enter power saving mode or not. We purpose a new concept that sensors can be used to shorten the length of device timeout. For example, if the mobile device has light sensor, we can use it to tune the brightness of LCD and keyboard. Furthermore, we can use motion sensor to detect user's behavior. To sum up, PM is very important for mobile device but it still have room for improvements. References 1. Robin Kravets, P. Krishnan, Power management techniques for mobile communication, international Conference on Mobile Computing and Networking. 2. Dynamic power management for embedded systems IBM and MontaVista Software Version 1.1, November 19, 2002
  • 11. 3. Robin Kravets , P. Krishnan , Application-driven power management for mobile communication. 4. Andreas Weissel, Frank Bellosa, Process cruise control: event-driven clock scaling for dynamic power management. 5. APM V1.2 spec. 6. ACPI, http://www.lesswatts.org/projects/acpi/index.php 7. Android Project - Power Management, http://www.netmite.com/android/mydroid/development/pdk/docs/power_manage ment.html 8. Steve Guo, Android Power Management 9. Matt Hsu, Jim Huang, Power Management from Linux Kernel to Android, 0xlab, 2009.