clocking.txt 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. Audio Clocking
  2. ==============
  3. This text describes the audio clocking terms in ASoC and digital audio in
  4. general. Note: Audio clocking can be complex!
  5. Master Clock
  6. ------------
  7. Every audio subsystem is driven by a master clock (sometimes referred to as MCLK
  8. or SYSCLK). This audio master clock can be derived from a number of sources
  9. (e.g. crystal, PLL, CPU clock) and is responsible for producing the correct
  10. audio playback and capture sample rates.
  11. Some master clocks (e.g. PLLs and CPU based clocks) are configurable in that
  12. their speed can be altered by software (depending on the system use and to save
  13. power). Other master clocks are fixed at a set frequency (i.e. crystals).
  14. DAI Clocks
  15. ----------
  16. The Digital Audio Interface is usually driven by a Bit Clock (often referred to
  17. as BCLK). This clock is used to drive the digital audio data across the link
  18. between the codec and CPU.
  19. The DAI also has a frame clock to signal the start of each audio frame. This
  20. clock is sometimes referred to as LRC (left right clock) or FRAME. This clock
  21. runs at exactly the sample rate (LRC = Rate).
  22. Bit Clock can be generated as follows:-
  23. BCLK = MCLK / x
  24. or
  25. BCLK = LRC * x
  26. or
  27. BCLK = LRC * Channels * Word Size
  28. This relationship depends on the codec or SoC CPU in particular. In general
  29. it is best to configure BCLK to the lowest possible speed (depending on your
  30. rate, number of channels and word size) to save on power.
  31. It is also desirable to use the codec (if possible) to drive (or master) the
  32. audio clocks as it usually gives more accurate sample rates than the CPU.