http://blog.csdn.net/kangear/article/details/38139669
[-]
- Compiling Tinyalsa companion Tools
- View the current system's sound card
- Tinymix Viewing the Reverb device
- Play WAV music with Tinyplay
- Tinycap use
Since the standard ALSA is not used by default in Android, it uses Tinyalsa, so even command-line-based testing uses LIBTINYALSA. The Android system can be seen in real-time, such as audio channel switching, when the upper-level audio is ever more changeable.
1. CompilingTinyalsa Companion tools
$ mmm external/tinyalsa/
After compiling, it will produce Tinyplay/tinymix/tinycap and so on tools.
Tinymix: View Configuration mixer
Tinyplay: Play Audio
Tinycap: Recording
2. View the current system's sound card
[Python]View Plaincopyprint?
- [email protected]:/ # cat /proc/ Asound/cards
- 0 [rkrk616 ]: rk_rk616 - rk_rk616
- rk_rk616
- 1 [ROCKCHIPSPDIF  ]: rockchip-spdif - rockchip-spdif
- rockchip-spdif
- [Email protected]:/ #
[Email protected]:/# cat/proc/asound/cards 0 [RKRK616 ]: rk_rk616-rk_rk616 rk_rk616 1 [rockchipspdif ]: RO Ckchip-spdif-rockchip-spdif
3.tinymixviewing the reverb device
Tinymix how to use a. no parameters - shows the current configuration B.tinymix [Ctrl ID] [VAR] do not add [var] to view the [Ctrl ID] Optional Options.
[Python]View Plaincopyprint?
- [Email protected]:/ # Tinymix
- Number of controls: 7
- CTL Type num Name value
- 0 ENUM 1 Playback Path OFF
- 1 ENUM 1 Capture mic Path mic OFF
- 2 ENUM 1 Voice call Path OFF
- 3 ENUM 1 Voip Path OFF
- 4 INT 2 Speaker Playback Volume 0 0
- 5 INT 2 headphone Playback Volume 0 0
- 6 ENUM 1 Modem Input Enable on
- [Email protected]:/ #
[Email protected]:/# Tinymixnumber of Controls:7ctltypenumname value0enum1playback Path off1enum1capture MIC Path MIC off2enum1voice call path off3enum1voip path off4int2speaker Playback Volume 0 05int2headphone Playback Volume 0 06enum1modem Input Enable on[email protected]:/#
Correspondence Explanation:
English |
Chinese |
Note |
Playback Path |
Audio output Channels |
|
Capture MIC Path |
Audio input Channels |
|
Voice Call Pah |
Call Audio Channel |
The device does not have a call module and cannot be tested |
Voip Pah |
IP Telephony Audio channel |
Scene Gtalk; Values are : SPK/HP_NO_MIC/BT |
Speaker Playback Volume |
Speaker volume |
Regardless of the upper volume value |
Headphone Playback Volume |
Headphone volume |
Ditto |
Modem Input Enable |
I don't know what to use. |
Test does not control audio input and output |
|
|
|
Playback Path is:
English |
Chinese |
Note |
OFF |
Shut down |
|
RCV |
- |
|
SPK |
Speaker |
Common |
Hp |
Headset with wheat |
|
Hp_no_mic |
Headset without wheat |
Common |
Bt |
Bluetooth |
|
Spk_hp |
- |
|
Ring_spk |
- |
|
Ring_hp |
- |
|
Ring_hp_no_mic |
- |
|
Ring_spk_hp |
- |
|
Example: Switching the output to the speaker
[Email protected]:/# tinymix 0 SPK
About tinymix Summary:
By observation, system sound volume adjustment is not directly used Span style= "Font-family:times New Roman;" >tinyalsa (Take the device I'm using as an example). The switching of the channels is really using the tinyalsaandroid 3 seconds will be about alsa android
When music is played through Bluetooth, it is no longer alsa . tinymix View has to deal with the shutdown state, because the Android4.2 Bluetooth protocol all implemented in the user layer, directly go to the UART channel. Such a design method 1:30 will not understand.
4. UseTinyplay playing wav music
This is just one of the most basic players, so it is not supported to play MP3, and so on compressed-format music. Did not learn to use before, the Internet is said to be very troublesome, but now it seems no trouble, directly played the 44.1khz/44.8khz wav music.
[Python]View Plaincopyprint?
- [Email protected]:/ # tinyplay/sdcard/0_16.wav
- Playing Sample: 2 ch, 44100 Hz, + bit
- [Email protected]:/ #
[Email protected]:/# tinyplay/sdcard/0_16.wav
Note: Before playing, you must first use the tinymix to set the channel, the above has given the example set to the speaker ; Because playback is played at the maximum volume, so be careful to prevent it from being frightened. This will test the audio file upload.
5.tinycapUse
[Email protected]:/# tinycap/sdcard/test.wav
can be recorded.
At present, only meet these, the first summary to this, you can at any time in depth.
20141014 Update:
1. The original Tinyalsa the original source code here Tinyalsa_github.
2. Own forkbusyboxtinymix/tinyplay/ Tinycap/tinypcminfo integration of a tinyalsa< Span style= "font-family: the song Body;" >
Tinyalsa-utils includes tinymix/ Tinyplay/tinycap/tinypcminfo How to use tool name. For example, to run then execute tinyalsa mixtinyalsa Tinymix
[Email protected]:/# Tinyalsa Mix
Mixer name: ' rk_rk616 '
Number of Controls:7
CTL Type num Name value
0 ENUM 1 Playback Path OFF
1 ENUM 1 Capture mic Path Main Mic
2 ENUM 1 Voice call Path OFF
3 ENUM 1 Voip Path OFF
4 INT 2 Speaker Playback Volume 0 0
5 INT 2 Headphone Playback Volume 0 0
6 ENUM 1 Modem Input Enable on
[Email protected]:/#
3. According to this [PATCH] tinyalsa:new Package information, later Tinyalsa will also be integrated into the busybox.
4. if a Failed to open mixer error occurs, your Android device is not alsa audio driver, but legacy OSS device.
Make a static library reference: Build and use static libraries and dynamic libraries in Linux
Other assumptions that have been confirmed as false:
1. Need to overwrite init.rc so that the system does not start Android-related services (MediaServer)
2. It is necessary to obtain tinyalsa by other means.
Go Android audio underlying debug-based on Tinyalsa