Myth 32/HDHR video suddenly corrupt

Have a MythTV related problem? Ask for help from other MythTV users here.

Moderator: Forum Moderators

Post Reply
GlowTube
Newcomer
Posts: 12
Joined: Fri Mar 15, 2019 6:45 pm
United States of America

Myth 32/HDHR video suddenly corrupt

Post by GlowTube »

I'm using the Myth version packaged with my Ubuntu 22.04.2 (32.0+fixes 20220325), and an HDHR/cablecard tri-tuner. This setup has been stable for a long, long time, but suddenly today I have mpeg-2 corruption on all three tuners and on all live tv channels HD and SD. Interestingly when I run VLC on the same machine, and view the same HDHR tuner streams, they are error-free. I've checked top() and there aren't any strange processes eating CPU or memory, I've rebooted several times including from poweroff, and I even tried an apt/reinstall for this version of Myth (I know that 33.1 exists and that I'm behind, but things were fine until yesterday). FWIW I've also made a few recordings using NextPVR on a Windows machine, and they are likewise error-free, so I'm convinced the HDHR tuner is putting out good stuff. What's happened to my trusty MythTV (which really means "What should I look for in my mythbackend.log to help figure this out")? Thanks for any advice.
Gribnif
Junior
Posts: 88
Joined: Wed May 14, 2014 12:46 pm
United States of America

Re: Myth 32/HDHR video suddenly corrupt

Post by Gribnif »

Are you sure it's the recording that's corrupt, and not the playback within Myth? Have you tried playing one of the resulting .ts files in VLC?
GlowTube
Newcomer
Posts: 12
Joined: Fri Mar 15, 2019 6:45 pm
United States of America

Re: Myth 32/HDHR video suddenly corrupt

Post by GlowTube »

Good suggestion. After checking, unfortunately the transport stream files are corrupt when played back with VLC or by viewing them under Mytth. Live TV (streams coming from the HDHR) is corrupt when played back in Myth, but error-free when played back in VLC. Looking at history I know my last-good recording, so I know the time range when "something" happened. I looked in syslog for this interval but didn't see anything suspicious.
white_haired_uncle
Senior
Posts: 265
Joined: Thu Feb 23, 2023 8:55 pm
Location: Safe outside my gilded cage
United States of America

Re: Myth 32/HDHR video suddenly corrupt

Post by white_haired_uncle »

My HDHR Connect Duo started acting up recently. Not too long after a firmware update, but not close enough to be sure. I get damaged recordings for a while. I can make the problem go away immediately with a hard reboot (pull the power plug for a second), unfortunately a soft reboot doesn't help. Hard to pin down, as it comes and goes intermittently. When I catch it in the act, if I pull up hdhomerun_config_gui, I see the status bars swing wildly (>10% per second), where they usually don't move.

You might look at these commands (I'll use ffffffff as my device id, because I have only one and I'm pasting from some recent testing).

Code: Select all

$ hdhomerun_config discover (in case you have more than one HDHR, you'll need the device id)
$ hdhomerun_config ffffffff  get /tuner0/program (making sure it's not in use)
$ hdhomerun_config ffffffff  set /tuner0/channel 20  (that's the RF, not virtual)
$ hdhomerun _config ffffffff set /tuner0/program 5 (the sub, as seen by hdhomreun_config_gui, or hdhomerun_config scan, or get /tuner0/streaminfo)
$ hdhomerun_config ffffffff  set /tuner0/vchannel 50.5 (an alternate to the previous two commands - in my case ch20/prog5 is 50.5)
$ hdhomerun config save /tuner0 /tmp/foo (watch the output ......... is good, anything but periods indicate errors, break with crtl-c.  Could use /dev/null as output)
$ hdhomerun_config ffffffff  get /tuner0/debug (for example purposes, numbers are since last channel/program change IIRC)
$ hdhomerun_config ffffffff set /sys/restart self (reboot - don't want to leave it locked on a channel, and I don't know another CLI to release)
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Myth 32/HDHR video suddenly corrupt

Post by pgbennett »

I had a problem with pixelating recordings with an HDHR Prime and I found it was the router. The router was occasionally dropping messages from the HDHR prime to MythTV. I solved it by using a switch between the HDHR prime and the myth backend, instead of having the router between them.
GlowTube
Newcomer
Posts: 12
Joined: Fri Mar 15, 2019 6:45 pm
United States of America

Re: Myth 32/HDHR video suddenly corrupt

Post by GlowTube »

So this gets weirder and weirder. Yesterday feeling somewhat desperate with favorite recording events coming up, I decided to blow away my Myth machine and start from scratch. I installed a fresh Ubuntu 22.04.2, added the Myth ppa, and then installed Myth 33.1. I fully expected that this would cure my corruption problem... but NO. Watching an HD stream on Myth's live TV, I saw the same video corruption as before. I installed VLC on the machine, pointed it at my HDHR tuner, and as before the incoming video stream was perfect according to VLC's limited codec statistics. I then did a recording exercise with each tool, and no surprise, Myth's recording was corrupt and VLC's recording of the same stream was fine. So whatever this problem is has survived a complete re-do of the Myth backend, and never shows itself when running VLC on the same machine. Mind=blown. As another data point I installed Jellyfin (SORRY!) and, while it lacks many of the features that I love about Myth, its video performance was the same as VLC: perfect live and recorded video, from the same HDHR. It was mentioned that an HDHR firmware update *might* have something to do with this, and it's true I did update that firmware recently, but these tests seem to support the notion that the HDHR output itself is correct and reliable.
User avatar
kmdewaal
Developer
Posts: 644
Joined: Wed Dec 07, 2016 8:01 pm
Netherlands

Re: Myth 32/HDHR video suddenly corrupt

Post by kmdewaal »

As I understand it, with VLC you do use the HTTP protocol and that gives you access to a single TV channel where the channel is selected by the HDHomeRun. MythTV uses a low level interface in which we get either the PIDs that are needed for the TV channel or the complete transport stream when there are too many PIDs requested. This is done this way because this lets MythTV do the channel scanning, it enables receiving multiple channels from the same multiplex and it allows catching the EIT guide information The channel scanning is essential for DVB-C because the HDHomeRun by itself does not find all channels.
The interface that MythTV uses runs over UDP and this does not correct transmission errors.
The HTTP runs over TCP and that does error correction.
My best guess is that you have failing networking hardware and that HTTP/TCP does correct for this and that is why VLC does work.
You can use the HDHomeRun also in the HTTP/TCP mode using the External Recorder, as I understand it.
GlowTube
Newcomer
Posts: 12
Joined: Fri Mar 15, 2019 6:45 pm
United States of America

Re: Myth 32/HDHR video suddenly corrupt

Post by GlowTube »

Your answer makes perfect sense, kmdewaal. I naively assumed that Myth and VLC were addressing the HDHR identically. If Myth uses UDP and my network is no longer healthy enough to sustain UDP without errors, that would explain it. As to WHY the network has gotten this way, there's no obvious answer. What I can do is start swapping out hardware and cables and re-trying Myth (as it's now the more stringent test case). It would seem that, for folks who can get by with simple HTTP access to HDHR (who don't need the channel scanning and can take a possible performance hit for the TCP retries and windowing) supporting this mode might be a nice feature.
User avatar
pgbennett
Developer
Posts: 503
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Myth 32/HDHR video suddenly corrupt

Post by pgbennett »

See my comment above.
Post Reply