audio - DBUS ofono无法与pulseaudio通信
问题描述
我正在尝试使用 ofono-1.18 和 pulseaudio-12.0 设置 bluez-5.50,以便通过蓝牙处理电话。但是,我在 dbus-monitor 上遇到了以下问题。
error time=1539324786.794398 sender=org.freedesktop.DBus -> destination=:1.28 error_name=org.freedesktop.DBus.Error.AccessDenied reply_serial=23
string "Rejected send message, 1 matched rules; type="method_return", sender=":1.28" (uid=0 pid=22288 comm="pulseaudio --realtime ") interface="(unset)" member="(unset)" error name="(unset)" requested_reply="0" destination=":1.25" (uid=0 pid=22285 comm="/usr/sbin/ofonod -d -n ")"
我的 /etc/dbus-1/system.conf 如下:
<policy user="root">
<allow own="org.pulseaudio"/>
<allow own="org.pulseaudio.Server"/>
<allow own="org.ofono"/>
<allow send_destination="org.ofono"/>
<allow send_interface="org.ofono.SimToolkitAgent"/>
<allow send_interface="org.ofono.PushNotificationAgent"/>
<allow send_interface="org.ofono.SmartMessagingAgent"/>
<allow send_interface="org.ofono.PositioningRequestAgent"/>
<allow send_interface="org.ofono.HandsfreeAudioAgent"/>
<allow own="org.bluez"/>
<allow send_destination="org.bluez"/>
<allow send_interface="org.bluez.Agent1"/>
<allow send_interface="org.bluez.MediaEndpoint1"/>
<allow send_interface="org.bluez.MediaPlayer1"/>
<allow send_interface="org.bluez.ThermometerWatcher1"/>
<allow send_interface="org.bluez.AlertAgent1"/>
<allow send_interface="org.bluez.Profile1"/>
<allow send_interface="org.bluez.HeartRateWatcher1"/>
<allow send_interface="org.bluez.CyclingSpeedWatcher1"/>
<allow send_interface="org.bluez.GattCharacteristic1"/>
<allow send_interface="org.bluez.GattDescriptor1"/>
<allow send_interface="org.freedesktop.DBus.ObjectManager"/>
<allow send_interface="org.freedesktop.DBus.Properties"/>
</policy>
据我了解,pulseaudio 和ofono 无法通信,尽管我从ofono 到pulseaudio 得到声音输出。另一个原因可能是 pulseaudio 是用 pulseaudio --start 启动的,但其他守护进程是用 systemd 服务启动的。
过了一会儿,ofon断开了,连蓝牙都断开了。我怀疑这个 dbus 错误可能是造成这种情况的原因。任何指导表示赞赏。
解决方案
- 确保安装了ofono
sudo apt-get install ofono
确保
pulse
创建了用户并且它是bluetooth
组的一部分授予权限将此添加到
/etc/dbus-1/system.d/ofono.conf
(内部<busconfig></busconfig>
):
<policy user="pulse">
<allow send_destination="org.ofono"/>
</policy>
推荐阅读
- php - 选择按天分组的列值总和
- ios - 如何在 Xcode 中支持 iPhone 的多种屏幕尺寸?
- swift - 如何在 Xcode 11 Playground 中使用图像?
- python - 如何将此代码转换为 for 循环格式?
- python - PIP install Wheel 文件有效,但同一软件包的同一版本的 tar 文件无效
- kubernetes - 当部署在一个 pod 中的应用程序调用部署在 minikube 中另一个 pod 中的另一个应用程序时出现问题
- angular - 如何使用 Angular CurrencyPipe 显示以千为单位的货币
- angular - RxJS:通过合并动态添加和删除 Observable
- javascript - 如何在 JavaScript 中旋转色调
- flutter - 省略号多行文本