You are not logged in.

#1 2011-10-08 15:21:28

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

mpd and pulse problem - Connection refused [SOLVED]

I'm having problems getting mpd to play nice with pulse-audio.  Pulse is installed and works with vlc, mplayer, flash, etc. just fine.  When I try to play through mpd the song in the gui simply shows a status of "paused" and the following gets written to the mpd.log. 

Advice is appreciated.

# tail -f /var/log/mpd/mpd.log
Oct 08 11:12 : output: Failed to enable "pulse audio" [pulse]: pa_context_connect() has failed: Connection refused
Oct 08 11:12 : output: Failed to enable "pulse audio" [pulse]: pa_context_connect() has failed: Connection refused
Oct 08 11:12 : output: Failed to enable "pulse audio" [pulse]: pa_context_connect() has failed: Connection refused
Oct 08 11:12 : player_thread: problems opening audio device while playing "Not_So_Hard_Stuff/Disturbed-The Sickness-2000/01_Voices.flac"

Here is my mpd.conf

$ sed '/#/d' /etc/mpd.conf
music_directory		"/media/data/all_genres"
playlist_directory	"/var/lib/mpd/playlists"
db_file			"/var/lib/mpd/mpd.db"
log_file		"/var/log/mpd/mpd.log"
pid_file		"/var/run/mpd/mpd.pid"
state_file		"/var/lib/mpd/mpdstate"
user "mpd"

gapless_mp3_playback			"yes"
zeroconf_enabled		"yes"
zeroconf_name			"Music Player"

input {
        plugin "curl"
}

audio_output {
	type		"pulse"
	name		"pulse audio"
}

mixer_type			"software"
audio_buffer_size "35000"
buffer_before_play "5%"

The pulseaudio wiki suggests that a 'pulse' group and 'pulse-access' and even 'pulse-rt' groups may be required?  I have used mpd for a year now with no such groups on my system.

EDIT: solved in post #13

Last edited by graysky (2011-10-16 13:42:46)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#2 2011-10-09 17:04:13

teletrabi
Member
Registered: 2008-01-29
Posts: 6

Re: mpd and pulse problem - Connection refused [SOLVED]

Same problem here -  for now. My config already worked without these groups...but also doesn't work with them.
May be there was an update of mpd or pulse in the last days?

Offline

#3 2011-10-09 21:38:47

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,912
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

teletrabi wrote:

Same problem here -  for now. My config already worked without these groups...but also doesn't work with them.
May be there was an update of mpd or pulse in the last days?

with mpd-git all is fine...


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#4 2011-10-09 21:56:07

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

mpd-git for me has the same behavior.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#5 2011-10-10 05:54:09

heftig
Developer
From: Germany
Registered: 2010-04-19
Posts: 148

Re: mpd and pulse problem - Connection refused [SOLVED]

Recent PulseAudio requires a DBus session daemon, and recent DBus refuses to autolaunch without X.

Make sure either PulseAudio or DBus (so pulse can autospawn) is running when you start MPD.

Offline

#6 2011-10-10 08:30:27

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

@heftig - thanks for the info.  I saw the dbus error and did just that - started it manually from X.  I still get the same error.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#7 2011-10-10 10:48:23

hokasch
Member
Registered: 2007-09-23
Posts: 1,461

Re: mpd and pulse problem - Connection refused [SOLVED]

Is pulseaudio really running when you start mpd? IIRC I had similar problems due to pulseaudio's idle timeout (daemon quits but can not autospawn because of no dbus). You could run pulseaudio with -vvv in a seperate screen to check if it stays up.

EDIT: Hmm, odd. Just checked my daemon.conf, and "exit-idle-time = -1" is commented. But I defintely had problems with the auto-quit.

Last edited by hokasch (2011-10-10 10:51:46)

Offline

#8 2011-10-10 18:43:56

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

@hokasch - yes, it is running

$ pg pulse
USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND
facade   1888  0.0  0.0 239152  6460 ?        S<l  14:32   0:00 /usr/bin/pulseaudio --start
facade   1902  0.0  0.0  93668  2844 ?        S    14:32   0:00 /usr/lib/pulse/gconf-helper

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#9 2011-10-10 21:14:37

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

Very odd.  From within an xfce-session, if I start mpd then try to play a song, here is the output recorded to /var/log/errors.log:

Oct 10 17:10:53 localhost pulseaudio[5128]: [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
Oct 10 17:10:53 localhost pulseaudio[5125]: [pulseaudio] main.c: Daemon startup failed.

It doesn't matter if I start xfce from runmode 3 via "xinit" or from gdm.

$ cat ~/.xinitrc 
#!/bin/sh
exec ck-launch-session startxfce4
#exec ck-launch-session gnome-session
#enlightenment-session

Last edited by graysky (2011-10-10 21:22:00)


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#10 2011-10-11 12:13:28

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

I just did a fresh install of arch to a spare partition, added xfce4, pulseaudio and mpd.  Same problem as described above so I opened this bug report.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#11 2011-10-16 08:42:46

Strider
Member
From: Belgium
Registered: 2009-08-04
Posts: 96

Re: mpd and pulse problem - Connection refused [SOLVED]

I confirm this bug.
My mpd client (sonata) refuses to work under gnome 3.2 when mpd is configured with pulseaudio output. With alsa outpur all works fine.


Win XP -> Ubuntu -> Fedora -> Arch -> Arch -> Arch -> Ar...

Offline

#12 2011-10-16 11:26:49

oilgame
Member
Registered: 2010-01-19
Posts: 41

Re: mpd and pulse problem - Connection refused [SOLVED]

I was struggling with this yesterday and I finally got it working by opening the X11 session to mpd: "xhost +local:mpd". Today even this doesn't seem to work hmm

Offline

#13 2011-10-16 13:42:19

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

I too modified my /etc/mpd.conf to use alsa even though I don't have alsa-utils installed at all.

$ sed '/#/d' /etc/mpd.conf
music_directory		"/media/data/all_genres"
playlist_directory	"/var/lib/mpd/playlists"
db_file			"/var/lib/mpd/mpd.db"
log_file		"/var/log/mpd/mpd.log"
pid_file		"/var/run/mpd/mpd.pid"
state_file		"/var/lib/mpd/mpdstate"
user "mpd"

gapless_mp3_playback			"yes"
zeroconf_enabled		"yes"
zeroconf_name			"Music Player"

input {
        plugin "curl"
}

audio_output {
type		"alsa"
name		"My ALSA Device"
}

mixer_type			"software"
audio_buffer_size "35000"
buffer_before_play "5%"

CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#14 2011-10-16 15:24:54

oilgame
Member
Registered: 2010-01-19
Posts: 41

Re: mpd and pulse problem - Connection refused [SOLVED]

graysky wrote:

I too modified my /etc/mpd.conf to use alsa even though I don't have alsa-utils installed at all.

$ sed '/#/d' /etc/mpd.conf
music_directory		"/media/data/all_genres"
playlist_directory	"/var/lib/mpd/playlists"
db_file			"/var/lib/mpd/mpd.db"
log_file		"/var/log/mpd/mpd.log"
pid_file		"/var/run/mpd/mpd.pid"
state_file		"/var/lib/mpd/mpdstate"
user "mpd"

gapless_mp3_playback			"yes"
zeroconf_enabled		"yes"
zeroconf_name			"Music Player"

input {
        plugin "curl"
}

audio_output {
type		"alsa"
name		"My ALSA Device"
}

mixer_type			"software"
audio_buffer_size "35000"
buffer_before_play "5%"

Doesn't work for me sad I get this error when I try to play something with your configuration:

ALSA lib pulse.c:229:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Oct 16 18:23 : output: Failed to open "My ALSA Device" [alsa]: Failed to open ALSA device "default": Connection refused

Offline

#15 2011-10-16 15:37:59

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

@og - sorry, I don't know what to say hmm


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#16 2011-10-16 16:12:59

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,912
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

why dont you guys run mpd as your own user? your music files normally belong to you anyway... and pulseaudio is a userprocess, so its destined to have issues otherwise...


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#17 2011-10-16 16:57:21

oilgame
Member
Registered: 2010-01-19
Posts: 41

Re: mpd and pulse problem - Connection refused [SOLVED]

Rasi wrote:

why dont you guys run mpd as your own user? your music files normally belong to you anyway... and pulseaudio is a userprocess, so its destined to have issues otherwise...

At least I don't want to give unnecessary rights for processes, my main user's home directory is encrypted and some of us have multiple users..

Last edited by oilgame (2011-10-16 16:59:08)

Offline

#18 2011-10-16 17:48:50

graysky
Wiki Maintainer
From: :wq
Registered: 2008-12-01
Posts: 10,075
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

Running as an mpd user is adventitious for several reasons: any user can interact with the player and playing continues when you log out of X.


CPU-optimized Linux-ck packages @ Repo-ck  • AUR packagesZsh and other configs

Offline

#19 2011-10-18 11:13:45

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,912
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

graysky wrote:

Running as an mpd user is adventitious for several reasons: any user can interact with the player and playing continues when you log out of X.

the mpd process is not dependent on X at all, doesnt matter what user you start it with smile
and the first argument can be circumvented by using mpd access rights (see mpd.conf)


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

#20 2011-10-18 11:21:54

SanskritFritz
Member
From: Budapest, Hungary
Registered: 2009-01-08
Posts: 1,830
Website

Re: mpd and pulse problem - Connection refused [SOLVED]

graysky wrote:

Running as an mpd user is adventitious for several reasons: any user can interact with the player and playing continues when you log out of X.

I honestly thought that this was the whole point of using mpd...


zʇıɹɟʇıɹʞsuɐs AUR || Cycling in Budapest with a helmet camera || Revised log levels proposal: "FYI" "WTF" and "OMG" (John Barnette)

Offline

Board footer

Powered by FluxBB