요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.
1. 요약·해설
원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.
2. 영어 원문 전체
번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.
원문 전체 펼치기
=======================
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 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).
3. 한국어 전문 번역
영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.
ASoC의 목표와 기존 SoC 오디오의 한계
1-26ALSA System on Chip(ASoC) 계층의 전체 프로젝트 목표는 pxa2xx, au1x00, iMX 같은 임베디드 시스템 온 칩 프로세서와 휴대용 오디오 코덱을 ALSA에서 더 잘 지원하는 것이다. ASoC 하위 시스템이 생기기 전에도 커널에 SoC 오디오 지원이 일부 있었지만 다음과 같은 한계가 있었다.
첫째, 코덱 드라이버가 기반 SoC CPU에 강하게 결합되는 경우가 많았다. 이는 바람직하지 않으며 코드 중복을 낳는다. 예를 들어 Linux에는 서로 다른 네 개의 SoC 플랫폼을 위한 별도의 `wm8731` 드라이버가 존재했다.
둘째, 사용자가 일으킨 오디오 이벤트를 알리는 표준 방법이 없었다. 헤드폰이나 마이크의 삽입, 삽입 뒤의 헤드폰·마이크 감지 같은 이벤트는 휴대용 장치에서 흔하며, 이벤트가 발생하면 오디오 경로를 다시 설정하거나 증폭기를 켜는 등 기기별 코드가 필요한 경우가 많다.
셋째, 드라이버는 오디오를 재생하거나 녹음할 때 코덱 전체의 전원을 켜는 경향이 있었다. PC에서는 괜찮을 수 있지만 휴대용 장치에서는 많은 전력을 낭비한다. 또한 코덱의 오버샘플링 비율이나 바이어스 전류 등을 변경해 전력을 절약하는 지원도 없었다.
기존 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-69ASoC 계층은 앞의 문제를 해결하기 위해 다음 기능을 제공하도록 설계되었다.
코덱 독립성은 한 코덱 드라이버를 다른 플랫폼과 기기에서도 재사용할 수 있게 한다.
코덱과 SoC 사이의 I2S/PCM 오디오 인터페이스를 쉽게 설정할 수 있다. 각 SoC 인터페이스와 코덱은 자신의 오디오 인터페이스 능력을 코어에 등록하며, 응용 프로그램의 하드웨어 매개변수가 알려지면 코어가 양쪽 능력을 일치시켜 구성한다.
Dynamic Audio Power Management(DAPM)는 코덱이 항상 가능한 최소 전력 상태에 있도록 자동으로 설정한다. 내부 코덱 오디오 라우팅과 활성 스트림에 따라 내부 전원 블록을 켜거나 끄는 동작도 포함한다.
팝과 클릭 잡음은 디지털 음소거를 사용하는 것을 포함해 코덱 전원을 올바른 순서로 켜고 끄면 줄일 수 있다. ASoC는 코덱에 전원 상태를 변경할 시점을 알린다.
기기별 제어 기능을 통해 각 기기는 스피커 증폭기 음량 제어 같은 자체 제어 항목을 사운드 카드에 추가할 수 있다.
ASoC가 제공하는 핵심 기능과 직접적인 효과다.
응용 프로그램의 매개변수가 정해진 뒤 코어가 양쪽 능력을 연결한다.
이 기능을 실현하기 위해 ASoC는 임베디드 오디오 시스템을 재사용 가능한 여러 구성 요소 드라이버로 나눈다.
코덱 클래스 드라이버는 플랫폼에 독립적이며 오디오 제어, 오디오 인터페이스 능력, 코덱 DAPM 정의, 코덱 입출력 함수를 담는다. 필요하면 BT, FM, MODEM IC도 이 클래스에 포함된다. 코덱 클래스 드라이버는 어떤 아키텍처와 기기에서도 실행할 수 있는 일반 코드여야 한다.
플랫폼 클래스 드라이버에는 해당 플랫폼의 오디오 DMA 엔진 드라이버, I2S·AC97·PCM 같은 Digital Audio Interface(DAI) 드라이버, 오디오 DSP 드라이버가 포함된다.
머신 클래스 드라이버는 다른 구성 요소 드라이버를 설명하고 서로 결합해 ALSA `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).
요약·해설
overview.rst:1-69ASoC가 임베디드 SoC 오디오의 코덱 종속성, 이벤트 처리 부재, 전력 낭비를 해결하기 위해 코덱·플랫폼·머신 드라이버로 책임을 나눈 설계를 설명합니다. 인터페이스 능력 일치, DAPM, 팝·클릭 감소, 기기별 제어의 작동 관계를 원문 좌표와 함께 정리합니다.