alsa内核文档翻译之——overview.txt
前言
目前,linux系統(tǒng)常用的音頻驅(qū)動(dòng)有兩種形式:alsa oss
alsa:現(xiàn)在是linux下音頻驅(qū)動(dòng)的主要形式,與簡(jiǎn)單的oss兼容。
oss:過(guò)去的形式
而我們板子上的uda1341用的就是alsa驅(qū)動(dòng)。
alsa概述:
因?yàn)槲覀冇玫氖前迳舷到y(tǒng),用的也是alsa 的一個(gè)soc子系統(tǒng)。所以我們直接講解alsa soc子系統(tǒng)。
ALSA SoC Layer
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 theASoC
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 - forexample,
? ? Linux had different wm8731 drivers for 4 different SoC platforms.
? * There was no standard method to signal user initiated audioevents (e.g.
? ? Headphone/Mic insertion, Headphone/Mic detection after aninsertion
? ? event). These are quite common events on portable devices andoften require
? ? machine specific code to re-route audio, enable amps, etc., aftersuch 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 lotof
? ? power on portable devices. There was also no support for saving
? ? power via changing codec oversampling rates, bias currents, etc.
ALSA板上系統(tǒng)層
==============
ALSA板上系統(tǒng)(ASoC)層的總體項(xiàng)目目標(biāo),是為對(duì)SOC嵌入式處理器和便攜音頻解碼器提供更好的ALSA支持。在ASoC子系統(tǒng)之前,己有對(duì)內(nèi)核的SoC音頻支持,但是那些支持存在一些局限:
解碼器常常與底層嵌入式處理器一對(duì)一緊密結(jié)合。這是非理想化的,因?yàn)檫@將導(dǎo)致代碼的重復(fù)-例如,對(duì)四個(gè)不同的嵌入式平臺(tái),Linux要有不同的wm8731驅(qū)動(dòng)。(理想的狀態(tài)是我們可以只有一個(gè)wm8731的驅(qū)動(dòng)代碼,就可以對(duì)應(yīng)于四個(gè)不同的處理器,但由上面說(shuō)的,解碼器-這里的wm8731與底層嵌入式處理器結(jié)合過(guò)于緊密,無(wú)法實(shí)現(xiàn)wm8731驅(qū)動(dòng)代碼的復(fù)用)
沒(méi)有一個(gè)標(biāo)準(zhǔn)的方法可以產(chǎn)生用戶初始化音頻事件的信號(hào)(即,耳機(jī)/麥克插入,響應(yīng)插入事件的耳機(jī)/麥克探測(cè))。這些在便攜設(shè)備上都是十分常見(jiàn)的事件并且在這些事件之后經(jīng)常需要機(jī)器相關(guān)的代碼來(lái)對(duì)音頻重設(shè)路徑,開(kāi)啟放大器等。
放音(錄音)時(shí),驅(qū)動(dòng)常常會(huì)打開(kāi)整個(gè)解碼器。對(duì)個(gè)人電腦來(lái)說(shuō)這沒(méi)什么問(wèn)題,但是在便攜設(shè)備上往往會(huì)導(dǎo)致電能的浪費(fèi)。另外,也沒(méi)有通過(guò)改變解碼器采樣率、偏置電流等方式來(lái)省電的支持。
ASoC Design
The ASoC layer is designed to address these issues and provide the following
features :-
? * Codec independence. Allows reuse of codec drivers on otherplatforms
? ? and machines.
? * Easy I2S/PCM audio interface setup between codec and SoC. EachSoC
? ? interface and codec registers it's audio interface capabilitieswith the
? ? core and are subsequently matched and configured when theapplication
? ? hardware parameters are known.
? * Dynamic Audio Power Management (DAPM). DAPM automatically setsthe codec to
? ? its minimum power state at all times. This includes poweringup/down
? ? internal power blocks depending on the internal codec audiorouting and any
? ? active streams.
? * Pop and click reduction. Pops and clicks can be reduced bypowering the
? ? codec up/down in the correct sequence (including using digitalmute). ASoC
? ? signals the codec when to change power states.
? * Machine specific controls: Allow machines to add controls to thesound card
? ? (e.g. volume control for speaker amplifier).
To achieve all this, ASoC basically splits an embedded audio system into 3
components :-
? * Codec driver: The codec driver is platform independent andcontains audio
? ? controls, audio interface capabilities, codec DAPM definition andcodec IO
? ? functions.
? * Platform driver: The platform driver contains the audio DMAengine and audio
? ? interface drivers (e.g. I2S, AC97, PCM) for that platform.
? * Machine driver: The machine driver handles any machine specificcontrols and
? ? audio events (e.g. turning on an amp at start of playback).
ASoC 設(shè)計(jì)
===========
ASoC層被設(shè)計(jì)用來(lái)解決這些問(wèn)題并提供如下特性:
解碼器獨(dú)立。允許在其它平臺(tái)或機(jī)器上重用解碼器驅(qū)動(dòng)。
解碼器與SoC的I2S/PCM音頻接口設(shè)置很容易。每個(gè)SoC接口與解碼器都向ALSA核心注冊(cè)它的音頻接口能力,而且應(yīng)用硬件參數(shù)己知時(shí)可以順序匹配和配置。
動(dòng)態(tài)音頻電源管理(DAPM)。DAPM自動(dòng)無(wú)論何時(shí),總是把解碼器自動(dòng)設(shè)置為它的最小電源狀態(tài)。這包括依據(jù)內(nèi)部解碼音頻線路和活躍的流來(lái)開(kāi)啟和關(guān)閉內(nèi)部電源模塊
咔嗒聲減少。咔嗒聲可以通過(guò)使用正確的解碼器電源開(kāi)啟和關(guān)閉順序而減少(包括使用數(shù)字消音)。ASoC在改變電源狀態(tài)時(shí)向解碼器發(fā)出信號(hào)。
機(jī)器相關(guān)的控制:允許機(jī)器增加對(duì)聲卡的控制。(如揚(yáng)聲器放大器的音量控制)。
要實(shí)現(xiàn)這些,ASoC基本上將嵌入式音頻系統(tǒng)分為3個(gè)部分:
解碼器驅(qū)動(dòng):解碼器驅(qū)動(dòng)是平臺(tái)無(wú)關(guān)的,包含音頻控制、音頻接口能力、解碼器動(dòng)態(tài)音頻電源管理和解碼器IO函數(shù)。
平臺(tái)驅(qū)動(dòng):平臺(tái)驅(qū)動(dòng)包含相應(yīng)平臺(tái)的音頻DMA引擎和音頻接口驅(qū)動(dòng)(如I2S,AC97,PCM)
機(jī)器驅(qū)動(dòng):機(jī)器驅(qū)動(dòng)處理所有機(jī)器相關(guān)的控制和音頻事件(如回放開(kāi)始時(shí)打開(kāi)放大器)。
Documentation
文檔
=============
The documentation is spilt into the following sections:-
本文檔分成如下部分:
overview.txt: This file.
overview.txt:概述,本文件。
codec.txt: Codec driver internals.
codec.txt:解碼器驅(qū)動(dòng)內(nèi)部實(shí)現(xiàn)
DAI.txt: Description of Digital Audio Interface standards and how to configure
a DAI within your codec and CPU DAI drivers.
DAI.txt:對(duì)數(shù)字音頻接口(DAI)標(biāo)準(zhǔn)和如何配置你的解碼器和CPU的數(shù)字音頻接品驅(qū)動(dòng)中的數(shù)字音頻接口的描述。
dapm.txt: Dynamic Audio Power Management
dapm.txt:動(dòng)態(tài)音頻電源管理
platform.txt: Platform audio DMA and DAI.
platform.txt:平臺(tái)音頻DMA和DAI。
machine.txt: Machine driver internals.
machine.txt:機(jī)器驅(qū)動(dòng)內(nèi)容介紹。
pop_clicks.txt: How to minimise audio artifacts.
pop_clicks.txt:如何最小化音步噪聲。
clocking.txt: ASoC clocking for best power performance.
clocking.txt:最佳電源表現(xiàn)下的ASoC時(shí)鐘
總結(jié)
以上是生活随笔為你收集整理的alsa内核文档翻译之——overview.txt的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: figma下载_在Figma中进行原型制
- 下一篇: [html] 你能否画出一个0.5px