Introducing the Raven Music Server

October 10, 2011

While I was on my quest of reducing the memory footprint of a freshly launched KDE session, I found that the process which uses most memory just after startup is Amarok, which contributes over 80 MiB to 300 MiB total RAM usage. Now of course, Amarok has its reasons for a high memory usage: For example, its collection is backed by a MySQL/Embedded database. This memory footprint is justified by the plethora of features Amarok offers. But still, 80 MiB RAM usage is quite a lot when all I want to do (99% of the time) is to listen to some music files on the local disk. (My collection has 818 tracks at this very moment.)

Can we improve on that?

Looking at my desktop, I see the “Now Playing” applet. It shows the current track from Amarok, and has the basic media player controls (pause/stop/previous/next + seek slider + volume slider). Again, this is about all I need for an user interface while my playlist is filled. I remember that the nowplaying applet communicates with Amarok via DBus using the MPRIS (Media Player Remote Interface Specification) standard.

With all these impressions in mind, my target is clear: I want a headless media player which runs in the background and offers an MPRIS-compliant control interface on DBus. Something with a smaller memory footprint.

Intensive searches on the internet did not turn up anything of interest. Of course there are command-line music players (e.g. MPlayer), but those expect to be connected to a terminal for control. They cannot be run in the background, and there’s no nice GUI for them (like with the nowplaying applet). It looks like I need to do it myself yet again.

So here is the Raven Music Server (called ravend for short, as it is a daemon), which is now publicly available at git://anongit.kde.org/scratch/majewsky/raven. It currently implements the basic interfaces mandated by MPRIS version 2 (unfortunately the “Now Playing” applet supports MPRIS 1 only). The biggest missing piece is support for editing the track list, so at the moment you need to restart the process to change the playlist.

I have been productively using ravend for two weeks now, since one day after its inception, and I’m quite satisfied with it. And now that it is in a public Git repo, you can, too! Provided that you find pleasure in controlling your mediaplayer with commands like

qdbus org.mpris.MediaPlayer2.ravend /org/mpris/MediaPlayer2 org.mpris.MediaPlayer2.Player.PlayPause

Convenient user interfaces will become available, eventually. Even then, the Raven Music Server will probably not be interesting for end users. Power users may find this project interesting if they like to keep an eye on their system’s memory footprint, or want to have their playback continue even when the X server is terminated, or want to run a full-fledged media player on a headless system.

19 Responses to “Introducing the Raven Music Server”

  1. Aurélien Says:

    Interesting project. It reminds me quite a bit of mpd, the Music Player Daemon. Did you evaluate this solution?

  2. Adrià Says:

    Hi! Yes I agree with you in all points. And that’s the reason why I use MPD, as Aurélien says. Your idea only seems to differ from MPD by its MPRIS2 interface (there are programs that add an MPRIS2 interface to MPD, too).

    As I had the same thoughts towards Amarok as you, the idea of coding an MPD KDE client crossed my mind, to get started with C++/Qt/KDE programming.

    I’ll follow this project closely, it seems a nice project 🙂

  3. Caesar Tjalbo Says:

    It would seem to me MPD wasn’t looked at. All it takes is a little tray tool or simple something that catches mediaplayer buttons from a keyboard.

  4. BartOtten Says:

    It would be cool if you could make something integrated in Amarok so you can go to ‘minimal version’. Then the biggest part op Amarok is closed and your Amarok-miniversion continues using the playlist made in full Amarok. I think that would be the ideal situation.

    Another program is not the best solution imho. Reason: http://forum.kde.org/viewtopic.php?f=15&t=97243

  5. peterix Says:

    Yes. Why not extend mpd instead?


  6. I also am surprised that you make no mention of MPD.

  7. David Says:

    I do not use MPRIS but, did you try XMMS2 with xmms-mpris-bridge?

  8. manianlift Says:

    It is using negative 1.5MB of 14MB of shared memory?

  9. Ernesto Manríquez Says:

    Is it planned to switch Amarok database to Nepomuk? You’ll surely reduce Amarok memory footprint in that way.

    • jmiahman Says:

      I don’t think it would because Nepomuk last I checked used MySQL as well. It would basically just open another MySQL. MySQL for desktop use is icky, there are far better (lighter) db systems to use, that should be used by default. Just because Desktop systems have more resources now doesn’t mean efficiently should get sloppy. It’s in my opinion with KDE 4 it has.

  10. Bigbrovar Says:

    I think you skipped over MPD as a solution for what you need. Its a headless music server which runs as a daemon and can be accessed from any clients (and there are a whole range of clients) It even has a mpris connector. Take a look at MPD so that you don’t reinvent the wheel 🙂

  11. PIC Says:

    Have you tryed qmmp?. It’s seems it has MPRIS 2 support

  12. Carol Newman Says:

    I think you skipped over MPD as a solution for what you need. Its a headless music server which runs as a daemon and can be accessed from any clients (and there are a whole range of clients) It even has a mpris connector. Take a look at MPD so that you don’t reinvent the wheel
    +1


  13. […] Well, probably not much right now.  Juk doesn’t support MPRIS2 (although I intend to change that for 4.9/5.0), Amarok worked before (although it should use marginally less power with MPRIS2 rather than the old MPRIS interface), VLC doesn’t support MPRIS2 (yet; version 1.2 will).  A handful of other players support MPRIS2, though, including the Raven Music Server. […]

  14. randomguy3 Says:

    Now Playing in master now supports MPRIS2, and this will be included in 4.8. Sorry it took so long.

  15. POD HD500. Says:

    Oh my goodness! Amazing article dude! Thank you so much, However I am experiencing problems with your RSS. I don’t understand why I am unable to subscribe to it. Is there anybody else getting identical RSS problems? Anybody who knows the answer can you kindly respond? Thanks!!

  16. Stone EZ Says:

    After I originally left a comment I seem to have clicked on the -Notify me when new comments are added- checkbox and from now on whenever a comment is added I receive four emails with the exact same comment. Is there a way you are able to remove me from that service? Thanks a lot!


  17. […] you just want a headless music player on your local machine, though, you can always use Raven, which talks MPRIS2 natively. Like this:LikeBe the first to like this […]


Leave a comment