I had this problem when I first started using mpd, but it was quite some time ago, so I can't exactly remember what I did to fix it!
Do you have PulseAudio preferences installed? I found this tip on a forum:
sudo apt-get install paprefs
Then open PulseAudio prefrences from the menu: System->Preferences->PulseAudio Preferences
Click the Network Server tab, then check the "Enable network access to local sound devices" box, and finally check the "Don't require authentication" box. After that, restart mpd: sudo /etc/init.d/mpd restart
However... I just realized that mpd works fine for me and I don't have "network access to local sound devices" enabled.
I think you might be right about needing to run mpd as the current user, which is what I'm doing. (I have no clue as to why this is though!)
A simple guide to setting up mpd to be run as a user can be found here:
http://gmpc.wikia.com/wiki/MPD_INSTALL_USER_SERVICE_UBUNTU
To sum things up, since you already have mpd installed:
1.) Stop it: sudo update-rc.d mpd disable
2.) Copy your mpdconf to your home directiory (as .mpdconf), and change the following entries to places where your user can access and write to:
music_directory
playlist_directory
db_file
log_file
error_file
pid_file
state_file
The page I'm taking this from suggests just creating a .mpd folder in your home directory for this stuff, save for your actual music directory.
3.) Comment out the user line in .mpdconf:
#user "mpd"
4.) Now you can run mpd and update the database.
5.) To make mpd start up automatically as a user when logging in, go to Startup Applications and add an entry for mpd, then create an autostart file in ~/.config/autostart/.
[Desktop Entry]
Type=Application
Exec=mpd
Hidden=false
NoDisplay=false
Terminal=false
X-GNOME-Autostart-enabled=true
Name[en_US]=Music Player Daemon
Name=Music Player Daemon
Comment[en_US]=plays the music
Comment=plays the music
There are probably downsides to running as a user, so maybe this won't suit your needs.
Finally, better than pulseaudio daemon mode, the best solution is there: it is about running mpd as yourself (and not mpd user) so you have no problem to use your own session pulseaudio.
A different answer , but tested and also working:
configure pulseaudio to run as "daemon mode" instead of the standard "user mode"
- in a terminal, run
sudo gedit /etc/init/pulseaudio.conf
then uncomment line 20 removing #
to get:
start on runlevel [2345]
save and quit gedit.
- Run this 2 commands in a terminal:
sudo usermod -aG pulse,pulse-access mpd
sudo usermod -aG pulse,pulse-access your-login
In the 2nd command, replace "your-login"
Now reboot: hopefully , it will work.
Note: For info, this page lists reasons why you must avoid pulseaudio daemon mode, but i find it ok on a single user pc (especially I see no more cpu/memory usage than user mode).
Best Answer
After reviewing yet another time my settings, I discovered ncmpcpp was in consume mode (it's toggle by pressing R). I hope this answer helps someone else.