related to Android audio driver
While I was diving into the Android kernel. I had a question about audio device driver.
People say that... - Android uses ALSA audio driver. - HAL layer is C/C++ library - ALSA driver runs in user space, not in ker开发者_StackOverflownel space
Then, questions: 1. What is the Audio Drivers(I guess it's ALSA driver) in the picture below? ALSA driver should exist in the library portion, isn't it? (http://developer.android.com/guide/basics/what-is-android.html)
2. There should be nothing about audio driver in Android Kernel, if it conforms to the ALSA driver?
- I have a wm8994.c codec source file which drives codec h/w actually. who's going to call the functions in wm8994.c? I think ALSA HAL will. Am I wrong?
I'm very confused...
Thank you ilgimae
I think it is too late to answer, probably you have figured out the answer by now.
The android HAL layer is written is C/C++. According to ALSA framework the driver is not in the userspace. All the apps use the ALSA library which in turn uses the ALSA frmawwork in the kernel, which in turn will use the functions present in the codec driver, which is wm8994.c in this case.
So for question 1: The driver exists in the kernel space, but apps use API defined in the ALSA library (userspace).
for question 2: The source you have is the codec driver, which will exist in the kernel space. The ALSA core will call these functions (via ALSA SoC layer, for system on chips).
hope this helps.
精彩评论