Android ALSA commands

Source: Internet
Author: User

Android 2.2 froyo provides three command line commands,

1. alsa_ctl can use this command to output the current audio settings. alsa_ctl store generates asound. State under/system/etc, which can be compared with asound. conf.

Alsa_ctl store: exports the current audio configuration parameter settings to the file/system/etc/asound. state.

We can directly modify this file for system initialization configuration. Of course, do not forget to add a command in init. RC:

##### Add to init. RC
Service asound_conf/system/bin/alsa_ctl restore
Oneshot

Alsa_ctl restore: Reload the configuration in the file/system/etc/asound. conf

2. alsa_aplay can use this command to play audio. Without parameters, only WAV format can be output.

3. The http://blog.csdn.net/sepnic/article/details/6334922 of the alsa_amixer article has a better explanation of this command.

In addition, alsa_arecord is provided. This command is not provided by default and must be generated using the following tools.

By default alsa_arecord doesn't exist. It is a soft link to alsa_aplay. So to create the link run the following command from Android prompt.

# ln -s /system/bin/alsa_aplay /system/bin/alsa_arecord

Software loopback command to test capture-Playback. Following command will record in "cd" format and play the recorded data.

alsa_arecord -f cd | alsa_aplay

The link below is interesting to ALSA.

Http://processors.wiki.ti.com/index.php/TI-Android-GingerBread-2.3.4-DevKit-2.1_PortingGuides

Alsa_arecord can be used to record the default device,

Alsa_arecord 1.wav

Alsa_arecord-f CD 1.wav // recording in CD format

Alsa_amixer contents can generate the current sound card status. alsa_ctl can generate asound. State or generate the current sound card status, but the format is different. Use ALSA. amixer to refer to the former, and write asound. conf to refer to the files generated by the latter.

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.