Backend on Pi 4

Post Reply
flitter
Newcomer
Posts: 12
Joined: Wed Aug 20, 2014 2:58 am
Australia

Backend on Pi 4

Post by flitter » Tue Jul 02, 2019 10:56 am

With the new Pi4 supporting much more RAM would it now be possible to use the Pi as a dedicated backend (or even just as a non-recording master backend?) (with no frontend installed)

jksj
Junior
Posts: 49
Joined: Thu Feb 13, 2014 7:53 pm
Great Britain

Re: Backend on Pi 4

Post by jksj » Fri Jul 05, 2019 8:03 am

I would expect it to be a full backend supporting any USB tuner that has drivers built into the kernel (would need an external disk drive obviously). I will try it this weekend an post the results.

kojaked
Newcomer
Posts: 9
Joined: Sat Jun 15, 2019 3:47 am
United States of America

Re: Backend on Pi 4

Post by kojaked » Sat Jul 06, 2019 3:00 am

I'm excited to learn if this is feasible. I have a backend running on a computer that is probably better suited as a NAS. If a Raspberry Pi 4 can handle it, that also expands the universe of people who could easily introduce MythTV to their homes.

jksj
Junior
Posts: 49
Joined: Thu Feb 13, 2014 7:53 pm
Great Britain

Re: Backend on Pi 4

Post by jksj » Sat Jul 06, 2019 11:00 am

The backend runs fine on a 2GB Pi 4. Recorded 3 HD channels 1080i to a usb2 hard drive from a DVB2 - USB2 tuner. I installed Rasbian and had the database on the SD card and recorded to an external USB2 drive. Would have been easier to put everything on the external drive, preferably USB3.

Running the frontend at the same time works-ish but is pushing it, needs a 4GB Pi 4. The frontend is hanging when exiting playback. The frontend runs fine on the same Pi4 without the backend present so I am fairly confidant its due to lack of memory.

Code: Select all

 
 Mem
              total        used        free      shared  buff/cache   available
Mem:        1803332      769496      281140       69408      752696      884144
Swap:        102396       32000       70396
Top
Tasks: 174 total,   2 running, 166 sleeping,   0 stopped,   6 zombie
%Cpu(s): 12.2 us, 19.8 sy, 24.1 ni, 42.8 id,  1.0 wa,  0.0 hi,  0.1 si,  0.0 st
MiB Mem :   1761.1 total,    272.7 free,    747.0 used,    741.3 buff/cache
MiB Swap:    100.0 total,     63.0 free,     37.0 used.    867.9 avail Mem 

  PID USER      PR  NI    VIRT    RES    SHR S  %CPU  %MEM     TIME+ COMMAND                                                                         
 9270 mythtv    37  17  546544 256348  46152 R  97.4  14.2   8:45.20 mythcommflag                                                                    
10201 pi        20   0  884916 362844  98172 S  44.6  20.1   1:23.70 mythfrontend                                                                    
 4084 mythtv    20   0  609100  88320  47624 S  38.6   4.9   5:29.08 mythbackend
I built from source and then it took a day to get the backend running so a none trivial task. Installing a frontend on Pi is easy particularly when using Mythtv Light. However a Backend installation - database (used Maria) -adding mythtv as a user -configuring the recording folders was no more difficult than using any other OS - wth lots of googling.

User avatar
pgbennett
Developer
Posts: 309
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: Backend on Pi 4

Post by pgbennett » Sat Jul 06, 2019 12:38 pm

mythtv-light does include the backend so it should not be necessary to build from source. Also the wiki guides should give all the info on setting up the database etc. although that info is in the "Build from source" article https://www.mythtv.org/wiki/Build_from_ ... tall_tasks

flitter
Newcomer
Posts: 12
Joined: Wed Aug 20, 2014 2:58 am
Australia

Re: Backend on Pi 4

Post by flitter » Sat Jul 06, 2019 11:36 pm

jksj wrote:
Sat Jul 06, 2019 11:00 am
The backend runs fine on a 2GB Pi 4. Recorded 3 HD channels 1080i to a usb2 hard drive from a DVB2 - USB2 tuner. I installed Rasbian and had the database on the SD card and recorded to an external USB2 drive. Would have been easier to put everything on the external drive, preferably USB3.
That's fantastic news! Finally I can retire another piece of my old HTPC infrastructure and introduce a more distributed arrangement!

Thanks jksj!!!

MikeB2013
Senior
Posts: 371
Joined: Mon Jul 25, 2016 4:16 pm
Great Britain

Re: Backend on Pi 4

Post by MikeB2013 » Wed Jul 10, 2019 10:46 am

Just for information.

Running mythbackend on my Pi4 (4GB) works well.

I am using microSD card to boot into rootfs on a 1 TB USB 3 hard drive, so the microSD card is only used to boot.
Note this method is the only one available until boot from USB is available on Pi4 (it is being worked on).

I have it configured to use 1x USB DVB-T2 tuner (Astrometa), two network DVB-S/S2 tuners (VBOX 3345).
The DVB-T2 tuner is using EIT, with DVB-S/S2 tuners using xmltv (Schedules Direct tvgrab_zz_sdjson).
Note that you will likely need to set mythfilldatabase arguments to have "--no-allatonce" switch as mythfilldatabase can be very memory hungry.

You can use any of the Raspbian Buster versions, but when running totally headless (no hdmi connection, or keyboard/mouse), so it is mythbackend only, I use Raspbian Buster Lite. You need to be careful when running mythtv-setup. On my Pi4 it hangs. Killing the process has not effect, trying a reboot command (sudo reboot), still hangs, ssh connections get logout, but the Pi4 does not reboot. It required a hard poweroff i.e. unplug power.

I found two solutions to this:
1. put hdmi_ignore_cec=1 in /boot/config.txt on Pi4 and reboot for it to take effect.
or --not recommended
2. run mythtv-setup with -O libCECEnabled=0 switch i.e. mythtv-setup -O libCECEnabled=0

TIP: If running totally headless, you can force ssh at initial boot by creating an empty file named ssh in /boot/ on the microSD card before you put it into the Pi4. This way you don't need to temporarily connect a monitor, keyboard to Pi4. As long as the Pi4 has an ethernet connection and can get an ip address you are good to go via ssh.


Mike

kojaked
Newcomer
Posts: 9
Joined: Sat Jun 15, 2019 3:47 am
United States of America

Re: Backend on Pi 4

Post by kojaked » Sat Jul 13, 2019 5:20 am

Dare I ask: how well does commercial flagging work on a Pi 4?

Post Reply