Use ALSA for Android

Source: Internet
Author: User

The Android system supports ALSA but is not downloaded or compiled by default. Yes
Follow these steps to use ALSA in Android.

1. Use git to obtain the following three ALSA-related packages and place them in the corresponding location.
Git clone git: // android.git.kernel.org/platform/external/alsa-lib.git
Git clone git: // android.git.kernel.org/platform/external/alsa-utils.git
Git clone git: // android.git.kernel.org/platform/hardware/alsa_sound.git

2. Modify the boardconfig. mk file to add
Board_uses_alsa_audio: = true
Build_with_alsa_utils: = true
Then compile the three packages above.
3. Put the ALSA. conf file in the compiled system/etc/directory.
The basic content is as follows (the specific configuration depends on the audio codec used ):
CTL. androidplayback {
Type HW
Card 0
}

CTL. androidcapture {
Type HW
Card 0
}

PCM. androidplayback_speaker_normal {
Type hooks
Slave. PCM {
Type HW
Card 0
Device 1
}

Hooks.0 {
Type ctl_elems
Hook_args [
{
Name = 'mono mixer dac1 switch'
Value = true
}
{
Name = 'mono mixer dac2 switch'
Value = true
}
]
}
}

4. troubleshooting
If you are good at using alsa_amixer and alsa_aplay.

Related Article

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.