linux音頻alsa-uda134x驅動文檔閱讀之一(over-view)

來源:互聯網
上載者:User

轉自:http://blog.chinaunix.net/uid-22917448-id-1765502.html


前言

目前,linux系統常用的音頻驅動有兩種形式:alsa
oss 
alsa:現在是linux下音頻驅動的主要形式,與簡單的oss相容。
oss:過去的形式
而我們板子上的uda1341用的就是alsa驅動。
alsa概述:
因為我們用的是板上系統,用的也是alsa 的一個soc子系統。所以我們直接講解alsa soc子系統。

ALSA SoC Layer
ALSA板上系統層
==============

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板上系統(ASoC)層的總體項目目標,是為對SOC嵌入式處理器和便攜音頻解碼器提供更好的ALSA支援。在ASoC子系統之前,己有對核心的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.
解碼器常常與底層嵌入式處理器一對一緊密結合。這是非理想化的,因為這將導致代碼的重複-例如,對四個不同的嵌入式平台,Linux要有不同的wm8731驅動。(理想的狀態是我們可以只有一個wm8731的驅動代碼,就可以對應於四個不同的處理器,但由上面說的,解碼器-這裡的wm8731與底層嵌入式處理器結合過於緊密,無法實現wm8731驅動代碼的複用)

  * 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
ASoC 設計
===========

The ASoC layer is designed to address these issues and provide the following
features :-
ASoC層被設計用來解決這些問題並提供如下特性:

  * 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 it's audio interface capabilities with the
    core and are subsequently matched and configured when the application
    hardware parameters are known.
解碼器與SoC的I2S/PCM音頻介面設定很容易。每個SoC介面與解碼器都向ALSA核心註冊它的音頻介面能力,而且應用硬體參數己知時順序匹配並配置。

  * 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.
動態音頻電源管理(DAPM)。DAPM自動無論何時,總是把解碼器自動化佈建為它的最小電源狀態。這包括依據內部解碼音頻線路和活躍的流來開啟和關閉內部電源模組

  * 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.
哢嗒聲減少。哢嗒聲可以通過使用正確的解碼器電源開啟和關閉順序而減少(包括使用數字消音)。ASoC在改變電源狀態時向解碼器發出訊號。

  * 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 3
components :-
要實現這些,ASoC基本上將嵌入式音頻系統分為3個部分:

  * Codec driver: The codec driver is platform independent and contains audio
    controls, audio interface capabilities, codec DAPM definition and codec IO
    functions.
解碼器驅動:解碼器驅動是平台無關的,包含音頻控制、音頻介面能力、解碼器動態音頻電源管理和解碼器IO函數。

  * Platform driver: The platform driver contains the audio DMA engine and audio
    interface drivers (e.g. I2S, AC97, PCM) for that platform.
平台驅動:平台驅動包含相應平台的音頻DAM引擎和音頻介面驅動(如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).
機器驅動:機器驅動處理所有機器相關的控制和音頻事件(如回放開始時開啟放大器)。

Documentation
文檔
=============

The documentation is spilt into the following sections:-
本文檔分成如下部分:

overview.txt: This file.
overview.txt:概述,本檔案。
codec.txt: Codec driver internals.
codec.txt:解碼器驅動內部實現

DAI.txt: Description of Digital Audio Interface standards and how to configure
a DAI within your codec and CPU DAI drivers.
DAI.txt:對數字音頻介面(DAI)標準和如何配置你的解碼器和CPU的數字音頻接品驅動中的數字音頻介面的描述。

dapm.txt: Dynamic Audio Power Management
dapm.txt:動態音頻電源管理

platform.txt: Platform audio DMA and DAI.
platform.txt:平台音頻DMA和DAI。

machine.txt: Machine driver internals.
machine.txt:機器驅動內容介紹。

pop_clicks.txt: How to minimise audio artifacts.
pop_clicks.txt:如何最小化音步雜訊。

clocking.txt: ASoC clocking for best power performance.
clocking.txt:最佳電源表現下的ASoC時鐘

原文請見:http://www.junziju.usr.cc/home/space.php?uid=2&do=blog&id=327君子注:
您現在所閱讀的,是君子閱讀Linux音頻SoC驅動時,寫下的文檔譯文。
君子寫些譯文,一方面是作為自己的筆記,協助記憶,另一方面也希望能對他人有所協助。
如果您能於君子的譯文中有所收穫,則吾心甚慰。
所有這幾個文檔原文,是見於linux-2.6.30/Documentation/sound/alsa/soc目錄下的全部內容。
由於君子對音頻方面的內容瞭解也不多,很多地方我自己也不理解,只是照著原文生硬的譯出來。
其中錯誤願來來訪者之賓不吝指正。
張君再拜.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.