Skip to content
rfvirgil edited this page Sep 23, 2015 · 1 revision

About TinyHAL

TinyHAL is a highly configurable audio HAL for Android systems aimed at providing an improved basis for doing audio system integration in the Android application layer.

Traditionally the use-case logic has been hardcoded into HALs, which means that to edit use-cases or add new ones the code has to be changed and rebuilt. Typically any configuration files have been restricted to listing the ALSA control settings to be applied for a use-case but have no control over the actual use-case decisions.

A major aim of TinyHAL is for the configuration file to also control the logic of decision making about which use-cases to apply.

Key features

  • Based on top of tinyalsa and tinycompress
  • Configuration via an XML file
  • As much configuration as possible done via a text configuration file, minimizing the need for source code modifications
  • Custom streams can be defined to represent extra hardware audio routes outside of the standard Android playback and record - for example specific route handling for baseband, FM radio, HDMI, etc.
  • Optional one-off boot-time configuration of fixed mixer controls
  • Dynamic mixer control setting based on stream open/close, device attach/detach, and custom use-case
  • Per-device mixer control settings for enabling and disabling that audio device
  • Connecting or disconnecting an audio device (speaker, headset, mic) on a stream can execute a different set of mixer settings for every connected {stream, device} combination.
  • Custom use-cases allow creation of mixer control setups that will be executed on events unique to the product, without having to hardcode knowledge of that use-case into TinyHAL.
  • Support for various types of ALSA control
  • Support for writing values into binary ALSA controls
  • Configuration file description is abstracted from Android’s audio definitions to avoid being constrained by what Android knows about. This allows greater flexibility in handling custom cases than would be possible if limited to Android’s built-in view of the audio.
  • Support for compressed offloaded streams (introduced in KitKat)
  • Use-case manager (configuration file and ALSA control handling) is a separate library so can be re-used with different HAL implementations

Documentation

Documentation is available in the source repository:


Clone this wiki locally