简体   繁体   中英

android a2dp sink bluez

I'm working on bluetooth tasks. As far as I know, bluedroid doesn't support a2dp sink function. But bluez supports sink function. So I replaced bluedroid with bluez in Android 4.4, and I saw it worked as a source. (SEE aosp-bluez) But I don't know how to make it work as a sink.

Q1) is there any way to test or use a2dp sink in the HAL layer with some tools such as haltest, btmgmt, etc? Or please let me know how to make bluez work as a sink.

Q2) in my opinion, bluez (ver 5.14) itself support a2dp sink, but it seems that AOSP don't support a2dp sink. Therefore, in order to make an app using a2dp sink, it needs making java, jni apis. Am I right?

Yes bluez supports a2dp sink role, here maybe you need to change/update pulseaudio also because it is the which adds the registor for both a2dp sink/source. You can verify by typing sdptool browse local then you need to sdp record for a2dp sink role support, If its is not present then update the pulseaudio

At the time of posting, you were correct, A2DP Sink was not supported under the AOSP. That is no longer the case. Bluedroid now has full support for A2DP sink. However, it appears it is not enabled upon a default compilation of the stack. And once you do enable it, there is additional work required in order to get the AudioFlinger to output the A2DP stream to the speakers. I haven't yet achieved this. I know that the audio is being transferred over Bluetooth, because I can extract the audio from the btsnoop file captured by Bluedroid.

As everyone answered AOSP default code does not support A2DP sink profile. However, Samsung Galaxy S7 and above series phones do support sink role. But right now there seems to be limitation in sink functionality of the phone. Galaxy S7 and above series phones can only connect with Tizen Smart TVs at present through quickconnect app.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM