I've purchases a couple of Sonos starter kits and would like my PC to be part of the system as a zone. I started some software in this direction. The Sonos ZonePlayers seem to respond to standard UPnP MediaRenderer commands. Using basic UPnP code, I'm able to have one app control the Sonos ZonePlayers and PC-based MediaRenderer. However, I haven't yet determined what Sonos is doing during the "Zone setup->add" process. I.e. how a ZonePlayer is entered into the Sonos world in either the PC Desktop Controller or the Sonos Controller. It appears that this is the major hurdle that I need to overcome to get the PC as a zone in the Sonos system. Before I dig into figuring out how this is done, I thought I'd ask if anyone has already determined this or found doucmentation and would like to share. (I've also asked Sonos to publish this information which would be the best solutions.)
Sonos unfortunately is not inclined to release that info as that may impact
their sales of ZonePlayers, or their option to create a PC zone themselves.
I think you *could* make your app appear to be a zoneplayer by simply
exposing the exact same UPNP actions & responses as a zoneplayer does. In
other words, an apparent zone clone. But my guess is that if you make one
misstep -- don't respond as expected -- you will be kicked out of the group
(there even seems to be an exposed API to do this?)
There are two things that are going to be very tricky for you to write:
#1, the zone mesh network code, which is basicallly what the zone add sets
up. This is what allows zones to negotiate which one should be the master,
etc. Zones are constantly analyzing network status etc. between themselves
and other zones and you must participate in this to be a zone. I'm not sure
there is any way for you to get in on this traffic; it may not even use
UPNP.
#2, the synchronization code which keeps zoneplayers in perfect sync - this
may be a proprietary extension on top of the standard UPNP AV or perhaps is
done with the "play speed" parameter, I don't know.
If you don't mind ignoring #2, here is something you could write without
too much trouble: instead of trying to include the PC as a first-class zone,
make it a "mirror" of one of the zones. In other words, it just sits there
watching a single zone and playing whatever that zone is playing (since one
of the things a zone can be playing is another zone, you may need to walk
the chain until you find the original source.) Because of the lag in event
notification, there will also be a noticeable delay unless you figure out
some sync code...
Good luck! Let us know how it goes...
Steve
On 11/6/05, MFoley <mfo...@bluetooth.com> wrote:
> I've purchases a couple of Sonos starter kits and would like my PC to
> be part of the system as a zone. I started some software in this
> direction. The Sonos ZonePlayers seem to respond to standard UPnP
> MediaRenderer commands. Using basic UPnP code, I'm able to have one app
> control the Sonos ZonePlayers and PC-based MediaRenderer. However, I
> haven't yet determined what Sonos is doing during the "Zone setup->add"
> process. I.e. how a ZonePlayer is entered into the Sonos world in
> either the PC Desktop Controller or the Sonos Controller. It appears
> that this is the major hurdle that I need to overcome to get the PC as
> a zone in the Sonos system. Before I dig into figuring out how this is
> done, I thought I'd ask if anyone has already determined this or found
> doucmentation and would like to share. (I've also asked Sonos to
> publish this information which would be the best solutions.)
There are good points there that may or may not be worth the effort to overcome. I'm traveling starting tomorrow so won't be able to spend too much time on code until Thanksgiving week. I'll review the code and documentation in the mean time so perhaps I can be productive when I get back.
I see the point you raise about Sonos not wanting to publish this information. However, I think it is short sighted on their part. They are currently in a position where they can lead this ecosystem and define/own the platform. Getting developers onto their platform only strengthens their position which will result in more of their hardware being sold. Trying to own this entire market as a single, small company is an uphill battle that I doubt they can win.
I'll spend some more time on it over Thanksgiving. (I'm traveling in Europe now...) I was hoping to get some technical information to review from Sonos, but so far no joy there.
MFoley, Sonos seems pretty tight about giving out software details (it took quite some time for them to even tell us about the UPnP controls). Good luck, but I wouldn't hold my breath.
If not, they should help out a bit. You can use Device Spy to control a ZonePlayer, and then view the exact XML code that was sent (for implementation in your own programs). I think Microsoft has their own UPNP DLL which you may prefer.
And of course there's the source code in previous threads in this forum. Sorry I can't be of more help - to tell the truth I'm more of a user than a programmer :)
Take a look at previous threads - I uploaded source a .NET library that
wraps UPNP so you don't need to worry about the implementation details so
much and can just execute commands against ZonePlayers.
I'll be releasing new code pretty soon as the latest version of Sonos
software has changed the format of some APIs.