我正在尝试将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服务启动的。

稍后,ofono断开连接,甚至蓝牙也断开连接。我怀疑此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>
    

    10-08 01:01