After having run the previous version of MythTV for a couple of years without any significant issues, I upgraded to MythTV 0.25.

That broke a few thing, one of which I initially didn’t want to spend time on fixing for now: My existing grabber card sometimes locked up when starting a recording, preventing the box from shutting down, and it didn’t record any of the scheduled recordings either. I thought this could be related to a bug in an updated driver, so I decided to test out a HDHomeRun setup instead. As for saving time, that turned out to be a bad idea! But in terms of getting to a working solution, it looks as if I eventually got to a working solution… read on below.

To make a long story short: It didn’t work as expected.

Initially, all recordings and live tv had glitches in the video and audiostreams, with various error messages being logged. It was not only the shown audio; the recorded files also had glitches and reported errors when played with e.g. VLC on the same or on other machines.

The errors I saw in the mythfrontend.log and mythbackend.log files (in /var/log/mythtv) could be traces like e.g.:

I HDHRStreamHandler ... <RecordingQuality ... 
countinuity_error_count="2234" packet_count="1739249"> ...

showing a high amount of discontinuities (if I got that right), or some sequences of interleaved message like e.g.:

E Decoder avformatdecoder.cpp:4216 
(ProcessAudioPacket) AFD: Unknown audio decoding error
N CoreContext mythplayer.cpp:2078 (PrebufferEnoughFrames) 
Player(0): Waited ... ms for video buffers ...

I also noted strange issues when doing the initial channel scans, which made me a bit suspicious initially: The signal strength is reported by MythTV to be only 49%(!), but at the same time — i.e. during the scan — a running HDHomeRun config GUI shows that each of channels sync perfectly and have 100% signal strength and quality (in my case I have a strong signal; I can get it to 97% if I move the box to the cable drop furthest away in the house). And in MythTV during live tv, it typically shows around 50% signal strength only — with HDHomeRun config GUI again showing 100% signal.

So I tested a bunch of stuff, including disabling EIT which I had suspected, to no avail. I eventually gave up, and I currently believe there is a problem with the way MythTV is interfacing to the HDHomeRun in at least 0.25. There are all sorts of suggestions on the net to fix or circumvent similar issues (increase buffer sizes, have a ping running to prevent some ARP messages, etc), but none worked for me. The problem is not related to the network. In fact, the HDHomeRun box works very well when using it from e.g. VLC from the same machine, and I have no dropped packages when looking at the network interfaces on the box.

But there is a workaround that will allow MythTV 0.25 to work with HDHomeRun!

Just install the kernel drivers for HDHomeRun (I used Villy Thomsens dvbhdhomerun ppa; install dvbhdhomerun-dkms and dvbhdhomerun-utils and/or have a look here), and install your HDHomeRun box as a  DVB card instead of as a decidated MythTV HDHomeRun box. This will cause MythTV to use the dvbhdhomerun kernel drivers instead of relying on  MythTV’s built-in support. I have not yet seen any detrimental effect of doing so — and now it all seems to work 🙂

There is a description on how to do this on the silicondust site, but it is somewhat incorrect (use the ppa instead also for newer releases, and you don’t need to edit the dvbhomerun-utils.conf file), so have an eye on what you do!

The gist of the installation is to enable the ppa, install the dkms drivers, edit the /etc/dvbhdhomerun setup file to point to your HDHomeRun box and define its type, add a line to /etc/modules (or similar) and set up a DVB card pointing to the right adapter. That’s it — then you can do your channel scans as needed. If you are not familiar with Linux, then you might need a little more detailed instructions than below, though. Feel free to ask here also.

But in essense, you need to type in the following commands (if you’re using e.g. Ubuntu 12.04):

sudo add-apt-repository ppa:tfylliv/dvbhdhomerun 
sudo apt-get update 
sudo apt-get install dvbhdhomerun-dkms dvbhdhomerun-utils

Then ensure you add a line like follows at the end of the /etc/modules file:

dvb_hdhomerun

And edit the /etc/dvbhdhomerun file to suit your setup. Mine looks like this (replace the FFFFFFFF with the number of your box):

[FFFFFFFF-0]
tuner_type=DVB-C
use_full_name=true
[FFFFFFFF-1]
tuner_type=DVB-C
use_full_name=true

The you may reboot and install a new DVB card in MythTV and select the appropriate /dev/dvb/adapterN/frontend0 file(s).

So far, this seems to work for me. I will have to wait and see if this also have the “locking” problem, though, before declaring a total success.

… just wanted to put this here for others that might have similar problems!

For the record, I’m using the latest beta firmware (as of the time of writing): “20120820beta1”. The stock one (201204-something) had problems detecting my channels properly even in the initial scan using the GUI.

 

As a side-note: I noticed that when the MythTV backend runs and has access to the HDHomeRun box, it can cause glitches to other machines also connected to the HDHomeRun box. I haven’t spent a lot of time on this, but it appears not to be related to EIT, though.