简体   繁体   English

BlueZ vs Bluedroid蓝牙堆栈

[英]BlueZ vs Bluedroid bluetooth stack

BlueZ have a lot of documentations and all. BlueZ有很多文档和所有文档。 And from the same, i understood BlueZ supports A2DP sink support. 同样,我了解BlueZ支持A2DP接收器支持。 And at the same time an android device can be made act as an A2DP sink by modifying the audio.conf file inside the same. 同时,通过修改同一个内部的audio.conf文件,可以使android设备充当A2DP接收器。

I also came to know that from android 4.2 onwards, the BlueZ stack was replaced by Broadcom's Bluedroid stack. 我也知道从android 4.2开始,BlueZ堆栈被Broadcom的Bluedroid堆栈取代。 I searched a lot about Bluedroid stack. 我搜索了很多关于Bluedroid堆栈的信息。 But i was not able to find much details about the same. 但我无法找到相同的细节。

Hope someone can help me with the following doubts. 希望有人可以帮我解决以下疑问。

1). 1)。 Whether Bluedroid have A2DP sink support? Bluedroid是否支持A2DP接收器?

2). 2)。 Whether the audio.conf file will be available for devices having bluedroid stack? audio.conf文件是否可用于具有bluedroid堆栈的设备?

3). 3)。 I am going to write an A2DP sink support for an android device by directly calling API's of BlueZ stack. 我将通过直接调用BlueZ堆栈的API来为Android设备编写A2DP接收器支持。 But my final question is whether the same can be used with Bluedroid stack also? 但我最后的问题是Bluedroid堆栈是否也可以使用相同的? Hope Bluedroid is just an expansion of BlueZ. 希望Bluedroid只是BlueZ的扩展。

Please help. 请帮忙。

Bluedroid is a stack provided by Broadcom and is now opensource in android . Bluedroid是Broadcom提供的一个堆栈,现在是android中的opensource。 Bluedroid is not related with bluez in any respect, it has few advantages over bluez(i differ to that). Bluedroid在任何方面都与bluez无关,它与bluez相比几乎没有优势(我与此不同)。

[1]. [1]。 Bluedroid does not have a2dp sink support as of now, as per code available source code only a2dp source support is available 截至目前,Bluedroid没有a2dp接收器支持,根据代码可用源代码,只有a2dp源支持可用

[2]. [2]。 Audio.conf file is for bluez stack, it is not a part of bluedroid Audio.conf文件用于bluez堆栈,它不是bluedroid的一部分

[3]. [3]。 Directly calling Bluez API-- i think you will use dbus calls but bluedroid does not support dbus method calls, it has a callback mechanism implemented, so it will not work, bluedroid is not an expansion of bluez. 直接调用Bluez API--我认为你会使用dbus调用但是bluedroid不支持dbus方法调用,它有一个实现的回调机制,所以它不起作用,bluedroid不是bluez的扩展。

A2DP Sink role is now supported in Android Lollipop (5.0). Android Lollipop(5.0)现在支持A2DP Sink角色。 They have modified the Bluedroid source code to support the same. 他们修改了Bluedroid源代码以支持相同的功能。 To completely support it , you need to modify the audio HAL (audio.h), AudioPolicyManagerBase.cpp and audio_policy.conf and Also Audio Manager, A2DPStateMachine etc. 要完全支持它,您需要修改音频HAL(audio.h),AudioPolicyManagerBase.cpp和audio_policy.conf以及音频管理器,A2DPStateMachine等。

As user987500 said, A2DP sink is supported in android L,only make minor modification, you device can changed from A2DP src to sink. 正如user987500所说,android L支持A2DP接收器,只做了一些小修改,你的设备可以从A2DP src改为sink。 But be sure only one role can be supported for one device, which can be configured from xml file. 但请确保一个设备只能支持一个角色,可以从xml文件配置。

Adding to the above answers, since Android L, sink support is introduced but still Audio streaming portion of code is not completed. 除了上面的答案,自从Android L,引入了支持,但仍然没有完成代码的音频流部分。 However, I have found this change list where a2dp sink implementation is completed and media can be played through sink device as mentioned in the commit message of the change list: 但是,我找到了这个更改列表,其中完成了a2dp接收器实现,并且可以通过接收器设备播放媒体,如更改列表的提交消息中所述:

Bluetooth A2DP Sink 蓝牙A2DP接收器

The change implements the A2DP sink feature. 此更改实现了A2DP接收器功能。 If the android device is a sink role, it can receive music from phone via BT. 如果Android设备是接收器角色,它可以通过BT从手机接收音乐。 This feature can be apply in multimedia car kit, set-top box and family HiFi. 此功能适用于多媒体车载套件,机顶盒和家庭HiFi。 Set BLUETOOTH_A2DP_SINK := true in BoardConfig.mk to enable A2DP Sink featue in bluedroid. 在BoardConfig.mk中设置BLUETOOTH_A2DP_SINK:= true以在bluedroid中启用A2DP Sink特征。

You also need the changes below in framework to route music to speaker. 您还需要在框架中进行以下更改,以便将音乐路由到扬声器。 https://android-review.googlesource.com/#/c/97832/ https://android-review.googlesource.com/#/c/97853/ https://android-review.googlesource.com/#/c/97833/ https://android-review.googlesource.com/#/c/98130/ https://android-review.googlesource.com/#/c/98131/ https://android-review.googlesource.com/#/c/97832/ https://android-review.googlesource.com/#/c/97853/ https://android-review.googlesource.com/#/ c / 97833 / https://android-review.googlesource.com/#/c/98130/ https://android-review.googlesource.com/#/c/98131/

This change does not include SBC decoder. 此更改不包括SBC解码器。 You can get a SBC decoder from github.com/tieto/sbc-decoder. 你可以从github.com/tieto/sbc-decoder获得一个SBC解码器。

All the best!!! 祝一切顺利!!!

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

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