You are not logged in.

#1 2017-12-26 13:28:27

EnochRoot
Member
From: Just outside London, UK
Registered: 2015-12-08
Posts: 42

[SOLVED] MPD failing to connect to Pulseaudio on Debian testing

Running Debian testing and just noticed that MPD is no longer playing music, I think since it was upgraded to 0.20.13-1.

PulseAudio is working fine, other applications are able to play music/sounds.

MPD is running as my user, /etc/mpd.conf sets up the normal variables for playlists, DB, log file, pid file etc. Audio output is setup to be

audio_output {
        type            "pulse"
        name            "MPD"
}

When I try to play a track, I get the following output in the mpd.log

Dec 24 19:46 : exception: Failed to enable output "MPD" [pulse]
Dec 24 19:46 : exception: nested: pa_context_connect() has failed: Connection refused

Have tried restarting mpd, pulseaudio and the whole box. Searching on the web hasn't revealed anything recent relating to this issue.

Cheers

Enoch

Last edited by EnochRoot (2017-12-27 15:03:16)

Offline

#2 2017-12-26 13:41:34

Head_on_a_Stick
Member
From: London
Registered: 2015-09-29
Posts: 8,759
Website

Re: [SOLVED] MPD failing to connect to Pulseaudio on Debian testing

Try

mv ~/.pulse{,.bak}

Then reboot.

If it works, merge your configurations back in with reference to /etc/pulse/{default,system}.pa

Source: https://bbs.archlinux.org/viewtopic.php … 7#p1183197


“Et ignotas animum dimittit in artes.” — Ovid, Metamorphoses, VIII., 18.

Forum Rules   •   How to report a problem   •   Software that rocks

Offline

#3 2017-12-26 13:58:00

EnochRoot
Member
From: Just outside London, UK
Registered: 2015-12-08
Posts: 42

Re: [SOLVED] MPD failing to connect to Pulseaudio on Debian testing

Thanks for that, but don't have a ~/.pulse directory, will read through the thread you referenced later, or more realistically tomorrow as about to go out.

Cheers

Enoch

Offline

#4 2017-12-26 16:17:17

ector1935
Member
Registered: 2017-05-03
Posts: 162

Re: [SOLVED] MPD failing to connect to Pulseaudio on Debian testing

I just installed mpd on busenlabs, after seeing your post, everything works, but with pulse I use the following code:

audio_output {
	type		"pulse"
	name		"pulse audio"
    mixer_type  "software" # Or "hardware"
##	server		"remote_server"		# optional
##	sink		"remote_server_sink"	# optional
}
#

Best regards

Offline

#5 2017-12-26 18:05:48

cloverskull
Member
Registered: 2015-10-01
Posts: 307

Re: [SOLVED] MPD failing to connect to Pulseaudio on Debian testing

Is mpd configured to run as your regular user account or some other account?

If it's some other account, it could be that the user is not in the audio group (or similar). Sounds like pulse is rejecting mpd's connection. Could try checking pulse logs, even though I don't know where to find them, I'm sure it's documented somewhere.

Offline

#6 2017-12-27 13:53:30

EnochRoot
Member
From: Just outside London, UK
Registered: 2015-12-08
Posts: 42

Re: [SOLVED] MPD failing to connect to Pulseaudio on Debian testing

Have had some time to do some further investigations. mpd is run under my user account, but it runs from systemd. In order to try and debug things further, I ran mpd from the command line, having stopped mpd and mpd.socket using systemctl.

What do you know, but mpd when run with the command below works perfectly.

mpd --stdout --no-daemon --verbose

Have seen some references to mpd not picking up one of the XDG environment variables when run from systemd, but those are from a few years ago. Am guessing something has changed recently in the way mpd is being started under systemd, so will dig into that a bit further.

Cheers

Enoch

Offline

#7 2017-12-27 15:01:10

EnochRoot
Member
From: Just outside London, UK
Registered: 2015-12-08
Posts: 42

Re: [SOLVED] MPD failing to connect to Pulseaudio on Debian testing

Had seen other posts indicating that mpd might not find the running pulseaudio process if it didn't have XDG_RUNTIME_DIR set correctly, so added the line below to /etc/default/mpd which is picked up by systemd and that fixes the issue after a restart of mpd.

Not sure why it worked previously, but yay.

XDG_RUNTIME_DIR=/run/user/1000

Offline

Board footer

Powered by FluxBB