日期:2014-05-16  浏览次数:20645 次

linux音频alsa-uda134x驱动文档阅读之一(over-view)

转自: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层被设计用来解决这些问题并提供如下