Another question about Pi 4 as backend

For discussion of topics specific to MythTV on Raspberry Pi devices
jeff_mythtv
Newcomer
Posts: 9
Joined: Mon Feb 26, 2018 11:45 pm
United States of America

Another question about Pi 4 as backend

Post by jeff_mythtv » Tue Mar 24, 2020 7:38 pm

I know this question might have been asked many times. I think the answer might be more updated as Pi 4 has been around long enough.

How capable is for Pi 4 4GB board to be the backend server hardware? Any difficulties to record two and replay two at the same time? I am currently using the Lenovo TS 140 and running the 0.27 mythbuntun. There is no problem whatsoever. However, I'd like to use the hardware for something else if the Pi 4 can achieve the same result.

Any feedback would be greatly appreciated.

User avatar
heyted
Senior
Posts: 157
Joined: Sun Jun 08, 2014 2:14 am
Location: South Florida
Contact:
United States of America

Re: Another question about Pi 4 as backend

Post by heyted » Wed Mar 25, 2020 12:51 am

Some people are using a Pi for a combined frontend and backend. I imagine having a few channels via OTA would be better than many channels with cable in this case.
Ted | My blog

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

Re: Another question about Pi 4 as backend

Post by MikeB2013 » Wed Mar 25, 2020 12:45 pm

jeff_mythtv wrote:
Tue Mar 24, 2020 7:38 pm
I know this question might have been asked many times. I think the answer might be more updated as Pi 4 has been around long enough.

How capable is for Pi 4 4GB board to be the backend server hardware? Any difficulties to record two and replay two at the same time? I am currently using the Lenovo TS 140 and running the 0.27 mythbuntun. There is no problem whatsoever. However, I'd like to use the hardware for something else if the Pi 4 can achieve the same result.

Any feedback would be greatly appreciated.
record two, replay two at the same time is not a problem, as there is not really much processing power required, it is mainly input/output over USB and Ethernet. This assumes that the operating system (Raspbian Buster) is running on an external disk, not the microSD card.

Note there is currently a problem with Commercial flagging

It really comes down to how much disk storage you need. If you need many TB of storage, Pi4 may not be the optimal solution.
Pi4 has 2 x USB3 and 2 x USB2 ports, with combined power of around 1.4 A using the official power supply. This is normally sufficient for a single hard disk. I have used single hard disks, including SSD up to 2 TB with no problems. It is not a good idea to plugin external hard disk whilst Pi4 is powered (some disks have a high start up surge current which can cause Pi lock up and/or corrupt the microSD card).

The earliest version of mythtv that can be used with Pi4 is 30, with 31 (when available) recommended.

jeff_mythtv
Newcomer
Posts: 9
Joined: Mon Feb 26, 2018 11:45 pm
United States of America

Re: Another question about Pi 4 as backend

Post by jeff_mythtv » Wed Mar 25, 2020 3:05 pm

Thank you!

I have two questions:

1. Is the commercial flagging problem also found in other hardware or just pi-related? I know it is more a software issue. Just want to make sure how much the pi differs from the legacy lineup;

2. Pi4 is not the optimal solution if many TB of storage is planned to use. Is it because the storage would be powered from the USB port so the Pi may not have enough power for the writing? What if the storage has its own power source, would that still present a problem?

In v27.4, the commercial flagging is not air-tight for all scenarios. If the commercial is not detected if it happens at the beginning or the beginning of the recording is in the middle of the commercial. But it works enough times as far as I remember.

One extra question, is the Mythtv-light built with different hardware using cross platform compiler?

Many thanks for your feedback!

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

Re: Another question about Pi 4 as backend

Post by MikeB2013 » Wed Mar 25, 2020 3:54 pm

1. Commercial flagging issue is limited to Raspberry Pi see https://code.mythtv.org/trac/ticket/13476

2. Externally powered storage will be ok. A USB3 powered HUB (as long as it does not back feed power to Pi USB ports) will also work.

mythtv-light is built using a Pi2, Pi3 or Pi4. Official releases are available at https://www.mythtv.org/wiki/MythTV_Light

jeff_mythtv
Newcomer
Posts: 9
Joined: Mon Feb 26, 2018 11:45 pm
United States of America

Re: Another question about Pi 4 as backend

Post by jeff_mythtv » Wed Mar 25, 2020 10:01 pm

Mike, thanks for your insights!

All major functionality appears to be working fine, except the commercial flagging mechanism.

I am running Mythtv-Light v30 off pi3-b. The cpu usage appears to be modest. I am recording programs into a 128gb usb flash drive. I don't feel any issue at the moment. The TV signal source is a 3-years old HDHomerun Connect. MythTV v30 assigns different channel numbers. CBS New York was 1021, now it is 10201. Basically the zero is inserted into the 2nd last digit. I don't know why the change is made, it shouldn't affect me as long as this "chanid" is not used for anything critical.

I will spend the next few days to record more programs. This is a game change for me. My current box is off until the front end asks for watching TV. With pi, I can leave it on all the time. .... what else ... Yes, have you tried to build the source code using more powerful hardware than pi, use the cross platform compiler? I just want to know if it has been done and if it is doable. I have done quite a few cross platform compilation for pi using PC. If it can be done, that would save a lot of time ... I am curious if v29.1 would be any different.

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

Re: Another question about Pi 4 as backend

Post by MikeB2013 » Thu Mar 26, 2020 1:28 pm

As far as "chanid" is concerned, is it really "chanid" or channel number as seen in Program Guide?
I am not familiar with atsc, so will leave this for someone else to comment.

For building I usually build native on Pi4 as it is faster than Pi2 or Pi3.
Clean build of mythtv-light (ignoring mythplugins) on Pi4 (4GB) with Raspbian Buster.
Using mythtv/packaging/deb-light/ build system on fixes/31
Took 67 minutes on my Pi4 (4GB) to produce the .deb file which can be installed on Pi2 or Pi3 as well.
Only thing I did to speed up build was to change in mythtv/packaging/deb-light/build.sh the number of parallel jobs from 2 to 4 (line 45).

Some weeks ago I tried cross-compile but could not get it to work (could well have been my error somewhere).
However, using distcc to off load the compile from Pi4 worked on the then latest mythtv master (which is now essentially mythtv fixes/31)
See https://solarianprogrammer.com/2018/05/ ... pberry-pi/
Host was Xubuntu 18.04 LTS (old laptop with core i7 8 GB RAM, os on SSD) I only built cross-compiler for gcc 8.3 as this is same as Raspbian Buster.
Build using packaging/deb-light/build_package.sh with jobs set to 8 in build.sh took 22 minutes compared to 64 minutes on Pi4 with jobs=4

The only potential issue I see with the distcc approach is that if something does not work, is it a real bug or something to do with building via distcc.

Note that building mythtv requires a lot of build dependencies, I strongly recommend the use of mythtv/ansible to set these up on the Raspberry Pi4, or any other system.

Mike

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

Re: Another question about Pi 4 as backend

Post by MikeB2013 » Thu Mar 26, 2020 2:59 pm

When building mythtv fixes/31 or master the following configure line is required, assumes mythtv has been cloned from github i.e.
git clone https://github.com/MythTV/mythtv.git

Note I have ignored mythplugins for the present (some issues are being worked on).

manual build, having checked out the appropriate branch for mythtv:
cd mythtv/mythtv
./configure --prefix=/usr --disable-vdpau --enable-opengl --disable-vaapi --cpu=cortex-a7 --arch=armv7 --extra-cflags=-mfpu=neon --extra-cxxflags=-mfpu=neon

Build using mythtv/packaging/deb-light build system, again having checked out appropriate branch for mythtv and packaging:
cd mythtv/mythtv
../../packaging/deb-light/build_package.sh -c "--cpu=cortex-a7 --arch=armv7 --extra-cflags=-mfpu=neon --extra-cxxflags=-mfpu=neon"

Note: I expect the extra parameters to be added to deb-light build system at some point when mythtv-light 31 gets released, so the additional -c "--cpu=cortex-a7 --arch=armv7 --extra-cflags=-mfpu=neon --extra-cxxflags=-mfpu=neon" will not be needed.

Mike

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

Re: Another question about Pi 4 as backend

Post by pgbennett » Thu Mar 26, 2020 3:36 pm

Please bear in mind that the v0.27 version of MythTV for Raspberry Pi is unofficial, unsupported and has some bugs. The source code for v0.27 is not in the main MythTV repository. You need to use v30 or v31. Note also there are major changes in playback between v30 and v31.

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

Re: Another question about Pi 4 as backend

Post by jfabernathy » Fri Mar 27, 2020 10:21 am

As someone who uses my RPi4 4GB daily as a combo FE/BE, stick with v30 for now. I use mythweb a lot and with v31 you loose the Raspbian Desktop. With v30 I run the full Rasbian install so the Rpi4 can be used as a normal computer while recording or as a mythfrontend.

Jim A

jeff_mythtv
Newcomer
Posts: 9
Joined: Mon Feb 26, 2018 11:45 pm
United States of America

Re: Another question about Pi 4 as backend

Post by jeff_mythtv » Fri Mar 27, 2020 2:28 pm

I use the mythweb a lot. I notice the images at the leftmost column after getting into "Recorded Programs" are not shown. They used to be found under the "recordings" location in other releases (v27, v28.x, v29.x and v30 with ubuntu 18.04). What did I miss? I've set the ownership of mythweb/data as "mythtv:mythtv", same as /var/lib/mythtv.

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

Re: Another question about Pi 4 as backend

Post by jfabernathy » Fri Mar 27, 2020 3:59 pm

I just checked on my RPi4 v30 system and on mythweb recorded tab they take a while to populate, but they do show up.

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

Re: Another question about Pi 4 as backend

Post by MikeB2013 » Fri Mar 27, 2020 4:25 pm

jeff_mythtv wrote:
Fri Mar 27, 2020 2:28 pm
I use the mythweb a lot. I notice the images at the leftmost column after getting into "Recorded Programs" are not shown. They used to be found under the "recordings" location in other releases (v27, v28.x, v29.x and v30 with ubuntu 18.04). What did I miss? I've set the ownership of mythweb/data as "mythtv:mythtv", same as /var/lib/mythtv.
Ownership on mythweb/data is incorrect, it should be "www-data:www-data"

I don't know where mythweb is installed on your system, there are two common places:
/usr/share/mythtv/mythweb
or
/usr/local/share/mythtv/mythweb

in either case navigate to mythweb and run the following:

Code: Select all

sudo chown -R www-data:www-data data/
sudo chmod -R g+w data/
and restart apache2

jeff_mythtv
Newcomer
Posts: 9
Joined: Mon Feb 26, 2018 11:45 pm
United States of America

Re: Another question about Pi 4 as backend

Post by jeff_mythtv » Fri Mar 27, 2020 9:26 pm

Sorry, it didn't work.

I know it is permission related. I've included www-data in the mythtv group and made sure the mythweb/data belongs to www-data:www-data. And "data" allows group writing.

The png files are supposed to be inside of the recordings directory along with the ts files. ts files are fine, no png is found.

I did not build from the source code, it is running on 2020-02-13-raspbian-buster, not the lite nor the full.

What could go wrong? I have attached the screenshot, but you all know what I am referring to.....

Just manually ran the mythpreviewgen:

mythtv-light-30<192.168.1.101>:/opt/disk01/recordings:/>sudo -u mythtv mythpreviewgen --size 0x0 --chanid 10201 --starttime 20200327211600 --outfile /tmp/a.png
2020-03-27 17:38:16.306915 C mythpreviewgen version: fixes/30 [v30.0-60-gb9c1b41a6c] www.mythtv.org
2020-03-27 17:38:16.307100 C Qt version: compile: 5.11.3, runtime: 5.11.3
2020-03-27 17:38:16.307112 N Enabled verbose msgs: general
2020-03-27 17:38:16.307179 N Setting Log Level to LOG_INFO
2020-03-27 17:38:16.318318 I Added logging to the console
2020-03-27 17:38:16.320795 I Setup Interrupt handler
2020-03-27 17:38:16.320835 I Setup Terminated handler
2020-03-27 17:38:16.320858 I Setup Segmentation fault handler
2020-03-27 17:38:16.320878 I Setup Aborted handler
2020-03-27 17:38:16.320927 I Setup Bus error handler
2020-03-27 17:38:16.320950 I Setup Floating point exception handler
2020-03-27 17:38:16.320977 I Setup Illegal instruction handler
2020-03-27 17:38:16.321002 I Setup Real-time signal 0 handler
2020-03-27 17:38:16.321043 I Setup Hangup handler
2020-03-27 17:38:16.321847 N Using runtime prefix = /usr
2020-03-27 17:38:16.321867 N Using configuration directory = /home/mythtv/.mythtv
2020-03-27 17:38:16.322211 I Assumed character encoding: en_US.UTF-8
2020-03-27 17:38:16.325054 I Empty LocalHostName. This is typical.
2020-03-27 17:38:16.325123 I Using a profile name of: 'mythtv-light-30' (Usually the same as this host's name.)
2020-03-27 17:38:16.325584 I Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
2020-03-27 17:38:17.438876 N Setting QT default locale to en_US
2020-03-27 17:38:17.438936 I Current locale en_US
2020-03-27 17:38:17.439146 N Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
2020-03-27 17:38:17.474174 I Preview at calculated offset (240 seconds)
* failed to open vchiq instance
2020-03-27 17:38:17.629757 I AFD: codec AC3 has 6 channels
QWaitCondition::wait(): mutex lock failure: Invalid argument
QWaitCondition::wait(): mutex unlock failure: Invalid argument
QWaitCondition::wait(): cv wait failure: Invalid argument
Attachments
Screenshot from 2020-03-27 17-19-34.png
Screenshot from 2020-03-27 17-19-34.png (67.39 KiB) Viewed 490 times

jeff_mythtv
Newcomer
Posts: 9
Joined: Mon Feb 26, 2018 11:45 pm
United States of America

Re: Another question about Pi 4 as backend

Post by jeff_mythtv » Sun Mar 29, 2020 9:58 pm

I got a pi4-4gb board yesterday. Here is what I did:

1. continue the previous installed "mythtv-light", the preview problem wasn't resolved;
2. start from scratch buster-2020-02-13 desktop version, git clone https://github.com/MythTV/mythtv.git and git clone https://github.com/MythTV/mythweb.git, checkout fixes/30,

./configure --prefix=/usr --enable-omx-rpi --disable-vdpau --disable-opengl-video --enable-opengl --disable-opengl-themepainter --disable-vaapi --cpu=cortex-a7 --arch=armv7 --extra-cflags=-mfpu=neon --extra-cxxflags=-mfpu=neon

When creating the linux login, I make www-data a group member of mythtv. /usr/share/mythtv/mythweb/data's ownership is www-data with 775; /var/lib/mythtv/recordings is owned by mythtv, same 775.

The thumbnails are generated.

3. I repeat the process for v29. It is running fine. I think it has few "bugs" than v30. It's not bug, it is out of sync between these two releases.

The commercial flagging mechanism is not working right in v30 as we know it. In addition, I think the codecs used in v30 might be different from v29? When I brought up the vlc to watch the recorded programs, vlc is always crashed in a few seconds...

Going back to why I got the pi4, I'd like to think the "light" version I have maybe different from yours because the preview thumbnail problems. The only I did differently in the "light" version is I did not place www-data under mythtv group.

I will continue to play with these, either v29 or v30 in the next few days. Please share your experiences whatever come to your mind.... Working alone would be very boring. lol

Thanks!

Post Reply