Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

I am trying to use mpd with PulseAudio output. Thus I wrote the following in /etc/mpd.conf:

music_directory "/mnt/dados/Musicas"
playlist_directory "~/.mpd/playlists"
db_file "~/.mpd/mpd.db"
log_file "~/.mpd/mpd.log"
pid_file "~/.mpd/mpd.pid"
state_file "~/.mpd/mpdstate"
user "renan"

audio_output {
   type         "pulse"
   name         "MPD Output"
}

mixer_type         "software"

mpd is running as user renan. However, I get no output; appears this in mpd.log:

Feb 15 20:24 : output: Failed to enable "MPD Output" [pulse]: pa_context_connect() has failed: Connection refused
Feb 15 20:24 : output: Failed to enable "MPD Output" [pulse]: pa_context_connect() has failed: Connection refused
Feb 15 20:24 : output: Failed to enable "MPD Output" [pulse]: pa_context_connect() has failed: Connection refused
Feb 15 20:24 : output: Failed to enable "MPD Output" [pulse]: pa_context_connect() has failed: Connection refused
Feb 15 20:24 : output: Failed to enable "MPD Output" [pulse]: pa_context_connect() has failed: Connection refused
Feb 15 20:24 : output: Failed to enable "MPD Output" [pulse]: pa_context_connect() has failed: Connection refused

If I try to use ALSA by adding the lines below to /etc/mpd.conf, mpd works but it blocks the audio device: if I open any other software that plays sound it will be unable to play sound, and vice-versa.

audio_output {
   type         "alsa"
   name         "My ALSA Device"
   device         "hw:0,0"  
   format         "44100:16:2"   
}

The rest of my system has no problem outputting audio through PulseAudio. What am I doing wrong?

I run x64 Arch Linux and have the following MPD/PulseAudio related packages installed:

lib32-libpulse 3.0-1
libmpd 11.8.17-1
libmpdclient 2.7-1
libpulse 3.0-2
mpd 0.17.3-1
mpdscribble 0.22-6
pulseaudio 3.0-2
pulseaudio-alsa 2-2
python2-mpd 0.3.0-4
share|improve this question
    
According to the mpd wiki entry, your .conf for Pulse should read: audio_output { type "pulse" name "pulse audio" } –  jasonwryan Feb 15 '13 at 23:01
    
I tried this; did not work. –  Renan Feb 15 '13 at 23:07
    
I've got the same problem on Arch. Unfortunately I just drop mpd. –  Mateusz Jagiełło Feb 15 '13 at 23:08
1  
Found something here: bbs.archlinux.org/viewtopic.php?id=155456 –  Renan Feb 15 '13 at 23:09
add comment

2 Answers

up vote 0 down vote accepted

Apparently it is a known problem since the migration to systemd. Worked around by editing the /usr/lib/systemd/system/mpd.service file and adding the lines

[Service]
User=renan
PAMName=system-local-login

(replace renan by your username)

Then, if it works, it should appear in the PulseAudio mixer with the name you gave in the configuration file:

enter image description here

share|improve this answer
add comment

User "renan" must be a member of group "audio". Do

$ sudo usermod -a -G audio renan
share|improve this answer
    
I am already a member of this group. –  Renan Mar 8 '13 at 1:09
add comment

We're looking for long answers that provide some explanation and context. Don't just give a one-line answer; explain why your answer is right, ideally with citations. Answers that don't include explanations may be removed.

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.