Thursday, November 4, 2010

Run Pulseaudio and MPD as own user

Oh huh.. I've ran into some meany troubles when installing MPD. It just didn't want to talk to Pulseaudio if it runs as systemwide daemon.

Solutions: Start MPD as your user or the Pulseaudio daemon systemwide.
Problem: Every Howto for Pulseaudio told me how bad and very bad and very very bad it is to run it systemwide ~.~

Okey.. not a big deal. Let's just set up MPD with your own user..

First of all install MPD:

emerge mpd -avq

I'm using the following useflags for it:

aac alsa avahi bzip2 curl ffmpeg fifo flac id3 ipv6 jack lame lastfmradio libsamplerate mad mikmod network ogg pulseaudio tcpd unicode vorbis wavpack -ao -audiofile -cdio -cue -debug -doc -fluidsynth -libmms -modplug -mpg123 -musepack -oss -pipe -profile -sid -sndfile -sqlite -twolame -zip

Some of them might not be available on every system because I'm using the live version from mpd overlay. It's available in layman.

Now the /etc/mpd.conf needs to go to the right place:

mkdir -p ~/.config/mpd/
cp /etc/mpd.conf ~/.config/mpd/


And finally some edits in the config.. mine looks like this:

music_directory "/mnt/media/music/collection"
playlist_directory "/mnt/media/music/playlists"
db_file "~/.config/mpd/database"
log_file "~/.config/mpd/mpd.log"
pid_file "/var/run/mpd/mpd.pid"
state_file "~/.config/mpd/state"
bind_to_address "localhost"
audio_output {
type "pulse"
name "MPD"
}
replaygain "album"
replaygain_preamp "0"
volume_normalization "yes"

Everything else is commented out.

So far so good.. mpd should be able to run now.

mpd ~/.config/mpd/mpd.conf


I've put this line into my autostart.sh of Openbox. It's using really less CPU while idling so I really don't mind. Some frontends are able to start and stop it too but I'm switching the frontends sometimes for tests and silly things.

No comments:

Post a Comment