aboutsummaryrefslogtreecommitdiff
path: root/en/devices/audio/latency_measurements.html
blob: 9ec6e256e13b5db1c8f3d3d10ebfc1e662d560ad (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
<html devsite>
  <head>
    <title>Audio Latency Measurements</title>
    <meta name="project_path" value="/_project.yaml" />
    <meta name="book_path" value="/_book.yaml" />
  </head>
  <body>
  <!--
      Copyright 2017 The Android Open Source Project

      Licensed under the Apache License, Version 2.0 (the "License");
      you may not use this file except in compliance with the License.
      You may obtain a copy of the License at

          http://www.apache.org/licenses/LICENSE-2.0

      Unless required by applicable law or agreed to in writing, software
      distributed under the License is distributed on an "AS IS" BASIS,
      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
      See the License for the specific language governing permissions and
      limitations under the License.
  -->


<p><a href="http://en.wikipedia.org/wiki/Latency_%28engineering%29">Latency</a>
is an important system performance metric. While many kinds of
<a href="latency.html">audio latency</a> metrics exist, one useful and
well-understood metric is
<a href="latency_measure.html#measuringRoundTrip">round-trip latency</a>,
defined as the time it takes for an audio signal to enter the input of a mobile
device, be processed by an app running on the application processor, and exit
the output.</p>

<img src="images/round_trip_on_device.png" alt="Round-trip audio latency on
device" id="figure1" />
<p class="img-caption"><strong>Figure 1.</strong> Round-trip audio latency on
device: T<sub>output</sub> - T<sub>input</sub></p>

<p>This page provides round-trip audio latency measurements for select
Nexus/Pixel devices and Android platform versions.</p>

<h2 id="why">Why we measure latency</h2>

<p>Google measures and reports latency so Android application developers have
the data they need to make informed decisions about available latency on actual
devices. By sharing latency numbers for select Nexus and Pixel devices, we hope
to encourage the entire Android community to measure, publish, and reduce
latency on <em>all</em> Android devices. Please join us in our commitment to
reducing audio latency!</p>

<h2 id="app">Application impact on latency</h2>

<p>Signal processing can add the following types of delay to latency:</p>
<ul>
<li><strong>Algorithmic</strong>. This delay is inherent and does not vary with
the CPU. An example is the delay added by a
<a href="http://en.wikipedia.org/wiki/Finite_impulse_response">finite impulse
response</a> (FIR) filter.</li>
<li><strong>Computational</strong>. This delay is related to the number of
required CPU cycles. For example, attenuation of a signal is usually done by a
multiplication operation that takes a varying number of cycles depending on the
CPU.</li>
</ul>

<h2 id="how">How we measure</h2>

<p>We made the measurements listed on this page using the
<a href="loopback.html">Dr. Rick O'Rang audio loopback dongle</a> and an
<a href="latency_measure.html#larsenTest">audio feedback (Larsen effect)
test</a>. Measurements assume the application signal processing adds zero
algorithmic delay and near-zero computational delay.</p>

<p>We measure round-trip latency via the headset connector for several reasons:
</p>
<img src="images/round_trip_via_headset_connector.png" alt="Round-trip latency
via headset connector" id="figure2" />
<p class="img-caption"><strong>Figure 2.</strong> Round-trip latency via headset
connector: T<sub>output</sub> - T<sub>input</sub></p>
<ul>
<li>Important music applications (such as guitar and voice processing) use the
headset connector.</li>
<li>Measuring round-trip latency of the on-device microphone and speaker can be
cumbersome, as it is difficult to keep a feedback loop in open air from entering
uncontrolled oscillation.</li>
<li>On-device transducers are small and sacrifice frequency response to achieve
their small size. To compensate, digital signal processing is applied but
increases algorithmic delay for the on-device path.</li>
</ul>

<p>There are cases where on-device microphone and speaker latencies <em>do</em>
matter, but they are usually for one direction, not round-trip. Techniques for
measuring unidirectional latency are described at
<a href="latency_measure.html#measuringOutput">Measuring Output Latency</a>
and
<a href="latency_measure.html#measuringInput">Measuring Input Latency</a>.</p>

<h2 id="measurements">Example measurements</h2>

<p>The measurements listed below are specific to a
<a href="/setup/build-numbers.html">build number</a>. Devices are listed in
approximate order of initial release and by platform version; you can also
<a href="#chart">view latencies in a chart</a>. The test application uses the
Android native audio API based on OpenSL ES.</p>

<table>
<tr>
  <th>Model</th>
  <th>Platform<br />version</th>
  <th>Build<br />number</th>
  <th>Sample rate<br />(Hz)</th>
  <th>Buffer size<br />(frames)</th>
  <th>Buffer size<br />(ms)</th>
  <th>Round-trip<br />latency (ms)<br />&plusmn; one buffer</th>
</tr>

<tr>
  <td>Nexus One</td>
  <td>2.3.6</td>
  <td>GRK39F</td>
  <td>44100</td>
  <td>768</td>
  <td>17.4</td>
  <td>345</td>
</tr>

<tr>
  <td>Nexus S</td>
  <td>2.3.6</td>
  <td>GRK39F</td>
  <td>44100</td>
  <td>1024</td>
  <td>23.2</td>
  <td>260</td>
</tr>

<tr>
  <td>Nexus S</td>
  <td>4.0.4</td>
  <td>IMM76D</td>
  <td>44100</td>
  <td>1024</td>
  <td>23.2</td>
  <td>260</td>
</tr>

<tr>
  <td>Nexus S</td>
  <td>4.1.2</td>
  <td>JZO54K</td>
  <td>44100</td>
  <td>880</td>
  <td>20</td>
  <td>210</td>
</tr>

<tr>
  <td>Galaxy Nexus</td>
  <td>4.0.1</td>
  <td>ITL41D</td>
  <td>44100</td>
  <td>976</td>
  <td>22.1</td>
  <td>270</td>
</tr>

<tr>
  <td>Galaxy Nexus</td>
  <td>4.3</td>
  <td>JWR66Y</td>
  <td>44100</td>
  <td>144</td>
  <td>3.3</td>
  <td>130</td>
</tr>

<tr>
  <td>Nexus 4</td>
  <td>4.2.2</td>
  <td>JDQ39E</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>195</td>
</tr>

<tr>
  <td>Nexus 4</td>
  <td>5.1</td>
  <td>LMY47O</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>58</td>
</tr>

<tr>
  <td>Nexus 10</td>
  <td>5.0.2</td>
  <td>LRX22G</td>
  <td>44100</td>
  <td>256</td>
  <td>5.8</td>
  <td>36</td>
</tr>

<tr>
  <td>Nexus 10</td>
  <td>5.1</td>
  <td>LMY47D</td>
  <td>44100</td>
  <td>256</td>
  <td>5.8</td>
  <td>35</td>
</tr>

<tr>
  <td>Nexus 7<br />2013</td>
  <td>4.3</td>
  <td>JSR78D</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>149</td>
</tr>

<tr>
  <td>Nexus 7<br />2013</td>
  <td>4.4</td>
  <td>KRT16S</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>85</td>
</tr>

<tr>
  <td>Nexus 7<br />2013</td>
  <td>5.0.2</td>
  <td>LRX22G</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>64</td>
</tr>

<tr>
  <td>Nexus 7<br />2013</td>
  <td>5.1</td>
  <td>LMY47O</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>55</td>
</tr>

<tr>
  <td>Nexus 7<br />2013</td>
  <td>6.0</td>
  <td>MRA58K</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>55</td>
</tr>

<tr>
  <td>Nexus 5</td>
  <td>4.4.4</td>
  <td>KTU84P</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>95</td>
</tr>

<tr>
  <td>Nexus 5</td>
  <td>5.0.0</td>
  <td>LRX21O</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>47</td>
</tr>

<tr>
  <td>Nexus 5</td>
  <td>5.1</td>
  <td>LMY47I</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>42</td>
</tr>

<tr>
  <td>Nexus 5</td>
  <td>6.0</td>
  <td>MRA58K</td>
  <td>48000</td>
  <td>192</td>
  <td>4</td>
  <td>38</td>
</tr>

<tr>
  <td>Nexus 9</td>
  <td>5.0.0</td>
  <td>LRX21L</td>
  <td>48000</td>
  <td>256</td>
  <td>5.3</td>
  <td>35</td>
</tr>

<tr>
  <td>Nexus 9</td>
  <td>5.0.1</td>
  <td>LRX22C</td>
  <td>48000</td>
  <td>256</td>
  <td>5.3</td>
  <td>38</td>
</tr>

<tr>
  <td>Nexus 9</td>
  <td>5.1.1</td>
  <td>LMY47X</td>
  <td>48000</td>
  <td>256</td>
  <td>5.3</td>
  <td>32</td>
</tr>

<tr>
  <td>Nexus 9</td>
  <td>6.0</td>
  <td>MRA58K</td>
  <td>48000</td>
  <td>128</td>
  <td>2.6</td>
  <td>15</td>
</tr>

<tr>
  <td>Nexus 6</td>
  <td>5.0.1</td>
  <td>LRX22C</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>65</td>
</tr>

<tr>
  <td>Nexus 6</td>
  <td>5.1</td>
  <td>LMY47I</td>
  <td>48000</td>
  <td>240</td>
  <td>5</td>
  <td>42</td>
</tr>

<tr>
  <td>Nexus 6</td>
  <td>6.0</td>
  <td>MRA58K</td>
  <td>48000</td>
  <td>192</td>
  <td>4</td>
  <td>33</td>
</tr>

<tr>
  <td>Nexus 5X</td>
  <td>6.0</td>
  <td>MDA89E</td>
  <td>48000</td>
  <td>192</td>
  <td>4</td>
  <td>18</td>
</tr>

<tr>
  <td>Nexus 6P</td>
  <td>6.0</td>
  <td>MDA89D</td>
  <td>48000</td>
  <td>192</td>
  <td>4</td>
  <td>18</td>
</tr>

<tr>
  <td>Pixel</td>
  <td>7.1.2</td>
  <td>NHG47L</td>
  <td>48000</td>
  <td>192</td>
  <td>4</td>
  <td>18</td>
</tr>

<tr>
  <td>Pixel XL</td>
  <td>7.1.2</td>
  <td>NHG47L</td>
  <td>48000</td>
  <td>192</td>
  <td>4</td>
  <td>18</td>
</tr>

</table>

<a id=chart></a>
<img src="/devices/audio/images/round-trip-latencies.png" />
<p class="img-caption"><strong>Figure 3.</strong> Round trip latencies.</p>

</body>
</html>