← Documents Documentation/sound/soc/clocking.rst GitHub 원문 ↗

Linux 6.18.37 · Sound / ASoC

오디오 클로킹

ASoC 디지털 오디오 링크의 MCLK·SYSCLK, BCLK, LRC·FRAME 용어와 주파수 관계를 설명하고, codec과 CPU의 clock master 선택 및 절전 관점의 BCLK 설정 원칙을 정리합니다. `snd_soc_dai_set_sysclk()` 등 네 DAI 클록 API도 원문 좌표와 함께 연결합니다.

Source pathDocumentation/sound/soc/clocking.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약·해설

clocking.rst:1-58

ASoC 디지털 오디오 링크의 MCLK·SYSCLK, BCLK, LRC·FRAME 용어와 주파수 관계를 설명하고, codec과 CPU의 clock master 선택 및 절전 관점의 BCLK 설정 원칙을 정리합니다. `snd_soc_dai_set_sysclk()` 등 네 DAI 클록 API도 원문 좌표와 함께 연결합니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

원문 전체 펼치기
1 ==============
2 Audio Clocking
3 ==============
4
5 This text describes the audio clocking terms in ASoC and digital audio in
6 general. Note: Audio clocking can be complex!
7
8
9 Master Clock
10 ------------
11
12 Every audio subsystem is driven by a master clock (sometimes referred to as MCLK
13 or SYSCLK). This audio master clock can be derived from a number of sources
14 (e.g. crystal, PLL, CPU clock) and is responsible for producing the correct
15 audio playback and capture sample rates.
16
17 Some master clocks (e.g. PLLs and CPU based clocks) are configurable in that
18 their speed can be altered by software (depending on the system use and to save
19 power). Other master clocks are fixed at a set frequency (i.e. crystals).
20
21
22 DAI Clocks
23 ----------
24 The Digital Audio Interface is usually driven by a Bit Clock (often referred to
25 as BCLK). This clock is used to drive the digital audio data across the link
26 between the codec and CPU.
27
28 The DAI also has a frame clock to signal the start of each audio frame. This
29 clock is sometimes referred to as LRC (left right clock) or FRAME. This clock
30 runs at exactly the sample rate (LRC = Rate).
31
32 Bit Clock can be generated as follows:-
33
34 - BCLK = MCLK / x, or
35 - BCLK = LRC * x, or
36 - BCLK = LRC * Channels * Word Size
37
38 This relationship depends on the codec or SoC CPU in particular. In general
39 it is best to configure BCLK to the lowest possible speed (depending on your
40 rate, number of channels and word size) to save on power.
41
42 It is also desirable to use the codec (if possible) to drive (or master) the
43 audio clocks as it usually gives more accurate sample rates than the CPU.
44
45 ASoC provided clock APIs
46 ------------------------
47
48 .. kernel-doc:: sound/soc/soc-dai.c
49 :identifiers: snd_soc_dai_set_sysclk
50
51 .. kernel-doc:: sound/soc/soc-dai.c
52 :identifiers: snd_soc_dai_set_clkdiv
53
54 .. kernel-doc:: sound/soc/soc-dai.c
55 :identifiers: snd_soc_dai_set_pll
56
57 .. kernel-doc:: sound/soc/soc-dai.c
58 :identifiers: snd_soc_dai_set_bclk_ratio
59

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

ASoC 오디오 클록 용어

1-8

이 문서는 ASoC와 일반적인 디지털 오디오에서 사용하는 클로킹 용어를 설명한다. 오디오 클로킹은 여러 클록의 주파수와 주종 관계를 함께 맞춰야 하므로 복잡할 수 있다.

==============
Audio Clocking
==============

This text describes the audio clocking terms in ASoC and digital audio in
general. Note: Audio clocking can be complex!

마스터 클록

9-21

모든 오디오 서브시스템은 마스터 클록으로 구동된다. 이 클록은 `MCLK` 또는 `SYSCLK`라고도 하며 crystal, PLL, CPU clock 같은 여러 소스에서 얻을 수 있다. 마스터 클록은 올바른 재생 및 캡처 sample rate를 만들어 내는 기준이 된다.

PLL이나 CPU 기반 클록처럼 일부 마스터 클록은 시스템 사용 조건과 절전을 위해 소프트웨어로 속도를 바꿀 수 있다. 반면 crystal처럼 정해진 주파수로만 동작하는 고정 마스터 클록도 있다.

마스터 클록 소스
소스주파수 특성용도
Crystal고정안정된 기준 주파수
PLL소프트웨어 설정 가능필요한 오디오 주파수 합성
CPU clock시스템에 따라 설정 가능사용 조건과 전력 정책에 맞춘 공급

MCLK 또는 SYSCLK를 만드는 대표 소스와 설정 가능성을 구분한다.

Master Clock
------------

Every audio subsystem is driven by a master clock (sometimes referred to as MCLK
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.

Some master clocks (e.g. PLLs and CPU based clocks) are configurable in that
their speed can be altered by software (depending on the system use and to save
power). Other master clocks are fixed at a set frequency (i.e. crystals).

DAI의 비트 클록과 프레임 클록

22-44

Digital Audio Interface인 DAI는 보통 `BCLK`라고 부르는 Bit Clock으로 구동된다. BCLK는 codec과 CPU 사이의 링크에서 디지털 오디오 데이터를 전송하는 타이밍을 제공한다.

DAI에는 각 오디오 프레임의 시작을 알리는 frame clock도 있다. 이 클록은 `LRC`(left right clock) 또는 `FRAME`이라고도 하며 sample rate와 정확히 같은 주파수로 동작한다. 따라서 `LRC = Rate`이다.

BCLK는 `MCLK / x`, `LRC * x`, 또는 `LRC * Channels * Word Size` 관계로 생성할 수 있다. 실제 관계는 해당 codec이나 SoC CPU 구현에 따라 달라진다.

전력을 줄이려면 sample rate, channel 수, word size가 허용하는 범위에서 BCLK를 가능한 한 낮게 설정하는 것이 일반적으로 좋다. 가능하다면 codec이 오디오 클록을 구동하는 master 역할을 맡는 편이 CPU보다 더 정확한 sample rate를 제공하는 경우가 많다.

DAI 클록 관계
클록별칭관계 또는 역할
MCLKSYSCLK오디오 서브시스템의 기준 마스터 클록
BCLKBit ClockCodec과 CPU 사이의 디지털 데이터 전송 타이밍
LRCFRAME프레임 시작 표시, LRC = sample rate

오디오 링크의 세 주요 클록과 주파수 관계를 정리한다.

BCLK 생성식
해석
BCLK = MCLK / x마스터 클록을 분주
BCLK = LRC * x프레임 클록에 링크 비율을 곱함
BCLK = LRC * Channels * Word Size한 프레임의 전체 bit 수로 계산

하드웨어가 지원하는 방식에 따라 x는 divider 또는 ratio가 된다.

오디오 클록의 파생 관계
Crystal·PLL·CPU clockMCLK / SYSCLKDivider 또는 ratioBCLKCodec↔CPU data link
Sample rateLRC / FRAMEChannels × Word SizeBCLK

기준 클록과 프레임 조건으로 링크 전송 클록을 결정한다.

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
runs at exactly the sample rate (LRC = Rate).

Bit Clock can be generated as follows:-

- BCLK = MCLK / x, or
- BCLK = LRC * x, or
- BCLK = LRC * Channels * Word Size

This relationship depends on the codec or SoC CPU in particular. In general
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.

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.

ASoC 클록 API

45-58

이 절의 `kernel-doc` 지시문은 `sound/soc/soc-dai.c`에서 네 클록 API의 설명을 가져온다. `snd_soc_dai_set_sysclk()`는 DAI system clock을 설정하고, `snd_soc_dai_set_clkdiv()`는 clock divider를 설정한다.

`snd_soc_dai_set_pll()`은 DAI의 PLL을 구성하며, `snd_soc_dai_set_bclk_ratio()`는 한 frame에 대응하는 BCLK 비율을 설정한다. 구체적인 지원 값과 동작은 각 DAI driver 구현에 달려 있다.

ASoC DAI 클록 API
함수설정 대상
snd_soc_dai_set_sysclk()System clock 또는 master clock
snd_soc_dai_set_clkdiv()Clock divider
snd_soc_dai_set_pll()PLL 입력·출력 클록
snd_soc_dai_set_bclk_ratio()Frame당 BCLK 비율

원문이 kernel-doc으로 포함하는 함수와 설정 대상을 연결한다.

ASoC provided clock APIs
------------------------

.. kernel-doc:: sound/soc/soc-dai.c
   :identifiers: snd_soc_dai_set_sysclk

.. kernel-doc:: sound/soc/soc-dai.c
   :identifiers: snd_soc_dai_set_clkdiv

.. kernel-doc:: sound/soc/soc-dai.c
   :identifiers: snd_soc_dai_set_pll

.. kernel-doc:: sound/soc/soc-dai.c
   :identifiers: snd_soc_dai_set_bclk_ratio