androidbluetoothaudio-recordingmicrophonea2dp

How To Modify Android's Bluetooth Stack to Enable A2dp Sink


I'm working on an audio recorder app that uses a bluetooth mic to record audio on to an Android device (Nexus 7 - rooted Android 4.4.2). It's currently implemented on HFP and everything is working fine. The bluetooth mic is implemented with Bluegiga's WT32 bluetooth module + a mic input, audio quality via HFP isn't great but it's sufficient for now.

However, I'm now trying to change the bluetooth profile to A2dp, since there are two mic inputs (L/R) and WT32 supports A2dp (source). After much research I found that stock Android doesn't support A2dp (sink), and it's possible to modify Android's bluetooth stack to enable A2dp (sink).

What I don't understand is how does one access and modify the bluetooth stack. It would be nice if someone with an answer is able to break-down the steps to achieve this.

I've tried following the answer to this question: Receive audio via Bluetooth in Android, yet I can't seem to find the appropriate file to modify. Actually, I don't even know if I'm looking into the right folder. I've looked through the devices file via Android-studio's DDMS-File Explorer.

ps, I'm still fairly new with Android app development, so I may have misused some of the terminologies and I apologies in-advance for that.


Solution

  • This is actually what I'm trying to do for a long time... The reason you can't find the configuration file is because Google replaced the Bluetooth stack from BlueZ with a new stack built by Google and Broadcom. The new stack uses a different configuration file, which I don't know how to tinker with.

    If you are serious about it, the closest thing I found to start with is the official introduction for the bluetooth framework on Android: https://source.android.com/devices/bluetooth.html