简体   繁体   English

Android a2dp接收器bluez

[英]android a2dp sink bluez

I'm working on bluetooth tasks. 我正在做蓝牙任务。 As far as I know, bluedroid doesn't support a2dp sink function. 据我所知,bluedroid不支持a2dp接收器功能。 But bluez supports sink function. 但是bluez支持接收器功能。 So I replaced bluedroid with bluez in Android 4.4, and I saw it worked as a source. 因此,我在Android 4.4中将bluedroid替换为bluez,并且看到了它作为源。 (SEE aosp-bluez) But I don't know how to make it work as a sink. (请参阅aosp-bluez)但是我不知道如何使它作为接收器工作。

Q1) is there any way to test or use a2dp sink in the HAL layer with some tools such as haltest, btmgmt, etc? Q1)是否可以使用haltest,btmgmt等工具在HAL层中测试或使用a2dp接收器? Or please let me know how to make bluez work as a sink. 或者,请让我知道如何使bluez作为接收器工作。

Q2) in my opinion, bluez (ver 5.14) itself support a2dp sink, but it seems that AOSP don't support a2dp sink. Q2)在我看来,bluez(5.14版)本身支持a2dp接收器,但是AOSP似乎不支持a2dp接收器。 Therefore, in order to make an app using a2dp sink, it needs making java, jni apis. 因此,为了使用a2dp接收器制作应用程序,需要制作java,jni api。 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. 是的,bluez支持a2dp接收器角色,在这里您可能还需要更改/更新pulseaudio,因为它为两个a2dp接收器/源添加了注册器。 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 您可以通过键入sdptool来浏览本地进行验证,然后需要sdp记录以获得a2dp接收器角色支持,如果不存在,请更新pulseaudio

At the time of posting, you were correct, A2DP Sink was not supported under the AOSP. 在发布时,您是正确的,AOSP不支持A2DP Sink。 That is no longer the case. 这已不再是这种情况。 Bluedroid now has full support for A2DP sink. Bluedroid现在完全支持A2DP接收器。 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. 并且一旦启用它,就需要进行其他工作才能使AudioFlinger将A2DP流输出到扬声器。 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. 我知道音频正在通过蓝牙传输,因为我可以从Bluedroid捕获的btsnoop文件中提取音频。

As everyone answered AOSP default code does not support A2DP sink profile. 每个人都回答了A​​OSP,默认代码不支持A2DP接收器配置文件。 However, Samsung Galaxy S7 and above series phones do support sink role. 但是,三星Galaxy S7及更高系列手机确实支持接收器角色。 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. Galaxy S7及以上系列手机目前只能通过quickconnect应用程序与Tizen Smart TV连接。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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