Improved UPnP serving and client

  Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
alcoheca Offline
Team-XBMC Developer
Posts: 264
Joined: Feb 2008
Reputation: 5
Post: #1
Improved UPnP serving and client

Summary: Despite it’s age, UPnP-AV is still the de facto standard for multimedia sharing in the home. Hundreds of products throughout millions of homes support UPnP to varying degrees. This propagation of devices represent a largely untapped potential to increase the relevancy of XBMC. Currently, XBMC operates both as a UPnP ‘media server’ and a ‘media renderer/control point’ (client), however it does not fully utilize the protocol to provide as rich as user experience as possible, and some third-party devices are incapable of streaming the content from XBMC altogether. The aim of this project is to extend the existing UPnP handling within the application, enhancing both the underlying code for the ease of future development, increasing the support for existing devices, while making great improvements to the end user’s perceptions as a whole.

How will I achieve this: As it stands, there is already an existing approach to accessing one or more libraries across multiple XBMC clients - sharing the actual SQL database - however this approach has its flaws and is not likely to become a supported feature. In terms of UPnP, there are a number of areas where the existing handling can be improved:
  • not all the available information for files is offered to clients
  • discovery of media servers is not immediately clear to new users
  • UPnP sources are not integrated into the local library views
  • there is no support for tracking access to the files in the server component (such as watched-status, last played position)
  • crucially there is the limiting factor of no support for transcoding video & audio files to formats accepted by the player. Many existing devices support a very limited number of video and audio formats. If XBMC is to operate not only as a media player, but a viable server it must also cater for as many appliances as possible.
  • access restriction is non-existent

My approach will be to initially tackle the easiest changes - metadata, automatic discovery, library integration, before moving onto the major part of developing client <-> server communication via UPnP protocol extensions. Real-time transcoding of media files can be achieved through proper management of DLNA profiles, and the actual work would be performed by third party applications such as FFmpeg or lame.

Supporting access restrictions over UPnP require further changes to the profile handling of the application which may not be feasible in the timeframe. While I will not be working on developing a separate server application, it’s worth pointing out that the changes to the server side will be easily transferable in the future.

Benefits: Increasing numbers of XBMC users rightly expect the application to take full advantage of today’s multi-device environments. With the advent of low cost NAS devices, frontends such as the RaspberryPi, and more generally the gradual diversification of technology in the home, XBMC has the opportunity to reassert itself as the principle sustainable & open media-center of the future. Users benefit from a richer experience overall, as well as the increasing utilization of existing UPnP devices in their homes, while developers benefit from the adoption of a stable framework for server/client communications.

Goals: The main goal is to bring UPnP fully into the forefront of XBMC, making use of those features to reduce setup times, allow greater control over multiple players, provide a richer user experience and increase the flexibility of the platform overall.

What does it touch in XBMC: The majority of the client-side changes will take place in the file system and library layers. There will also be some modifications to the user interface in order to enumerate connected devices more easily. For the server-side changes, my attention will be focussed on maximising portability and interoperability with other servers. Even though it’s likely that eventually an distinct XBMC server application will exist, it’s important that backwards compatibility with standard UPnP devices is maintained.

Requirements: The changes will take place exclusively in the application itself, so all that is required is knowledge of C++ and the source tree. Having access to other UPnP supporting devices, I will be well positioned to test their functionality during the development process, something that is crucial to the success of this project.

How long have you been writing software for work/fun? I’ve been writing software for over 10 years. Initially I worked on web development, before shifting to C++ during my first year at University. Since then I’ve worked with other languages, notably Java & Perl.

What is your primary development language/environment? C/C++ via GNU/Linux.

Is this your first GSOC? No, I participated in the Summer of Code of ‘08.

Have you contributed to XBMC or other FLOSS projects? For my first GSoC, I worked on the beginnings of the PVR branch. During that summer I became accustomed with the XBMC source tree and was also allowed the opportunity to meet many new colleagues at the inaugural developers convention in Amsterdam. I was asked to join as a permanent team member in the autumn of 2008. I was also instrumental in refactoring the Add-ons system in 2009.
(This post was last modified: 2012-04-07 10:57 by alcoheca.)
find quote
RockerC Offline
Senior Member
Posts: 154
Joined: May 2011
Reputation: 3
Post: #2
Add an FFmpeg based on-the-fly transcoder and remuxer to that and it is a super idea!

Transcoder would enable you to playback audio and video formats not supported on some devices, or on devices that do not support high definition videos, as well as have place shifting capability to access your home library over a slower internet / WAN link from a friends house or on your mobile devices over 3G / 4G Smile

Remuxer would solve the PS3 / Xbox 360 issue with them playing H264 but not supporting MKV containers.
find quote
alcoheca Offline
Team-XBMC Developer
Posts: 264
Joined: Feb 2008
Reputation: 5
Post: #3
Little update - I'm upgraded the Platinum library to the latest version, and have a much better understanding of the workings now(!). If anyone is brave and has a working UPnP setup in their house, feel free to compile the upgrade-platinum branch from my fork on github and let me know of any problems in this thread - NOT the bug system! There shouldn't be any new features, but reports of bugs that have been fixed would be gratefully appreciated. No binaries will be available, so if you can't compile you'll need to wait I'm afraid.

I'm now looking at improving the sorting of files returned by the server, and how best to handle the 'quirks' database - i.e. the mappings of specific behaviour to certain (naughty) devices. UPnP is highly extensible, so our support for it should be the same.
find quote
RockerC Offline
Senior Member
Posts: 154
Joined: May 2011
Reputation: 3
Post: #4
Plex (blasphemy here I know) have also added some great UPnP / DLNA extensions features to their media server these past months

http://elan.plexapp.com/2012/03/29/this-...hers-dlna/
http://elan.plexapp.com/2012/05/08/plex-...-v0-9-6-1/
http://elan.plexapp.com/2012/06/04/plex-...-v0-9-6-3/

Might still be a good idea to steel or borrow some media server ideas even if they won't let you just copy their server side code Wink

Plex Media Server is also using Plutinosoft UPnP / DLNA library so maybe some code will tricle upstream but don't count on it Frown
find quote
jmarshall Offline
Team-XBMC Developer
Posts: 24,564
Joined: Oct 2003
Reputation: 138
Post: #5
The server is closed, so I doubt any code would trickle anywhere.

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


[Image: badge.gif]
find quote
edrikk Offline
Senior Member
Posts: 106
Joined: Jul 2011
Reputation: 2
Wink  RE: Improved UPnP serving and client Post: #6
This is so incredibly great to see!

As it happens, I just posted a Trac ticket which aligns with what you're trying to do here!

Great job, as DLNA is quite useful, and when done correctly, rather functional. As others mentioned on this thread, even though the Plex implementation is in its infancy, it is quite possibly the best implementation I've seen in my usecases yet in terms of meta-data etc (I've used PS3 Media Server, Twonky, XBMC DLNA, Serviio, Plex, Fuppes, MediaTomb, so I speak from experience).

Looking forward to seeing this!


PS. Say what you will about others (e.g. Plex), but you have to give a nod when something is done right.
PPS. I apprecaite greatly the fact that XBMC mods/forum doesn't censor out 'competition' names, allowing for proper discussion. +1 for that!
(This post was last modified: 2012-06-13 21:41 by edrikk.)
find quote
alcoheca Offline
Team-XBMC Developer
Posts: 264
Joined: Feb 2008
Reputation: 5
Post: #7
Sorry for slow reply, I'm not receiving notifications on updates to this thread - will remedy that asap..

I've been having a good look at the Plex server, from a user perspective of course. I can't play with the client as I don't have a Mac or a windows machine.

UPnP/DLNA *is* very useful, and has been underused by XBMC up untill now. Hopefully during this summer we'll see some major improvements..

@Edrikk thanks I'm monitoring the upnp related trac tickets and will get round to updating it
find quote
avjui Offline
Junior Member
Posts: 21
Joined: Sep 2011
Reputation: 0
Post: #8
I think a nice feature would be the syncron playback of the current played media a on a upnp client. I think i have read that upnp is able to do that.
find quote
Robotica Offline
Posting Freak
Posts: 987
Joined: Aug 2010
Reputation: 3
Post: #9
Great project Alcoheca!

Can you tell if picture streaming over UPNP is also part of your plans? Unlike video and audio, pictures aren't stored in a database but they (and their metadata) are cached, which has recently changed drasticly.

As far as I know picture streaming over UPNP in XBMC Eden/Frodo is fixed but needs some work also. But the release notes of XBMC 9 (Camelot) said "Ability to view pictures over UPnP in XBMC, also loads of fixes to the UPnP library"
(This post was last modified: 2012-10-03 11:22 by Robotica.)
find quote
kricker Offline
Team-XBMC QA Specialist
Posts: 3,308
Joined: Apr 2004
Reputation: 16
Location: Knoxville, TN
Post: #10
Nice. I just got pointed to this thread by JoetheFox. I didn't know anyone was working on transcoding features for XBMC. I toyed around with Plex a couple months ago to see how they did it. I didn't get very far into it before I gave up and pitched it. I've been using AirVideo for years for streaming to my iPod and it works so well. I've not found anything quite as easy to setup and use as that. I used Serviio, Mezzmo and PS3 Media Server for a short while trying to stream video to my Sony TVs and iPod/Android devices. Each worked pretty well, but still nothing as well as Airvideo. I'm looking forward to see what you do with this. If you need testing on the Windows side of things, I'd be happy to help. I can compile on my own. I'd love to see a server that can run on my unRaid box (Slackware linux variation) where all my media resides.

Read this before using these builds.
XBMC win32 SVN builds
Changelog
find quote
Post Reply