am 9d8090ce: am 2aad0ead: Merge "Docs: Adding reverse-engineered XHTML variant of CDDs from Docs"

* commit '9d8090cec4f0e484132a11e83ce99f44b9117336':
  Docs: Adding reverse-engineered XHTML variant of CDDs from Docs
diff --git a/src/devices/audio/latency.jd b/src/devices/audio/latency.jd
index a779157..cf856a5 100644
--- a/src/devices/audio/latency.jd
+++ b/src/devices/audio/latency.jd
@@ -123,7 +123,7 @@
   see the Wikipedia article
   <a href="http://en.wikipedia.org/wiki/Rate-monotonic_scheduling">Rate-monotonic scheduling</a> (RMS).
   A key point is that fixed priorities should be allocated strictly based on period,
-  with higher priorities assigned to threads of shorter periods, not based on perceived "importance".
+  with higher priorities assigned to threads of shorter periods, not based on perceived "importance."
   Non-periodic threads may be modeled as periodic threads, using the maximum frequency of execution
   and maximum computation per execution.  If a non-periodic thread cannot be modeled as
   a periodic thread (for example it could execute with unbounded frequency or unbounded computation
@@ -166,7 +166,8 @@
   is a broad term that encompasses efforts to monitor
   and reduce power consumption while optimizing performance.
   <a href="http://en.wikipedia.org/wiki/Thermal_management_of_electronic_devices_and_systems">Thermal management</a>
-  is similar, but seeks to measure and control heat to avoid damage due to excess heat.
+  and <a href="http://en.wikipedia.org/wiki/Computer_cooling">computer cooling</a>
+  are similar, but seek to measure and control heat to avoid damage due to excess heat.
   In the Linux kernel, the CPU
   <a href="http://en.wikipedia.org/wiki/Governor_%28device%29">governor</a>
   is responsible for low-level policy, while user mode configures high-level policy.
diff --git a/src/devices/audio/latency_measure.jd b/src/devices/audio/latency_measure.jd
index 14574fb..0b1724a 100644
--- a/src/devices/audio/latency_measure.jd
+++ b/src/devices/audio/latency_measure.jd
@@ -91,7 +91,8 @@
 <h2 id="measuringRoundTrip">Measuring Round-Trip Latency</h2>
 
 <p>
-  Round-trip latency is the sum of output latency and input latency.
+  <a href="http://en.wikipedia.org/wiki/Round-trip_delay_time">Round-trip latency</a>
+  is the sum of output latency and input latency.
 </p>
 
 <h3 id="larsenTest">Larsen test</h3>
diff --git a/src/devices/audio/terminology.jd b/src/devices/audio/terminology.jd
index ba2eb19..fcf7956 100644
--- a/src/devices/audio/terminology.jd
+++ b/src/devices/audio/terminology.jd
@@ -54,6 +54,15 @@
 Compare to "gain."
 </dd>
 
+<dt>audiophile</dt>
+<dd>
+An <a href="http://en.wikipedia.org/wiki/Audiophile">audiophile</a>
+is an individual who is concerned with a superior music
+reproduction experience, especially someone willing to make tradeoffs
+(of expense, component size, room design, etc.) beyond what an ordinary
+person might choose.
+</dd>
+
 <dt>bits per sample or bit depth</dt>
 <dd>
 Number of bits of information per sample.
@@ -73,6 +82,24 @@
 Compare to "upmixing."
 </dd>
 
+<dt>DSD</dt>
+<dd>
+A proprietary audio encoding based on
+<a href="http://en.wikipedia.org/wiki/Pulse-density_modulation">pulse-density modulation</a>.
+Whereas PCM encodes a waveform as a sequence of individual audio samples of multiple bits,
+DSD encodes a waveform as a sequence of bits at a very high sample rate.
+For DSD, there is no concept of "samples" in the conventional PCM sense.
+Both PCM and DSD represent multiple channels by independent sequences.
+DSD is better suited to content distribution than as an internal representation for processing,
+as it can be difficult to apply traditional DSP algorithms to DSD.
+DSD is used in
+<a href="http://en.wikipedia.org/wiki/Super_Audio_CD">Super Audio CD</a>
+(SACD), and in DSD over PCM (DoP) for USB.
+See the Wikipedia article
+<a href="http://en.wikipedia.org/wiki/Direct_Stream_Digital">Digital Stream Digital<a/>
+for more information.
+</dd>
+
 <dt>duck</dt>
 <dd>
 To temporarily reduce the volume of one stream, when another stream
@@ -81,6 +108,15 @@
 Compare to "mute."
 </dd>
 
+<dt>FIFO</dt>
+<dd>
+A hardware module or software data structure that implements
+<a href="http://en.wikipedia.org/wiki/FIFO">First In, First Out</a>
+queueing of data.  In the context of audio, the data stored in the queue
+are typically audio frames.  A FIFO can be implemented by a
+<a href="http://en.wikipedia.org/wiki/Circular_buffer">circular buffer</a>.
+</dd>
+
 <dt>frame</dt>
 <dd>
 A set of samples, one per channel, at a point in time.
@@ -99,16 +135,58 @@
 Compare to "attenuation."
 </dd>
 
+<dt>HD audio</dt>
+<dd>
+High Definition audio, a synonym for "high-resolution audio."
+Not to be confused with Intel High Definition Audio.
+</dd>
+
 <dt>Hz</dt>
 <dd>
 The units for sample rate or frame rate.
 </dd>
 
+<dt>high-resolution audio</dt>
+<dd>
+There is no standard definition, but high-resolution usually means any representation
+with greater bit-depth and sample rate than CDs (which are stereo 16-bit PCM at 44.1 kHz),
+and with no lossy data compression applied.
+Equivalent to "HD audio."  See the Wikipedia article
+<a href="http://en.wikipedia.org/wiki/High-resolution_audio">high-resolution audio</a>
+for more information.
+</dd>
+
 <dt>latency</dt>
 <dd>
 Time delay as a signal passes through a system.
 </dd>
 
+<dt>lossless</dt>
+<dd>
+A <a href="http://en.wikipedia.org/wiki/Lossless_compression">lossless data compression</a>
+algorithm preserves bit accuracy across encoding and decoding.
+The result of decoding any previously encoded data is equivalent to the original data.
+Examples of lossless audio content distribution formats include
+<a href="http://en.wikipedia.org/wiki/Compact_disc">CDs</a>, PCM within
+<a href="http://en.wikipedia.org/wiki/WAV">WAV</a>, and
+<a href="http://en.wikipedia.org/wiki/FLAC">FLAC</a>.
+Note that the authoring process may reduce the bit depth or sample rate from that of the
+<a href="http://en.wikipedia.org/wiki/Audio_mastering">masters</a>.
+Distribution formats that preserve the resolution and bit accuracy of masters
+are the subject of "high-resolution audio."
+</dd>
+
+<dt>lossy</dt>
+<dd>
+A <a href="http://en.wikipedia.org/wiki/Lossy_compression">lossy data compression</a>
+algorithm attempts to preserve the most important features of media across
+encoding and decoding.  The result of decoding any previously encoded
+data is perceptually similar to the original data, but is not identical.
+Examples of lossy audio compression algorithms include MP3 and AAC.
+As analog values are from a continuous domain, whereas digital values are discrete,
+ADC and DAC are lossy conversions with respect to amplitude.  See also "transparency."
+</dd>
+
 <dt>mono</dt>
 <dd>
 One channel.
@@ -116,7 +194,7 @@
 
 <dt>multichannel</dt>
 <dd>
-See "surround sound".
+See "surround sound."
 Strictly, since stereo is more than one channel, it is also "multi" channel.
 But that usage would be confusing.
 </dd>
@@ -190,6 +268,14 @@
 sound position beyond stereo left and right.
 </dd>
 
+<dt>transparency</dt>
+<dd>
+The ideal result of lossy data compression, as stated in the
+<a href="http://en.wikipedia.org/wiki/Transparency_%28data_compression%29">Transparency Wikipedia article</a>.
+A lossy data conversion is said to be transparent if it is perceptually indistinguishable from the
+original by a human subject.
+</dd>
+
 <dt>underrun</dt>
 <dd>
 An audible <a href="http://en.wikipedia.org/wiki/Glitch">glitch</a> caused by failure
@@ -271,6 +357,13 @@
 audio and video data.  For mobile devices, either a micro-HDMI (type D) or MHL connector is used.
 </dd>
 
+<dt>Intel HDA</dt>
+<dd>
+<a href="http://en.wikipedia.org/wiki/Intel_High_Definition_Audio">Intel High Definition Audio</a>
+(commonly shortened to HDA) is a specification for, among other things, a front-panel connector.
+Not to be confused with generic "high-definition audio" or "high-resolution audio."
+</dd>
+
 <dt>MHL</dt>
 <dd>
 Mobile High-Definition Link is a mobile audio/video interface, often
@@ -294,6 +387,12 @@
 See Wikipedia article <a href="http://en.wikipedia.org/wiki/S/PDIF">S/PDIF</a>.
 </dd>
 
+<dt>Thunderbolt</dt>
+<dd>
+<a href="http://en.wikipedia.org/wiki/Thunderbolt_%28interface%29">Thunderbolt</a>
+is a multimedia interface that competes with USB and HDMI for connecting to high-end peripherals.
+</dd>
+
 <dt>USB</dt>
 <dd>
 Universal Serial Bus.
@@ -310,7 +409,9 @@
 implementor may need to be aware of these, but not the end user.
 </p>
 
+<p>
 See these Wikipedia articles:
+</p>
 <ul>
 <li><a href="http://en.wikipedia.org/wiki/General-purpose_input/output">GPIO</a></li>
 <li><a href="http://en.wikipedia.org/wiki/I%C2%B2C">I²C</a>, for control channel</li>
@@ -469,6 +570,11 @@
 tinyalsa.
 </dd>
 
+<dt>audio device</dt>
+<dd>
+Any audio I/O end-point which is backed by a HAL implementation.
+</dd>
+
 <dt>AudioEffect</dt>
 <dd>
 An API and implementation framework for output (post-processing) effects
@@ -525,6 +631,13 @@
 <a href="src.html">sample rate conversion</a>.
 </dd>
 
+<dt>audio source</dt>
+<dd>
+An <a href="http://developer.android.com/reference/android/media/MediaRecorder.AudioSource.html">audio source</a>
+is an enumeration of constants that indicates the desired use case for capturing audio input.
+As of API level 21 and above, <a href="attributes.html">audio attributes</a> are preferred.
+</dd>
+
 <dt>AudioTrack</dt>
 <dd>
 The primary low-level client API for sending data to an audio output
diff --git a/src/devices/audio/usb.jd b/src/devices/audio/usb.jd
index e805ac4..147bfa3 100644
--- a/src/devices/audio/usb.jd
+++ b/src/devices/audio/usb.jd
@@ -552,7 +552,10 @@
 
 <ul>
 <li>design hardware to support USB host mode</li>
-<li>enable all kernel features needed: USB host mode, USB audio, isochronous transfer mode</li>
+<li>enable generic USB host support at the framework level
+via the <code>android.hardware.usb.host.xml</code> feature flag</li>
+<li>enable all kernel features needed: USB host mode, USB audio, isochronous transfer mode;
+see <a href="{@docRoot}/devices/tech/kernel.html">Android Kernel Configuration</a></li>
 <li>keep up-to-date with recent kernel releases and patches;
 despite the noble goal of class compliance, there are extant audio peripherals
 with <a href="http://en.wiktionary.org/wiki/quirk">quirks</a>,
diff --git a/src/devices/tech/kernel.jd b/src/devices/tech/kernel.jd
index da749c5..637c5c4 100644
--- a/src/devices/tech/kernel.jd
+++ b/src/devices/tech/kernel.jd
@@ -288,3 +288,11 @@
 CONFIG_TIMER_STATS=y
 CONFIG_SCHED_TRACER=y
 </pre>
+
+<h3>For USB host mode audio</h3>
+
+<pre>
+CONFIG_SND_USB=y
+CONFIG_SND_USB_AUDIO=y
+# CONFIG_USB_AUDIO is for a peripheral mode (gadget) driver
+</pre>