4

I'm running Jessie version on Raspberry Pi2. I'm trying to install Pulseaudio 8 from the source, but having problems running it in system mode with Bluez5 with A2DP support.

On startup in system-wide mode, it fails with "module-bluez5-discover.c: Failed to load module for device /org/bluez/hci0/dev_AC_CF_85_23_8C_78" error when I connect my phone to bluetooth.

If I simply restart pulseaudio under user account using:

pulseaudio -vvvv

and connecting the phone, everything works fine and I can play music via A2DP from the phone.

Pulseaudio is setup to run as systemd service in /etc/systemd/system/pulseaudio.service:

/usr/local/bin/pulseaudio --system --disallow-exit --disable-shm --exit-idle-time=-1 --disallow-module-loading

Here is the verbose log output when it fails to load module:

D: [pulseaudio] bluez5-util.c: dbus: path=/MediaEndpoint/A2DPSink, interface=org.bluez.MediaEndpoint1, member=SetConfiguration
D: [pulseaudio] bluez5-util.c: Transport /org/bluez/hci0/dev_AC_CF_85_23_8C_78/fd3 state changed from disconnected to idle
D: [pulseaudio] module-bluez5-discover.c: Loading module-bluez5-device path=/org/bluez/hci0/dev_AC_CF_85_23_8C_78
W: [pulseaudio] module-bluez5-discover.c: Failed to load module for device /org/bluez/hci0/dev_AC_CF_85_23_8C_78
D: [pulseaudio] bluez5-util.c: Transport /org/bluez/hci0/dev_AC_CF_85_23_8C_78/fd3 available for profile a2dp_source
D: [pulseaudio] bluez5-util.c: Unknown interface org.freedesktop.DBus.Introspectable found, skipping
D: [pulseaudio] bluez5-util.c: Unknown interface org.bluez.MediaPlayer1 found, skipping
D: [pulseaudio] bluez5-util.c: Unknown interface org.freedesktop.DBus.Properties found, skipping

Here is the same section when it manages load the module when I run pulseaudio under normal user account ("pi").

D: [pulseaudio] bluez5-util.c: dbus: path=/MediaEndpoint/A2DPSink, interface=org.bluez.MediaEndpoint1, member=SetConfiguration
D: [pulseaudio] bluez5-util.c: Transport /org/bluez/hci0/dev_AC_CF_85_23_8C_78/fd6 state changed from disconnected to idle
D: [pulseaudio] module-bluez5-discover.c: Loading module-bluez5-device path=/org/bluez/hci0/dev_AC_CF_85_23_8C_78
I: [pulseaudio] module-card-restore.c: Restoring port latency offsets for card bluez_card.AC_CF_85_23_8C_78.
I: [pulseaudio] card.c: Created 1 "bluez_card.AC_CF_85_23_8C_78"
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.CardProfile added for object /org/pulseaudio/core1/card1/profile0
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.CardProfile added for object /org/pulseaudio/core1/card1/profile1
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.CardProfile added for object /org/pulseaudio/core1/card1/profile2
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Card added for object /org/pulseaudio/core1/card1
D: [pulseaudio] module-bluez5-device.c: Acquiring transport /org/bluez/hci0/dev_AC_CF_85_23_8C_78/fd6
I: [pulseaudio] bluez5-util.c: Failed optional acquire of unavailable transport /org/bluez/hci0/dev_AC_CF_85_23_8C_78/fd6
I: [pulseaudio] module-bluez5-device.c: SBC parameters: allocation=0, subbands=1, blocks=3, bitpool=2
I: [pulseaudio] source.c: Created source 1 "bluez_source.AC_CF_85_23_8C_78" with sample spec s16le 2ch 44100Hz and channel map front-left,front-right
I: [pulseaudio] source.c:     bluetooth.protocol = "a2dp_source"
I: [pulseaudio] source.c:     device.description = "Nexus 6P"

The only configuration change that I did to Pulseaudio was in /etc/pulse/system.pa, I added this:

### Bluetooth Support
.ifexists module-bluetooth-discover.so
load-module module-bluetooth-discover
.endif

I think I configured permissions correctly too:

pulse is added to audio pulse is added lp pi user is added to pulse-access

DBUS permissions are set as follows:

<busconfig>
       <policy user="root">
                <allow own="org.pulseaudio.Server"/>
                <allow send_destination="org.bluez"/>
                <allow send_interface="org.bluez.Manager"/>
        </policy>
        <policy user="pulse">
                <allow own="org.pulseaudio.Server"/>
                <allow send_destination="org.bluez"/>
                <allow send_interface="org.bluez.Manager"/>
        </policy>
        <policy context="default">
                <deny own="org.pulseaudio.Server"/>
                <deny send_destination="org.bluez"/>
                <deny send_interface="org.bluez.Manager"/>
        </policy>
</busconfig>

My phone is paired and connected to bluetooth stack fine.

Can anyone help to understand why Pulseaudio doesn't want to work with Bluez in system mode ?

Bugacha
  • 81
  • 1
  • 4

1 Answers1

4

I found the solution for my problem and it's to remove --disallow-module-loading flag. It prevents loading of module-bluez5-device as this module is always loading on-demand and can't be pre-loaded on startup via defaults.pa/system.pa.

Bugacha
  • 81
  • 1
  • 4