marcjero 8 Posted November 13, 2014 Share Posted November 13, 2014 Hello, I found that linking XMBC... err Kodi to MB is basically possible throught DLNA/UPNP. I created a custom XBMC DLNA profile that transcodes nothing. Some features are working, others are not. remote control of XBMC renderer from MB -you can start playing a movie from MB UI (great) -you can mute XBMC from MB UI (interesting) -you can't pause, stop, rewind, etc : all the buttons are grayed in the MB UI browsing MB library from XBMC -I was surprised about the good metadata compatibility (good enough for me) : browsing of library is excellent, much better than expected and fast (xbmc is running on a PI) -but movie playback doesn't start when initiated from XBMC UI (XBMC is starting an infinite query loop with server because I guess MB is not returning exactly what was expected) I have the feeling that it could be very possible to make these 2 great projects natively compatibles. Do you think this makes sense ? I know that XBMC doesn't implement DLNA. Do you think MB can serve simple UPNP clients ? I have dev skills so I can help on this topic. Thanks. 2 Link to comment Share on other sites More sharing options...
Luke 37007 Posted November 13, 2014 Share Posted November 13, 2014 Hi there, Thanks for the report. Yea we'd love to have your help on this. Can you find out exactly what the problem is in regards to the xml responses being returned by the server? We can start with that and then look at the remote control buttons. Thanks! Link to comment Share on other sites More sharing options...
marcjero 8 Posted November 13, 2014 Author Share Posted November 13, 2014 (edited) Hi Luke, I got a server log in debug mode. Where would you like me to upload this ? EDIT : I'm not familiar with UPNP/DLNA protocol. But I see in the server payload that the playback URL is returned to client. I suppose xbmc doesn't recognize this DLNA metadata. Edited November 12, 2014 by marcjero Link to comment Share on other sites More sharing options...
Luke 37007 Posted November 13, 2014 Share Posted November 13, 2014 Well it's not so much the log but really we need someone to find the issue with the xml response .so comparing that to another player that works would be a good start. maybe you use one xbmc instance to act as a upnp server, use another xbmc to browse, then grab that xml. Link to comment Share on other sites More sharing options...
marcjero 8 Posted November 13, 2014 Author Share Posted November 13, 2014 Yes I understand. I can use another XBMC instance as UPNP server and compare the payload returned with this one. We should find what XBMC is expecting in the message and then we can try to fix that on the MB side if possible. I will do this tomorrow ! 1 Link to comment Share on other sites More sharing options...
Luke 37007 Posted November 13, 2014 Share Posted November 13, 2014 Awesome, thanks. We'll get it figured out Link to comment Share on other sites More sharing options...
marcjero 8 Posted November 15, 2014 Author Share Posted November 15, 2014 (edited) I didn't have time to work on it but don't worry I will debug this next week Edited November 15, 2014 by marcjero 1 Link to comment Share on other sites More sharing options...
marcjero 8 Posted November 21, 2014 Author Share Posted November 21, 2014 (edited) Ok I think I found something interesting. Look what is returning mediabrowser to Kodi when browsing a movie object : <u:BrowseResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><Result><DIDL-Lite .......</DIDL-Lite></Result><NumberReturned>1</NumberReturned><TotalMatches>0</TotalMatches><UpdateID>2337</UpdateID></u:BrowseResponse></SOAP-ENV:Body></SOAP-ENV:Envelope> I removed the DIDL message because I don't think the issue is here. Mediabrowser is returning 1 for NumberReturned but 0 for TotalMatches. TotalMatches should be set to 1 here. I think that when TotalMatches <> NumberReturned Kodi is trying to iterate browse requests and enters an infinite loop. Kodi UPNP server is returning 1 for both. Does it make sense for you ? Edited November 20, 2014 by marcjero Link to comment Share on other sites More sharing options...
Luke 37007 Posted November 21, 2014 Share Posted November 21, 2014 I'll look at it. This was a tricky one though that @@7illusions and I fixed a few months ago. Changing it could affect other upnp clients, so I'm unlikely to throw it in last minute before a server release. But certainly at the beginning of the next cycle we can add it and see how it goes. Link to comment Share on other sites More sharing options...
steve1977 67 Posted November 22, 2014 Share Posted November 22, 2014 I found that linking XMBC... err Kodi to MB is basically possible throught DLNA/UPNP. I created a custom XBMC DLNA profile that transcodes nothing. Some features are working, others are not. remote control of XBMC renderer from MB -you can start playing a movie from MB UI (great) -you can mute XBMC from MB UI (interesting) -you can't pause, stop, rewind, etc : all the buttons are grayed in the MB UI Thanks marcjero to supporting with your dev skills. It sounds like this is getting some traction again. Thanks again! There is a long threat on the issue you are stating above about not being able to pause, stop, etc. Any further thoughts are appreciated!!! http://mediabrowser.tv/community/index.php?/topic/10416-xbmc-as-receiver/page-4 Link to comment Share on other sites More sharing options...
Luke 37007 Posted November 22, 2014 Share Posted November 22, 2014 i'm putting the change up in a server dev build so that you can play with it. i'll decide later if it goes into the release or not. 2 Link to comment Share on other sites More sharing options...
Happy2Play 8242 Posted November 22, 2014 Share Posted November 22, 2014 How can I get the dev version ? I suppose I have to build it ? Go to Dashboard-Advanced-Auto Update and change level to Dev and click save. This will auto update to Dev build. Link to comment Share on other sites More sharing options...
marcjero 8 Posted November 22, 2014 Author Share Posted November 22, 2014 You are welcome. Just a newbie question : how can I get the dev version ? I suppose I have to build it ? I saw your fix and I'm pretty sure it will work fine now. I understand now that when an UPNP client is doing a BrowseMetadata request server can return several results. Returning 0 fro TotalMatches confuses XBMC and then it tries to get all the results using an index. I can clearly see that in the log file. And for each request MB returns exactly the same payload so this can run forever... Link to comment Share on other sites More sharing options...
marcjero 8 Posted November 22, 2014 Author Share Posted November 22, 2014 Well this doesn't seem to work for me, nothing happens even if I restart the service. I running a headless Ubuntu server and installed from PPA... Link to comment Share on other sites More sharing options...
Luke 37007 Posted November 22, 2014 Share Posted November 22, 2014 Well this doesn't seem to work for me, nothing happens even if I restart the service. I running a headless Ubuntu server and installed from PPA... The auto-updates are only for windows right now Link to comment Share on other sites More sharing options...
marcjero 8 Posted November 22, 2014 Author Share Posted November 22, 2014 Ok so I found the script to build the Linux version on Github. Is there a script that creates the deb package as well ? Link to comment Share on other sites More sharing options...
marcjero 8 Posted December 4, 2014 Author Share Posted December 4, 2014 Hi Luke, I just tested 5445.6 (that should include the fix) but unfortunately TotalMatches is still set to 0. I took a look at the code you fixed, please read my comments inside if (string.Equals(flag, "BrowseMetadata")) // OK the query is really BrowseMetadata { if (item.IsFolder || serverItem.StubType.HasValue) { var childrenResult = (await GetUserItems(item, serverItem.StubType, user, sortCriteria, start, requested).ConfigureAwait(false)); totalCount = 1; result.DocumentElement.AppendChild(_didlBuilder.GetFolderElement(result, item, serverItem.StubType, null, childrenResult.TotalRecordCount, filter, id)); // Here totalCount = 1 so it looks fine } else { // Here totalCount = 0 I guess we just fall here... result.DocumentElement.AppendChild(_didlBuilder.GetItemElement(result, item, null, null, deviceId, filter)); } provided++; //Maybe you just need to add something like totalCount++; here and remove totalCount = 1; } else... 2 Link to comment Share on other sites More sharing options...
Luke 37007 Posted December 4, 2014 Share Posted December 4, 2014 Thanks. You can test it out with the latest dev build. 2 Link to comment Share on other sites More sharing options...
Luke 37007 Posted December 5, 2014 Share Posted December 5, 2014 Thanks I'll look at it. Yes movies initially come back with a folder container that contains the actual movie, trailers, extras, cast/crew, etc. Link to comment Share on other sites More sharing options...
marcjero 8 Posted December 5, 2014 Author Share Posted December 5, 2014 (edited) Ok it works better now but there are other issues. Did you change the behaviour of browsing in the last few days ? Because now when I select a movie a BrowseDirectChildren query is issued so I think XBMC is thinking the movie is just a folder. Inside this folder I can see 2 items : the real movie object and another item called "Movie Team". I can play the movie object. But it's strange because for some movies I can't just enter the movie folder at all. BrowseDirectChildren fails with this exception : System.AggregateException at System.Threading.Tasks.Task`1[System.Collections.Generic.IEnumerable`1[System.Collections.Generic.KeyValuePair`2[System.String,System.String]]].get_Result () [0x00000] in <filename unknown>:0 at MediaBrowser.Dlna.ContentDirectory.ControlHandler.GetResult (System.String methodName, MediaBrowser.Dlna.Server.Headers methodParams) [0x00000] in <filename unknown>:0 at MediaBrowser.Dlna.Service.BaseControlHandler.ProcessControlRequestInternal (MediaBrowser.Controller.Dlna.ControlRequest request) [0x00000] in <filename unknown>:0 at MediaBrowser.Dlna.Service.BaseControlHandler.ProcessControlRequest (MediaBrowser.Controller.Dlna.ControlRequest request) [0x00000] in <filename unknown>:0 InnerException: System.ArgumentException Argument not supported: http://192.168.0.14:8096/mediabrowser/videos/1757f360122bb19dcc459b49fe0f15a9/stream at MediaBrowser.Common.Net.MimeTypes.GetMimeType (System.String path) [0x00000] in <filename unknown>:0 at MediaBrowser.Dlna.Didl.DidlBuilder.AddVideoResource (System.Xml.XmlElement container, IHasMediaSources video, System.String deviceId, MediaBrowser.Dlna.Didl.Filter filter, System.String contentFeatures, MediaBrowser.Model.Dlna.StreamInfo streamInfo) [0x00000] in <filename unknown>:0 at MediaBrowser.Dlna.Didl.DidlBuilder.AddVideoResource (System.Xml.XmlElement container, IHasMediaSources video, System.String deviceId, MediaBrowser.Dlna.Didl.Filter filter, MediaBrowser.Model.Dlna.StreamInfo streamInfo) [0x00000] in <filename unknown>:0 at MediaBrowser.Dlna.Didl.DidlBuilder.GetItemElement (System.Xml.XmlDocument doc, MediaBrowser.Controller.Entities.BaseItem item, MediaBrowser.Controller.Entities.BaseItem context, Nullable`1 contextStubType, System.String deviceId, MediaBrowser.Dlna.Didl.Filter filter, MediaBrowser.Model.Dlna.StreamInfo streamInfo) [0x00000] in <filename unknown>:0 at MediaBrowser.Dlna.ContentDirectory.ControlHandler+<HandleBrowse>c__async0.MoveNext () [0x00000] in <filename unknown>:0 Is the movie folder a normal item I should get ? I noticed this error as well : Error - NotFoundHttpHandler: 192.168.0.14:8096 Request not found: /mediabrowser/Dlna/icons/people480.jpg I can build the dev sources and test easily so I can do any testing you need now. I can share a basic Kodi profile with no transcoding if interested. Edited December 4, 2014 by marcjero Link to comment Share on other sites More sharing options...
marcjero 8 Posted December 5, 2014 Author Share Posted December 5, 2014 (edited) Ok I think that the correct playback URL should be http://192.168.0.14:8096/mediabrowser/videos/1757f360122bb19dcc459b49fe0f15a9/stream.mkv Extension is missing so video type isn't resolved. It's strange because I looked into the library db file and movies paths are correct. update : all metadata for all movies are displayed correctly in the dashboard. I was expecting a problem when extracting metadata from media files but it doesn't seem to be the cause of the error. Edited December 5, 2014 by marcjero Link to comment Share on other sites More sharing options...
Luke 37007 Posted December 6, 2014 Share Posted December 6, 2014 you are correct, although that method should really be named IsEligibleForDirectStream, because there is no direct play with dlna, only direct stream. what you've commented out will result in no subtitles, because if the subtitle method is encode, but you force direct stream, there won't be any subs. instead you should adjust the dlna profile so that the subtitle method ends up being external or embed. Link to comment Share on other sites More sharing options...
marcjero 8 Posted December 6, 2014 Author Share Posted December 6, 2014 Luke, I think I found where the problem is (was) Look at this code (StreamBuilder.cs) : private bool IsEligibleForDirectPlay(MediaSourceInfo item, int? maxBitrate, MediaStream subtitleStream, VideoOptions options) { if (subtitleStream != null) { if (!subtitleStream.IsTextSubtitleStream) { return false; } /*SubtitleDeliveryMethod subtitleMethod = GetSubtitleDeliveryMethod(subtitleStream, options); if (subtitleMethod != SubtitleDeliveryMethod.External && subtitleMethod != SubtitleDeliveryMethod.Embed) { return false; }*/ } return IsAudioEligibleForDirectPlay(item, maxBitrate); } I understand you do some testing about the subtitles. Some of my files fail at the second test, I don't really know why. Just to be sure to understand what is the difference with DirectPlay and Direct Stream ? DirectStream is for HTTP without transcoding (my use case), DirectPlay for direct access to filesystem (smb, nfs) ? Am I correct ? Link to comment Share on other sites More sharing options...
marcjero 8 Posted December 6, 2014 Author Share Posted December 6, 2014 (edited) Oh I see I will look at the DLNA profile then. Do you think it's possible to implement direct play for UPNP ? UPDATE : I did few hacks and was able to play video using nfs (DirectPlay) I found that you already enabled DirectPlay for DLNA only for HTTP protocol correct ? Do you plan to support other protocols in the future ? Doesn't require many changes, the main problem is to provide an additional configuration option for DLNA profiles. Edited December 9, 2014 by marcjero 1 Link to comment Share on other sites More sharing options...
steve1977 67 Posted December 29, 2014 Share Posted December 29, 2014 Any update on this? Allowing XBMC to play directly without any transcoding over SMB (triggered by MBS or the IOS app) would be heaven! This would basically make the IOS device a client on its own and at the same time a remote for XBMC. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now