2016-11-10 22:25:28 +01:00
==============
2006-10-06 18:34:51 +02:00
Audio Clocking
==============
This text describes the audio clocking terms in ASoC and digital audio in
2007-10-20 01:34:40 +02:00
general. Note: Audio clocking can be complex!
2006-10-06 18:34:51 +02:00
Master Clock
------------
2007-10-20 01:34:40 +02:00
Every audio subsystem is driven by a master clock (sometimes referred to as MCLK
2006-10-06 18:34:51 +02:00
or SYSCLK). This audio master clock can be derived from a number of sources
(e.g. crystal, PLL, CPU clock) and is responsible for producing the correct
audio playback and capture sample rates.
2008-01-23 08:41:46 +01:00
Some master clocks (e.g. PLLs and CPU based clocks) are configurable in that
2006-10-06 18:34:51 +02:00
their speed can be altered by software (depending on the system use and to save
2007-10-20 01:34:40 +02:00
power). Other master clocks are fixed at a set frequency (i.e. crystals).
2006-10-06 18:34:51 +02:00
DAI Clocks
----------
The Digital Audio Interface is usually driven by a Bit Clock (often referred to
as BCLK). This clock is used to drive the digital audio data across the link
between the codec and CPU.
The DAI also has a frame clock to signal the start of each audio frame. This
clock is sometimes referred to as LRC (left right clock) or FRAME. This clock
2006-10-19 20:35:56 +02:00
runs at exactly the sample rate (LRC = Rate).
2006-10-06 18:34:51 +02:00
2006-10-19 20:35:56 +02:00
Bit Clock can be generated as follows:-
2006-10-06 18:34:51 +02:00
2016-11-10 22:25:28 +01:00
- BCLK = MCLK / x, or
- BCLK = LRC * x, or
- BCLK = LRC * Channels * Word Size
2006-10-19 20:35:56 +02:00
2007-02-08 17:06:09 +01:00
This relationship depends on the codec or SoC CPU in particular. In general
2008-01-23 08:41:46 +01:00
it is best to configure BCLK to the lowest possible speed (depending on your
rate, number of channels and word size) to save on power.
2006-10-06 18:34:51 +02:00
2008-01-23 08:41:46 +01:00
It is also desirable to use the codec (if possible) to drive (or master) the
audio clocks as it usually gives more accurate sample rates than the CPU.
2006-10-06 18:34:51 +02:00