Kodi Community Forum

Full Version: Your Mythtv Backend?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2
For a number of years I had a dedicated front/backend PC for Mythtv, this worked really well - When the Raspberry Pi 2 came out I thought I'd give it a try and see how well it would work as a frontend. I have to say it has been really impressive, the low cost running of a Pi means I don't feel guilty leaving it on, the HDMI-CEC support makes it very easy to control and combining Kodi with the Mythtv add-on works perfectly.

From a frontend perspective everything is working really well.

But my backend is still the same old system, its an old Shuttle PC which is fairly noisy so I'm looking at options how to make it quieter. I've purchased a NAS and a network tv tuner so the backend will only really be used for scheduling and managing recordings. The ideal option maybe to use a 2nd Raspberry Pi to share the load, but I wanted to ask what everyone else is using to give me some ideas.
I'm currently using an ASRock Beebox as my mythbackend; that is pretty much all it does. It's silent, so that's a big advantage; my setup is similar to yours as my tuners are on the network, and my storage is on a NAS mounted via NFS4.

I just ordered an Odroid-C2 to take the place as the backend. I decided to go with this machine because it has more RAM than a RPi2/3, does 64bit (which the Pi3 can't, yet), and has GbE on a separate bus from the USB. I personally would not use the RPi (in any incarnation) for a backend because its ethernet is only 100Mbs, and on the same bus as the USB—definitely sure to be a bottleneck, especially if you're running your TV streams via the network, and all of your PVR is on a NAS, too.
Would be interested to know how you get on with the Odroid.

It looks perfect for my needs, quiet & cheap, my only concern would be performance
I'll update the post when I know. The device is currently on backorder; the distributor initially said that it was due to ship this past Friday (22 Apr), but their website currently states that the new shipping date for the new inventory is 28 Apr (Thursday, tomorrow) and their orders/shipping department informed me via email that they are still prepping the backorders for fulfillment.

Since the device has 2GB RAM and GbE, I'm fairly certain that it will perform quite well. I'm also considering using some of the 32GB eMMC that I ordered for it as the LiveTV buffer; Arch has F2FS built into its kernels, so that should help with the responsiveness as well.
I've been using a PI2 as a mythtv backend for about 4 months. It has a USB DVB-S2 stick as a tuner and recordings are stored on a directly attached USB hard disk (which powers down automatically when not in use) and a NAS.
The OS is hosted on the SD card with /var/lib/mysql on a 4GB USB flash stick I had lying around (when the mysql database was also hosted on the SD card I had problems with database performance - intermittent 3-4 second pauses with the green 'SD in use' light on which interfered with recording). It also hosts lighttpd for mythweb and seems to work reasonably reliably.

The biggest problem is the USB tuner 'Mygica T230 DVB-T/T2/C' which sometimes (maybe once a month or so) goes mad and records garbage. Not sure why, maybe just duty cycle. I had to disable over the air guide updates as it was getting far too hot and failing relatively quickly despite removing the plastic cover ;-).
When this happens unfortunately it seems I need to manually power cycle the USB stick to get it working again :-(.

Compared to my previous backend (CORE2) it is not quite as snappy but seems to work OK. The USB tuner is actually faster changing channels in live TV than the PCI cards in the old backend which I've set up as a slave... I've been pondering getting an SSD for the OS and mysql as I'm sure something will fail sooner or later using this setup...

The biggest problem so far is the noise of the external USB hard disk when in use (you get what you pay for!)

I've got 3 PI1 frontends running Kodi (currently an older OpenElec Millhouse build of Krytpton) in the house which connect to this, although we only really ever use one at a time. It does take quite a while to load the recordings list (I have a lot), so I've also been considering moving to a PI3 to see if a bit more horsepower here helps (the old backend was faster here), although maybe putting mysql on an SSD would be of more benefit.

Conclusion: a PI2 as a mythtv backend for light use works. There will be a limit however and it probably isn't that far away. Sending everything twice down one USB2 channel (3 for live tv!) is bound to catch up with you sooner or later.
I received my Odroid C2 in the mail yesterday, and as of this evening I have MythTV 0.28 installed and running on it. It's fully configured now, but I'm still unsure if I want to import my existing recordings, or just transcode them into smaller files and import them into Kodi's library. Similarly, since it is nearing the end of the spring TV season, I may just forgo importing my recording rules, too.

(I use SchedulesDirect for my guide data, and a few weeks ago I switched from using MythTV's mythfilldatabase to using ScheduleDirect's mfdb-json to pull guide data from their JSON API instead of MythTV's XMLTV route. I find the guide data a little bit more robust this way, and seems to be more lightweight.)

I'll do some testing over the week to see how it's working. The AMLogic codecs are not yet fully supported in mainline, especially for the S905, but that's not really a concern because I am just either recording a stream or redirecting it without any transcoding. It may take a hit on the commercial detection, but that has yet to be determined.

Since my previous DVR machine was only a lowly Atom N3000, I don't think there will be much difference in load. I may just have to let the old Atom machine do the transcoding of existing programs—I believe this chipset supports Intel's QSV.

One question though: does MythTV support external EDLs from txt such as those generated by comskip? If the S905/Cortex A53 doesn't do well with the decode for commercial detection I may enlist another machine with better hardware decoding to handle the commercial detection outside of the MythTV ecosystem, and comskip would be preferable.
I'm not sure if I didn't configure the new backend in the same manner, or if there are dependencies missing, but I'm getting LOTS of MythSocket errors and timeouts. I'll investigate this through the week to figure out what's going as, as it may be a difference in x86_64 vs. aarch64, but something is definitely seeming to be way off.

An initial grab of my channels and their metadata from SD into mythconverg via JSON took under 8 minutes; when trying to load that same guide data into Kodi on one of my TVs from that backend it took nearly 90 minutes. Granted there may be a network issue that's new, or it could just be the bloated mess that is MythTV rather than directly accessing the database, but it warrants investigation.
Thanks for the update rpcameron, I haven't got around to purchasing this yet so really interested to hear how you're getting on.

For my guide data I just pull over the air, but don't think this will be a problem either way.

How did you install Mythtv? which Linux Distro did you use? I've used Mythbuntu in the past so I'm assuming as Ubuntu works this shouldn't be a problem.

Also, do you shutdown your backend? I've used Mythwelcome in the past to automatically turn off/on and Wake on Lan when accessing from a Kodi frontend. I don't support you know if this should all be feasible?
No, my backend runs 24/7, which is why keeping it on a low power machine is important. I use Arch as my distro; it's a little bit more hands-on for configuration, but packages are more up-to-date than Debian/Ubuntu-based distros, and there's far less bloat.

I'm still investigating the Odroid C2, as there's a weird problem with the addon that I can't figure out just yet: When playing LiveTV in the addon, and the backend starts its normal background jobs (such as checking for free space, marking deleting recordings to be purged, purging those recordings, checking for when updates need to be run, &c.), the LiveTV freezes in the addon. It's not a problem in the backend, as the LiveTV feed is still recording, but the addon has frozen. I am still looking into the issues, so hopefully it's not DOA as a replacement yet.
After some configuration changes (and problems with the current Atom N3000 backend), this weekend I am running the C2-based backend as the only one on my network. So far with testing this morning it seems to be working well, and fairly responsive (except for WebFrontend accessed on iOS). I haven't noticed any problems with pvr.mythtv yet, but the only frontend I've tested is x86_64 running 3.4.16.

I'll upgrade the RPi2 frontends to the same pvr.mythth version, although I think the only changes from the current version they're running and git are translation updates.

(The change over to the C2 as the new full-time backend was because on the existing Atom-based backend mythbackend started segfaulting every minute or so, and I haven't been able to fully investigate it yet. I'm not sure if this is part of some edits I made to mythbackend.service, but so far the C2 seems to be running quite well.)
The segfaults on aarch64 on the C2 carried over and the x86_64 build on the Atom; neither would run for very long before failing. A backtrace seemed to indicate a problem with my qt5 libs. It's probably a symbol mismatch from different compiled versions of the qt5 5.6 libs, gcc6.1, and mythtv 0.28 limited to Arch's packages.

However, since I've been meaning to switch to something lighterweight than MythTV anyway, I used this as an opportunity to switch everything over to Tvheadend.
This is primarily addressed to RPCAMERON, but feedback from anyone is welcome.

I got flooded in April so I've been out of the loop for a while. I used to run daily Milhouse builds on a Pi2. After 3 months of not keeping up, I have no idea where that all stands now. Before the flood, I purchase an Odroid C2 and got the first hacks of OpenELEC running on it. I really liked the performance upgrade, especially when bringing up the live TV program guide (lots of channels available in Houston, so...).

Anyway, I'm going to try using Android on the C2 and run Kodi (tonight if the 300+MB download ever finishes) on top of that as an ap, so that I can also use the Netflix Android ap for streaming, assuming that all of this will give me Dolby Digital surround sound that works and stays in sync. I'm a passthrough kind of guy because there ARE differences, regardless of what anyone says. PCM just doesn't cut it for me.

At any rate, I use an Intel I3 mythbuntu backend that is way too much overkill for the job. It does do a good job of commercial flagging though, but it is adding too much to my electric bill and taking from my limited space right now. For live TV, I use two HDHomerun network tuners feeding the backend and the mythpvr addon for the Pi2 front-end. I have multiple frontends, but primarily use one of them for most of the watching. I'm using a blu-ray player for Netflix streams and disc playing. The HDMI output of the Pi2 feeds an Onkyo TX-NR828 receiver which drives a projector before the flood. Now I'm using an HDTV while reconstruction is taking place.

The C2 seems to be powerful enough to forgo LibreELEC and run regular kodi on an underlying OS (Android or ubuntu). Any thoughts on that?

Now, to the point of all this. I'd like to nix the I3 mythbackend and shrink it down to an Odroid C2 or XU4. I don't mind keeping all of the frontends separate from the backend, though it might be nice to have Kodi on the backend as well. I'm been using MythTV off and on for wayyy over 10 years, so I'm clueless as to what is available for an alternative backend. I did use WMC for a while, but now that's out of the question. How is your C2 doing now as a replacement myth backend? If you've switched away, how are you liking TVHeadend? Can you point me to a good starting place on learning TVHeadend?
There is currently a lot of work going on for the C2 about improving their media decoding using OpenGL ES, but the changes haven't been applied upstream. Netflix on Android on the C2 does not do full HD because the C2 does not have full Level 3 DRM support, which I understand comes from Google. (Personally, I'd like to see an official Android TV build for the C2, but it does not look like HK will do it.)

LibreELEC works all right, but you do need to do some after install reconfiguration because the maintainer has decided to put his config files as the default, rather than using Kodi's defaults. Also, because the amcodec support isn't yet 100%, there are still some performance issues.

I can't really comment further on MythTV performance because I've since dropped MythTV for Tvheadend. I'm much happier with Tvheadend, mostly because of MythTV's bloat and kitchen sink approach.
My mythtv backend is an old laptop with a half-broken keyboard.

I had considered a Pi for the backend (and frontend), but according to a plug that measures power usage, the laptop typically alternated between 0w and 7w, presumably because my plug's display doesn't update fast enough for a laptop with a cpu that is constantly going to idle. There's no battery connected to the laptop so it wasn't the case that the battery is full.

My reckoning is that it's cheaper to run an old laptop 24x7 rather than purchase a Pi.

So energy used per day is watts * 24 hours / 1000, giving 0.168kw-hrs per day for my 7w mostly idle laptop. US average cost is apparently 5c/kw, but assume I pay double because laptop is sometimes busier then that means it costs 0.168 * 0.10 = $0.01/day to run or around $6 per year (basically 1w is approx $1 per year to run at 10c/kw).

Assume a Pi uses no electricity at all then it would still take around 5 years to cover the cost of a Pi assuming I had a spare memory card, etc to make it work. Add in the case and extra hardware I might need such as a powered hub for the multiple usb tuners and various cables and it would take another couple of years to break even. The absolute maximum my laptop's power supply can output is 19v which is $16pa (at 10c/kw), but I don't think it would ever hit that power usage unless I was heavy compiling.

Add in the fact the Pi will use electricity and it will take even longer to break-even. If it uses 5w(?) then that's $4pa, so only saving $2pa over my laptop, so break-even after 18 years based on current prices.

In reality, my laptop is a combined fe/be/kodi/tvheadend/other stuff and uses the ACPI settings so it is shutdown most of the day and wakes up to record or when we watch something so uses no electricity for most of the day. The laptop is very quiet since the fans either never run or are far enough away to be drowned out by other noises.

Also you should factor in the fact that Intel/AMD is a fully supported Ubuntu system so you install and it works exactly as you'd expect, whereas I think the Pi is more partially/community supported. So factor in a few hours of trawling forums for how to do X/Y/Z, especially since the DB writes can be very frequent and time consuming. Certainly I was surprised that some cheap machines (such as android, possibly Pi too) don't come with a clock so lose the time when you power then off/on. Not an issue if you have a permanent Internet connection for them to re-get their time, but just one of the many gotchas that you don't expect.

Remember that things like your tuners and storage all use electricity so the best way is to keep the backend powered down if you can. Also consider how much HD you concurrently record and whether the Pi's usb bus can handle it (since it shares the bus with Ethernet and will share it with presumably a USB disk or two). I guess it should probably handle it.

Of course, none of this stops me wanting a Pi, but for the moment the laptop seems far better for me.
My backend is an iMac. It's my desktop machine, runs MythTV backend recording via HDHOMERUN (up to 5 channels at once), runs Plex server also, does Handbrake encodings, I code on it, do database work on it (Mariadb). Seems to do it all effortlessly. Very happy, didn't want another machine to just run MythTV. Have an Intel Nuc running Kodi. Love the integration between MythTV and Kodi, and, MythTV and Plex, which then easily allows Apple TV, Roku to play anything.
Pages: 1 2