Kodi Community Forum
Improved UPnP serving and client - Printable Version

+- Kodi Community Forum (https://forum.kodi.tv)
+-- Forum: Development (https://forum.kodi.tv/forumdisplay.php?fid=32)
+--- Forum: Kodi Application (https://forum.kodi.tv/forumdisplay.php?fid=93)
+---- Forum: GSoC (https://forum.kodi.tv/forumdisplay.php?fid=299)
+----- Forum: GSoC 2012 (https://forum.kodi.tv/forumdisplay.php?fid=161)
+----- Thread: Improved UPnP serving and client (/showthread.php?tid=127949)

Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17


RE: Improved UPnP serving and client - da-anda - 2012-12-27

depends on the UPNP server I guess. I'm not using UPNP myself yet, so can't tell. Just give it a shoot and enable the UPNP server in XBMC and use it from another XBMC or mount it to itself to see what's currently possible.


RE: Improved UPnP serving and client - artrafael - 2012-12-29

(2012-12-27, 01:22)steve1977 Wrote: Related question - can the upnp library be sorted by year, genre, etc?

Yes.




RE: Improved UPnP serving and client - sialivi - 2013-01-11

@alcoheca

Apparently media with single quotes in the filename aren't working properly, http://forum.xbmc.org/showthread.php?tid=151362


RE: Improved UPnP serving and client - odt_x - 2013-03-06

Hey. Something is off with XBMCs upnp server announces. It kinda works and then it doesnt. Can it survive a multple network interface scenario? This is my routing table:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         90.191.148.1    0.0.0.0         UG        0 0          0 p1p1
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 br0
10.8.0.0        10.8.0.2        255.255.255.0   UG        0 0          0 tun0
10.8.0.2        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
90.191.148.0    0.0.0.0         255.255.252.0   U         0 0          0 p1p1
224.0.0.0       0.0.0.0         240.0.0.0       U         0 0          0 br0

p1p1 is internet and upnp has no place being there, I created the multicast net route on br0 specifically to avoid that but when I look at network devices from a windows client on the br0 interface I get my xbmc upnp server listed but cannot browse it, double clicking will open a browser window with http://p1p1-ip:8080/. In XBMC system info it says the IP is 10.0.0.1 which should be used anywhere else aswell?

If running XBMC on the client pc occasionally the server is visible/browsable and then again it is not. tcpdumping and debug log havent really revealed much yet.

Would it be possible to limit the UPNP server only to one interface manually?


RE: Improved UPnP serving and client - Tolriq - 2013-03-06

Hi there,

Before starting to dig in Xbmc UPNP code I'm wondering if it's possible to generate upnp url that can be read by a renderer without going through the complete upnp negotiation ?
I suppose url like upnp://uuid would not but perhaps via the http service this is possible or does the protocol does not allow that.

The underlying idea is to add the missing link beetween JSON and UPNP for example watch content on tablets without browsing via upnp or push to a renderer.


RE: Improved UPnP serving and client - alcoheca - 2013-03-08

(2013-03-06, 20:59)Tolriq Wrote: Hi there,

Before starting to dig in Xbmc UPNP code I'm wondering if it's possible to generate upnp url that can be read by a renderer without going through the complete upnp negotiation ?
I suppose url like upnp://uuid would not but perhaps via the http service this is possible or does the protocol does not allow that.

The underlying idea is to add the missing link beetween JSON and UPNP for example watch content on tablets without browsing via upnp or push to a renderer.

I'm afraid that's not possible. UPnP URLs are dynamic.


RE: Improved UPnP serving and client - alcoheca - 2013-03-08

(2013-03-06, 15:42)odt_x Wrote: Hey. Something is off with XBMCs upnp server announces. It kinda works and then it doesnt. Can it survive a multple network interface scenario? This is my routing table:

Code:
Kernel IP routing table
Destination     Gateway         Genmask         Flags   MSS Window  irtt Iface
0.0.0.0         90.191.148.1    0.0.0.0         UG        0 0          0 p1p1
10.0.0.0        0.0.0.0         255.255.255.0   U         0 0          0 br0
10.8.0.0        10.8.0.2        255.255.255.0   UG        0 0          0 tun0
10.8.0.2        0.0.0.0         255.255.255.255 UH        0 0          0 tun0
90.191.148.0    0.0.0.0         255.255.252.0   U         0 0          0 p1p1
224.0.0.0       0.0.0.0         240.0.0.0       U         0 0          0 br0

p1p1 is internet and upnp has no place being there, I created the multicast net route on br0 specifically to avoid that but when I look at network devices from a windows client on the br0 interface I get my xbmc upnp server listed but cannot browse it, double clicking will open a browser window with http://p1p1-ip:8080/. In XBMC system info it says the IP is 10.0.0.1 which should be used anywhere else aswell?

If running XBMC on the client pc occasionally the server is visible/browsable and then again it is not. tcpdumping and debug log havent really revealed much yet.

Would it be possible to limit the UPNP server only to one interface manually?

Sorry to hear this - I actually thought something like this might happen. I *might* have made things worse during the libPlatinum upgrade.

Before I spend time looking around, can you test with an Eden build and confirm whether this is a new problem or not? Thanks


RE: Improved UPnP serving and client - Tolriq - 2013-03-08

Yes I have seen that in the code but I guess if we use BuildSafeResourceUri it will fill the hash map so then the uPnp server can server the file ?

The goal is not to store those url it's to query for example the now playing item via JSON gets the uPnp url and fill the upnp server, so then the user can continue watching the now playing item on his phone.

From what I have read in the code I can get the UUID and the uri and generate an url like upnp://uudi/%25%/MD5/ but is this url enough for a player to render it ?


RE: Improved UPnP serving and client - alcoheca - 2013-03-08

Are you talking about trying to switch the current playing item on an xbmc player onto a different non-upnp player?

EDIT: As switching to another UPnP device is planned already and will not use JSON.


RE: Improved UPnP serving and client - Tolriq - 2013-03-08

This was a sample but to an upnp compatible player.

The goal it to try to add the missing link between upnp and JSON.

JSON is the protocol to browse all the app content get now playing, playlist and such but there's no way to then start those content on an upnp player.


RE: Improved UPnP serving and client - alcoheca - 2013-03-08

To start playback of any content on a UPnP player you need to set the transport URI, and optionally provide metadata (XBMC is happy to play a URI without metadata).

You do this by calling the 'SetAVTransportURI' method of the 'AVTransport' service using a SOAP request to the 'controlurl' provided by the service description file.

To find out what is currently playing on a device you call GetMediaInfo or GetPositionInfo, in the response you'll find the 'Current URI' and 'CurrentURIMetaData' values.

At no point in this situation do you need the UPnP server paths (ie the upnp:// stuff which is entirely XBMC specific, NOT part of the UPnP/dlna spec).

Hope things are clearer now - IMO it's probably best if you read up on the UPnP documentation, and make use of an existing library to avoid coding all this stuff yourself.

ps this has nothing to do with JSON Smile


RE: Improved UPnP serving and client - Tolriq - 2013-03-08

Well I guess that you don't understand the need Smile

The problem is not for me to implement an Upnp library or play with JSON what I was talking about is to extend JSON Api in Xbmc, I have already made a few PR and was more looking to propose more.

Xbmc have a database with item and ID, remotes can get those without any problems via JSON, but they can't start the playing of those items anywhere else than on Xbmc itself since JSON and current HTTP implementation does not support streaming (mainly because of the lack of support of Partial Content and Range Request).

So Upnp is the only link left for that. So the need is how to link the JSON object to TransportUI served by Xbmc Upnp server itself.

Since we can advertise by JSON the uuid or any upnp needed field that uniquely identify this server starting the media and the negotiation after is not the problem either.

A very simple need that would open great things for remote makers.


RE: Improved UPnP serving and client - alcoheca - 2013-03-08

Now that I understand what you're suggesting, you need to rethink your approach.

The "http://hostname:port/%25/<path sha5>/filename.ext" you're trying to piece together is dynamic and could/should be specific to the client. It is only valid once a client browses the library.

Your best bet is creating a JSON RPC which plays a library item on another UPnP renderer. The code to play media on another renderer is in trunk. That way you can deal with just library IDs, and some enumeration of available players.


RE: Improved UPnP serving and client - Tolriq - 2013-03-08

Well this would solve a part of the problem but not to start the media on a phone where the upnp client would be started after the command


RE: Improved UPnP serving and client - alcoheca - 2013-03-08

Yes it does.

xbmc starts.

remote browses

phone starts

remote requests playback of media on phone - the RPC I was talking about

xbmc starts playback on phone

Clearly the phone needs to be on when the remote requests playback on the phone