[ALSA] ASoC documentation updates
[linux-2.6-block.git] / Documentation / sound / alsa / soc / clocking.txt
CommitLineData
eb1a6af3
LG
1Audio Clocking
2==============
3
4This text describes the audio clocking terms in ASoC and digital audio in
5general. Note: Audio clocking can be complex !
6
7
8Master Clock
9------------
10
11Every audio subsystem is driven by a master clock (sometimes refered to as MCLK
12or SYSCLK). This audio master clock can be derived from a number of sources
13(e.g. crystal, PLL, CPU clock) and is responsible for producing the correct
14audio playback and capture sample rates.
15
16Some master clocks (e.g. PLL's and CPU based clocks) are configuarble in that
17their speed can be altered by software (depending on the system use and to save
18power). Other master clocks are fixed at at set frequency (i.e. crystals).
19
20
21DAI Clocks
22----------
23The Digital Audio Interface is usually driven by a Bit Clock (often referred to
24as BCLK). This clock is used to drive the digital audio data across the link
25between the codec and CPU.
26
27The DAI also has a frame clock to signal the start of each audio frame. This
28clock is sometimes referred to as LRC (left right clock) or FRAME. This clock
a71a468a 29runs at exactly the sample rate (LRC = Rate).
eb1a6af3 30
a71a468a 31Bit Clock can be generated as follows:-
eb1a6af3
LG
32
33BCLK = MCLK / x
34
35 or
36
37BCLK = LRC * x
38
a71a468a
LG
39 or
40
41BCLK = LRC * Channels * Word Size
42
10b98527
LG
43This relationship depends on the codec or SoC CPU in particular. In general
44it's best to configure BCLK to the lowest possible speed (depending on your
45rate, number of channels and wordsize) to save on power.
eb1a6af3 46
10b98527
LG
47It's also desireable to use the codec (if possible) to drive (or master) the
48audio clocks as it's usually gives more accurate sample rates than the CPU.
eb1a6af3 49
eb1a6af3 50
eb1a6af3 51