Linux声音系统之高级Linux声音体系
2015-02-13 10:51:14 阿炯

高级Linux声音体系(英语:Advanced Linux Sound Architecture,缩写为ALSA)是Linux内核中,为声卡提供的驱动组件,以替代原先的OSS(开放声音系统)。 主要的目的是支持声卡的自动配置,以及完美的处理系统中的多个声音设备,这些目的大多都已达到。另一个声音框架JACK使用ALSA提供低延迟的专业级音频编辑和混音能力。


The ALSA driver is fully compatible with OSS/Lite Mixer and PCM interfaces, so probably all OSS (Open Sound System) applications which use these interfaces should work. The ALSA driver offers better native interfaces, and many applications now offer native support. If your Application is not mentioned, please edit this page and add it.

Jaroslav Kysela过去是这个项目的领导者,这个项目开始于为1998年Gravis Ultrasound所开发的驱动,它一直作为一个单独的软件包开发,直到2002年他被引进入Linux内核的开发版本 (2.5.4-2.5.5)。从2.6版本开始ALSA成为Linux内核中默认的标准音频驱动程序集,OSS则被标记为废弃。

The Advanced Linux Sound Architecture (ALSA) provides audio and MIDI functionality to the Linux operating system. ALSA has the following significant features:

 Efficient support for all types of audio interfaces, from consumer sound cards to professional multichannel audio interfaces.
 Fully modularized sound drivers.
 SMP and thread-safe design.
 User space library (alsa-lib) to simplify application programming and provide higher level functionality.
 Support for the older Open Sound System (OSS) API, providing binary compatibility for most OSS programs.


ALSA是一个完全开放源代码的音频驱动程序集,除了像OSS那样提供了一组内核驱动程序模块之外,ALSA还专门为简化应用程序的编写提供了相应的函数库,与OSS提供的基于ioctl的原始编程接口相比,ALSA函数库使用起来要更加方便一些。

利用该函数库,开发人员可以方便快捷的开发出自己的应用程序,细节则留给函数库内部处理。当然ALSA也提供了类似于OSS的系统接口,不过ALSA的开发者建议应用程序开发者使用音频函数库而不是驱动程序的API。

在内核设备驱动层,ALSA提供了alsa-driver,同时在应用层,ALSA为我们提供了alsa-lib,应用程序只要调用alsa-lib提供的API,即可以完成对底层音频硬件的控制。


由上图可以看出,用户空间的alsa-lib对应用程序提供统一的API接口,这样可以隐藏了驱动层的实现细节,简化了应用程序的实现难度。内核空间中,alsa-soc其实是对alsa-driver的进一步封装,他针对嵌入式设备提供了一些列增强的功能。


最新版本:1.0


官方主页:http://www.alsa-project.org/