SlideShare una empresa de Scribd logo
1 de 11
Descargar para leer sin conexión
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.

Más contenido relacionado

La actualidad más candente

Linux on ARM 64-bit Architecture
Linux on ARM 64-bit ArchitectureLinux on ARM 64-bit Architecture
Linux on ARM 64-bit ArchitectureRyo Jin
 
DCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DCSF 19 Accelerating Docker Containers with NVIDIA GPUsDCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DCSF 19 Accelerating Docker Containers with NVIDIA GPUsDocker, Inc.
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time OptimizationKan-Ru Chen
 
LCA13: Power State Coordination Interface
LCA13: Power State Coordination InterfaceLCA13: Power State Coordination Interface
LCA13: Power State Coordination InterfaceLinaro
 
Windows Vista - Sistema Operacional
Windows Vista - Sistema OperacionalWindows Vista - Sistema Operacional
Windows Vista - Sistema OperacionalAnderson Favaro
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardAnne Nicolas
 
Multiple Shared Processor Pools In Power Systems
Multiple Shared Processor Pools In Power SystemsMultiple Shared Processor Pools In Power Systems
Multiple Shared Processor Pools In Power SystemsAndrey Klyachkin
 
Linux beginner's Workshop
Linux beginner's WorkshopLinux beginner's Workshop
Linux beginner's Workshopfutureshocked
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debuggingUtkarsh Mankad
 
SFO15-302: Energy Aware Scheduling: Progress Update
SFO15-302: Energy Aware Scheduling: Progress UpdateSFO15-302: Energy Aware Scheduling: Progress Update
SFO15-302: Energy Aware Scheduling: Progress UpdateLinaro
 
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...Anne Nicolas
 
Linux power management: are you doing it right?
Linux power management: are you doing it right?Linux power management: are you doing it right?
Linux power management: are you doing it right?Chris Simmonds
 
OS caused Large JVM pauses: Deep dive and solutions
OS caused Large JVM pauses: Deep dive and solutionsOS caused Large JVM pauses: Deep dive and solutions
OS caused Large JVM pauses: Deep dive and solutionsZhenyun Zhuang
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM ShapeBlue
 
Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Angela Mendoza M.
 
Block I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBlock I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBabak Farrokhi
 
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)Linaro
 

La actualidad más candente (20)

Linux on ARM 64-bit Architecture
Linux on ARM 64-bit ArchitectureLinux on ARM 64-bit Architecture
Linux on ARM 64-bit Architecture
 
DCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DCSF 19 Accelerating Docker Containers with NVIDIA GPUsDCSF 19 Accelerating Docker Containers with NVIDIA GPUs
DCSF 19 Accelerating Docker Containers with NVIDIA GPUs
 
Android Boot Time Optimization
Android Boot Time OptimizationAndroid Boot Time Optimization
Android Boot Time Optimization
 
LCA13: Power State Coordination Interface
LCA13: Power State Coordination InterfaceLCA13: Power State Coordination Interface
LCA13: Power State Coordination Interface
 
Windows Vista - Sistema Operacional
Windows Vista - Sistema OperacionalWindows Vista - Sistema Operacional
Windows Vista - Sistema Operacional
 
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime RipardKernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
Kernel Recipes 2017 - An introduction to the Linux DRM subsystem - Maxime Ripard
 
Embedded Hypervisor for ARM
Embedded Hypervisor for ARMEmbedded Hypervisor for ARM
Embedded Hypervisor for ARM
 
Multiple Shared Processor Pools In Power Systems
Multiple Shared Processor Pools In Power SystemsMultiple Shared Processor Pools In Power Systems
Multiple Shared Processor Pools In Power Systems
 
Linux beginner's Workshop
Linux beginner's WorkshopLinux beginner's Workshop
Linux beginner's Workshop
 
Android booting sequece and setup and debugging
Android booting sequece and setup and debuggingAndroid booting sequece and setup and debugging
Android booting sequece and setup and debugging
 
SFO15-302: Energy Aware Scheduling: Progress Update
SFO15-302: Energy Aware Scheduling: Progress UpdateSFO15-302: Energy Aware Scheduling: Progress Update
SFO15-302: Energy Aware Scheduling: Progress Update
 
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
Kernel Recipes 2018 - Overview of SD/eMMC, their high speed modes and Linux s...
 
IBM PowerVC Introduction and Configuration
IBM PowerVC Introduction and ConfigurationIBM PowerVC Introduction and Configuration
IBM PowerVC Introduction and Configuration
 
Linux power management: are you doing it right?
Linux power management: are you doing it right?Linux power management: are you doing it right?
Linux power management: are you doing it right?
 
OS caused Large JVM pauses: Deep dive and solutions
OS caused Large JVM pauses: Deep dive and solutionsOS caused Large JVM pauses: Deep dive and solutions
OS caused Large JVM pauses: Deep dive and solutions
 
Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM Achieving the ultimate performance with KVM
Achieving the ultimate performance with KVM
 
Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08Nvidia cuda tutorial_no_nda_apr08
Nvidia cuda tutorial_no_nda_apr08
 
Block I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktraceBlock I/O Layer Tracing: blktrace
Block I/O Layer Tracing: blktrace
 
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)SFO15-TR9: PSCI, ACPI (and UEFI to boot)
SFO15-TR9: PSCI, ACPI (and UEFI to boot)
 
Memorias
MemoriasMemorias
Memorias
 

Destacado

Android power management
Android power managementAndroid power management
Android power managementJerrin George
 
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
 

Destacado (20)

Android power management
Android power managementAndroid power management
Android power management
 
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
 

Similar a Android 电源管理 power_management_(英文版)

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
 

Similar a Android 电源管理 power_management_(英文版) (20)

PowerManagement
PowerManagementPowerManagement
PowerManagement
 
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
 
Smart home automation system
Smart home automation systemSmart home automation system
Smart home automation system
 

Último

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

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.