Samsung TV built-in DLNA client broken since v1.1.5
Brought to you by:
jmaggard
The Samsung ES8000 TV works with minidlna/ReadyMedia up to and including v1.1.4.
However in v1.1.5 and v1.2.0, the TV displays an error and the following is logged:
[2017/08/04 23:27:01] upnpsoap.c:123: warn: Returning UPnPError 402: Invalid Args
... which further debug code indicates is coming from:
if( !ObjectID && !(ObjectID = GetValueFromNameValueList(&data, "ContainerID")) ) { SoapError(h, 402, "Invalid Args"); goto browse_error; }
HTTP debug (from v1.1.5) shows:
[2017/08/07 23:35:43] clients.c:271: debug: Client found in cache. [Samsung Series [CDEF]/entry 1] [2017/08/07 23:35:43] upnphttp.c:880: debug: HTTP REQUEST: POST /ctl/ContentDir HTTP/1.1 Accept: */* User-Agent: SEC_HHP_[TV]UE40ES8000/1.0 DLNADOC/1.50 Host: x.x.x.x:2869 SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#X_GetFeatureList" CONTENT-TYPE: text/xml; charset="utf-8" Content-Length: 291 Connection: close <?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:X_GetF eatureList xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"></u:X_GetFeatureList></s:Body></s:Envelope> [2017/08/07 23:35:43] upnphttp.c:655: debug: SOAPAction: urn:schemas-upnp-org:service:ContentDirectory:1#X_GetFeatureList [2017/08/07 23:35:43] upnpsoap.c:1985: debug: SoapMethod: X_GetFeatureList [2017/08/07 23:35:43] upnphttp.c:1216: debug: HTTP RESPONSE: HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Connection: close Content-Length: 783 Server: 4.11.3 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.1.5 Date: Mon, 07 Aug 2017 22:35:43 GMT EXT: <?xml version="1.0" encoding="utf-8"?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:X_GetFeatureListResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><FeatureList><Features xmlns="urn:schemas-upnp-org:av:avs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:schemas-upnp-org:av:avs http://www.upnp.org/schemas/av/avs.xsd"><Feature name="samsung.com_BASICVIEW" version="1"><container id="1" type="object.item.audioItem"/><container id="2" type="object.item.videoItem"/><container id="3" type="object.item.imageItem"/></Feature></Features></FeatureList></u:X_GetFeatureListResponse></s:Body></s:Envelope> [2017/08/07 23:35:43] clients.c:271: debug: Client found in cache. [Samsung Series [CDEF]/entry 1] [2017/08/07 23:35:43] upnphttp.c:880: debug: HTTP REQUEST: POST /ctl/ContentDir HTTP/1.1 Accept: */* User-Agent: SEC_HHP_[TV]UE40ES8000/1.0 DLNADOC/1.50 Host: x.x.x.x:2869 SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#X_GetFeatureList" CONTENT-TYPE: text/xml; charset="utf-8" Content-Length: 291 Connection: close <?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:X_GetFeatureList xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"></u:X_GetFeatureList></s:Body></s:Envelope> [2017/08/07 23:35:43] upnphttp.c:655: debug: SOAPAction: urn:schemas-upnp-org:service:ContentDirectory:1#X_GetFeatureList [2017/08/07 23:35:43] upnpsoap.c:1985: debug: SoapMethod: X_GetFeatureList [2017/08/07 23:35:43] upnphttp.c:1216: debug: HTTP RESPONSE: HTTP/1.1 200 OK Content-Type: text/xml; charset="utf-8" Connection: close Content-Length: 783 Server: 4.11.3 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.1.5 Date: Mon, 07 Aug 2017 22:35:43 GMT EXT: <?xml version="1.0" encoding="utf-8"?> <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><u:X_GetFeatureListResponse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><FeatureList><Features xmlns="urn:schemas-upnp-org:av:avs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:schemas-upnp-org:av:avs http://www.upnp.org/schemas/av/avs.xsd"><Feature name="samsung.com_BASICVIEW" version="1"><container id="1" type="object.item.audioItem"/><container id="2" type="object.item.videoItem"/><container id="3" type="object.item.imageItem"/></Feature></Features></FeatureList></u:X_GetFeatureListResponse></s:Body></s:Envelope> [2017/08/07 23:35:43] clients.c:271: debug: Client found in cache. [Samsung Series [CDEF]/entry 1] [2017/08/07 23:35:43] upnphttp.c:880: debug: HTTP REQUEST: POST /ctl/ContentDir HTTP/1.1 Accept: */* User-Agent: SEC_HHP_[TV]UE40ES8000/1.0 DLNADOC/1.50 Host: x.x.x.x:2869 SOAPACTION: "urn:schemas-upnp-org:service:ContentDirectory:1#Browse" CONTENT-TYPE: text/xml; charset="utf-8" Content-Length: 451 Connection: close <?xml version="1.0" encoding="utf-8"?><s:Envelope s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/" xmlns:s="http://schemas.xmlsoap.org/soap/envelope/"><s:Body><u:Browse xmlns:u="urn:schemas-upnp-org:service:ContentDirectory:1"><ObjectID></ObjectID><BrowseFlag>BrowseDirectChildren</BrowseFlag><Filter>*</Filter><StartingIndex>0</StartingIndex><RequestedCount>30</RequestedCount><SortCriteria></SortCriteria></u:Browse></s:Body></s:Envelope> [2017/08/07 23:35:43] upnphttp.c:655: debug: SOAPAction: urn:schemas-upnp-org:service:ContentDirectory:1#Browse [2017/08/07 23:35:43] upnpsoap.c:1985: debug: SoapMethod: Browse [2017/08/07 23:35:43] upnpsoap.c:123: warn: Returning UPnPError 402: Invalid Args [2017/08/07 23:35:43] upnphttp.c:1216: debug: HTTP RESPONSE: HTTP/1.1 500 Internal Server Error Content-Type: text/xml; charset="utf-8" Connection: close Content-Length: 396 Server: 4.11.3 DLNADOC/1.50 UPnP/1.0 MiniDLNA/1.1.5 Date: Mon, 07 Aug 2017 22:35:43 GMT EXT: <s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/" s:encodingStyle="http://schemas.xmlsoap.org/soap/encoding/"><s:Body><s:Fault><faultcode>s:Client</faultcode><faultstring>UPnPError</faultstring><detail><UPnPError xmlns="urn:schemas-upnp-org:control-1-0"><errorCode>402</errorCode><errorDescription>Invalid Args</errorDescription></UPnPError></detail></s:Fault></s:Body></s:Envelope>
That is definitely an invalid argument. I was under the impression that Samsung had cleaned those bugs up many years ago. How old is your TV model?
Does this patch help?
Great, thanks - I'll try that patch now and report back.
The TV is a Samsung ES8000 which dates from around 2012, and it also has the Evolution Kit from 2013. Both are patched up to the most recent firmware.
Hmm - interesting... it works, but the behaviour under v1.1.4 and below was that you'd be offered a choice, after choosing "Audio", "Video", or "Pictures", of "All Video" (for example), "Folders" and "Recently Added".
With the above patch, v1.2.0 jumps straight to the "All items" view, without first giving a choice of limiting the items shown.
(... and with a large number of items, crashed Samsung's UI - but I doubt that's RM's problem)
Does a different ObjectID allow the second-level menu to be shown? Is it possible to modify the above patch to restore the "All <item>"/"Folders"/"Recently Added" sub-menu?
It's hard to say what the TV has decided to do. Can you post debug logs from the conversation with the TV after the patch is applied?
Interesting to note that Music and Photos still show meta-categories (such as Recent Items/Newly Added, Folders, etc.) first. Only Videos jumps straight to the full item-list, which then causes the Samsung client to crash after a period (presumably because it's trying to display every item at once, rather than paging).
minidlna-1.2.0 + patch:
For comparison, v1.1.4 shows a second-level menu of All/Folders/Recent (as previously dfescribed) and, if All Items is chosen, doesn't hang and crash, but pretty much instantly shows a page of items and then loads their thumb-nails.
I guess that the real question is what changed between v1.1.4 and v1.2.0 in this respect, since the same client is being used in both cases.
A start:
Did a quick search, the latest firmware for your tv is Aug 2015? Look like Samsung gave up on your tv? Time to buy a new one.
Yes, the correct response to a software regression is to replace the hardware! ;)
In all seriousness, though, I did look at a diff of upnpsoap.c between 1.1.4 and 1.2.0 - and the changes weren't great, but also didn't include anything which to me looked obviously likely to be related - but then, I know nothing of the DLNA DMS/DMP protocols. Is it likely that any change will reference Samsung specifically? Was there some cleanup between 1.1.4 and 1.2.0 which removed work-arounds for devices considered obsolete?
Show a list of files using samsung. clients.* is of interest. Looks like the profile you are using has changed. Don't know if it will help, but you can try testing with similar flags as v1_1_4.
Good news - the exact change above (which presumably means that the earlier patch no longer takes effect) restores working functionality as was the case in v1.1.4: there is the three-item menu initially (All items, Recently Added, Folders) and each of these works - no more hanging followed by a crash when choosing All Items.
I'm confirming now that it is the FLAG_SAMSUNG_DCM10 flag specifically which is causing the problem for my device.
It looks as if 'upnphttp.c' contains:
... and 2012-era Samsung devices which have been flagged with FLAG_SAMSUNG_DCM10 cannot grok the Samsung-specific description returned.
So it appears that clients.c needs to further subdivide 'ESamsungSeriesCDE' devices into those which need a non-standard XML description, and those which cannot handle it.
My understanding is that removing the DCM10 flag will break bookmark support, so of course I'd prefer to avoid that. So I have a couple requests.
1) The 1.2.0+patch debug output seems to have been truncated, and the important parts are missing. Can you maybe write the full output to a file, compress it, and attach it here?
2) Please try this patch:
Last edit: Justin Maggard 2017-08-14
Thanks! I'll try this evening.
That last patch looks good - a brief test shows All FIles/Recent/Folders after chosing the category of media to stream, and appears not to suffer from crashing when viewing All Files.
Fast Forward and Rewind when playing media still displays "Not available", but then it always has done, even before v1.1.4... I guess this isn't intended to work with this client?
All good, though :)
Last edit: Stuart Shelton 2017-08-15
Great! Would you also be able to capture debug output with this latest patch, and attach it here? It'd be very helpful for simulating your TV in the future for testing.