3

I installed MPD, to prevent crackling sound I want to use pulseaudio.

So I configured MPD to use pulseaudio:

audio_output {
  type   "pulse"
  name   "MPD PulseAudio Output"
  server "localhost"
}

But then MPD cannot connect to pulseaudio:

output: Failed to open "Analoge uitgang" [pulse]: failed to connect: Connection refused

Pulseaudio reports nothing more than "access denied, connection closed".

To fix this problem I performed all the steps described here: http://mpd.wikia.com/wiki/PulseAudio

I restarted MPD and Pulseaudio many times and also rebooted the Raspberry pi many times, but it still doesn't work.

How can I give MPD access to Pulseaudio?

I don't think I'm running the X11-bell plugin. I have a recent 512MB raspberry pi model which I run headless with 2012-12-16-wheezy-raspbian. I only installed MPD, Avahi and Samba.

i.amniels
  • 151
  • 1
  • 6

2 Answers2

2

I removed the server setting from MPD and now it works. I added the server setting in the first place to fix an other error.

audio_output {
  type   "pulse"
  name   "MPD PulseAudio Output"
}
i.amniels
  • 151
  • 1
  • 6
0

Maybe you need to add Music Player Daemon user to the audio group.

  1. Look for the user used by MPD:

    $ cat /etc/passwd
    # ...
    # some users
    # ...
    
    # the user you are looking for is probably something like this:
    mpd:x:142:142:Music Player Daemon,,,:/path/to/mpd/home:/bin/false
    
    # ...
    # some others users
    # ...
    

    What you need is the first field of the line (mpd in my example).

  2. Add this user to the audio group:

    $ sudo adduser mpd audio
    
Morgan Courbet
  • 3,703
  • 3
  • 22
  • 38
  • MPD runs under the user mpd and I already added user mpd to the audio group. Didn't fix the problem. Thanks though. The MPD wiki page states that I need to add user mpd to the group pulse-rt, but this group is not on my system. Might this be the problem? – i.amniels Jan 03 '13 at 10:28
  • After Googling a bit, you aren't alone with this problem. In what groups is the user mpd? ($ groups mpd) – Morgan Courbet Jan 03 '13 at 10:50
  • mpd is in groups audio, pulse and pulse-access – i.amniels Jan 03 '13 at 18:29