iphone - HFP 配置文件与 linux 和 iphone 5

标签 iphone linux bluetooth bluez hfp

如何在我的 ubuntu linux 和 iphone 5s 上使用 hfp?我安装了蓝牙、所有 bluez 软件包和 ofono。

对于ofono,我需要一个调制解调器。根据我从蓝牙核心、协议(protocol)和配置文件规范中了解到的情况,蓝牙的 rfcomm 和 spp 可用于模拟调制解调器。这如何与 bluez 一起使用? bluetoothd 和 ofonod dbus-services 是否已经处理到 hfp 的传入连接,或者我是否必须编写自己的监听器?

编辑:

程序正在运行。我根据测试脚本实现了它。但是我遇到了音频问题,因为我在通话时没有任何声音。声音未静音。

pa 日志(已翻译):

Sep 26 13:57:47 ubu2 pulseaudio[2524]: [alsa-sink-Intel ICH] alsa-sink.c: ALSA woke us up to write new Data on the Device but there was nothing to write!
Sep 26 13:57:47 ubu2 pulseaudio[2524]: [alsa-sink-Intel ICH] alsa-sink.c: This is most probably an Error of the ALSA-Driver 'snd_intel8x0'. Please send this error to the ALSA-Developers.
Sep 26 13:57:47 ubu2 pulseaudio[2524]: [alsa-sink-Intel ICH] alsa-sink.c: We have been woken up by the POLLOUT-Set, but a following call of snd_pcm_avail() returned the value 0 or another value smaller than min_avail.

如何查看 ALSA 是否遇到了一些错误?我没有找到日志。

当连接 a2dp-Profile 让我的电脑成为 iPhone 的扬声器时,我也没有声音。

编辑 2:

要解决此错误,建议这样做:
文件:/etc/pulse/default.pa
tsched=0 添加到以下行:
加载模块模块检测
来自帖子 #21 https://bugs.launchpad.net/ubuntu/+source/linux/+bug/374002

但这并没有解决我的问题。我也尝试强制加载其他模块。

最佳答案

有ofono和bluez就够了。

但是,最新版本的 bluez/ofono 和 pulseaudio 不支持 HSP 和 HFP 配置文件。 Pulseaudio 发行说明说 bluez5.x 仅支持 A2DP。如果您正在使用 bluez4.x、ofono 和 pulseaudio 4.x/5.x 你可能仍然可以毫无问题地工作。

http://www.freedesktop.org/wiki/Software/PulseAudio/Notes/5.0/

ofono 会将您的 iPhone 5s 视为您的调制解调器。配对并连接 iPhone 后 通过 bluetoothctl 或任何替代 GUI,您可以运行以下 ofono 测试以查看 如果ofono选对了。尝试在终端上使用 ofonod -n -d 运行 ofonod 以监控调试日志,并可能也以详细方式运行 pulseaudio (pulseaudio -k && pulseaudio -v)

bash$ cd */ofono-1.x/test

此目录包含用于测试 ofono 功能的示例 dbus 脚本。

bash$ ./list-modems

[ /hfp/org/bluez/hci0/dev_94_94_26_88_XX_XX ]
    Type = hfp
    Interfaces = org.ofono.Siri org.ofono.VoiceCallManager org.ofono.CallVolume org.ofono.Handsfree org.ofono.NetworkRegistration 
    Features = net 
    Serial = 94:94:26:88:XX:XX
    Online = 1
    Powered = 1
    Lockdown = 0
    Emergency = 0
    Name = XXXXXX’s iPhone
    [ org.ofono.Siri ]
        EyesFreeMode = disabled
        Enabled = 1
    [ org.ofono.VoiceCallManager ]
        EmergencyNumbers = 08 000 999 110 112 911 118 119 
    [ org.ofono.CallVolume ]
        Muted = 0
        SpeakerVolume = 50
        MicrophoneVolume = 50
    [ org.ofono.Handsfree ]
        VoiceRecognition = 0
        InbandRinging = 1
        Features = three-way-calling echo-canceling-and-noise-reduction voice-recognition release-all-held release-specified-active-call private-chat create-multiparty 
        BatteryChargeLevel = 4
        SubscriberNumbers = +XXXXXXXXXXXX
        EchoCancelingNoiseReduction = 1
    [ org.ofono.NetworkRegistration ]
        Status = registered
        Name = XXX XXXXXX
        Mode = auto-only
        Strength = 60

如果您看到类似于上面的输出,请启用调制解调器并尝试使用以下命令拨号 如果 SCO 套接字被创建或拒绝,命令并观察 ofono 调试日志。而且当然, 查看音频是否路由到 Ubuntu。

bash$ ./enable-modem

bash$ ./dial-number +XXXXXXXXXXXX
...

同样,尝试调出您的 iPhone 并观察 ofono、pulseaudio 日志。 bash$ ./接听电话

看起来 pulseaudio 的人们正试图让这个与 bluez5.x 和 ofono 一起工作但是 似乎还没有公开可用的补丁。该错误正在此处跟踪: https://bugs.freedesktop.org/show_bug.cgi?id=73325

关于iphone - HFP 配置文件与 linux 和 iphone 5,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25033052/

相关文章:

python - 添加路径和从 Python 调用外部程序时出现问题

linux - 如何查找 Linux 服务器上安装的 Oracle 版本(在终端中)

ios - GKSession:发送字符串数组

iphone - 有没有一种方法可以检查点是否与矩形相交?

C# 等效于 stringByAddingPercentEscapesUsingEncoding?

iphone - UITableViewCell 中的 NSCF 类型值

java - fetchUuidWithSdp 总是给出缓存的 UUID

ios - 在 ios 应用程序中使用 svg 或字体图标

linux - 将标准错误发送到标准输出不起作用

mobile - 跨平台蓝牙互操作性