Modify

Opened 17 months ago

Last modified 2 weeks ago

#12767 new Bug Report - General

Issues with DLNA clients

Reported by: Dylan Walkden <dylan@…> Owned by: dblain
Priority: minor Milestone: 0.28.2
Component: MythTV - UPnP Version: 0.28.0
Severity: medium Keywords: dnla upnp
Cc: Ticket locked: no

Description

I'm experiencing problems accessing the recordings on my MythTV backend using DNLA clients.

Using a PS3 to browse "Recordings by Title" shows folders for each show but the folders are empty, with some (but not all) of the recordings appearing in the root folder of that view. Using "Recordings by Date" appears to work as normal.

To test I tried using the Windows Kodi app (latest version) as a DLNA client, it was unable to locate the MythTV backend at all, even if I manually specified the IP address.

Other people are also seeing this issue, as reported here: http://www.gossamer-threads.com/lists/mythtv/users/598767

Attachments (9)

2016-05-13 17_02_54-UPnP Inspector.png (40.8 KB) - added by Dylan Walkden <dylan@…> 17 months ago.
mythtv_mediaserver.png (22.7 KB) - added by stuartm 17 months ago.
MythTV logs.txt (5.4 KB) - added by Dylan Walkden <dylan@…> 17 months ago.
Mythbox.pcapng (431.5 KB) - added by Dylan Walkden <dylan@…> 16 months ago.
VLC media player.png (12.5 KB) - added by anonymous 15 months ago.
Empty VLC
VLC other media server.png (26.7 KB) - added by anonymous 15 months ago.
Not using Myth TV .28
Myth27_2TVs.pcapng (216.5 KB) - added by karlstudentspam@… 15 months ago.
0.27 packet capture
Myth28_2TVs.pcapng (166.8 KB) - added by karlstudentspam@… 15 months ago.
0.28 packet capture
mythtv-dlna-fixes.patch (2.7 KB) - added by davidm <dfilterspam@…> 7 months ago.
possible fixes

Download all attachments as: .zip

Change History (46)

comment:1 follow-ups: Changed 17 months ago by stuartm

The issue with Kodi is that it's neither DLNA or UPnP compliant.

Just as soon as I get the time I'll add a config setting to enable compatibility with broken clients.

For the issue with the PS3 I think we'll need to debug with UPnP-Inspector to see what's happening in your setup. I don't have a PS3 but I can't reproduce the title issue with any DLNA compliant client and the returned metadata is correct.

comment:2 in reply to: ↑ 1 Changed 17 months ago by Dylan Walkden <dylan@…>

Replying to stuartm:

For the issue with the PS3 I think we'll need to debug with UPnP-Inspector to see what's happening in your setup. I don't have a PS3 but I can't reproduce the title issue with any DLNA compliant client and the returned metadata is correct.

I'm very happy to assist, just let me know what you need and I'll see what I can do.

Changed 17 months ago by Dylan Walkden <dylan@…>

comment:3 in reply to: ↑ 1 ; follow-up: Changed 17 months ago by Dylan Walkden <dylan@…>

Replying to stuartm:

For the issue with the PS3 I think we'll need to debug with UPnP-Inspector to see what's happening in your setup. I don't have a PS3 but I can't reproduce the title issue with any DLNA compliant client and the returned metadata is correct.

I grabbed uPnP Inspector and have been familiarising myself with it. I'm not sure if this helps but I can browse the content on my Synology NAS (detected as a MediaServer?) by right-clicking and selecting "browse MediaServer?" but when I right-click on the MythTV backend (detected as a MediaRenderer?) that option is missing.

comment:4 in reply to: ↑ 3 ; follow-up: Changed 17 months ago by dekarl

Replying to Dylan Walkden <dylan@…>:

but when I right-click on the MythTV backend (detected as a MediaRenderer?) that option is missing.

I think you are looking at your frontend, the "MythFrontend:1" gives it away. I'm not seeing a backend at all in that screenshot.

comment:5 in reply to: ↑ 4 Changed 17 months ago by Dylan Walkden <dylan@…>

Replying to dekarl:

Replying to Dylan Walkden <dylan@…>:

but when I right-click on the MythTV backend (detected as a MediaRenderer?) that option is missing.

I think you are looking at your frontend, the "MythFrontend:1" gives it away. I'm not seeing a backend at all in that screenshot.

Heh, I should have noticed that. The frontend and backend are running on the same server, would that be relevant?

comment:6 Changed 17 months ago by Dylan Walkden <dylan@…>

I've tried shutting down the frontend and restarting the backend just in case. The backend still doesn't show up in uPnP Inspector. Though the PS3 is still able to locate it, but with the same issues with the content browsing.

comment:7 follow-up: Changed 17 months ago by stuartm

No, Frontend and backend UPnP server can co-exist on the same machine just fine. This is the setup I have on my development machine. It should look like the screenshot I've attached.

So we need to figure out why UPnP Inspector is unable to see the backend. Enabling "-v http, upnp" logging on the backend may help.

comment:8 Changed 17 months ago by stuartm

  • Milestone changed from unknown to 0.28.1

Changed 17 months ago by stuartm

comment:9 follow-up: Changed 17 months ago by stuartm

Can you check what the version of UPnP inspector is?

comment:10 in reply to: ↑ 9 Changed 17 months ago by Dylan Walkden <dylan@…>

Replying to stuartm:

Can you check what the version of UPnP inspector is?

Version 0.2.2

comment:11 follow-up: Changed 17 months ago by stuartm

I'm using 0.2.3 (from their repo), if I recall correctly there is a bug in 0.2.2. or in one of the packaged dependencies.

comment:12 in reply to: ↑ 11 Changed 17 months ago by Dylan Walkden <dylan@…>

Replying to stuartm:

I'm using 0.2.3 (from their repo), if I recall correctly there is a bug in 0.2.2. or in one of the packaged dependencies.

Righto, I'll see if I can compile get it running on my linux box.

comment:13 in reply to: ↑ 7 Changed 17 months ago by Dylan Walkden <dylan@…>

Replying to stuartm:

No, Frontend and backend UPnP server can co-exist on the same machine just fine. This is the setup I have on my development machine. It should look like the screenshot I've attached.

So we need to figure out why UPnP Inspector is unable to see the backend. Enabling "-v http, upnp" logging on the backend may help.

Here are the logs I got while uPnP Inspector (0.2.2) was running a discovery. Though I did use --setverbose rather than -v to turn on logging, but I assume that won't matter.

I tried copy & paste but it was a huge mess, I'll add the logs as an attachment.

Changed 17 months ago by Dylan Walkden <dylan@…>

comment:14 Changed 17 months ago by Dylan Walkden <dylan@…>

I got uPnP Inspector 0.2.3 up and running and it is able to locate the MythTV backend and if I browse the contents they all show up correctly.

Would it be helpful if I installed Wireshark and got a packet capture of the PS3 talking to the backend?

comment:15 follow-up: Changed 17 months ago by stuartm

Yes, thank you, I think looking at what the PS3 is asking for and receiving would be the next step and a great help.

comment:16 in reply to: ↑ 15 Changed 16 months ago by Dylan Walkden <dylan@…>

Replying to stuartm:

Yes, thank you, I think looking at what the PS3 is asking for and receiving would be the next step and a great help.

Sorry about the delay, here is the capture file as promised.

Changed 16 months ago by Dylan Walkden <dylan@…>

Changed 15 months ago by anonymous

Empty VLC

comment:17 Changed 15 months ago by karlstudentspam@…

I just thought I'd let you know, this is not unique to PS3.

I have a less than a year old Samsung Smart TV that shows shows "MythTV AV media Server" the Music, Videos and Recordings are all empty. This used to work with .27, and now doesn't work with .28

If I use other software (BubbleUPnP) I can browse and stream from .28 without a problem, so it isn't totally broke.

New reproducible steps: 1) Load up VLC media player (v2.2.4 on Windows or Linux) 2) Under Local Network (on the left) select Universal Plug 'n Play 3) Wait a few seconds and double click your PC 4) Notice that no sub-directories show up.

I've verified that I can browse other PnP servers with VLC, without issues. (I attached a screen shot)

Changed 15 months ago by anonymous

Not using Myth TV .28

comment:18 Changed 15 months ago by stuartm

VLC is known to have a broken UPnP implementation. I believe the bugs have been filed with them, but it wouldn't hurt to check and add your experiences in their bug tracker.

There are several bugs, but the one most applicable here is that they don't support discovery of UPnP/DLNA servers with versions greater than 1. MythTV implements version 4. The UPnP spec states that clients MUST connect to servers supporting later versions - As UPnP is backwards compatible a v1 client can connect to a v4 server with no issues.

Other issues include the indexing behaviour of VLC - once connected to the server it proceeds to crawl all the media available (this is contrary to the intention of UPnP spec). However making things worse it fetches the metadata for files one at a time instead of in batches, it sends no filters with the requests and with a large enough media collection this means thousands, tens of thousands of consecutive requests are made to the UPnP server consuming large amounts of bandwith instead of a few dozen calls returning only the metadata which will actually be used. This amounts to an unintended Denial of Service attack on the server.

TLDR; VLC's UPnP implementation is terrible, badly written and riddled with bugs. Neither DLNA nor UPnP compliant.

comment:19 Changed 15 months ago by dekarl

please add links to bugs in UPNP client implementations at https://www.mythtv.org/wiki/UPnP_Client_Info#Software_UPnP_Clients

comment:20 Changed 15 months ago by karlstudentspam@…

Thanks for the update on VLC, I agree that VLC has a broken implementation of UPnP.

I had some time to do a little "before and after" testing. I set up two Virtual Machines (VMs) with MythTV 0.27 and 0.28

The VM with MythTV 0.27 has the IP Address = 192.168.2.27

The VM with MythTV 0.28 has the IP Address = 192.168.2.28

I tried VLC and it didn't work with either version, so there goes the hopes that you could easily reproduce the problem (without me sending you a TV).

So decided I wold gather up some more information:

1) I fired up Wireshark on both VMs.

2) I powered up my Samsung TV (192.168.2.10) [it is four months old]

I waited about 5 minutes then tried to navigate to Videos. (Against both VMs) .28 does not show any videos, but at least both VMs show up.

3) Later I powered up my LG TV (192.168.2.8) [two years old w/current updates]

.28 does not even show up as a device I can select.

TLDR; VLC is broke, which is a completely separate issue. Neither of my TVs will list videos after upgrading to 0.28, both worked fine with 0.27. I'll attach two caps.

I'd be willing to help in whatever way I can, to get this bug resolved. Contact me at a google based email address.

Changed 15 months ago by karlstudentspam@…

0.27 packet capture

Changed 15 months ago by karlstudentspam@…

0.28 packet capture

comment:21 Changed 12 months ago by and.mayer@…

When removing the deviceList section from devicemaster.xml (and restarting the BE) Kodi (16.1 running on Android in my case) is able to see content from the 0.28 backend again.

comment:22 Changed 11 months ago by stuartm

Removing the deviceList section just breaks sending of the correct versions numbers/device description to Kodi proving that the problem is at the Kodi end.

comment:23 follow-up: Changed 11 months ago by karlstudentspam@…

Is there a configuration change I can also make to MythTV, so that I can get my smart TVs to work again via DNLA? They used to work with Myth .27

Is there anything I can do to help?

comment:24 Changed 11 months ago by stuartm

What brands/model of TV?

comment:25 follow-up: Changed 11 months ago by karlstudentspam@…

Network details can be found in the previous attached packet captures.

192.168.2.10 = SEC_HHP_[TV]Samsung LED40/1.0 DLNADOC/1.50

a.k.a. Samsung H5203 http://www.samsung.com/us/televisions-home-theater/tvs/full-hd-tvs/led-h5203-series-smart-tv-40-class-40-0-diag-un40h5203afxza/


192.168.2.8 = Linux/3.0.13 UPnP/1.0 LGE_DLNA_SDK/1.6.0 [TV][LG]55LA6970-UD/05.09.06 DLNADOC/1.50

a.k.a. LG 55LA6970 http://www.lg.com/us/tvs/lg-55LA6970-led-tv

I could probably borrow a Sony (I think) as well, as a friend of mine is having the same problem.

comment:26 in reply to: ↑ 23 Changed 11 months ago by dekarl

Replying to karlstudentspam@…:

Is there anything I can do to help?

I started to learn Docker to package up a Mythical MythTV UPNP Demonstrator but got sidetracked in details like "how to do multicast networking from containers". (then life happened)

If anyone is good at Docker and wants to help, a container which automatically sets up a backend (just use the Ubuntu packages) with some sample content (Blender movies + metadata as movies and recordings) that would be a great thing to hand out to UPNP client developers in a "Plugfest as a Service" style :)

comment:27 Changed 11 months ago by stuarta

@dekarl docker is pretty straightforward. We can work on producing a Dockerfile to generate this.

comment:28 in reply to: ↑ 25 Changed 11 months ago by and.mayer@…

Replying to karlstudentspam@…:

Network details can be found in the previous attached packet captures.

Your LG TV might suffer from the same problem Kodi has with embedded devices. Have you already tried if removing deviceList from devicemaster.xml changes anything (although this would not prove who is in error here)? Your Samsung TV is issuing a browse request for ObjectId? Videos with RequestedCount? 1 and the BE does return with NumberReturned? 4, I think that upnpcdsvideo.cpp LoadChilden? is in error here, it does always return all children for the root video node (but I don't know if fixing this problem would help for your TV).

comment:29 Changed 11 months ago by karlStudentspam@…

I commented out the deviceList section as well as the embedded device section inside of that. Then restarted the backend, it does not appear to have made any difference for either TV.

I also removed any XML comments within that section as well. (So the ending XML comment tags wouldn't conflict.)

I'm almost tempted to pull down the code and try to debug it myself at this point. Last time I compiled MythTV myself, was 10+ years ago. With the file name upnpcdsvideo.cpp that at least gives me a place to start looking.

comment:30 Changed 8 months ago by stuarta

  • Milestone changed from 0.28.1 to 0.28.2

Moving remaining open 0.28.1 tickets to 0.28.2

Changed 7 months ago by davidm <dfilterspam@…>

possible fixes

comment:31 Changed 7 months ago by davidm <dfilterspam@…>

I have added a patch here. This includes the removal of the deviceList section, as well as a couple other small changes. The combination of these resolve browsing on Kodi for me, as well as the PS3, and an HTC android device.

comment:32 Changed 7 months ago by stuartm

The case comparison fixes are fine. The removal of the devicelist section is still problematic. I'll check against UPnP spec one more time to see whether there's anything wrong with our version, but that wasn't the case when I've looked at it in the past.

The main issue remains the fact that some of these clients are not UPnP compliant and breaking the server to make the clients work is not an acceptable solution.

comment:33 Changed 7 months ago by davidm <dfilterspam@…>

Since this thread indicated that kodi is problematic with this entry, and since I was using that for diagnosing the problem, I started with that section removed. I have just gone back and re-added the deviceList section. The other two devices I used to confirm the fix still work with that in place. I do not have enough devices to specifically say that this is kodi specific, but at this stage, it seems to be the only one exhibiting the problem. In general, the other changes in the patch are all that are required for things to work properly for me.

comment:34 Changed 4 months ago by efolse@…

It is a deal breaker for my mythtv not to allow my tv play the recordings. My wife would rightly throw me out of the house and the backend would land on top of me. I had to reinstall an earlier version (27.2) to get access to everything. Perhaps a separate server that translates from the UPnP ideal spec to the less precise but more functional hardware. When we get a new TV we can then manually (individually) disable and remove the transitional server.

comment:35 Changed 4 months ago by robbadler@…

I applied this patch to my install of 0.28.1 and both my PS3 can now fully browse and play the DLNA listings from Mythtv. Thanks so much

Linux 3.10.0-514.6.2.el7.x86_64 CentOS Linux release 7.3.1611 (Core) MythTV Version : v0.28.1-34-gc5a43e5 MythTV Branch : ticket12767 Network Protocol : 88 Library API : 0.28.20161120-1 QT Version : 5.6.1 Options compiled in:

linux debug use_hidesyms using_alsa using_oss using_pulse using_pulseoutput using_backend using_bindings_perl using_bindings_python using_bindings_php using_dvb using_frontend using_hdhomerun using_vbox using_ceton using_hdpvr using_ivtv using_joystick_menu using_libcec using_libcrypto using_libdns_sd using_libxml2 using_lirc using_mheg using_opengl using_opengl_video using_opengl_themepainter using_qtwebkit using_qtscript using_qtdbus using_taglib using_v4l2 using_x11 using_xrandr using_xv using_debugtype using_systemd_notify using_bindings_perl using_bindings_python using_bindings_php using_freetype2 using_mythtranscode using_opengl using_vaapi using_vdpau using_ffmpeg_threads using_mheg using_libass using_libxml2

comment:36 Changed 2 weeks ago by thomas@…

I have tried VLC (Android), DMS Explorer (Android) and (for me most importantly) djmount, which is being used by my Enigma2 based Linux SAT receiver.

The main problem with 0.27 was that MythTV presented HD recordings as .m3u and my SAT reveiver thought that this is an MP3 playlist. I was able to play SD recordings fine. So I updated my test system to 0.28.1.

0.28.1 (on Gentoo) out of the box is invisible to *all* of the clients. When I remove the deviceList section from devicemaster.xml then VLC can see it, but sees no content. DMS Explorer works fine. djmount unfortunately still cannot see it at all.

comment:37 Changed 2 weeks ago by thomas@…

Forgot one thing: My 2012 LG TV can see MythTV 0.27, but cannot see 0.28.1, not even with the deviceList section removed.

Add Comment

Modify Ticket

Action
as new The owner will remain dblain.
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.