How can I enable the new Bluetooth A2DP Sink feature introduced in Lollipop?

7.1k views Asked by At

I am attempting to modify the AOSP android image for Nexus 5 to include support for Bluetooth A2DP Sink. I've found that Google was nice enough to include a hidden build target for the Nexus 5.

https://android.googlesource.com/device/lge/hammerhead/+/android-5.0.1_r1/car_hammerhead.mk

That includes modified Bluedroid configuration files that allow the device to advertise the A2DP Sink service over Bluetooth. It also changes the class of device to be a Bluetooth Automative Carkit and modifies the configuration of the Bluetooth.apk to support A2DP Sink and the AVRCP controls service.

This got me about 75% of the way there. I tested this much out by grabbing a KitKat phone and pairing to the modified build on the Nexus 5. It correctly advertises the A2DP Sink service and allows my KitKat phone to connect to the A2DP Sink Service. From the KitKat phone, it appeared to even allow me to stream music to the Nexus 5. But music is never heard on the Nexus 5. I even captured the HCI traffic on the Nexus 5 and found that the music is in fact getting streamed to the phone.

The issue is that the Bluetooth device receives the audio stream, but the audio is never routed to the speakers. Does anyone have any idea how I can route the A2DP stream to the Nexus 5's speakers?

0

There are 0 answers