Media Player Daemon

From Paldo

Jump to: navigation, search

This article covers the basic tasks which are needed to run mpd (media player daemon) on paldo.

Contents

[edit] Install Packages

Installing mpd is as easy as:

$upkg-install mpd

If you wish to scrobble the played songs, you can also install mpdscribble:

$upkg-install mpdscribble

[edit] Configure mpd

The entire mpd configuration is done in one single file which you save in ~/.mpdconf For a basic setup you need something like this:

port                    "6600"
music_directory         "~/media/audio"
playlist_directory      "~/.mpd/playlists"
db_file                 "~/.mpd/mpd.db"
log_file                "~/.mpd/mpd.log"

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

password                "topsecret@read,add,control,admin"

mixer_type              "software"

The config values are pretty easy to understand:

  • port = defines the port on which mpd listens
  • music_directory = path to your media library
  • playlist_directory = path where the playlists are stored
  • db_file = path to the mpd database file containing track infos
  • log_file = path to the log file
  • audio_output = defines how to output the audio stream
  • password = defines a password which the client needs to pass for the defined actions
  • mixer_type = defines the volume control settings

In this case we use the shiny and awesome PulseAudio as output sink and a software mixer (on my machine the hardware mixer gave me an error on several clients).

All settings are well documented in the mpd config example which you can find in /usr/share/doc/mpd/mpdconf.example

[edit] Setting up Needed Files and Directories

After saving the config file you need to touch the defined directories and files. In this case:

$mkdir -p ~/.mpd/playlists
$touch mpd.log

[edit] First run

Before you can start rocking, you need to let mpd crawling through the defined media library. Start mpd in the following manner:

$mpd --create-db

[edit] Connect the client

Now it's time to connect to the daemon using any mpd compatible client. You can for example use mpcc on the Nokia N900 to control the daemon. Just configure the necessary settings (don't forget the password). And then start to dance :)

[edit] last.fm scrobbling

As described you can also enable scrobbling using the mpdscribble package. Put your settings in .mpdscribble/mpdscribble.conf:

username = nikslor
password = topsecret
host = topsecret@localhost
port = 6600
log = /home/nicolas/.mpdscribble/mpdscribble.log
journal = /home/nicolas/.mpdscribble/mpdscribble.cache
verbose = 2
sleep = 1
musicdir = ~/media/audio

The config values are pretty easy to understand:

  • username = last.fm username
  • password = last.fm password
  • host = mpdPassword@IP-Address
  • port = mpd port
  • log = path to the log file add full path here! ~/.mpdscribble/mpdscribble.log does not work!!
  • journal = path to the cache file add full path here! ~/.mpdscribble/mpdscribble.cache does not work!!
  • verbose = log level
  • sleep = dunno :P
  • musicdir = path to the audio library

The man page has some more infos about the config values

Personal tools