Playing music remotely using MPD

From the home page of MPD:

Music Player Daemon (MPD) allows remote access for playing music (MP3, Ogg Vorbis, FLAC, AAC, Mod, and wave files) and managing playlists. MPD is designed for integrating a computer into a stereo system that provides control for music playback over a local network. It is also makes a great desktop music player, especially if you are a console junkie, like frontend options, or restart X often.

The idea behind using MPD was to be able to set up a multimedia computer that I could manage either locally or remotely. When I mean remotely, I don’t mean via VNC or X11/NX. For example, I don’t need the overhead of a full X11 session just to play music over the sound card of my multimedia computer. I might do that using MPlayer over a SSH/screen session or a text-based, command-line music player, but sometimes I like GUI applications too!

Also, detaching the music player controller (the daemon) from the client allows me to use different clients from different computers. Sometimes I’m using one of my Apple computers. Sometimes I’m using one of Linux boxes. Using a client that matches natively my operating system is something that I really appreciate.

For Linux I use Sonata. For Mac OS X I use Theremin.

Installing MPD on Ubuntu Feisty Fawn

Installing MPD in Ubuntu Linux, as usual, it’s pretty straightforward:

sudo apt-get install mpd

By default, Ubuntu will install MPD, start it up and create the symbolic links under /etc/rc[0123456].d to make sure it gets started at the next system boot.

You might also want to edit MPD’s configuration file:

$EDITOR /etc/mpd.conf

In my case, the only thing I changed in this file is the bind_to_address directive to allow clients to connect remotely. It looks like this:

bind_to_address                 "0.0.0.0"

Installing Sonata on Ubuntu Feisty Fawn

Sonata is a nice Python-based, GTK+2.0-based MPD client. Thus, it’s multi-platform and can be run on Linux, *BSD, Solaris, Mac OS X and (I guess) even Windows.

To install Sonata on Ubuntu Linux, run apt-get as usual:

sudo apt-get install sonata

The first time you run Sonata, either from the command-line or from the menu, it will ask you where the MPD daemon is running. It defaults to localhost (and port 6600) so I changed that to point to the hostname of my multimedia computer.

Installing Sonata on Mac OS X

Installing Sonata on Mac OS X is a little bit more elaborated, since some of the components that Sonata requires are not installed by default on Mac OS X.

Sonata requires Python and, more concretely, PyGTK. Since I am already using MacPorts, getting PyGTK installed was a matter of running:

sudo /opt/local/bin/port install py-gtk2

The rest is pretty much the same as for Linux.

Installing Theremin.app on Mac OS X

Theremin.app is a nice, native Cocoa application for Mac OS X that sports Growl integration. For example, when MPD starts playing a new song, Theremin.app notifies the user via a Growl notification.

Download Theremin.app from Theremin’s Web site.

Extract it and run it:

tar jxvf Theremin_0.5.1.tbz
open Theremin.app

Theremin.app can also be compiled from sources by downloading the source code from the Subversion repository and using Xcode to compile it. I must confess that I was lazy to that, so I chose to run the pre-compiled binaries.

2 thoughts on “Playing music remotely using MPD

  1. Excellent post. I was checking constantly this blog and I’m impressed! Very helpful information specially the ultimate part 🙂 I care for such information a lot. I was looking for this particular information for a very lengthy time. Thanks and best of luck.

  2. Woah! I’m really digging the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between user friendliness and visual appearance. I must say you’ve done a very good job with this. Also, the blog loads super quick for me on Opera. Outstanding Blog!

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s