Open source jukebox?

So this weekend, we had a party. We needed music, obviously. But we didn’t want to use CDs, or an iPod or anything like that. Those things are too easy to change. People go and hit ‘next track’ when they don’t want to listen to something, and it annoys everybody who was actually trying to listen to it. You know who I mean. There’s always one person, sometimes a few people, who think their music is ‘better’ and they always see fit to make everyone else listen to whatever it is they’re wanting us to.

So I wanted to set up something to solve this problem. It obviously had to be a little bit more complicated. It needed to have some kind of vague access control. So I did.

I pulled an old system (PII 300Mhz, 384Mb RAM, S3 Virge DX/3D, and a new addition: SoundBlaster Live! PCI) out from storage and put my favourite operating system on it. The install didn’t work out the first time because I stupidly let the automatic partitioner partition the drive; having only 3Gb in total, this left about 1.5Gb for each of / and /home, which unfortunately isn’t big enough to fit all the software I wanted to install. Round two, I manually created a /swap equal to RAM size and the rest for /.

Installed Arch fine. Installed XFCE4 — for speed. When running it was using an entire 80-ish Mb of RAM. As for how I planned on playing music, well… I installed my favourite audio player and a frontend for it: relaxx player which is a nice AJAXy web client for controlling mpd. This was the only part of the system which was slow: even running it in Midori, the slowness of the interpreted Java/script environment made the UI very molasses-like in response. It wasn’t too bad; maybe a quarter to half second of lag between operations.

The music playback itself never skipped a beat (literally); as mpd itself uses pretty much zero resources. The audio (mp3 mostly, but some FLAC) was streamed over our 100Mbit network from my desktop PC just fine.

What’s good about relaxx is that it has an admin login and a guest (non-authenticated users) operating mode, and you can specify what rights the non-admin user has by simply selecting their permissible operations from a list while logged in as admin. Essentially that meant I was able to specify the guest to only allow add to playlist and play. They could not stop, skip track, delete from the playlist, etc. Which worked out quite well because as I mentioned earlier: there’s always at least one clown who wants to play their favourite tracks from “Greatest Country Hits of the 60s” while everyone else is enjoying something a little less … shit.

The only feature I think is missing from a jukebox-like application such as relaxx is the ability to have multiple playlists as some kind of intelligent queuing system. As an example: before the party started I manually created a large list of desirable songs and set the play mode to shuffle. However, this isn’t the most ideal solution when it comes to allowing others to add their own music. The other extreme would have been to start with a blank playlist and let people add their own songs all night. I think this isn’t ideal because then you may run out of music, or one person who is particularly attentive might see fit to add many songs of their own liking in a row.

So, I think that an intelligent system whereby you may start out with a large playlist of your favourite tracks, but allowing others to add songs they like, is best. However, there would need to be something involved where you could configure the player to, for example, play a recently added track at least once every x minutes. So you know that when you add your favourite song, it will be played in amongst the existing playlist at least once within the next x minutes.

Another idea I had was the use of multiple playlists, each with their own weight. So you could have all your really fav songs in a series of weighted lists, and the chance that a song is played depends upon how much weight its containing playlist has. This way you could only allow people to add to the medium or low weight playlist which ensures their tracks are not played more often than those in the highest weight playlist, which you have setup yourself beforehand.

I imagine there could be many other uses for these kinds of intelligent playlist systems, and I don’t doubt that I am not the first one who has thought of this. Leave a comment to let me know what you think.


About this entry