androidandroid-ndkandroid-audiorecorda2dphfp

Forcing Android A2DP profile to work when we have an active (HFP) Bluetooth SCO connection


As we can connect two bluetooth device with different connection type Phone audio and music audio (i.e HFP profile and A2DP profile respectively). the both device connect simultaneously but HPF has a precedence over A2DP that means when I have an active SCO connection(or a voice call) A2DP stops working. I want them both to work simultaneously. I want to get the audio from the HFP device and play it on the A2DP device. Would like to know some work around if possible even if takes to write a NDK code.


Solution

  • I tried hard but did not find any scalable solution on this lines how ever changing the bluetooth profile of the hardware has solved my problem completely.

    I have used the GATT profile of bluetooth (BLE) and transmitted the audio packets from the custom hardware to the android phone and have written my own logic to decode it. This worked, now i can connect numerous devices and also send the audio acquired to an a2dp device as well.

    note : I still have some latency issue wit this solution but that is another problem to solve.