Connection refused (1) error when using pulsesink


#1

Hi everyone,

My setup is Raspberry Pi 2 with Raspbian operating system. Together with Mopidy running as a service I also use Kodi on that device. Unfortunately Kodi cannot play sounds or has another issues when Mopidy is running and both are using Alsa output. So I installed pulseaudio to cope with this problem. But when I set:

[audio]
output = pulsesink

in mopidy.conf then I cannot play anything with Mopidy. The following error messages are in mopidy log:

2016-02-23 20:39:16,285 ERROR [484:MainThread] mopidy.audio.gst: GStreamer error: gst-resource-error-quark: Failed to connect: Connection refused (1)
2016-02-23 20:39:16,289 WARNING [484:Audio-2] mopidy.audio.actor: Setting GStreamer state to GST_STATE_PLAYING failed

I also found this in /var/log/messages, but don’t know whether it is somehow related:

pulseaudio[1798]: [pulseaudio] server-lookup.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11
pulseaudio[1798]: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbus-daemon without a $DISPLAY for X11

Kodi is able to play sound using pulseaudio flawlessly. For any help will be very grateful!

Many thanks,

Stan


#2

Finally I found the solution here: https://github.com/mopidy/mopidy/issues/954 in post from trygveaa. Added load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1 into /etc/pulse/default.pa and output = pulsesink server=127.0.0.1 into mopidy config.


#3

For anyone else landing here, the Mopidy documentation at https://docs.mopidy.com/en/latest/service/#configure-pulseaudio should be your first port of call.


#4

Thanks for the link! I couldn’t find this page using google search with mopidy and pulseaudio keywords.


#5

funny with that setup i got the exact same error yes, i also put it in my mopidy conf

any other fixes?


#6

I also had the error when adding the configs into pulseaudio and mopidy as described in the doc.

What finally worked for me:

  • install paprefs
  • enable network access (without auth) for localhost
  • restart pulseaudio with sudo killall pulseaudio and pulseaudio --start

Pulsesink stopped working (Linux)