Goodbye Amarok – welcome mpd

I just discovered the perfect solution to one of my biggest problems in recent memory, i.e. controlling playback of my music playing on my Home Entertainment Computer. It’s called mpd and I love it. I love it I love it I love it I love it. Why didn’t anyone tell me about this earlier? It lets me remote control music playback on my entertainment machine from virtually any device in my flat. Well, I don’t think there’s an mpd client for coffee brewers yet, but still.

A bit of background: ever since I set up my own server (“im in ur closet survin ur blog”) I’ve stored my whole music collection on it. Everything in one place, nice and easy to manage. But I couldn’t very well play the music from the server. First of all, it has no display attached to it (ok, not a real problem, but I’ll list it just to get some more reasons). Second, it doesn’t have a decent sound card, and even if it did, it’s too far from my amplifier to connect an audio cable between them. The solution at that time was to mount the music directory on the server to my desktop computer and use Amarok or Rhythmbox or whatever player was being used at the time to play the music. Since my desktop computer was in the same room as my amplifier, an audio cable could be connected fairly effortlessly.

This solution worked quite well as long as my desktop computer was switched on (which it was 24/7). When using my old laptop in the sofa, I could even connect to my desktop over ssh and control Amarok through dcop. Which was nice.

Last year when I got my Mac at work, I ditched my desktop computer and started using the Book instead. About at the same time, I set up my Home Entertainment Computer which became responsible for providing me with digital tv, showing movies, playing music and so on. The HEC (heck, let’s call it Kermit since that’s its hostname) first used the same music playing setup as my desktop computer, mounting the music directory and playing it with Amarok. It has a wireless keyboard with some “media buttons”, i.e. play, stop, forward etc, making it fairly easy to control Amarok although the only display attached to it is my tv, which makes Amarok’s interface somewhat unreadable (besides, who want’s to keep the tv turned on all the time).

This was my reality until a few days ago. It performed allright, but still had some annoying drawbacks:

  • Problem: I’m lazy. Reaching for the wireless keyboard 0,5m away to skip to the next song, change volume, pause, etc. is too cumbersome.
    Solution: Use my laptop (which of course is in my lap) to ssh to Kermit and use “DISPLAY=:0 dcop amarok player next” and similar commands. Ok, I can live with that.
  • Problem: Managing playlists. Dcop has support for queuing a file into the playlist from the filesystem, but it’s just too painful. Furthermore, it’s either not possible or really difficult to rearrange the playlist using dcop. Not to speak of searching for a particular song.
    Solution candidate: use X11 on my Mac, ssh to Kermit with X11 forwarding and run the whole Amarok interface locally. The problem here is that if I close the lid on my Mac, the music stops. Fail.

Basically, having Amarok running on Kermit and controlling it with either the wireless keyboard or my laptop was like walking around in the dark. You get around, but you don’t enjoy the trip.

Along came mpd. A music playing daemon running on some machine connected to the loudspeakers, which can be controlled remotely (or locally) from a wide variety of clients. With a shitload of features it takes on Amarok anytime. Just point it to the directory with your music, start it and connect to it with a client. After that it’s like playing music locally, although the sound comes from the big living room speakers and not your crappy laptop speakers.

I started using MPcOSX, a client for OS X with basic playlist functionality. It looks smooth and works pretty well, but it still lacked some of the features I’ve been longing for. What really blew my socks off was the web based client RelaXXPlayer with drag’n’drop, context menus and the shitz. I even taught my girlfriend how to use it, so now it doesn’t require a geek to control music playback anymore. Ok, this version (0.6b4) has some performance issues (mainly due to polling the daemon every second and using tickers and sliders in the interface), but I took matters in my own hands and rewrote the interface a bit. I’ll upload the patches when I have time.

Edit: grab the patches here:

While these clients allow me to search for songs, reorder the playlist, change volume etc graphically, I still need my laptop as a remote control. Today I discovered MDPod, an mpd client for iPhone or iPod Touch. Since my girlfriend has an iTouch, I decided to try it out. Amazingly, it works really well, which means that I can use the iTouch as a remote control for the music playing in the living room. This is where I really started to like mpd.

The next step is to find a client to run locally which would interpret the media buttons on the wireless keyboard, and a scrobbler for sending info to LastFM.

But for now: over and out.

Advertisements

10 Comments

Filed under Geek speak, Linux, Mac, The thing they call Life

10 responses to “Goodbye Amarok – welcome mpd

  1. Rob Collins

    Hi there. Just started to dabble in MPD and am finding it very good. My aim eventually is to do something line what you describe but I envisage using my laptop (from a reclined position on the sofa!) with sonata running as the client. Just taking baby steps with this so have tried using both MPD and sonata and MPD on the same aforementioned laptop and find the simplicity very encouraging. My next step is to get all my music onto a separate music server sitting on my stereo system but would like to do this wirelessly from sonata on my laptop. Been looking around on the net at bluetooth dongle solutions but it all seems pretty complicated with lots of muckimg around with config files etc. Do you know of an easy way to get your controller (sonata/laptop in my case) talking to MDP on the music server wirelessly?

    Ta,
    Rob Collins
    New Zealand

  2. Rob, I’m not sure I completely understand what you’re trying to do, but it seems that you’re aiming at the same setup as I’ve got right now. I’ve got all my music files on a “music server” (connected to my stereo amplifier) which runs the mpd daemon. One of my clients (MpcOSX, in your case Sonata) runs locally on my laptop and communicates with the daemon over LAN. In the client’s configuration, I’ve input the music server’s IP and that’s it.

    To be precise, my music files resides on my web server, which my music server mounts, but in practice it makes no difference.

    I’m not sure what you’re trying to accomplish with bluetooth here. With mpd, there’s no need to use bluetooth as the components communicate over LAN. Of course, this requires your music server to be connected to your LAN in the first place. If it isn’t, then you actually may have some difficulties with the mpd client and daemon running on different machines.

  3. Rob Collins

    Thanks for the reply Fredrik and sorry,

    Forgot to mention, don’t have a home network at present of any description and cannot see a reason for me to need one except for this latest music server project (possibly). Basically don’t want to run a wire between my laptop “remote control” and the music server as it would be nice to “lounge” with my laptop not connected to anything. I want to plug a bluetooth dongle into the usb port of of my laptop and one into the usb port of the flac server to achieve point to point ad-hoc “network”. Right now listeneing to sonata play the Beatles day in the life from MPD on the same machine, working perfectly. I’m very impressed with the simplicity of it all!

    PS – had a look at your photo albums also and congratulations on some lovely photos, you seem to be able to capture the moment very naturally! The scenery and occasion seems very similar to what we might get up to here in NZ.

  4. Rob,

    thanks for the compliment on the photos, I guess most people have become used to me running around with my camera and just don’t care that much anymore. Or then it’s the alcohol 😉

    Anyway, I don’t have any solution to your mpd without LAN problem up my sleeve, but I’ve experimented with some other solutions (not involving mpd) before this present one. Specifically, I was trying out this Sony’s audio bluetooth transceiver (google around for HWS-BTA2W). It hooks up to an amplifier with a normal 3,5mm audio cable and receives the audio signal from any device supporting the A2DP protocol. In my case, my MacBook was able to recognize the transceiver as a “Bluetooth headset” (or similar) and happily streamed the music via the transceiver to my amplifier.

    Using this technique, the music naturally has to be played on your laptop, which makes the music server kind of superfluous. Also, I had some problems with the transceiver’s poor range and choppy connection, but you might have better luck.

    If you want to stick to mpd, you could always just hook your music server up to a WLAN router (with a short cable, and hide the router behind the server or smth) and have your laptop communicate over that. This is also my current setup. Compared to bluetooth, the WLAN connection allows me to move freely with my laptop in my flat.

    Other than that, I’m afraid I don’t really have any ideas on how to create an “audio ad hoc netowrk” with bluetooth.

  5. Rob Collins

    Thanks for the very helpful suggestions Fredrik. The Sony transceiver sounds like a likely contender and will seriously do some more looking into it. Happy snapping!

  6. Gordon

    Fredrik,

    I’ve had it in my head for quite some time that it sure would be nice to have my music server, which is connected to the amp, be playable from a web-based client. The goal being a good enough reason to go out and buy a Nokia N810. I believe that you might have given me the reason! Thanks for the great write-up. When I get the pieces in place I’ll let you know how things work out.

    Many thanks,
    Gordon

  7. Gordon,

    glad to hear that my thoughts about mpd can make you go out and support Finnish industry by buying a Nokia N810 🙂 Feel free to share your experiences later on.

    For anyone’s information, I’ve found a better client to OS X – Theremin. It’s much more feature rich than MpcOSX and perfect for my needs. In fact, it has almost completely dethrown RelaxxPlayer due to it’s responsiveness.

    I also installed an ncurses-based client – ncpmc – locally on the media machine. So now I can control the music at home from anywhere over ssh (even using my Nokia E66 😉

  8. maziello

    Hi,

    I’ve been reading your post about mpd just AFTER making it working for me (after a deep research in alternatives, like xmms2).

    For me, the best client solution is MINION, a firefox plugin.
    So, if you use a Mac, there is a Firefox for mac, either Windows, either Linux… Same solution for every platform…

    Thanks for sharing your experiences… If you need a howto Ubuntu server + mpd (in spanish), just mail me.

    See you, (and excuse my poor, bad and long forgotten english).

  9. Maziello,

    thanks for the tip! I installed Minion and was a bit confused at first when I didn’t find any UI for the plugin and the documentation was a bit meager.

    However, after finding the new menu item and the controls in the bottom right corner, I have to say that I’m starting to like Minion. It seems to lack a playlist search and queue functionality, which would really make my day as I’ve usually got my whole library in the playlist and the player on shuffle. On the other hand, I have a feeling that those features are quite rare among other MPD clients as well.

    Otherwise it’s quite snappy and makes MPD even more ubiquitous.

  10. Oskar

    Excellent Article!

    If I could write like this I would be well chuffed 😉

    The more I read articles of such quality as this (which is rare), the more I think there might be a future for the Web. Keep it up, as it were.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s