High-resolution audio

The Android 10 release includes the following improvements for high-resolution audio:

  • Float: WAV, FLAC codecs, and extractors are updated to support float (24+ bits of lossless precision). Downmix and Virtualizer effects are updated to float. Updated precision is allowed by MediaPlayer (NuPlayer).
  • High-frequency: WAV, FLAC codecs, and extractors are updated to support 192 kHz. The default Android supplied effects are tested for 192 kHz support at standard frequencies. The standard frequencies permitted are 88.2 kHz, 96 kHz, 176.4 kHz, and 192 kHz.
  • Multichannel: Default Android playback effects are tested for multichannel support to eight channels.
  • Timing: Timing information is included throughout the audio framework.

Starting in Android 9, the following improvements don't require any partner implementation:

  • The number of simultaneous client output tracks increases from 14 to 40, as limited client instances of AudioTrack have been an issue for apps in Android 8.x.
  • Maximum client/server memory increases from 4 MB to 32 MB (depending on total device memory) to allow more simultaneous high-resolution audio tracks.
  • Total mixed tracks increases from 32 to 256 to prevent resource contention between apps and the System UI.

Output effect changes

See Audio effects for Android 11 release changes.

Prior to the Android 9 release, effect chain processing was implemented in stereo int16 sample format. This had several limitations:

  • All output effects forced conversion from floating point audio data to int16, causing loss of precision.
  • Output effects were rejected from output sinks with a channel count greater than two.

In the Android 9 release, the effect chain processing pipeline is upgraded to support the multichannel float format. Key points:

  • Android software effects are already migrated to stereo float.
  • Legacy effects are supported with format adapters, which convert float to int16 as needed.

Implement output effects

A reference implementation for output effects is available under frameworks/av/media/libeffects.

Partners implementing their own custom output effects should do the following for the Android 10 release:

  • Update output effects to support the multichannel float format:
    • Int16 processing support is no longer required.
    • Support output channel counts from 2–8 (for future compatibility consider counts from 1–30).
    • Support input channel counts matching output channel counts for insert effects. Auxiliary effects continue to see an input channel count of 1 (mono).
    • Support both channel position masks (canonical) and channel index masks of (1 << n) - 1.
  • If you must continue to support legacy vendor output effects and can't update them, then verify legacy code as follows:
    • Legacy output (insert) effects must reject unsupported configurations in EFFECT_CMD_SET_CONFIG.
      • Check that the format is int16.
      • Check that the input and output channel masks are stereo.
      • If either check fails, return -EINVAL.
    • Legacy output (auxiliary) effects are configured by AudioFlinger with a mono input channel mask and potentially multichannel output channel masks, depending on whether the output sink is multichannel. They must reject unsupported configurations in EFFECT_CMD_SET_CONFIG.
      • Check that the format is int16.
      • Check that the input channel mask is mono and the output channel mask is stereo.
      • If either check fails, return -EINVAL.
    • Verify legacy code. Don't assume that it works!