Backend on Pi 4

For discussion of topics specific to MythTV on Raspberry Pi devices
angelo454
Newcomer
Posts: 8
Joined: Wed Nov 11, 2020 2:33 am
United States of America

Re: Backend on Pi 4

Post by angelo454 » Sat Nov 14, 2020 4:48 pm

I have a 5TB hdd that I installed Raspbian Lite and have configured the Pi 4 to boot directly to it and converted the filesystem to GPT so I have access to the whole drive and will now start the MythTV lite install.

Is it ok to do it this way?
I also plan to do the install from a new mythtv user with the same rights as pi. Will the scripts work, or are they hard coded for the pi user?

User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

Re: Backend on Pi 4

Post by jfabernathy » Sat Nov 14, 2020 5:07 pm

IMHO, I do everything as pi user except when I setup XMLTV or run mythfilldatabase manually. that include running mythtv-setup.

try installing lite and fixing all the locale settings with raspi-config. Then get the pi-utils that MikeB2013 created. I would do it that way at least once. It always works for me. After you use the pi-mythbackend-helper script and reboot, setup XMLTV as user mythv. All you need to do is:

Code: Select all

sudo su mythtv
cd
then follow the wiki on XMLTV https://www.mythtv.org/wiki/XMLTV
Then run ./run_mythsetup.sh as pi and setup your backend. After a few minutes the backend will automatically run the mythfilldatabase and populate the EPG.
Use ./run_mythfrontend to run the mythfrontend on RPI4

angelo454
Newcomer
Posts: 8
Joined: Wed Nov 11, 2020 2:33 am
United States of America

Re: Backend on Pi 4

Post by angelo454 » Sat Nov 14, 2020 10:23 pm

Thanks for the advice, I will do it that way. Since I am doing it from an hdd this time, I would like to save intermediate images of the hdd in case something goes wrong. Do you know of an easy way to save an image? I am trying AOMEI backupper, but it will take up to 4 hours. I basically only have Raspbian Lite on it so there is not much there.

User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

Re: Backend on Pi 4

Post by jfabernathy » Sat Nov 14, 2020 10:39 pm

I've never saves any images during setup. For me the time from start to finish is only 30 minutes so I don't worry about it.

I have just updated my Mythtv blog to include my V31 MythTV install on the RPI4. It may help you or others. It's mainly for me next time I have to redo a setup
https://mythtv-rp4.blogspot.com/2020/11 ... rpi-4.html

angelo454
Newcomer
Posts: 8
Joined: Wed Nov 11, 2020 2:33 am
United States of America

Re: Backend on Pi 4

Post by angelo454 » Sat Nov 28, 2020 5:10 pm

Jim, thanks for posting your instructions! They were extremely helpful although I ran into some issues as my configuration is different than yours. I am noting what happened and what I did differently so it may help others.

My hardware is:
  • Raspberry Pi 4 with 4GB DRAM
  • SiliconDust HDHomeRun Prime 3 tuner with a rented Fios CableCARD
  • HDD used is WD 5TB Passport Portable External Hard WDBPKJ0050BBK-WESN
Setup
  • Since I am using a 5TB HDD, I needed to use GPT boot partition instead of MBR which has a 2TB limit. Instead of doing steps 2-6, I did the following
  • Used Raspberry Pi Imager to install the full Raspbian OS to an SD card. This is required as I used Linux scripts to convert the MBR to a GPT boot partition. I could not successfully do the conversion from Windows.
  • Used Raspberry Pi Imager to install the Raspbian Lite OS to the HDD
  • Insert SD card into Raspberry PI and boot up to the desktop
  • Plug in the HDD and unmount the HDD (Desktop automatically mounts USB drives)
  • It took a while to convert drive to GPT
  • First boot took a while as it does a system check. Will likely see an error message when done. Rebooting seemed to clear it. I have not had any issues booting off the HDD since installing the OS on it and it has been about 2 weeks since I installed the OS on it.
  • Followed remaining steps 7 – 15 of the 1st section of the blog.
  • For HDHR tuner setup, I ran into a lot of issues following the steps under “Mythtv-setup for HDHR tuners with OTA EPG Program Guide”. I think this is because my HDHR tuner is a Prime with a CableCARD. For most of the channels I had 3 of the same and I removed them by hand using the MythWeb interface. If I were to do it again, I would skip doing the EIT scan as it did not work well for me and just do the rest of the setup steps in this section. I would then go to the “Change to using an EPG from Schedules Direct via XMLTV json.” section.
  • Everything is working well and I get all the subscribed channels except for about 6 channels which have copy protection set. I know I have the CableCARD configured properly, as I can view those 6 channels form the Silicon Dust HDHomeRun app on my Windows 10 PC, as long as I am viewing it on an HDMI connected monitor. Within MythTV, the HDHomeRun app for Kodi or Fire TV, I cannot get those 6 copy protected channels. From what I have read, this is because you have to have an HD television or monitor connected by to be able to view them. I tried hooking up the Pi4 to a TV via the HDMI cable but it did not help. There does not seem like there is a solution for this from the limited search I did. Since I do not really view those 6 channels, it is not a priority.
Thanks again for posted instructions, it was a GREAT help!

marks7389
Newcomer
Posts: 11
Joined: Wed Apr 07, 2021 6:17 pm
Great Britain

Re: Backend on Pi 4

Post by marks7389 » Wed Apr 07, 2021 6:40 pm

Hi All,

I'm looking to replace my nearly ten year old nVidia ion based MythTV combined BE/FE and after some research (and reading this thread!) decided to trial using a Pi 4 as a replacement.

To start off with I plan on installing Raspberry Pi OS and MythTV Lite on a microSD card, importing my database and a test recording or two and see how it goes.

My thoughts were ultimately to get a 2TB SSD for the recordings and database and keep the OS and software on a microSD, primarily to make testing and, if necessary, backing out future upgrades a bit easier by just popping in a card with the old build and restoring the database from backup. I've seen the warnings around not using a microSD card on a backend device due to the level of FS writes and consequent wear on the card. Does anyone have any thoughts whether its still a bad idea even if the database is on the SSD?

Thinking about a UGREEN USB C Hard Drive Enclosure with the ASM235CM chipset as an external drive case that supports USAP and Trim and has good feedback from Pi 4 users. Does anyone have any direct experience of this or similar as good option for recording and database storage?

User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

Re: Backend on Pi 4

Post by jfabernathy » Wed Apr 07, 2021 7:40 pm

marks7389 wrote:
Wed Apr 07, 2021 6:40 pm

My thoughts were ultimately to get a 2TB SSD for the recordings and database and keep the OS and software on a microSD, primarily to make testing and, if necessary, backing out future upgrades a bit easier by just popping in a card with the old build and restoring the database from backup. I've seen the warnings around not using a microSD card on a backend device due to the level of FS writes and consequent wear on the card. Does anyone have any thoughts whether its still a bad idea even if the database is on the SSD?

Thinking about a UGREEN USB C Hard Drive Enclosure with the ASM235CM chipset as an external drive case that supports USAP and Trim and has good feedback from Pi 4 users. Does anyone have any direct experience of this or similar as good option for recording and database storage?
Now that the RPi 4 boots from USB SATA SSD I would not use a microSD card for anything but picking my teeth, IMHO. Your database is the last thing you want on the microSD as you write a lot to the database and random writes are the worse on microSDs.

I have not run a RPI 4 base backend in about 6 months but when I start to again, I'll just burn the Raspberry PI OS directly to the SSD and start there. If you want to test with a smaller SSD first then you can get a number of good SATA SSDs cheap. I found a Kingston 240 GB sata ssd for $30 on Amazon.

BTW, I noticed that the location for the DEB has changes recently for Mythtv-light. So if you use the Pi-utils from github, they might need some edits.

marks7389
Newcomer
Posts: 11
Joined: Wed Apr 07, 2021 6:17 pm
Great Britain

Re: Backend on Pi 4

Post by marks7389 » Wed Apr 07, 2021 9:12 pm

jfabernathy wrote:
Wed Apr 07, 2021 7:40 pm
Now that the RPi 4 boots from USB SATA SSD I would not use a microSD card for anything but picking my teeth, IMHO. Your database is the last thing you want on the microSD as you write a lot to the database and random writes are the worse on microSDs.

I have not run a RPI 4 base backend in about 6 months but when I start to again, I'll just burn the Raspberry PI OS directly to the SSD and start there. If you want to test with a smaller SSD first then you can get a number of good SATA SSDs cheap. I found a Kingston 240 GB sata ssd for $30 on Amazon.

BTW, I noticed that the location for the DEB has changes recently for Mythtv-light. So if you use the Pi-utils from github, they might need some edits.
Yes, I figured as much with the database so wasn't thinking about hosting that on a microSD card anyway, only really thinking about the OS and software packages.

I'm going to need to replace my DVB-T2 tuner as well as my current one is a PCI-e card. I'd assumed originally it would need to be USB (e.g. the Hauppage WinTV-dualHD), but the discussion here has got me thinking about the HDHomeRun. I don't really need more than two tuners (in fact a single tuner would be fine 99% of the time). Is the HDHomeRun worth the extra money and are there any downsides to using a network tuner?

Any other options? I've seen historical references to the VBox XTi 3442 but that doesn't seem to be available any more.

User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

Re: Backend on Pi 4

Post by jfabernathy » Thu Apr 08, 2021 9:55 am

marks7389 wrote:
Wed Apr 07, 2021 9:12 pm

I'm going to need to replace my DVB-T2 tuner as well as my current one is a PCI-e card. I'd assumed originally it would need to be USB (e.g. the Hauppage WinTV-dualHD), but the discussion here has got me thinking about the HDHomeRun. I don't really need more than two tuners (in fact a single tuner would be fine 99% of the time). Is the HDHomeRun worth the extra money and are there any downsides to using a network tuner?
My main backend is an old PC so I use a Hauppauge WinTV QuadHD PCIe card. I also have HDHomerun Connect and Quatro Network tuners that are used by Smart TV and PC. I also use the HDHR with RPI4 backends when I need them. I have had no issues with the HDHomerun tuners beyond a few setup issues related to making sure the network and tuners come online before mythbackend is started.

If I needed to replace my old reliable PC backend/NAS. I'd probably use a RPI4 with the HDHR Quatro tuner and just buy a commercially available NAS.

Jim

gedakc
Junior
Posts: 56
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Backend on Pi 4

Post by gedakc » Thu Apr 08, 2021 4:12 pm

marks7389 wrote:
Wed Apr 07, 2021 9:12 pm
Is the HDHomeRun worth the extra money and are there any downsides to using a network tuner?
One big plus to the HDHomeRun is that it has it's own power supply so it does not place any additional power demands on the host computer. In my case that meant I could add a USB3 2TB portable hard drive directly to my Raspberry Pi and still have sufficient power for everything to run smoothly.

I wrote a tutorial in which I mention some TV tuner selection criteria for Raspberry Pi PVR - Hardware Selection. The tutorial was for Tvheadend but the logic also applies for MythTV.

Regarding the MicroSD cards, I have run LibreELEC with Kodi and Tvheadend on a microSD card for over 2 years with no issues. Only the recordings are on a USB3 2TB portable hard drive so these microSD cards have proven to be relatively durable but with read/write speeds a lot slower than HDDs.

My main MythTV PVR is an Intel i5-2500k box with two Hauppaugge HVR 2250 PCI dual tuners that's been running for 10 years. It's been a solid performer and I have it set up to automatically power down and then wake up for recordings.

marks7389
Newcomer
Posts: 11
Joined: Wed Apr 07, 2021 6:17 pm
Great Britain

Re: Backend on Pi 4

Post by marks7389 » Thu Apr 08, 2021 6:11 pm

gedakc wrote:
Thu Apr 08, 2021 4:12 pm

One big plus to the HDHomeRun is that it has it's own power supply so it does not place any additional power demands on the host computer. In my case that meant I could add a USB3 2TB portable hard drive directly to my Raspberry Pi and still have sufficient power for everything to run smoothly.

I wrote a tutorial in which I mention some TV tuner selection criteria for Raspberry Pi PVR - Hardware Selection. The tutorial was for Tvheadend but the logic also applies for MythTV.

Regarding the MicroSD cards, I have run LibreELEC with Kodi and Tvheadend on a microSD card for over 2 years with no issues. Only the recordings are on a USB3 2TB portable hard drive so these microSD cards have proven to be relatively durable but with read/write speeds a lot slower than HDDs.
That's useful information, thank you. Whilst planning to use an SSD, so not constrained in the same way by the power draw, I must admit I'm quite drawn to the HDHR for its additional flexibility.

Even if we only use a couple of tuners for MythTV, the quad tuner device would presumably additionally allow live TV streams to other devices such as phones/tablets and TVs in locations without a convenient aerial socket nearby. Plus I've never managed to get Myth Live TV to work that well (though my current setup is still on v0.27). So food for thought....

I note however that quad tuner has the same 100Mbit/s network interface. UK DVB-T2 muxes carry 40Mbit/s each, and I'm assuming that MythTV can use a single tuner to record multiple channels on the same mux as with a local tuner. However it's not clear to me whether that means Myth instructs the HDHR to filter out whatever combination of streams it wants or pulls the whole lot over the network and filters out what it needs. Do you know?

Good to know about your experience with the SD cards.

gedakc
Junior
Posts: 56
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Backend on Pi 4

Post by gedakc » Thu Apr 08, 2021 6:48 pm

marks7389 wrote:
Thu Apr 08, 2021 6:11 pm
(though my current setup is still on v0.27).
My main PVR is also running MythTV v0.27 under Mythbuntu 14.04. That combination has been super reliable and robust for me and other family members with similar PVRs.
marks7389 wrote:
Thu Apr 08, 2021 6:11 pm
I note however that quad tuner has the same 100Mbit/s network interface. UK DVB-T2 muxes carry 40Mbit/s each, and I'm assuming that MythTV can use a single tuner to record multiple channels on the same mux as with a local tuner. However it's not clear to me whether that means Myth instructs the HDHR to filter out whatever combination of streams it wants or pulls the whole lot over the network and filters out what it needs. Do you know?
A single ATSC TV stream can be about 20 Mb/s. This stream can be split into multiple channels, but each channel will then have a subset of the 20 Mb/s stream. The total of all channels within the single ATSC broadcast cannot exceed 20 Mb/s. In practice this means that four 20 Mb/s streams can fit within the bandwidth available with a 100 Mb/s network interface.
Last edited by gedakc on Fri Apr 09, 2021 6:49 pm, edited 1 time in total.

User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

Re: Backend on Pi 4

Post by jfabernathy » Thu Apr 08, 2021 7:24 pm

gedakc wrote:
Thu Apr 08, 2021 4:12 pm
Regarding the MicroSD cards, I have run LibreELEC with Kodi and Tvheadend on a microSD card for over 2 years with no issues. Only the recordings are on a USB3 2TB portable hard drive so these microSD cards have proven to be relatively durable but with read/write speeds a lot slower than HDDs.
I've learned from the LibreELEC forum that LE is designed to boot up into ram and not use the microSD card very often. Your mileage may vary when using Raspberry Pi OS and mythtv.

User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

Re: Backend on Pi 4

Post by jfabernathy » Thu Apr 08, 2021 7:42 pm

I know that ATSC MB/s has reduced in the USA as a result of the FCC repack of channels. I use to see the higher quality programs consume 6GB per hour. Now that is more like 4GB per hour. Some of that bandwidth is going to more sub channels in the mux,

From a practical side I have tested a HDHR Quatro plugged into a gigabit switch along with a RPI4 and all my 37 other devices and can record at the same time 4 HD programs, 2 1080i and 2 720p, while watching a pre-recorded program using the same RPI4 as the frontend. While I don't like the quality of the RPI4 as a frontend generally, it is viewable. I regularly have recorded 4 HD programs while watching a recording using a Nvidia Shield TV as the frontend.

So I have not experienced a problem with the 100Mb interface on the HDHR.

marks7389
Newcomer
Posts: 11
Joined: Wed Apr 07, 2021 6:17 pm
Great Britain

Re: Backend on Pi 4

Post by marks7389 » Thu Apr 08, 2021 9:04 pm

jfabernathy wrote:
Thu Apr 08, 2021 7:42 pm
I know that ATSC MB/s has reduced in the USA as a result of the FCC repack of channels. I use to see the higher quality programs consume 6GB per hour. Now that is more like 4GB per hour. Some of that bandwidth is going to more sub channels in the mux,
How's that encoded? DVB-T2 here is rarely more than 2GB/hour for h264 encoded 1080i content these days. MPEG2 encoded SD content tends to be well under 1GB/hour.

On the plus side, so long as it only pulls the data it needs for the channels being recorded I'm never going to have a problem with capacity on the network link and the majority of what we record is carried on the same mux, there's just typically a lot crammed into them.
From a practical side I have tested a HDHR Quatro plugged into a gigabit switch along with a RPI4 and all my 37 other devices and can record at the same time 4 HD programs, 2 1080i and 2 720p, while watching a pre-recorded program using the same RPI4 as the frontend. While I don't like the quality of the RPI4 as a frontend generally, it is viewable. I regularly have recorded 4 HD programs while watching a recording using a Nvidia Shield TV as the frontend.
I'm thinking a Fire TV 4K stick as frontend if necessary which I'll probably end up doing anyway for the TV in the bedroom. Will see how it goes.

Post Reply