1 ## 5.10\. Professional Audio 2 3 If device implementations report support for feature 4 `android.hardware.audio.pro` via the 5 [android.content.pm.PackageManager]( 6 http://developer.android.com/reference/android/content/pm/PackageManager.html) 7 class, they: 8 9 * [C-1-1] MUST report support for feature 10 `android.hardware.audio.low_latency`. 11 * [C-1-2] MUST have the continuous round-trip audio latency, as defined in 12 [section 5.6 Audio Latency](#5_6_audio_latency), MUST be 20 milliseconds or less and SHOULD be 13 10 milliseconds or less over at least one supported path. 14 * [C-1-3] MUST include a USB port(s) supporting USB host mode and USB 15 peripheral mode. 16 * [C-1-4] MUST report support for feature `android.software.midi`. 17 * [C-1-5] MUST meet latencies and USB audio requirements using the 18 [OpenSL ES](https://developer.android.com/ndk/guides/audio/opensl-for-android.html) 19 PCM buffer queue API. 20 * [SR] Are STRONGLY RECOMMENDED to provide a consistent level of CPU 21 performance while audio is active and CPU load is varying. This should be tested 22 using [SimpleSynth](https://github.com/googlesamples/android-audio-high-performance/tree/master/SimpleSynth) 23 commit [1bd6391](https://github.com/googlesamples/android-audio-high-performance/commit/1bd6391f8ba9512f9f8798e979bc55b899f856d1). 24 The SimpleSynth app needs to be run with below parameters and achieve zero 25 underruns after 10 minutes: 26 * Work cycles: 200,000 27 * Variable load: ON (this will switch between 100% and 10% of the work 28 cycles value every 2 seconds and is designed to test CPU governor 29 behavior) 30 * Stabilized load: OFF 31 * SHOULD minimize audio clock inaccuracy and drift relative to standard time. 32 * SHOULD minimize audio clock drift relative to the CPU `CLOCK_MONOTONIC` 33 when both are active. 34 * SHOULD minimize audio latency over on-device transducers. 35 * SHOULD minimize audio latency over USB digital audio. 36 * SHOULD document audio latency measurements over all paths. 37 * SHOULD minimize jitter in audio buffer completion callback entry times, as this 38 affects usable percentage of full CPU bandwidth by the callback. 39 * SHOULD provide zero audio underruns (output) or overruns (input) under normal use 40 at reported latency. 41 * SHOULD provide zero inter-channel latency difference. 42 * SHOULD minimize MIDI mean latency over all transports. 43 * SHOULD minimize MIDI latency variability under load (jitter) over all transports. 44 * SHOULD provide accurate MIDI timestamps over all transports. 45 * SHOULD minimize audio signal noise over on-device transducers, including the 46 period immediately after cold start. 47 * SHOULD provide zero audio clock difference between the input and output sides of 48 corresponding end-points, when both are active. Examples of corresponding 49 end-points include the on-device microphone and speaker, or the audio jack input 50 and output. 51 * SHOULD handle audio buffer completion callbacks for the input and output sides 52 of corresponding end-points on the same thread when both are active, and enter 53 the output callback immediately after the return from the input callback. Or 54 if it is not feasible to handle the callbacks on the same thread, then enter the 55 output callback shortly after entering the input callback to permit the 56 application to have a consistent timing of the input and output sides. 57 * SHOULD minimize the phase difference between HAL audio buffering for the input 58 and output sides of corresponding end-points. 59 * SHOULD minimize touch latency. 60 * SHOULD minimize touch latency variability under load (jitter). 61 62 If device implementations meet all of the above requirements, they: 63 64 * [SR] STRONGLY RECOMMENDED to report support for feature 65 `android.hardware.audio.pro` via the [`android.content.pm.PackageManager`]( 66 http://developer.android.com/reference/android/content/pm/PackageManager.html) 67 class. 68 69 If device implementations meet the requirements via the OpenSL ES PCM buffer 70 queue API, they: 71 72 * [SR] STRONGLY RECOMMENDED to also meet the same requirements via the 73 [AAudio](https://developer.android.com/ndk/guides/audio/aaudio/aaudio.html) API. 74 75 If device implementations include a 4 conductor 3.5mm audio jack, they: 76 77 * [C-2-1] MUST have the continuous round-trip audio latency to be 20 78 milliseconds or less over the audio jack path. 79 * [SR] STRONGLY RECOMMENDED to comply with 80 section [Mobile device (jack) specifications]( 81 https://source.android.com/devices/accessories/headset/jack-headset-spec) 82 of the [Wired Audio Headset Specification (v1.1)]( 83 https://source.android.com/devices/accessories/headset/plug-headset-spec). 84 * The continuous round-trip audio latency SHOULD be 10 milliseconds 85 or less over the audio jack path. 86 87 If device implementations omit a 4 conductor 3.5mm audio jack and 88 include a USB port(s) supporting USB host mode, they: 89 90 * [C-3-1] MUST implement the USB audio class. 91 * [C-3-2] MUST have a continuous round-trip audio latency of 20 92 milliseconds or less over the USB host mode port using USB audio class. 93 * The continuous round-trip audio latency SHOULD be 10 milliseconds 94 or less over the USB host mode port using USB audio class. 95 96 If device implementations include an HDMI port, they: 97 98 * [C-4-1] MUST support output in stereo and eight channels at 20-bit or 99 24-bit depth and 192 kHz without bit-depth loss or resampling.