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