• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1page.title=Measuring Power Values
2@jd:body
3
4<!--
5    Copyright 2015 The Android Open Source Project
6
7    Licensed under the Apache License, Version 2.0 (the "License");
8    you may not use this file except in compliance with the License.
9    You may obtain a copy of the License at
10
11        http://www.apache.org/licenses/LICENSE-2.0
12
13    Unless required by applicable law or agreed to in writing, software
14    distributed under the License is distributed on an "AS IS" BASIS,
15    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16    See the License for the specific language governing permissions and
17    limitations under the License.
18-->
19<div id="qv-wrapper">
20  <div id="qv">
21    <h2>In this document</h2>
22    <ol id="auto-toc"></ol>
23  </div>
24</div>
25
26
27<p>Device manufacturers must provide a component power profile in
28<code>/frameworks/base/core/res/res/xml/power_profile.xml</code>.</p>
29
30<p>To determine values for power profiles, use hardware that measures the power
31being used by the device and perform the various operations for which
32information is needed. Measure the power use during those operations and compute
33the values (deriving differences from other baseline power uses as appropriate).
34</p>
35
36<p>As the goal of a power profile is to estimate battery drain appropriately,
37power profile values are given in current (amps). The Android framework
38multiplies the current by the time for which the subsystem was active and
39computes the mAh value, which is then used to estimate the amount of battery
40drained by the application/subsystem.</p>
41
42<p>Devices with Bluetooth, modem, and Wi-Fi controllers running Android 7.0 and
43higher can provide additional power values obtained from chipset data.</p>
44
45
46<h2 id="multiple-cpus">Devices with heterogeneous CPUs</h2>
47
48<p>The power profile for devices with CPU cores of heterogeneous architecture
49must include the following additional fields:
50<ul>
51<li>Number of total CPUs for each cluster.</li>
52<li>CPU speeds supported by each cluster.</li>
53</ul>
54
55<p>To differentiate between active CPUs and supported CPU speeds for each
56cluster, append the cluster number to the name of the array. Example:</p>
57
58<pre>
59&lt;array name="cpu.active.cluster0"&gt;
60&lt;value&gt;200&lt;/value&gt;
61&lt;value&gt;300&lt;/value&gt;
62&lt;value&gt;400&lt;/value&gt;
63&lt;/array&gt;
64&lt;array name="cpu.speeds.cluster0"&gt;
65&lt;value&gt;600000&lt;/value&gt;
66&lt;value&gt;800000&lt;/value&gt;
67&lt;value&gt;1200000&lt;/value&gt;
68&lt;/array&gt;
69
70&lt;array name="cpu.active.cluster1"&gt;
71&lt;value&gt;400&lt;/value&gt;
72&lt;value&gt;500&lt;/value&gt;
73&lt;value&gt;600&lt;/value&gt;
74&lt;/array&gt;
75&lt;array name="cpu.speeds.cluster1"&gt;
76&lt;value&gt;800000&lt;/value&gt;
77&lt;value&gt;1200000&lt;/value&gt;
78&lt;value&gt;1400000&lt;/value&gt;
79&lt;/array&gt;
80</pre>
81
82<h2 id="values">Power values</h2>
83<p>The following table describes available power value settings. To view the
84sample file in AOSP, see
85<a href="https://android.googlesource.com/platform/frameworks/base/+/master/core/res/res/xml/power_profile.xml">power_profile.xml</a>.</p>
86
87<table>
88<tr>
89  <th>Name</th>
90  <th>Description</th>
91  <th>Example Value</th>
92  <th>Notes</th>
93</tr>
94<tr>
95  <td>none</td>
96  <td>Nothing</td>
97  <td>0</td>
98  <td></td>
99</tr>
100
101<tr>
102  <td>screen.on</td>
103  <td>Additional power used when screen is turned on at minimum brightness.</td>
104  <td>200mA</td>
105  <td>Includes touch controller and display backlight. At 0 brightness, not the
106  Android minimum which tends to be 10 or 20%.</td>
107</tr>
108
109<tr>
110  <td>screen.full</td>
111  <td>Additional power used when screen is at maximum brightness, compared to
112  screen at minimum brightness.</td>
113  <td>100mA-300mA</td>
114  <td>A fraction of this value (based on screen brightness) is added to the
115  screen.on value to compute the power usage of the screen.</td>
116</tr>
117
118<tr>
119  <td>wifi.on</td>
120  <td>Additional power used when Wi-Fi is turned on but not receiving,
121  transmitting, or scanning.</td>
122  <td>2mA</td>
123  <td></td>
124</tr>
125
126<tr>
127  <td>wifi.active</td>
128  <td>Additional power used when transmitting or receiving over Wi-Fi.</td>
129  <td>31mA</td>
130  <td></td>
131</tr>
132
133<tr>
134  <td>wifi.scan</td>
135  <td>Additional power used when Wi-Fi is scanning for access points.</td>
136  <td>100mA</td>
137  <td></td>
138</tr>
139
140<tr>
141  <td>dsp.audio</td>
142  <td>Additional power used when audio decoding/encoding via DSP.</td>
143  <td>14.1mA</td>
144  <td>Reserved for future use.</td>
145</tr>
146
147
148<tr>
149  <td>dsp.video</td>
150  <td>Additional power used when video decoding via DSP.</td>
151  <td>54mA</td>
152  <td>Reserved for future use.</td>
153</tr>
154
155<tr>
156  <td>camera.avg</td>
157  <td>Average power use by the camera subsystem for a typical camera
158  application.</td>
159  <td>600mA</td>
160  <td>Intended as a rough estimate for an application running a preview
161  and capturing approximately 10 full-resolution pictures per minute.</td>
162</tr>
163
164<tr>
165  <td>camera.flashlight</td>
166  <td>Average power used by the camera flash module when on.</td>
167  <td>200mA</td>
168  <td></td>
169</tr>
170
171
172<tr>
173  <td>gps.on</td>
174  <td>Additional power used when GPS is acquiring a signal.</td>
175  <td>50mA</td>
176  <td></td>
177</tr>
178
179<tr>
180  <td>radio.active</td>
181  <td>Additional power used when cellular radio is transmitting/receiving.</td>
182  <td>100mA-300mA</td>
183  <td></td>
184</tr>
185
186<tr>
187  <td>radio.scanning</td>
188  <td>Additional power used when cellular radio is paging the tower.</td>
189  <td>1.2mA</td>
190  <td></td>
191</tr>
192
193<tr>
194  <td>radio.on</td>
195  <td>Additional power used when the cellular radio is on. Multi-value entry,
196  one per signal strength (no signal, weak, moderate, strong).</td>
197  <td>1.2mA</td>
198  <td>Some radios boost power when they search for a cell tower and do not
199  detect a signal. Values can be the same or decrease with increasing signal
200  strength. If you provide only one value, the same value is used for all
201  strengths. If you provide two values, the first is used for no-signal, the
202  second value is used for all other strengths, and so on.</td>
203</tr>
204
205<tr>
206  <td>bluetooth.controller.idle</td>
207  <td>Average current draw (mA) of the Bluetooth controller when idle.</td>
208  <td> - </td>
209  <td rowspan=4>These values are not estimated, but taken from the data sheet of
210  the controller. If there are multiple receive or transmit states, the average
211  of those states is taken. In addition, the system now collects data for
212  <a href="#le-bt-scans">Low Energy (LE) and Bluetooth scans</a>.<br><br>Android
213  N and later no longer use the Bluetooth power values for bluetooth.active
214  (used when playing audio via Bluetooth A2DP) and bluetooth.on (used when
215  Bluetooth is on but idle).</td>
216</tr>
217
218<tr>
219  <td>bluetooth.controller.rx</td>
220  <td>Average current draw (mA) of the Bluetooth controller when receiving.</td>
221  <td> - </td>
222</tr>
223
224<tr>
225  <td>bluetooth.controller.tx</td>
226  <td>Average current draw (mA) of the Bluetooth controller when transmitting.</td>
227  <td> - </td>
228</tr>
229
230<tr>
231  <td>bluetooth.controller.voltage</td>
232  <td>Average operating voltage (mV) of the Bluetooth controller.</td>
233  <td> - </td>
234</tr>
235
236<tr>
237  <td>modem.controller.idle</td>
238  <td>Average current draw (mA) of the modem controller when idle.</td>
239  <td> - </td>
240  <td rowspan=4>These values are not estimated, but taken from the data sheet of
241  the controller. If there are multiple receive or transmit states, the average
242  of those states is taken.</td>
243</tr>
244
245<tr>
246  <td>modem.controller.rx</td>
247  <td>Average current draw (mA) of the modem controller when receiving.</td>
248  <td> - </td>
249</tr>
250
251<tr>
252  <td>modem.controller.tx</td>
253  <td>Average current draw (mA) of the modem controller when transmitting.</td>
254  <td> - </td>
255</tr>
256
257<tr>
258  <td>modem.controller.voltage</td>
259  <td>Average operating voltage (mV) of the modem controller.</td>
260  <td> - </td>
261</tr>
262
263<tr>
264  <td>wifi.controller.idle</td>
265  <td>Average current draw (mA) of the Wi-Fi controller when idle.</td>
266  <td> - </td>
267  <td rowspan=4>These values are not estimated, but taken from the data sheet of
268  the controller. If there are multiple receive or transmit states, the average
269  of those states is taken.</td>
270</tr>
271
272<tr>
273  <td>wifi.controller.rx</td>
274  <td>Average current draw (mA) of the Wi-Fi controller when receiving.</td>
275  <td> - </td>
276</tr>
277
278<tr>
279  <td>wifi.controller.tx</td>
280  <td>Average current draw (mA) of the Wi-Fi controller when transmitting.</td>
281  <td> - </td>
282</tr>
283
284<tr>
285  <td>wifi.controller.voltage</td>
286  <td>Average operating voltage (mV) of the Wi-Fi controller.</td>
287  <td> - </td>
288</tr>
289
290<tr>
291  <td>cpu.speeds</td>
292  <td>Multi-value entry that lists each possible CPU speed in KHz.</td>
293  <td>125000KHz, 250000KHz, 500000KHz, 1000000KHz, 1500000KHz</td>
294  <td>The number and order of entries must correspond to the mA entries in
295  cpu.active.</td>
296</tr>
297
298<tr>
299  <td>cpu.idle</td>
300  <td>Total power drawn by the system when CPUs (and the SoC) are in system
301  suspend state.</td>
302  <td>3mA</td>
303  <td></td>
304</tr>
305
306<tr>
307  <td>cpu.awake</td>
308  <td>Additional power used when CPUs are in scheduling idle state
309  (kernel idle loop); system is not in system suspend state.</td>
310  <td>50mA</td>
311  <td>Your platform might have more than one idle state in use with differing
312  levels of power consumption; choose a representative idle state for longer
313  periods of scheduler idle (several milliseconds). Examine the power graph on
314  your measurement equipment and choose samples where the CPU is at its lowest
315  consumption, discarding higher samples where the CPU exited idle.</td>
316</tr>
317
318<tr>
319  <td>cpu.active</td>
320  <td>Additional power used by CPUs when running at different speeds.</td>
321  <td>100mA, 120mA, 140mA, 160mA, 200mA</td>
322  <td>Value represents the power used by the CPU rails when running at different
323  speeds. Set the max speed in the kernel to each of the allowed speeds and peg
324  the CPU at that speed. The number and order of entries correspond to the
325  number and order of entries in cpu.speeds.</td>
326</tr>
327
328<tr>
329  <td>cpu.clusters.cores</td>
330  <td>Number of cores each CPU cluster contains.</td>
331  <td>4, 2</td>
332  <td>Required only for devices with <a href="#multiple-cpus">heterogeneous CPU
333  architectures</a>. Number of entries and order should match the number of
334  cluster entries for the cpu.active and cpu.speeds. The first entry represents
335  the number of CPU cores in cluster0, the second entry represents the number of
336  CPU cores in cluster1, and so on.</td>
337</tr>
338
339<tr>
340  <td>battery.capacity</td>
341  <td>Total battery capacity in mAh.</td>
342  <td>3000mAh</td>
343  <td></td>
344</tr>
345
346</table>
347
348<h2 id="le-bt-scans">Low Energy (LE) and Bluetooth scans</h2>
349<p>For devices running Android 7.0, the system collects data for Low Energy (LE)
350scans and Bluetooth network traffic (such as RFCOMM and L2CAP) and associates
351these activities with the initiating application. Bluetooth scans are associated
352with the application that initiated the scan, but batch scans are not (and
353are instead associated with the Bluetooth application). For an application
354scanning for N milliseconds, the cost of the scan is N milliseconds of rx time
355and N milliseconds of tx time; all leftover controller time is assigned to
356network traffic or the Bluetooth application.</p>
357