mpd in debian jessie using pulse audio

I've used mpd on various desktops for a long time, and I've always just set the output directly in the mpd.conf file, but that leads to the sound device being tied up if you ever want to do anything else with it. I finally got around to setting this up properly with pulse audio. This setup uses mpd running as the mpd user, and sets up pulse audio (which is running as the desktop user) to allow network access on localhost. MPD then connects to pulse audio to send the audio stream.

# give mpd access to use pulse
sudo usermod -aG pulse,pulse-access mpd

# configure pulse to allow access from localhost
echo "load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1" >> /etc/pulse/default.pa

# restart pulse audio as the user
pulseaudio --kill
pulseaudio --start

Then configure /etc/mpd.conf with the following audio_output:

audio_output {
      type            "pulse"
      name            "MPD PulseAudio Output"
      server          "127.0.0.1"
      # set sink to name from "pacmd list-sinks"
      sink            "alsa_output.usb-Burr-Brown_from_TI_USB_Audio_DAC-00-DAC.analog-stereo"
}

Restart mpd, and then it should start playing through pulse audio. (should be able to see it playing in pavucontrol). Lots more detailed information here for different configurations: http://mpd.wikia.com/wiki/PulseAudio


Previous: hacking a logic controls cr3003 usb cash drawer Next: wordpress plugin update error: PCLZIP_ERR_BAD_FORMAT