iTunes Server

by kurisu

I know it sounds weird, but it’s something that I am sure all you guys have thought about, one way or another. We all know how painful it is to actually have a common iTunes music library, that is :

+ updatable by more than one computer
+ not bound to a specific user
+ residing on a “neutral” storage volume

In short, with the current release, it’s not possible. However it is a much needed function. But if you take iTunes “as-is”, the whole architecture would have to be twisted a lot to fulfill the above requirements. Enter “iTunes Server”…

Now, follow me here… how difficult would that be to implement true server functions in our favorite music management app ? We’ve all seen the various tricks that one can use to approximate a true music server, and it ain’t no fiesta.

I was recently discussing this very problem and its current solutions with a very tech savvy great friend of mine, who likes iTunes, but finds it annoyingly limited in a few areas.
The guy recently moved to a new place, and wants to have one big music library to share on his LAN with his girlfriend. Simple enough, right ?

Well, of course, I suggested the trick of placing the library on a samba share (even the xml files at the root), and while this is ok, if you have two clients adding or making modifications to the library at the same time, then you’re in for some serious mess in the database.
Then I suggested to run a daap daemon on his linux server, but then again, only one client can update the content, and also has to relaunch the daemon to refresh what the others will see via iTunes sharing.

We both concluded that if Apple were serious about building a “digital hub”, they probably knew about this non-sense situation already.
I then started to dream about a clever and elegant way to touch this utopia, and it all of a sudden, it became clear : iTunes should move to a more thoroughly defined client/server architecture, à la X11.

1. Single machine setup

Of course, we cannot disrupt the current seemless user experience, so we need to be able to run both the iTunes server and the iTunes client on the same machine. Again, X11 is a perfect example : when you “startx”, the OS starts the actual “display server”, and launches the window manager, and eventually other applications, which are in essence *clients*, i.e. they need to hook up to the X server to actually display anything… on the same machine. The same kind of philosophy can be applied to iTunes : you launch the program, and it starts up both the server, that indexes and streams the songs, and the client (which in essence would merely be a frontend). Looks the same, acts the same. no problemo here.

2. Multiple clients setup

So, let’s say we spawn one instance of the iTunes daemon on the machine where our music files reside. The daemon loads up its index of previously imported tracks, and broadcasts its presence through *rendezvous*, much in the same way a daap server would. The difference would lie in the way clients and server communicate : your client (your PowerBook, for instance) would authenticate with a key to the server, which by return grants it stream/modify/delete/create rights, on a per user basis. Non-authenticated machines would only gain stream rights, and thus the library would only show up as it does now when you use iTunes sharing.

Now, if two users access the music library at the same time, same scheme. Works with 3, 5, 10 clients (provided you have the according bandwitdth on your LAN, that is… more than 3 clients on 802.11b would be painfully slow).

But let’s say you are currently ripping a cd you just bought, and that someone else is modifying the tags of a song. The iTunes server daemon can handle both at the same time and then broadcast the changes on the LAN, much like a SQL server that would push a refresh to its clients upon each transaction.

While you are ripping, of course, the server would not broadcast any changes everytime a chunk of newly ripped AAC audio is written, because otherwise this would create a ridiculous amount of network traffic for nothing. But upon finishing importing one track, bam, all clients receive the update, and display the new file in the browse window.
The updates would be sent by the server only to the registered and connected clients, therefore limiting further the useless network traffic.

I am no programming wizard, but this is within the realm of possible things to do today.
Somehow I am pretty sure Apple already has something like that in mind for iTunes 5.0. I mean, let’s face it, there were no groundshaking new features after the 4.1 release. And that’s like aeons ago.

Share this: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • bodytext
  • del.icio.us
  • Slashdot
  • Reddit

 

7 Responses to “iTunes Server”

  1. Swissfondue Says:

    I solved the problem of 2 accounts using (not sharing) the same library whereby each user can add, modify or delete songs in the same library by using the applescript “startitunes”. You can find a how-to under http://captnswing.net/howto/itunes/

  2. kurisu Says:

    right, thanks for the link. interesting read.
    Although your solution applies to 1 machine, multiple accounts not logged in simultaneously. What I was trying to touch was the possibility of having different people modifying the library at the same time, and for that I still believe iTunes needs to separate client and server into two separate entities.

  3. jas Says:

    iTunes server would be a very welcome product indeed.
    But I seriously doubt we will ever see it.
    Why?
    The same technology would instantly allow entire college campuses to steal each others music. A situation Apple is all too aware of.

  4. macuser Says:

    I don’t think it would allow entire college campuses to steal music, at least not easily. It would allow entire college campuses to listen to music that resides on one PC, but the files would never be copied locally, so as soon as they disconnect no more files.

  5. Jimmy Says:

    I just got my 2000t and all of my songs are skipping in iTunes, and I cant figure out why. If someone could help me out and tell me how to fix this I would really appreciate it because its driving me crazy. Thanks for the replys.

  6. Carlos Says:

    if have itunes in my home, and I have a server in my oficine with my music, how can I connect itunes to my server, it is possible or not?

    please answer in my mail

  7. Thomas Says:

    If you open the correct ports or create a VPN it will work of course!

Leave a Reply