ALSA programming: Getting Started with __ programming

Source: Internet
Author: User

1, Gnu/linux system under the three main audio driver assembly
Linux has three mainstream audio driver assemblies: Oss/lite (also known as Oss/free), Oss/full
(commercial software), ALSA (Free software).

Oss/lite is now the Linux kernel with its own audio driver assembly, initially by Hannu Savolainen
Development. Later Hannu ran to develop Open Sound System (that is, the oss/full mentioned above).
Due to Hannu's "escape", the RH-funded Alan Cox enhanced Hannu developed drivers and made them
Fully modular. Now Alan Cox is a defender of the kernel sound-drive set. Oss/lite from kernel-2.0.
Incorporated into the kernel, now everyone uses the sound card drive by default is Oss/lite.

Oss/full is a commercial software developed and marketed by 4Front Technologies. It can drive a lot of
Sound card and can be used in many UNIX systems. Oss/full is fully compatible prior to oss/lite development
The application. As a business software, you can use it, but you can't get its source code, and
You have to pay for that.

ALSA is the next-generation standard sound card driver set for the Linux kernel. At the beginning, Jaroslav Kysela
Gravis Ultrasound card develops the driver, and later the program is renamed alsa"Advanced Linux Audio
System "because they think ALSA is better than the Oss/lite driver set in the original kernel and can
Instead of Oss/lite. They are right, ALSA supports more sound cards than oss/lite, fully compatible with previously based
OSS developed programs, SMP (multiprocessor) and thread safety design, and starting from the 2.5-branched kernel,
The ALSA driver set is incorporated into the kernel, which you can see in this year's 2.6 version of the kernel.

2. Why do I use ALSA to develop audio programs
First of all, ALSA is the standard of Linux sound card driver later, Oss/lite will be removed from the kernel sooner or later.
The development of ALSA based audio programs can guarantee future compatibility.
Second, we are simply comparing the development of OSS and ALSA approaches.
OSS provides a range of system interfaces to applications. Developing OSS based applications requires the use of
Open,close,ioctl,read,write and other low-level system calls to complete the control of audio devices, audio stream input
Output.
ALSA, however, provides an excellent audio library for application developers. The audio library is used to develop
People can easily and quickly develop their own applications, details are left to the audio library internal processing. Of course ALSA.
Also provides a system interface similar to OSS, but ALSA's developers recommend that application developers use audio
Library rather than the drive API.

3. So where do I start?
The first step is of course to install the ALSA driver and audio library.
The current ALSA has two branches, one is the previous 0.5 version, one is now 0.9. ALSA's developers
The 0.5 version is not supported, so we want to use 0.9. You can ALSA on the homepage of the
www.alsa-project.org Install on download. The information on this page is useful for everyone to install:
Www.alsa-project.org/alsa-doc, I suggest we take a look at it first.

The second step is to refer to the documentation and examples.
There are two articles available for application developers on the ALSA document page:
ALSA 0.9.0 HOWTO [http://www.suse.de/~mana/alsa090_howto.html]
Howto Use the ALSA API [http://www.op.net/~pbd/alsa-audio.html]
Of course, there is also an online reference to the Audio Library API:
Http://www.alsa-project.org/alsa-doc/alsa-lib

In the development process you will certainly encounter problems or difficulties, then consult with the discussion will be indispensable. So to
The third step is to subscribe to the ALSA mailing list: alsa-devel@lists.sourceforge.net. Or
If you are not good at E, you can discuss it with others here. But don't expect too much, domestic development ALSA
There are fewer people in the audio program, and fewer people can come here.

If you have completed these steps, then you should start developing. And my mission is over.

4. Conclusion
I have in the Forum service area to suggest to open a Linux under the Audio programming section (see: Http://www.linuxforum.net/forum/showflat.php? cat=&board=uglyduck&number=359899&page=2&view=collapsed&sb=5&o=31&fpart=). However, the response was very Liao, David also did not comment, look at the opening of the Forum has been
No, had to return to the second, to this section to publish this tofu.
We can see that there is no technical content in this post, except the second part is to develop a ALSA based
Small program when some of the experience, the first part is actually reference to the Linux sound howto
[Http://www.ibiblio.org/pub/Linux/docs/HOWTO/Sound-HOWTO], while the third part did not
What content. I just want to tell you that you should pay attention to audio programming and give us a direction. Then
Two "basic" and an "in-depth" is reproduced from the ALSA document page, we are interested to see
See.
I still say: Gnu/linux system only from the application level into the development level to really in China rooted
To. I hope you will work hard.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.