Measuring Power Values

Device manufacturers must provide a component power profile in /frameworks/base/core/res/res/xml/power_profile.xml.

To determine values for power profiles, use hardware that measures the power being used by the device and perform the various operations for which information is needed. Measure the power use during those operations and compute the values (deriving differences from other baseline power uses as appropriate).

As the goal of a power profile is to estimate battery drain appropriately, power profile values are given in current (amps). The Android framework multiplies the current by the time for which the subsystem was active and computes the mAh value, which is then used to estimate the amount of battery drained by the application/subsystem.

Devices with Bluetooth, modem, and Wi-Fi controllers running Android 7.0 and higher can provide additional power values obtained from chipset data.

Devices with heterogeneous CPUs

The power profile for devices with CPU cores of heterogeneous architecture must include the following additional fields:

  • Number of total CPUs for each cluster (expressed in cpu.clusters.cores).
  • CPU speeds supported by each cluster.
  • Active CPU power consumption for each cluster.

To differentiate between active CPU power consumption and supported CPU speeds for clusters, append the cluster number to the name of the array. Cluster numbers are assigned in the order of CPU cores in the kernel device tree. For example, in a heterogeneous architecture that has two (2) clusters with four (4) cores:

  • cluster0 consists of cpu0-3
  • cluster1 consists of cpu4-7

The Android framework uses these CPU core numbers when it reads statistics from the sysfs files in: /sys/devices/system/cpu/cpu<number>/cpufreq/stats.

Example of cluster CPUs and speeds:

<array name="cpu.active.cluster0">
<value>200</value>
<value>300</value>
<value>400</value>
</array>
<array name="cpu.speeds.cluster0">
<value>600000</value>
<value>800000</value>
<value>1200000</value>
</array>

<array name="cpu.active.cluster1">
<value>400</value>
<value>500</value>
<value>600</value>
</array>
<array name="cpu.speeds.cluster1">
<value>800000</value>
<value>1200000</value>
<value>1400000</value>
</array>

Power values

The following table describes available power value settings. To view the sample file in AOSP, see power_profile.xml.

NameDescriptionExample ValueNotes
ambient.onAdditional power used when screen is in doze/ambient/always-on mode instead of off.around 100 mA-
screen.onAdditional power used when screen is turned on at minimum brightness.200 mAIncludes touch controller and display backlight. At 0 brightness, not the Android minimum which tends to be 10 or 20%.
screen.fullAdditional power used when screen is at maximum brightness, compared to screen at minimum brightness.100 mA-300 mAA fraction of this value (based on screen brightness) is added to the screen.on value to compute the power usage of the screen.
wifi.onAdditional power used when Wi-Fi is turned on but not receiving, transmitting, or scanning.2 mA-
wifi.activeAdditional power used when transmitting or receiving over Wi-Fi.31 mA-
wifi.scanAdditional power used when Wi-Fi is scanning for access points.100 mA-
audioAdditional power used when audio decoding/encoding via DSP.around 10 mAUsed for DSP audio.
videoAdditional power used when video decoding via DSP.around 50 mAUsed for DSP video.
camera.avgAverage power use by the camera subsystem for a typical camera application.600 mAIntended as a rough estimate for an application running a preview and capturing approximately 10 full-resolution pictures per minute.
camera.flashlightAverage power used by the camera flash module when on.200 mA-
gps.signalqualitybasedAdditional power used by GPS based on signal strength. This is a multi-value entry, one per signal strength, from weakest to strongest.30 mA, 10 mA-
gps.onAdditional power used when GPS is acquiring a signal.50 mA-
radio.activeAdditional power used when cellular radio is transmitting/receiving.100 mA-300 mA-
radio.scanningAdditional power used when cellular radio is paging the tower.1.2 mA-
radio.onAdditional power used when the cellular radio is on. This is a multi-value entry, one per signal strength (no signal, weak, moderate, strong).1.2 mASome radios boost power when they search for a cell tower and do not detect a signal. Values can be the same or decrease with increasing signal strength. If you provide only one value, the same value is used for all strengths. If you provide two values, the first is used for no-signal, the second value is used for all other strengths, and so on.
bluetooth.controller.idleAverage current draw (mA) of the Bluetooth controller when idle.-These values are not estimated, but taken from the data sheet of the controller. If there are multiple receive or transmit states, the average of those states is taken. In addition, the system now collects data for Low Energy (LE) and Bluetooth scans.

Android 7.0 and later no longer use the Bluetooth power values for bluetooth.active (used when playing audio via Bluetooth A2DP) and bluetooth.on (used when Bluetooth is on but idle).
bluetooth.controller.rxAverage current draw (mA) of the Bluetooth controller when receiving.-
bluetooth.controller.txAverage current draw (mA) of the Bluetooth controller when transmitting.-
bluetooth.controller.voltageAverage operating voltage (mV) of the Bluetooth controller.-
modem.controller.sleepAverage current draw (mA) of the modem controller when asleep.0 mAThese values are not estimated, but taken from the data sheet of the controller. If there are multiple receive states, the average of those states is taken. If there are multiple transmit states, specifying a value for each transmit state is supported starting in Android 9.
modem.controller.idleAverage current draw (mA) of the modem controller when idle.-
modem.controller.rxAverage current draw (mA) of the modem controller when receiving.-
modem.controller.txAverage current draw (mA) of the modem controller when transmitting at different RF power levels. This is a multi-value entry with one value per transmit power level.100 mA, 200 mA, 300 mA, 400 mA, 500 mA
modem.controller.voltageAverage operating voltage (mV) of the modem controller.-
wifi.controller.idleAverage current draw (mA) of the Wi-Fi controller when idle.-These values are not estimated, but taken from the data sheet of the controller. If there are multiple receive or transmit states, the average of those states is taken.
wifi.controller.rxAverage current draw (mA) of the Wi-Fi controller when receiving.-
wifi.controller.txAverage current draw (mA) of the Wi-Fi controller when transmitting.-
wifi.controller.voltageAverage operating voltage (mV) of the Wi-Fi controller.-
cpu.speedsThis is a multi-value entry that lists each possible CPU speed in KHz.125000 KHz, 250000 KHz, 500000 KHz, 1000000 KHz, 1500000 KHzThe number and order of entries must correspond to the mA entries in cpu.active.
cpu.idleTotal power drawn by the system when CPUs (and the SoC) are in system suspend state.3 mA-
cpu.awakeAdditional power used when CPUs are in scheduling idle state (kernel idle loop); system is not in system suspend state.50 mAYour platform might have more than one idle state in use with differing levels of power consumption; choose a representative idle state for longer periods of scheduler idle (several milliseconds). Examine the power graph on your measurement equipment and choose samples where the CPU is at its lowest consumption, discarding higher samples where the CPU exited idle.
cpu.activeAdditional power used by CPUs when running at different speeds.100 mA, 120 mA, 140 mA, 160 mA, 200 mAValue represents the power used by the CPU rails when running at different speeds. Set the max speed in the kernel to each of the allowed speeds and peg the CPU at that speed. The number and order of entries correspond to the number and order of entries in cpu.speeds.
cpu.clusters.coresNumber of cores each CPU cluster contains.4, 2Required only for devices with heterogeneous CPU architectures. Number of entries and order should match the number of cluster entries for the cpu.active and cpu.speeds. The first entry represents the number of CPU cores in cluster0, the second entry represents the number of CPU cores in cluster1, and so on.
battery.capacityTotal battery capacity in mAh.3000 mAh-

Low Energy (LE) and Bluetooth scans

For devices running Android 7.0, the system collects data for Low Energy (LE) scans and Bluetooth network traffic (such as RFCOMM and L2CAP) and associates these activities with the initiating application. Bluetooth scans are associated with the application that initiated the scan, but batch scans are not (and are instead associated with the Bluetooth application). For an application scanning for N milliseconds, the cost of the scan is N milliseconds of rx time and N milliseconds of tx time; all leftover controller time is assigned to network traffic or the Bluetooth application.

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值