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

Linux 6.18.37 · Sound / ASoC

ALSA SoC 계층 개요

ASoC가 임베디드 SoC 오디오의 코덱 종속성, 이벤트 처리 부재, 전력 낭비를 해결하기 위해 코덱·플랫폼·머신 드라이버로 책임을 나눈 설계를 설명합니다. 인터페이스 능력 일치, DAPM, 팝·클릭 감소, 기기별 제어의 작동 관계를 원문 좌표와 함께 정리합니다.

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

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

1. 요약·해설

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

요약·해설

overview.rst:1-69

ASoC가 임베디드 SoC 오디오의 코덱 종속성, 이벤트 처리 부재, 전력 낭비를 해결하기 위해 코덱·플랫폼·머신 드라이버로 책임을 나눈 설계를 설명합니다. 인터페이스 능력 일치, DAPM, 팝·클릭 감소, 기기별 제어의 작동 관계를 원문 좌표와 함께 정리합니다.

2. 영어 원문 전체

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

원문 전체 펼치기
1 =======================
2 ALSA SoC Layer Overview
3 =======================
4
5 The overall project goal of the ALSA System on Chip (ASoC) layer is to
6 provide better ALSA support for embedded system-on-chip processors (e.g.
7 pxa2xx, au1x00, iMX, etc) and portable audio codecs. Prior to the ASoC
8 subsystem there was some support in the kernel for SoC audio, however it
9 had some limitations:-
10
11 * Codec drivers were often tightly coupled to the underlying SoC
12 CPU. This is not ideal and leads to code duplication - for example,
13 Linux had different wm8731 drivers for 4 different SoC platforms.
14
15 * There was no standard method to signal user initiated audio events (e.g.
16 Headphone/Mic insertion, Headphone/Mic detection after an insertion
17 event). These are quite common events on portable devices and often require
18 machine specific code to re-route audio, enable amps, etc., after such an
19 event.
20
21 * Drivers tended to power up the entire codec when playing (or
22 recording) audio. This is fine for a PC, but tends to waste a lot of
23 power on portable devices. There was also no support for saving
24 power via changing codec oversampling rates, bias currents, etc.
25
26
27 ASoC Design
28 ===========
29
30 The ASoC layer is designed to address these issues and provide the following
31 features :-
32
33 * Codec independence. Allows reuse of codec drivers on other platforms
34 and machines.
35
36 * Easy I2S/PCM audio interface setup between codec and SoC. Each SoC
37 interface and codec registers its audio interface capabilities with the
38 core and are subsequently matched and configured when the application
39 hardware parameters are known.
40
41 * Dynamic Audio Power Management (DAPM). DAPM automatically sets the codec to
42 its minimum power state at all times. This includes powering up/down
43 internal power blocks depending on the internal codec audio routing and any
44 active streams.
45
46 * Pop and click reduction. Pops and clicks can be reduced by powering the
47 codec up/down in the correct sequence (including using digital mute). ASoC
48 signals the codec when to change power states.
49
50 * Machine specific controls: Allow machines to add controls to the sound card
51 (e.g. volume control for speaker amplifier).
52
53 To achieve all this, ASoC basically splits an embedded audio system into
54 multiple re-usable component drivers :-
55
56 * Codec class drivers: The codec class driver is platform independent and
57 contains audio controls, audio interface capabilities, codec DAPM
58 definition and codec IO functions. This class extends to BT, FM and MODEM
59 ICs if required. Codec class drivers should be generic code that can run
60 on any architecture and machine.
61
62 * Platform class drivers: The platform class driver includes the audio DMA
63 engine driver, digital audio interface (DAI) drivers (e.g. I2S, AC97, PCM)
64 and any audio DSP drivers for that platform.
65
66 * Machine class driver: The machine driver class acts as the glue that
67 describes and binds the other component drivers together to form an ALSA
68 "sound card device". It handles any machine specific controls and
69 machine level audio events (e.g. turning on an amp at start of playback).
70

3. 한국어 전문 번역

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

ASoC의 목표와 기존 SoC 오디오의 한계

1-26

ALSA System on Chip(ASoC) 계층의 전체 프로젝트 목표는 pxa2xx, au1x00, iMX 같은 임베디드 시스템 온 칩 프로세서와 휴대용 오디오 코덱을 ALSA에서 더 잘 지원하는 것이다. ASoC 하위 시스템이 생기기 전에도 커널에 SoC 오디오 지원이 일부 있었지만 다음과 같은 한계가 있었다.

첫째, 코덱 드라이버가 기반 SoC CPU에 강하게 결합되는 경우가 많았다. 이는 바람직하지 않으며 코드 중복을 낳는다. 예를 들어 Linux에는 서로 다른 네 개의 SoC 플랫폼을 위한 별도의 `wm8731` 드라이버가 존재했다.

둘째, 사용자가 일으킨 오디오 이벤트를 알리는 표준 방법이 없었다. 헤드폰이나 마이크의 삽입, 삽입 뒤의 헤드폰·마이크 감지 같은 이벤트는 휴대용 장치에서 흔하며, 이벤트가 발생하면 오디오 경로를 다시 설정하거나 증폭기를 켜는 등 기기별 코드가 필요한 경우가 많다.

셋째, 드라이버는 오디오를 재생하거나 녹음할 때 코덱 전체의 전원을 켜는 경향이 있었다. PC에서는 괜찮을 수 있지만 휴대용 장치에서는 많은 전력을 낭비한다. 또한 코덱의 오버샘플링 비율이나 바이어스 전류 등을 변경해 전력을 절약하는 지원도 없었다.

ASoC 이전의 세 가지 한계
문제영향
코덱과 SoC CPU의 강한 결합플랫폼마다 같은 코덱 드라이버를 중복 구현
사용자 오디오 이벤트 표준 부재삽입·감지 뒤 경로 변경과 증폭기 제어를 기기별로 구현
코덱 전체 전원 사용휴대용 장치의 전력 낭비와 세밀한 절전 기능 부족

기존 SoC 오디오 지원에서 ASoC가 해결하려 한 문제를 정리한다.

기존 이벤트 처리의 부담
헤드폰·마이크 삽입기기별 감지 코드오디오 경로 재설정증폭기 활성화

표준 이벤트 계층이 없을 때 기기별 코드가 맡아야 했던 흐름이다.

=======================
ALSA SoC Layer Overview
=======================

The overall project goal of the ALSA System on Chip (ASoC) layer is to
provide better ALSA support for embedded system-on-chip processors (e.g.
pxa2xx, au1x00, iMX, etc) and portable audio codecs.  Prior to the ASoC
subsystem there was some support in the kernel for SoC audio, however it
had some limitations:-

  * Codec drivers were often tightly coupled to the underlying SoC
    CPU. This is not ideal and leads to code duplication - for example,
    Linux had different wm8731 drivers for 4 different SoC platforms.

  * There was no standard method to signal user initiated audio events (e.g.
    Headphone/Mic insertion, Headphone/Mic detection after an insertion
    event). These are quite common events on portable devices and often require
    machine specific code to re-route audio, enable amps, etc., after such an
    event.

  * Drivers tended to power up the entire codec when playing (or
    recording) audio. This is fine for a PC, but tends to waste a lot of
    power on portable devices. There was also no support for saving
    power via changing codec oversampling rates, bias currents, etc.

ASoC 설계와 재사용 가능한 구성 요소

27-69

ASoC 계층은 앞의 문제를 해결하기 위해 다음 기능을 제공하도록 설계되었다.

코덱 독립성은 한 코덱 드라이버를 다른 플랫폼과 기기에서도 재사용할 수 있게 한다.

코덱과 SoC 사이의 I2S/PCM 오디오 인터페이스를 쉽게 설정할 수 있다. 각 SoC 인터페이스와 코덱은 자신의 오디오 인터페이스 능력을 코어에 등록하며, 응용 프로그램의 하드웨어 매개변수가 알려지면 코어가 양쪽 능력을 일치시켜 구성한다.

Dynamic Audio Power Management(DAPM)는 코덱이 항상 가능한 최소 전력 상태에 있도록 자동으로 설정한다. 내부 코덱 오디오 라우팅과 활성 스트림에 따라 내부 전원 블록을 켜거나 끄는 동작도 포함한다.

팝과 클릭 잡음은 디지털 음소거를 사용하는 것을 포함해 코덱 전원을 올바른 순서로 켜고 끄면 줄일 수 있다. ASoC는 코덱에 전원 상태를 변경할 시점을 알린다.

기기별 제어 기능을 통해 각 기기는 스피커 증폭기 음량 제어 같은 자체 제어 항목을 사운드 카드에 추가할 수 있다.

ASoC 설계 기능
기능효과
코덱 독립성플랫폼과 기기를 넘어 코덱 드라이버 재사용
I2S/PCM 설정등록된 양쪽 능력과 응용 프로그램의 하드웨어 매개변수를 일치시켜 구성
DAPM라우팅과 활성 스트림에 필요한 전원 블록만 자동 활성화
팝·클릭 감소올바른 전원 순서와 디지털 음소거 적용
기기별 제어보드의 증폭기 음량 같은 제어 항목 추가

ASoC가 제공하는 핵심 기능과 직접적인 효과다.

인터페이스 능력 일치
SoC 인터페이스 능력 등록ASoC 코어
코덱 인터페이스 능력 등록ASoC 코어
응용 프로그램 하드웨어 매개변수능력 일치와 I2S/PCM 구성

응용 프로그램의 매개변수가 정해진 뒤 코어가 양쪽 능력을 연결한다.

이 기능을 실현하기 위해 ASoC는 임베디드 오디오 시스템을 재사용 가능한 여러 구성 요소 드라이버로 나눈다.

코덱 클래스 드라이버는 플랫폼에 독립적이며 오디오 제어, 오디오 인터페이스 능력, 코덱 DAPM 정의, 코덱 입출력 함수를 담는다. 필요하면 BT, FM, MODEM IC도 이 클래스에 포함된다. 코덱 클래스 드라이버는 어떤 아키텍처와 기기에서도 실행할 수 있는 일반 코드여야 한다.

플랫폼 클래스 드라이버에는 해당 플랫폼의 오디오 DMA 엔진 드라이버, I2S·AC97·PCM 같은 Digital Audio Interface(DAI) 드라이버, 오디오 DSP 드라이버가 포함된다.

머신 클래스 드라이버는 다른 구성 요소 드라이버를 설명하고 서로 결합해 ALSA `sound card device`를 만드는 접착제 역할을 한다. 재생을 시작할 때 증폭기를 켜는 동작처럼 기기별 제어와 기기 수준 오디오 이벤트도 처리한다.

ASoC 구성 요소 클래스
클래스주요 책임재사용 범위
Codec제어, 인터페이스 능력, DAPM, 코덱 I/O아키텍처와 기기에 독립
Platform오디오 DMA, SoC DAI, 플랫폼 DSP특정 SoC 플랫폼
Machine구성 요소 결합, 기기별 제어와 이벤트특정 보드·기기

각 클래스의 경계와 책임을 구분한다.

ASoC 사운드 카드 구성
Codec class driverMachine class driver
Platform class driverMachine class driver
Machine class driverALSA sound card device

재사용 가능한 드라이버를 머신 드라이버가 하나의 카드로 결합한다.

ASoC Design
===========

The ASoC layer is designed to address these issues and provide the following
features :-

  * Codec independence. Allows reuse of codec drivers on other platforms
    and machines.

  * Easy I2S/PCM audio interface setup between codec and SoC. Each SoC
    interface and codec registers its audio interface capabilities with the
    core and are subsequently matched and configured when the application
    hardware parameters are known.

  * Dynamic Audio Power Management (DAPM). DAPM automatically sets the codec to
    its minimum power state at all times. This includes powering up/down
    internal power blocks depending on the internal codec audio routing and any
    active streams.

  * Pop and click reduction. Pops and clicks can be reduced by powering the
    codec up/down in the correct sequence (including using digital mute). ASoC
    signals the codec when to change power states.

  * Machine specific controls: Allow machines to add controls to the sound card
    (e.g. volume control for speaker amplifier).

To achieve all this, ASoC basically splits an embedded audio system into
multiple re-usable component drivers :-

  * Codec class drivers: The codec class driver is platform independent and
    contains audio controls, audio interface capabilities, codec DAPM
    definition and codec IO functions. This class extends to BT, FM and MODEM
    ICs if required. Codec class drivers should be generic code that can run
    on any architecture and machine.

  * Platform class drivers: The platform class driver includes the audio DMA
    engine driver, digital audio interface (DAI) drivers (e.g. I2S, AC97, PCM)
    and any audio DSP drivers for that platform.

  * Machine class driver: The machine driver class acts as the glue that
    describes and binds the other component drivers together to form an ALSA
    "sound card device". It handles any machine specific controls and
    machine level audio events (e.g. turning on an amp at start of playback).