androidbluetoothandroid-bluetoothhdmiaudioflinger

Android Framwrork bluetooth A2DP + HDMI


We are developing the Android Framework, and the default of the audio output is HDMI. When the bluetooth is connected with the Android, the audio output will be redirected to the bluetooth via A2DP protocol. How can we route the audio to the bluetooth speaker and the HDMI output at the same time? We have looked framework/base/media/java/android/media/AudioService.java and the frameworks/av/services/audioflinger/AudioFlinger.cpp, but I have no idea now. Does someone has the experience? Thanks!


Solution

  • I am quite certain that this is not possible to do. I am completely convinced that this is something that you shouldn't do. When you send audio over A2DP it is re-encoded, it is not the same audio stream that the one you send over HDMI. They will also be out of sync, since you have completely different delays between A2DP and HDMI.