blob: c47ce9530677961142f371784bc7550cdc58c460 [file] [log] [blame]
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +02001ALSA SoC Layer
2==============
3
4The overall project goal of the ALSA System on Chip (ASoC) layer is to provide
Matt LaPlante01dd2fb2007-10-20 01:34:40 +02005better ALSA support for embedded system-on-chip processors (e.g. pxa2xx, au1x00,
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +02006iMX, etc) and portable audio codecs. Currently there is some support in the
7kernel for SoC audio, however it has some limitations:-
8
9 * Currently, codec drivers are often tightly coupled to the underlying SoC
Matt LaPlante01dd2fb2007-10-20 01:34:40 +020010 CPU. This is not ideal and leads to code duplication i.e. Linux now has 4
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020011 different wm8731 drivers for 4 different SoC platforms.
12
Matt LaPlante01dd2fb2007-10-20 01:34:40 +020013 * There is no standard method to signal user initiated audio events (e.g.
14 Headphone/Mic insertion, Headphone/Mic detection after an insertion
15 event). These are quite common events on portable devices and often require
16 machine specific code to re-route audio, enable amps, etc., after such an
17 event.
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020018
19 * Current drivers tend to power up the entire codec when playing
20 (or recording) audio. This is fine for a PC, but tends to waste a lot of
21 power on portable devices. There is also no support for saving power via
22 changing codec oversampling rates, bias currents, etc.
23
24
25ASoC Design
26===========
27
28The ASoC layer is designed to address these issues and provide the following
29features :-
30
31 * Codec independence. Allows reuse of codec drivers on other platforms
32 and machines.
33
34 * Easy I2S/PCM audio interface setup between codec and SoC. Each SoC interface
35 and codec registers it's audio interface capabilities with the core and are
36 subsequently matched and configured when the application hw params are known.
37
38 * Dynamic Audio Power Management (DAPM). DAPM automatically sets the codec to
39 it's minimum power state at all times. This includes powering up/down
40 internal power blocks depending on the internal codec audio routing and any
41 active streams.
42
43 * Pop and click reduction. Pops and clicks can be reduced by powering the
44 codec up/down in the correct sequence (including using digital mute). ASoC
45 signals the codec when to change power states.
46
47 * Machine specific controls: Allow machines to add controls to the sound card
Matt LaPlante01dd2fb2007-10-20 01:34:40 +020048 (e.g. volume control for speaker amp).
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020049
50To achieve all this, ASoC basically splits an embedded audio system into 3
51components :-
52
53 * Codec driver: The codec driver is platform independent and contains audio
54 controls, audio interface capabilities, codec dapm definition and codec IO
55 functions.
56
57 * Platform driver: The platform driver contains the audio dma engine and audio
58 interface drivers (e.g. I2S, AC97, PCM) for that platform.
59
60 * Machine driver: The machine driver handles any machine specific controls and
Matt LaPlante01dd2fb2007-10-20 01:34:40 +020061 audio events (e.g. turning on an amp at start of playback).
Liam Girdwoodeb1a6af2006-10-06 18:34:51 +020062
63
64Documentation
65=============
66
67The documentation is spilt into the following sections:-
68
69overview.txt: This file.
70
71codec.txt: Codec driver internals.
72
73DAI.txt: Description of Digital Audio Interface standards and how to configure
74a DAI within your codec and CPU DAI drivers.
75
76dapm.txt: Dynamic Audio Power Management
77
78platform.txt: Platform audio DMA and DAI.
79
80machine.txt: Machine driver internals.
81
82pop_clicks.txt: How to minimise audio artifacts.
83
84clocking.txt: ASoC clocking for best power performance.