linux音频alsa-uda134x驱动文档阅读之一(over-view)
生活随笔
收集整理的這篇文章主要介紹了
linux音频alsa-uda134x驱动文档阅读之一(over-view)
小編覺得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.
轉(zhuǎn)自:http://blog.chinaunix.net/uid-22917448-id-1765502.html
前言
目前,linux系統(tǒng)常用的音頻驅(qū)動(dòng)有兩種形式:alsa oss?alsa:現(xiàn)在是linux下音頻驅(qū)動(dòng)的主要形式,與簡(jiǎn)單的oss兼容。
oss:過去的形式
而我們板子上的uda1341用的就是alsa驅(qū)動(dòng)。
alsa概述:
因?yàn)槲覀冇玫氖前迳舷到y(tǒng),用的也是alsa 的一個(gè)soc子系統(tǒng)。所以我們直接講解alsa soc子系統(tǒng)。
ALSA SoC Layer
ALSA板上系統(tǒng)層
==============
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:-
ALSA板上系統(tǒng)(ASoC)層的總體項(xiàng)目目標(biāo),是為對(duì)SOC嵌入式處理器和便攜音頻解碼器提供更好的ALSA支持。在ASoC子系統(tǒng)之前,己有對(duì)內(nèi)核的SoC音頻支持,但是那些支持存在一些局限:
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.
解碼器常常與底層嵌入式處理器一對(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è)不同的處理器,但由上面說的,解碼器-這里的wm8731與底層嵌入式處理器結(jié)合過于緊密,無法實(shí)現(xiàn)wm8731驅(qū)動(dòng)代碼的復(fù)用)
??* 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.
沒有一個(gè)標(biāo)準(zhǔn)的方法可以產(chǎn)生用戶初始化音頻事件的信號(hào)(即,耳機(jī)/麥克插入,響應(yīng)插入事件的耳機(jī)/麥克探測(cè))。這些在便攜設(shè)備上都是十分常見的事件并且在這些事件之后經(jīng)常需要機(jī)器相關(guān)的代碼來對(duì)音頻重設(shè)路徑,開啟放大器等。
??* 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.
放音(錄音)時(shí),驅(qū)動(dòng)常常會(huì)打開整個(gè)解碼器。對(duì)個(gè)人電腦來說這沒什么問題,但是在便攜設(shè)備上往往會(huì)導(dǎo)致電能的浪費(fèi)。另外,也沒有通過改變解碼器采樣率、偏置電流等方式來省電的支持。
ASoC Design
ASoC?設(shè)計(jì)
===========
The ASoC layer is designed to address these issues and provide the following
features :-
ASoC層被設(shè)計(jì)用來解決這些問題并提供如下特性:
??* Codec independence. Allows reuse of codec drivers on other platforms
? ? and machines.
解碼器獨(dú)立。允許在其它平臺(tái)或機(jī)器上重用解碼器驅(qū)動(dòng)。
??* Easy I2S/PCM audio interface setup between codec and SoC. Each SoC
? ? interface and codec registers it's audio interface capabilities with the
? ? core and are subsequently matched and configured when the application
? ? hardware parameters are known.
解碼器與SoC的I2S/PCM音頻接口設(shè)置很容易。每個(gè)SoC接口與解碼器都向ALSA核心注冊(cè)它的音頻接口能力,而且應(yīng)用硬件參數(shù)己知時(shí)順序匹配并配置。
??* 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.
動(dòng)態(tài)音頻電源管理(DAPM)。DAPM自動(dòng)無論何時(shí),總是把解碼器自動(dòng)設(shè)置為它的最小電源狀態(tài)。這包括依據(jù)內(nèi)部解碼音頻線路和活躍的流來開啟和關(guān)閉內(nèi)部電源模塊
??* 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.
咔嗒聲減少。咔嗒聲可以通過使用正確的解碼器電源開啟和關(guān)閉順序而減少(包括使用數(shù)字消音)。ASoC在改變電源狀態(tài)時(shí)向解碼器發(fā)出信號(hào)。
??* Machine specific controls: Allow machines to add controls to the sound card
? ? (e.g. volume control for speaker amplifier).
機(jī)器相關(guān)的控制:允許機(jī)器增加對(duì)聲卡的控制。(如揚(yáng)聲器放大器的音量控制)。
To achieve all this, ASoC basically splits an embedded audio system into 3
components :-
要實(shí)現(xiàn)這些,ASoC基本上將嵌入式音頻系統(tǒng)分為3個(gè)部分:
??* Codec driver: The codec driver is platform independent and contains audio
? ? controls, audio interface capabilities, codec DAPM definition and codec IO
? ? functions.
解碼器驅(qū)動(dòng):解碼器驅(qū)動(dòng)是平臺(tái)無關(guān)的,包含音頻控制、音頻接口能力、解碼器動(dòng)態(tài)音頻電源管理和解碼器IO函數(shù)。
??* Platform driver: The platform driver contains the audio DMA engine and audio
? ? interface drivers (e.g. I2S, AC97, PCM) for that platform.
平臺(tái)驅(qū)動(dòng):平臺(tái)驅(qū)動(dòng)包含相應(yīng)平臺(tái)的音頻DAM引擎和音頻接口驅(qū)動(dòng)(如I2S,AC97,PCM)
??* Machine driver: The machine driver handles any machine specific controls and
? ? audio events (e.g. turning on an amp at start of playback).
機(jī)器驅(qū)動(dòng):機(jī)器驅(qū)動(dòng)處理所有機(jī)器相關(guān)的控制和音頻事件(如回放開始時(shí)打開放大器)。
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í)鐘
原文請(qǐng)見:http://www.junziju.usr.cc/home/space.php?uid=2&do=blog&id=327君子注:
您現(xiàn)在所閱讀的,是君子閱讀Linux音頻SoC驅(qū)動(dòng)時(shí),寫下的文檔譯文。
君子寫些譯文,一方面是作為自己的筆記,幫助記憶,另一方面也希望能對(duì)他人有所幫助。
如果您能于君子的譯文中有所收獲,則吾心甚慰。
所有這幾個(gè)文檔原文,是見于linux-2.6.30/Documentation/sound/alsa/soc目錄下的全部?jī)?nèi)容。
由于君子對(duì)音頻方面的內(nèi)容了解也不多,很多地方我自己也不理解,只是照著原文生硬的譯出來。
其中錯(cuò)誤愿來來訪者之賓不吝指正。
張君再拜.
總結(jié)
以上是生活随笔為你收集整理的linux音频alsa-uda134x驱动文档阅读之一(over-view)的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 幕后常驻嘉宾配音小姐姐的2021年度总结
- 下一篇: 2021 年 JavaScript 大事