Back to home page

OSCL-LXR

 
 

    


0001 =======================
0002 ALSA SoC Layer Overview
0003 =======================
0004 
0005 The overall project goal of the ALSA System on Chip (ASoC) layer is to
0006 provide better ALSA support for embedded system-on-chip processors (e.g.
0007 pxa2xx, au1x00, iMX, etc) and portable audio codecs.  Prior to the ASoC
0008 subsystem there was some support in the kernel for SoC audio, however it
0009 had some limitations:-
0010 
0011   * Codec drivers were often tightly coupled to the underlying SoC
0012     CPU. This is not ideal and leads to code duplication - for example,
0013     Linux had different wm8731 drivers for 4 different SoC platforms.
0014 
0015   * There was no standard method to signal user initiated audio events (e.g.
0016     Headphone/Mic insertion, Headphone/Mic detection after an insertion
0017     event). These are quite common events on portable devices and often require
0018     machine specific code to re-route audio, enable amps, etc., after such an
0019     event.
0020 
0021   * Drivers tended to power up the entire codec when playing (or
0022     recording) audio. This is fine for a PC, but tends to waste a lot of
0023     power on portable devices. There was also no support for saving
0024     power via changing codec oversampling rates, bias currents, etc.
0025 
0026 
0027 ASoC Design
0028 ===========
0029 
0030 The ASoC layer is designed to address these issues and provide the following
0031 features :-
0032 
0033   * Codec independence. Allows reuse of codec drivers on other platforms
0034     and machines.
0035 
0036   * Easy I2S/PCM audio interface setup between codec and SoC. Each SoC
0037     interface and codec registers its audio interface capabilities with the
0038     core and are subsequently matched and configured when the application
0039     hardware parameters are known.
0040 
0041   * Dynamic Audio Power Management (DAPM). DAPM automatically sets the codec to
0042     its minimum power state at all times. This includes powering up/down
0043     internal power blocks depending on the internal codec audio routing and any
0044     active streams.
0045 
0046   * Pop and click reduction. Pops and clicks can be reduced by powering the
0047     codec up/down in the correct sequence (including using digital mute). ASoC
0048     signals the codec when to change power states.
0049 
0050   * Machine specific controls: Allow machines to add controls to the sound card
0051     (e.g. volume control for speaker amplifier).
0052 
0053 To achieve all this, ASoC basically splits an embedded audio system into
0054 multiple re-usable component drivers :-
0055 
0056   * Codec class drivers: The codec class driver is platform independent and
0057     contains audio controls, audio interface capabilities, codec DAPM
0058     definition and codec IO functions. This class extends to BT, FM and MODEM
0059     ICs if required. Codec class drivers should be generic code that can run
0060     on any architecture and machine.
0061 
0062   * Platform class drivers: The platform class driver includes the audio DMA
0063     engine driver, digital audio interface (DAI) drivers (e.g. I2S, AC97, PCM)
0064     and any audio DSP drivers for that platform.
0065 
0066   * Machine class driver: The machine driver class acts as the glue that
0067     describes and binds the other component drivers together to form an ALSA
0068     "sound card device". It handles any machine specific controls and
0069     machine level audio events (e.g. turning on an amp at start of playback).