如何修改 Android 的蓝牙堆栈以启用 A2dp 接收器 [英] How To Modify Android's Bluetooth Stack to Enable A2dp Sink

查看:41
本文介绍了如何修改 Android 的蓝牙堆栈以启用 A2dp 接收器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一款使用蓝牙麦克风将音频录制到 Android 设备(Nexus 7 - 根植于 Android 4.4.2)的录音机应用.它目前在 HFP 上实施,一切正常.蓝牙麦克风是通过 Bluegiga 的 WT32 蓝牙模块 + 麦克风输入实现的,通过 HFP 的音频质量不是很好,但现在已经足够了.

但是,我现在正在尝试将蓝牙配置文件更改为 A2dp,因为有两个麦克风输入 (L/R) 并且 WT32 支持 A2dp(来源).经过大量研究,我发现库存 Android 不支持 A2dp(接收器),并且可以修改 Android 的蓝牙堆栈以启用 A2dp(接收器).

我不明白的是如何访问和修改蓝牙堆栈.如果有答案的人能够分解实现这一目标的步骤,那就太好了.>

我已尝试按照此问题的答案进行操作:在 Android 中通过蓝牙接收音频,但我似乎找不到适当的文件进行修改.实际上,我什至不知道我是否正在查看正确的文件夹.我已经通过 Android-studio 的 DDMS-File Explorer 查看了设备文件.

ps,我对 Android 应用程序开发还很陌生,所以我可能误用了一些术语,我提前道歉.

解决方案

这实际上是我尝试了很长时间...找不到配置文件的原因是谷歌用谷歌和博通构建的新堆栈替换了BlueZ的蓝牙堆栈.新堆栈使用了不同的配置文件,我不知道如何修改.

如果你是认真的,我发现最接近的开始是Android上蓝牙框架的官方介绍:https://source.android.com/devices/bluetooth.html

I'm working on an audio recorder app that uses a bluetooth mic to record audio on to an Android device (Nexus 7 - rooted Android 4.4.2). It's currently implemented on HFP and everything is working fine. The bluetooth mic is implemented with Bluegiga's WT32 bluetooth module + a mic input, audio quality via HFP isn't great but it's sufficient for now.

However, I'm now trying to change the bluetooth profile to A2dp, since there are two mic inputs (L/R) and WT32 supports A2dp (source). After much research I found that stock Android doesn't support A2dp (sink), and it's possible to modify Android's bluetooth stack to enable A2dp (sink).

What I don't understand is how does one access and modify the bluetooth stack. It would be nice if someone with an answer is able to break-down the steps to achieve this.

I've tried following the answer to this question: Receive audio via Bluetooth in Android, yet I can't seem to find the appropriate file to modify. Actually, I don't even know if I'm looking into the right folder. I've looked through the devices file via Android-studio's DDMS-File Explorer.

ps, I'm still fairly new with Android app development, so I may have misused some of the terminologies and I apologies in-advance for that.

解决方案

This is actually what I'm trying to do for a long time... The reason you can't find the configuration file is because Google replaced the Bluetooth stack from BlueZ with a new stack built by Google and Broadcom. The new stack uses a different configuration file, which I don't know how to tinker with.

If you are serious about it, the closest thing I found to start with is the official introduction for the bluetooth framework on Android: https://source.android.com/devices/bluetooth.html

这篇关于如何修改 Android 的蓝牙堆栈以启用 A2dp 接收器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆