简体   繁体   中英

Android, msm_pcm_out device and ALSA lib

Could anyone tell me if it is possible to use alsa lib directly in native C code in Android?

Because I must receive raw data from native C code socket fd, I think it is better to play it out in native C, too. I have searched a lot and found that I could play pcm data directly by using msm_pcm_out device, but I could not find this device in my platform. So my last choice is using alsa lib. My questions are:

  1. Could I add msm_pcm_out device by myself ? And use it just like the sample playwav.c?

  2. If adding the msm_pcm_out device is not possible, could I use alsa lib in native C?

  3. If all I mentioned above are impossible, any suggestion?

Thank you.

Search result :

  1. MSM_PCM_* are the specified devices in Qualcomm MSM7K series chip, so other platform would not have this !

  2. It seems that using ALSA lib directly in native C is not possible because the ALSA resource would be engaged by system.

    Update : Use ALSA API to do the play would not work, but record works ! (Strange...)

  3. My last choice might be using the OpenSL ES...

Any suggestion would be appreciated.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM