Hacking the Philips Streamium

Update: Other streamium hack websites:
Paul Halloran's webpage - Paul halloran has added mp3 cataloging and other features that my simple script is lacking.
Dave Witt's webpage - Dave has expanded quite a bit on my script. Check it out.

What is the Philips Streamium?

The Philips Streamium is an internet micro hi-fi system (press release).  You can use it to listen to internet radio stations or you can browse and listen to mp3s that are served off of your PC.  You can see in the picture above on the left that the streamium is fairly small and fits in my TV stand.  The blue device to the right of my VCR is my Linksys router to which my streamium is connected, and to the left of my VCR is my cable modem that the router's WAN port is connected to.  One of the cables going off to the left runs from my router to my PC in the other room.

Why Hack it?

I posted a review on slashdot about a month ago about various problems with philips' streamium MCi-200.  Probably the worst is that philips has strict control over which internet radio stations you can listen too, and that the pc-link function (which allows your pc to communicate with and act as a mp3 server to your streamium) only works on windows.  Fortunately I managed to reverse engineer the pc-link protocol and I wrote my own pc-link server in perl, which can be run on any operating system with a perl interpreter installed.  In addition to being able run this pc-link server on any OS, I found out that it is easy to make my pc-link server trick the streamium into playing internet radio streams that are not normally allowed by philips!  The reason why this is so easy to do is that the server tells the streamium how to access mp3 files by giving it a url to the file.  Normally this would point back at the pc-link server and the streamium would just access the mp3 file through there, but you could give it a url for some mp3 stream somewhere on the internet.  The streamium can't tell the difference.  Also, it is possible to completely customize how you browse your mp3s.  One person who was considering purchasing a streamium or something for non-computer based access to mp3 archives asked me if the streamium allowed you to browse by artist, and then by album.  I can see where this would be very useful if you had a lot of mp3s by the same artist (my mp3 collection is fairly small so I don't have this problem), but with philips' pc-link software, you can't do it.  There is no way to customize any of the categories, but the actual pc-link protocol itself is fairly flexible.  So using my perl script you can categorize your mp3s however you want.  However, my perl script does not facilitate categorizing large amounts of mp3s. You'll probably want to check out Paul Halloran's webpage as he has written some excellent software specifically for this.

The Protocol

The protocol consists of fairly simple xml tags.  The client (streamium) sends out an xml UDP broadcast packet checking for servers.  The pc-link server responds with an xml TCP packet announcing it's presence.  The client then makes a connection to the server and starts browsing through the server's information, which is organized in a node tree format.  All nodes are numbered.  All leaf nodes are playable (meaning that they contain a url pointing to a mp3 file/stream).  Once the client finds a leaf node, it can connect to whatever url is given for that leaf node and obtain the mp3 from there, or it can continue browsing for other mp3s.  If you want more detailed information, I have outlined a sample interaction between the pc-link server and client.

The Script

pclink.pl (or click here for a .txt version)
(also see Paul's software)

If you have a perl interpreter you should be able to run this script on your system (if you are running windows and don't have an interpreter installed you can download activeperl from here).  If you look at the top of the script there are three global variables that you can customize.  They are all prefixed with "$global_".  The nodesfile is used to define how you want your mp3 files/streams categorized.  I have included here a sample nodesfile so that you can see how to create one.  Put it in the same dir as the pclink script.  The example radio stations on it should work without having to modify anything.  The mp3 files, of course, will not work unless you happen to have those exact mp3 files in the exact same directories as me on your web server (if you have a webserver installed that is).

The format for nodesfile is as follows:

<node id>;<node name>;<child nodeids seperated by commas>
<node id>;<node name>;dir(<subdir of $global_mp3dir>)

Leaf nodes:
<node id>;<node name>;<url>
<node id>;<node name>;<url>,length(<seconds>)

If you use the dir() format for a vertex, the children of that node will consist of all of the mp3 files in that directory.  If you use this you must have the $global_mp3dir and $global_mp3url set correctly in the pclink.pl script.  You also have to have apache or some other webserver installed and configured on your system.

Lines that begin with a "#" or that are blank are ignored.  Any url that contains the string "<me>" will have that string substituted with the actual IP address that the pc-link server is on as viewed by the pc-link client.

My script is not meant to be completely robust or advanced.  It does not know how to handle two streamiums on the same network for instance.  It does not get information from ID3tags and does not send that information to the streamium.  It is meant to allow basic functionality with extended freedoms that do not exist in philips' pc-link server.  Feel free to use this information and/or modify my script and distribute it however you like.  Let me know if you write any good pc-link code or if you have any questions.  My email address is