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.