androidaudioshared-librariesaudioflinger

Implement custom Android's libaudio.so or "how does audio work on Android?"


I'm discovering Android >4.0 at the moment and have some questions I cannot figure out by myself, maybe you can help me.

I found out, that some market-apps, like "AlsaMixer" or "MixGet with ALSA", put a library called "libaudio.so" into "/system/lib/" (with user-assistance).

I wondered what's happening and after searching a while, it seems that every Android-company can create a libaudio.so which implemented a certain C++-interface and put it into that path.

Android then takes this library for audio-handling (there exist implementations for ALSA, TinyALSA and others)?

But: On my phone is no such libaudio.so - how does this work? What is taken otherwise? I found out that I have a "libasound.so" in that directory, is that the default?

If I would try to implement my own libaudio.so (with my little knowledge at the moment), can I reference the "default"-library in it?

I think "hey, there exists a working audio-implementation on every phone in the world and I just want to extend it and not re-engineer (re-configure) the wheel?"

I mean:

AudioFlinger -> my custom libaudio.so -> default-library (libasound.so?) -> speakers

And what if there is already a libaudio.so on my phone?

I would be really thankful about every helpful answer. Maybe someone has an address for me, understandable for a beginner?

Thanks in advance & kind regards!


Solution

  • I now found a good & understandable graphic with great descriptions, how e.g. the audio is routed through an Android:

    Android Services Black Magic - Marakana (Page 10+11)

    But also many thanks to t0mm13b who prevented me from going the wrong way with libaudio.so.