Showing posts with label MPD. Show all posts
Showing posts with label MPD. Show all posts

Wednesday, September 17, 2008

HowTo: Install and configure MPD on OpenSUSE

Following a previous post on how to install Music Player Daemon (MPD) on FreeBSD I'll be presenting the steps need to install it this time on OpenSUSE.
  1. $ sudo su
  2. # zypper ar http://packman.links2linux.de packman
  3. # zypper mr -r packman
  4. # zypper ref
  5. # zypper install mpd
  6. # vim /etc/mpd.conf
  7. # /etc.init.d/mpd start
  8. # chkconfig mpd on
With steps 2 to 4 we've added the Packman community repository and enable its auto-refresh and taken the opportunity to refresh the remaining repositories.

Step 6 deals with the configuration of MPD. Point to music_directory and type in the path of you music library.

On steps 7 and 8 we've started the MPD service and set MPD to start at each reboot.

If need you can update the database at any time by running:
  • # mpd --create-db
Now that we have the MPD server installed let's proceed by installing my favourite client: ncmpc.
  1. # zypper install ncmpc
  2. # exit
  3. $ ncmpc -c
As a side note, the Packman Repository's ncmpc rpm was built without the clock and search build options. You can rebuild the rpm yourself if you really want to use the mentioned options.

An heads-up: don't end you Gnome session with ncmpc paused. It seems that the next time you restart your system the /dev/dsp device will be in use effectively stopping you from using programs that use the device, such as Mplayer. Simply stop ncmpc before exiting it, press Backspace to do so.

Additional and extremely useful information can be found under /usr/share/doc/mpd and /usr/share/doc/ncmpc.

Saturday, August 16, 2008

HowTo: Musicpd (Music Player Daemon) on FreeBSD

MPD stands for Music Player Daemon. It is made to control music through a very unique way. MPD has support for MP3, Ogg, FLAC, AAC, Mod, and wav files.

Let's proceed with the steps needed to install musicpd from ports:
  • % su
  • # cd /usr/ports/audio/musicpd ; make install clean
  • if you want select additional audio formats such as AAC and MOD files
Now let's move onto the configuration by copying the port's supplied example and editing from there:
  • # cp /usr/local/share/doc/mpd/mpdconf.example /usr/local/etc/mpd.conf
  • # chmod 644 /usr/local/etc/mpd.conf
  • # vi /usr/local/etc/mpd.conf
music_directory "/mnt/music"
playlist_directory "~/playlists"
db_file "~/database"
log_file "~/log"
error_file "~/error"
pid_file "~/pid"
state_file "~/state"
user "musicpd"

port "6600"
bind_to_address "127.0.0.1"

audio_output {
type "oss"
name "OSS"
}
To prevent MPD running as root we can setup a new user (musicpd):
  • # adduser
Username: musicpd
Full name: Music Player Daemon
Uid (Leave empty for default):
Login group [musicpd]:
Login group is musicpd. Invite mpd into other groups? []:
Login class [default]: daemon
Shell (sh csh tcsh bash rbash nologin) [sh]: nologin
Home directory [/home/musicpd]:
Use password-based authentication? [yes]: no
Lock out the account after creation? [no]: yes
Username : musicpd
Password :
Full Name : Music Player Daemon
Uid : 1002
Class : daemon
Groups : musicpd
Home : /home/musicpd
Shell : /usr/sbin/nologin
Locked : yes
OK? (yes/no): yes
Add another user? (yes/no): no
Goodbye!
  • # mkdir -p /home/musicpd/playlists
  • # chown muiscpd:musicpd /home/musicpd/playlists
To start MPD at boot time:
  • # echo 'musicpd_enable="YES"' >> /etc/rc.conf
Finally we start MPD and create the database:
  • # /usr/local/bin/mpd --create-db /usr/local/etc/mpd.conf
Now that we have the daemon up and running we need to put it to good use. I use the NCMPC client for the job.

To install NCMPC from ports:
  • # cd /usr/ports/audio/ncmpc ; make install clean