Here’s the way to add UPnP to Xbox:
- Download UPnPDirectory.rar and extract in xbmc\FileSystem
- Download libUPnP.rar and extract in docs\libUPnP
- Open libUPnP\libPlatinum.sln and compile both in Debug & Release
- run libUPnP\MakeLibPlatinum.bat (this will copy the proper header files and libs to xbmc\lib\libUPnP
- Download patch and apply to xbmc code
- Download SsdpProxy.exe and run it on your host, if somehow the default port (1901) is in used, you can specify a different port in the command line. (This is Win32 only for now. The linux version is coming soon…)
- Edit the XBMC UserData/Sources.xml and put your host IP in upnp://host/ (If you specified a different port with SsdpProxy, specify it here in upnp://host:port/)
- Run Windows Media Connect on your host
- Compile XBMC, Run & Enjoy
Update: If you have a standalone UPnP Media Server, most likely you won’t need the SsdpProxy. Just specify the ip address of the device in place of the host.
By the way, Platinum 0.1.0.0 is now available on Sourceforge. Enjoy.
I must be on a roll or something but tonite I was able to implement my multicast work around and I can now see more than 1 upnp servers. Check the result out.
So how does this workaround work? Well it’s quite easy. The xbox cannot send multicast so you need to specify which IP address the xbox should send the M-SEARCH packets to. That’s what you put in the XboxMediaCenter.xml Sources.xml as upnp://host:port.
The default port is not 1900 but 1901. The reason is that if you send a unicast udp packet to a port that is being used by multiple applications, only one will receive it wether or not they are expecting a multicast packet or not. So if you have multiple upnp apps on your host all listening on port 1900 for multicast packets, and you send unicastly instead of multicastly only one will receive it. Of course, most people don’t know but Windows has a service called SSDP which listens to 1900 and of course it’s the first one to receive the unicast packets that the xbox sends. So no other apps (UPnP Media Servers) running on Windows and not using this Service will not receive anything. Interestingly this Service is being used by all UPnP applications Microsoft comes out with, including Windows Media Connect. Go figure!
So now the proxy. By default, it has to listen on a different port than 1900 as explained above. So I chose 1901 but it’s configurable in the command line in case that port is ever going to be used by someone else. The proxy requires an exclusive access to the port (by binding it) to make sure it’s the only one listening on it to guarantee delivery. Of course remember to change the setting in the XboxMediaCenter.xml Sources.xml if you do change it.
When the proxy receives a SSDP unicast M-SEARCH from the xbox on port 1901 (or the one you specified), it creates a multicast socket and forwards the request to the regular UPnP address (239.255.255.250), and then waits for responses. Devices should respond to the proxy which then forwards back the responses to the xbox.
The proxy also listens for multicast announcement packets on port 1900. That way it can detect when a new UPnP device joins (or leaves) the network. When receiving a unicast request from the xbox, the proxy keeps around the ip address of the xbox and when multicast packets sent by UPnP devices are received by the proxy, it forwards them as well to the xbox (ip). It also works when devices go away but unfortunately, I have no way to asynchronously notify xbmc to update the UI (yet).
I just need to get the timeout working with blocking sockets which G. said he would add to Neptune soon.
I talked to spiff tonite again, I am going to publish all that tomorrow. Cheers!
A while back, I ported Rhapsody to the Xbox when I was working at Listen.com. It’s been a while but after seeing the latest XBMC 2.0 with 360 skin, I really wanted to do something with it again. Since I had just finished Platinum, I decided to port it. The main problem that people encountered when trying to port UPnP to the Xbox is that the Xbox doesn’t support Multicast (sending and receiving) and since Multicast is required for bootstrapping (SSDP), I had to find another way (which I’ll describe later).
Anyway, after a full night of coding and a little bit today, I was able to get it going with the help of spiff on Efnet #xbmc. See the video here and here.