Go Android audio underlying debug-based on Tinyalsa

Source: Internet
Author: User

http://blog.csdn.net/kangear/article/details/38139669

[-]

    1. Compiling Tinyalsa companion Tools
    2. View the current system's sound card
    3. Tinymix Viewing the Reverb device
    4. Play WAV music with Tinyplay
    5. 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?
    1. [email protected]:/ # cat /proc/ Asound/cards   
    2.  0 [rkrk616         ]: rk_rk616 - rk_rk616  
    3.                         rk_rk616  
    4.  1 [ROCKCHIPSPDIF  ]:  rockchip-spdif - rockchip-spdif  
    5.                         rockchip-spdif  
    6. [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?
  1. [Email protected]:/ # Tinymix
  2. Number of controls: 7
  3. CTL Type num Name value
  4. 0 ENUM 1 Playback Path OFF
  5. 1 ENUM 1 Capture mic Path mic OFF
  6. 2 ENUM 1 Voice call Path OFF
  7. 3 ENUM 1 Voip Path OFF
  8. 4 INT 2 Speaker Playback Volume 0 0
  9. 5 INT 2 headphone Playback Volume 0 0
  10. 6 ENUM 1 Modem Input Enable on
  11. [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?
    1. [Email protected]:/ # tinyplay/sdcard/0_16.wav
    2. Playing Sample: 2 ch, 44100 Hz, + bit
    3. [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

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.