前言 目前,linux系统常用的音频驱动有两种形式:alsa oss
alsa:现在是linux下音频驱动的主要形式,与简单的oss兼容。
oss:过去的形式
而我们板子上的uda1341用的就是alsa驱动。
alsa概述:
因为我们用的是板上系统,用的也是alsa 的一个soc子系统。所以我们直接讲解alsa soc子系统。

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板上系统层
==============
ALSA板上系统(ASoC)层的总体项目目标,是为对SOC嵌入式处理器和便携音频解码器提供更好的ALSA支持。在ASoC子系统之前,己有对内核SoC音频支持,但是那些支持存在一些局限:

解码器常常与底层嵌入式处理器一对一紧密结合。这是非理想化的,因为这将导致代码的重复-例如,对四个不同的嵌入式平台,Linux要有不同的wm8731驱动。(理想的状态是我们可以只有一个wm8731的驱动代码,就可以对应于四个不同的处理器,但由上面说的,解码器-这里的wm8731与底层嵌入式处理器结合过于紧密,无法实现wm8731驱动代码的复用)

没有一个标准的方法可以产生用户初始化音频事件的信号(即,耳机/麦克插入,响应插入事件的耳机/麦克探测)。这些在便携设备上都是十分常见的事件并且在这些事件之后经常需要机器相关的代码来对音频重设路径,开启放大器等。

放音(录音)时,驱动常常会打开整个解码器。对个人电脑来说这没什么问题,但是在便携设备上往往会导致电能的浪费。另外,也没有通过改变解码器采样率、偏置电流等方式来省电的支持

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 设计
===========

ASoC层被设计用来解决这些问题并提供如下特性

解码器独立。允许在其它平台或机器上重用解码器驱动

解码器与SoCI2S/PCM音频接口设置很容易。每个SoC接口与解码器都向ALSA核心注册它的音频接口能力,而且应用硬件参数己知时可以顺序匹配和配置。

动态音频电源管理(DAPM)。DAPM自动无论何时,总是把解码器自动设置为它的最小电源状态。这包括依据内部解码音频线路和活跃的流来开启和关闭内部电源模块

咔嗒声减少。咔嗒声可以通过使用正确的解码器电源开启和关闭顺序而减少(包括使用数字消音)。ASoC在改变电源状态时向解码器发出信号。

机器相关的控制:允许机器增加对声卡的控制。(如扬声器放大器的音量控制)。

要实现这些,ASoC基本上将嵌入式音频系统分为3个部分:

解码器驱动:解码器驱动是平台无关的,包含音频控制、音频接口能力、解码器动态音频电源管理和解码器IO函数

平台驱动:平台驱动包含相应平台的音频DMA引擎和音频接口驱动(I2S,AC97,PCM)

机器驱动:机器驱动处理所有机器相关的控制和音频事件(如回放开始时打开放大器)。

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:平台音频DMADAI

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时钟

alsa内核文档翻译之——overview.txt相关推荐

  1. Linux内核文档翻译

    本博客由浙江工商大学信息学院的计算机专业学生维护,提供Linux内核有关文档的中文翻译,为Linux内核学习提供参考. 内核版本:V3.11 版本来源:http://lxr.linux.no/linu ...

  2. linux 内核模型,The Linux Kernel Device Model - Overview -- Linux 内核设备模型概述

    --------------------------------------------------------------------------------------------------- ...

  3. Linux ALSA 音频系统:物理链路篇

    原址 1. Overview 硬件平台及软件版本: Kernel - 3.4.5 SoC - Samsung exynos CODEC - WM8994 Machine - goni_wm8994 U ...

  4. (一)Linux ALSA 音频系统:物理链路篇

    物理链路篇 转自:https://me.csdn.net/zyuanyun Linux ALSA 音频系统:物理链路篇 Linux ALSA 音频系统:物理链路篇 原创 zyuanyun 最后发布于2 ...

  5. Linux ALSA音频系统:platform,machine,codec

    版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明. 本文链接:https://blog.csdn.net/weixin_41965270/arti ...

  6. linux alsa驱动讲解

    转载自:https://codertw.com/%E7%A8%8B%E5%BC%8F%E8%AA%9E%E8%A8%80/477412/ 程式前沿 幫助程式設計師解決問題,增加專業技能,提升個人能力與 ...

  7. Linux 内核里的“智能指针”【转】

    转自:http://blog.jobbole.com/88279/ 众所周知,C/C++语言本身并不支持垃圾回收机制,虽然语言本身具有极高的灵活性,但是当遇到大型的项目时,繁琐的内存管理往往让人痛苦异 ...

  8. linux内核调试技术 kprobe使用与实现

    Linux kprobes调试技术是内核开发者们专门为了便于跟踪内核函数执行状态所设计的一种轻量级内核调试技术.利用kprobes技术,内核开发人员可以在内核的绝大多数指定函数中动态的插入探测点来收集 ...

  9. Linux 内核里的“智能指针”

    Linux 内核里的"智能指针" from: http://begeek.cn/post/7889.html?ref=myread 众所周知,C/C++语言本身并不支持垃圾回收机制 ...

  10. Linux内核里的“智能指针” (续)

    在上一篇文章<Linux内核里的智能指针>里介绍了Linux内核如何使用引用计数来更加安全的管理内存,本文承接前篇,主要介绍几点使用kref时的注意事项. Linux内核文档kref.tx ...

最新文章

  1. redis(7)、redis持久化
  2. 用户生命周期管理,整体运营的基础与核心
  3. 【随笔】About QWERTY
  4. 一般项目中哪里体现了数据结构_优秀程序员都应该学习的数据结构与算法项目(GitHub 开源清单)...
  5. BroadcastReceiver 广播机制详解
  6. es6 export 命令
  7. java跨站点脚本编制_跨站点请求伪造 跨站点脚本编制 通过框架钓鱼漏洞 | 学步园...
  8. VMware之虚拟机迁移
  9. 对variable-sized object may not be initialized的一点理解
  10. android高效视频压缩代码,Android视频压缩的示例代码
  11. PMP课程笔记:第8章 项目质量管理
  12. 易辅客栈-编写手游模拟器辅助脚本-征途
  13. 06计算机优秀毕业论文-总结和展望
  14. 《梦幻西游》手游服务器如何实现200万玩家同时在线?(技术篇)
  15. “人在囧途”今年少有的国产好电影
  16. 公交车查询系统软件测试,公交APP评测:谁是最好用的公交线路查询软件?
  17. 画意三峡---先睹为快
  18. 工业防腐漆的作用,你知道的有几个
  19. MODIS标准数据产品分级
  20. Android数据存储之文件存储

热门文章

  1. PCIe协议学习之-Ack/Nak协议
  2. Unity 3D 学习(一)——Roll a ball
  3. 软件默认安装路径C盘(更改办法)
  4. ArcGIS 对DEM数据进行剖面分析
  5. 基于GXWorks2的ST语言介绍
  6. matlab安装及破解
  7. 【第十届“泰迪杯”数据挖掘挑战赛】C题:疫情背景下的周边游需求图谱分析 问题二方案及Python实现
  8. pyGurobi使用手册
  9. vue导出数据为excel且设置样式
  10. 数据治理--浅谈数据标准、元数据、主数据、数据模型