My experience and questions with the Raspberry Pi 4

For discussion of topics specific to MythTV on Raspberry Pi devices
Post Reply
rodr
Junior
Posts: 29
Joined: Sun Apr 12, 2015 5:57 pm
Australia

My experience and questions with the Raspberry Pi 4

Post by rodr »

I recently set up set up MythTV 31 backend and frontend on a Raspberry Pi 4 with 8 GB RAM and booting from a 2 TB USB hard drive (not SSD). This was also an upgrade of 0.29 that was running on another PC with Mint 19. Just wanted to share my issues and solutions, and perhaps get a couple of questions answered.

I started with mythtv-light and the Pi running headless with VNC. On starting mythtv-setup I got errors "QXcbConnection: Failed to initialize XRandr", "failed to open vchiq instance" and "Segmentation fault". Then I tried it with X forwarding, no luck.

Rather than chase down problems like this so early in the game I decided to build from source. First without Ansible and using the dependencies listed at https://www.mythtv.org/wiki/Build_from_Source I quickly encountered "Package libcrystalhd-dev is not available, but is referred to by another package" with no obvious way to install libcrystalhd-dev.

Then building dependencies with Ansible worked better. The instructions said to run configure like this:

Code: Select all

./configure --enable-openmax --disable-vdpau --disable-opengl-video --enable-opengl --disable-opengl-themepainter --disable-vaapi
... however neither --enable-openmax nor --enable-omx-rpi were recognized and I finally figured out to use this:

Code: Select all

./configure --disable-vdpau --enable-opengl --disable-vaapi
After compiling and installing, mythtv-setup still segfaulted on exit when run on vncviewer, but was all good with ssh -X.

I was a bit puzzled by the instruction to use "useradd --system mythtv" to create the backend user. Why a system user? And this command does not create a home directory for mythtv, is that intentional? I would be running the frontend as the existing "pi" user.

I started the backend like this:

Code: Select all

sudo /usr/local/bin/mythbackend -d --logpath /var/log/mythtv/ --user mythtv
After a while this resulted in a LOT of log files in /var/log/mythtv/. Is there a way to do less logging with fewer output files?

My tuner is a Hauppauge WinTV DualHD which worked without issues on the PC running 0.29. On the Pi4 it did not work at all and I found "firmware file 'dvb-demod-si2168-02.fw' not found" in syslog. After a great deal of web searching and head scratching I finally figured out to download this file:

Code: Select all

https://github.com/OpenELEC/dvb-firmware/blob/master/firmware/dvb-demod-si2168-02.fw?raw=true
and copy it to /lib/firmware/. Why was that not included or otherwise mentioned? Is it related to the fact that my tuner is for the Australian market?

Another special thing I had to do was enable HDMI audio output in raspi-config.

It's working pretty well now. My most recent puzzle is why do I see errors like this in the logs, and does it matter?

Code: Select all

2020-07-29 05:29:57.144314 E [1368/10050] Metadata_13316 jobqueue.cpp:2251 (DoMetadataLookupThread) -
    JobQueue: Metadata Lookup Errored: "Deutsche Welle English News"
    recorded from channel 2030 at 2020-07-28T19:29:00Z (Failed with Exit Status 128)
User avatar
pgbennett
Developer
Posts: 504
Joined: Mon Apr 27, 2015 5:41 pm
United States of America

Re: My experience and questions with the Raspberry Pi 4

Post by pgbennett »

If you have the metadata job enabled in your recording rul, it tries to invoke the metadata command. It will try to run mythmetadatalookup . You may have a log file for mythmetadatalookup which may tell what went wrong, otherwise it may not be able to run the mythmetadatalookup command. If you don't want the metadata you can disable it in your recording rules and this will not happen.
rodr
Junior
Posts: 29
Joined: Sun Apr 12, 2015 5:57 pm
Australia

Re: My experience and questions with the Raspberry Pi 4

Post by rodr »

pgbennett wrote:
Wed Jul 29, 2020 4:35 pm
If you have the metadata job enabled in your recording rul, it tries to invoke the metadata command. It will try to run mythmetadatalookup . You may have a log file for mythmetadatalookup which may tell what went wrong, otherwise it may not be able to run the mythmetadatalookup command. If you don't want the metadata you can disable it in your recording rules and this will not happen.
Thank you. As best I can tell, I do not have a metadata job enabled in the recording rules; not even sure how to do that. Here is the content of the most recent mythmetadatalookup log file:

Code: Select all

2020-07-30 04:29:50.750842 C [6976/6976] thread_unknown mythcommandlineparser.cpp:2611 (ConfigureLogging) - mythmetadatalookup version: fixes/31 [v31.0-80-gf7a1f4b1a0] www.mythtv.org
2020-07-30 04:29:50.750951 C [6976/6976] thread_unknown mythcommandlineparser.cpp:2613 (ConfigureLogging) - Qt version: compile: 5.11.3, runtime: 5.11.3
2020-07-30 04:29:50.751067 I [6976/6976] thread_unknown mythcommandlineparser.cpp:2615 (ConfigureLogging) - Raspbian GNU/Linux 10 (buster) (arm)
2020-07-30 04:29:50.751084 N [6976/6976] thread_unknown mythcommandlineparser.cpp:2617 (ConfigureLogging) - Enabled verbose msgs:  general
2020-07-30 04:29:50.751394 N [6976/6976] thread_unknown logging.cpp:725 (logStart) - Setting Log Level to LOG_INFO
2020-07-30 04:29:50.762157 I [6976/6979] Logger logging.cpp:280 (run) - Added logging to the console
2020-07-30 04:29:50.763324 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Interrupt handler
2020-07-30 04:29:50.763348 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Terminated handler
2020-07-30 04:29:50.763385 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Segmentation fault handler
2020-07-30 04:29:50.763403 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Aborted handler
2020-07-30 04:29:50.763439 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Bus error handler
2020-07-30 04:29:50.763460 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Floating point exception handler
2020-07-30 04:29:50.763477 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Illegal instruction handler
2020-07-30 04:29:50.763507 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Real-time signal 0 handler
2020-07-30 04:29:50.763530 I [6976/6976] thread_unknown signalhandling.cpp:191 (SetHandlerPrivate) - Setup Hangup handler
2020-07-30 04:29:50.763775 I [6976/6978] LogForward loggingserver.cpp:129 (FileLogger) - Added logging to /var/log/mythtv/mythmetadatalookup.20200729182950.6976.log
2020-07-30 04:29:50.763876 N [6976/6976] thread_unknown mythdirs.cpp:203 (InitializeMythDirs) - Using runtime prefix = /usr/local
2020-07-30 04:29:50.763885 N [6976/6976] thread_unknown mythdirs.cpp:205 (InitializeMythDirs) - Using configuration directory = /nonexistent/.mythtv
2020-07-30 04:29:50.763997 I [6976/6976] CoreContext mythcorecontext.cpp:285 (Init) - Assumed character encoding: en_US.UTF-8
2020-07-30 04:29:50.764428 E [6976/6976] CoreContext mythdbparams.cpp:43 (IsValid) - DBHostName is not set in config.xml
2020-07-30 04:29:50.764472 E [6976/6976] CoreContext mythdbparams.cpp:43 (IsValid) - DBHostName is not set in config.xml
2020-07-30 04:29:50.764531 I [6976/6976] CoreContext mythcontext.cpp:629 (LoadDatabaseSettings) - Empty LocalHostName. This is typical.
2020-07-30 04:29:50.764549 I [6976/6976] CoreContext mythcontext.cpp:638 (LoadDatabaseSettings) - Using a profile name of: 'rpi4' (Usually the same as this host's name.)
2020-07-30 04:29:50.764751 I [6976/6976] CoreContext mythcontext.cpp:887 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000
2020-07-30 04:29:51.794528 E [6976/6976] CoreContext configuration.cpp:107 (Save) - Could not create /nonexistent/.mythtv
2020-07-30 04:29:51.802765 N [6976/6976] CoreContext mythcorecontext.cpp:1810 (InitLocale) - Setting QT default locale to en_AU
2020-07-30 04:29:51.802838 I [6976/6976] CoreContext mythcorecontext.cpp:1843 (SaveLocaleDefaults) - Current locale en_AU
2020-07-30 04:29:51.803080 E [6976/6976] CoreContext mythlocale.cpp:109 (LoadDefaultsFromXML) - No locale defaults file for en_AU, skipping
2020-07-30 04:29:51.831538 E [6976/6976] CoreContext platforms/mythpowerdbus.cpp:102 (Init) - PowerDBus: No UPower interface. Unable to monitor battery state
2020-07-30 04:29:51.872766 I [6976/6976] CoreContext mythpower.cpp:348 (PowerLevelChanged) - Power: On AC power
2020-07-30 04:29:51.872845 I [6976/6976] CoreContext mythpower.cpp:131 (Init) - Power: Supported actions: Restart,Shutdown
2020-07-30 04:29:51.874993 I [6976/6976] CoreContext mythtranslation.cpp:64 (load) - Loading en_us translation for module mythfrontend
2020-07-30 04:29:51.876901 I [6976/6976] CoreContext main.cpp:113 (main) - Testing grabbers and metadata sites for functionality...
2020-07-30 04:29:51.879096 I [6976/6982] SystemManager mythsystemunix.cpp:262 (run) - Starting process manager
2020-07-30 04:29:51.879351 I [6976/6983] SystemSignalManager mythsystemunix.cpp:488 (run) - Starting process signal handler
2020-07-30 04:29:51.879507 I [6976/6984] SystemIOHandlerR mythsystemunix.cpp:83 (run) - Starting IO manager (read)
2020-07-30 04:29:51.886052 I [6976/6985] SystemIOHandlerW mythsystemunix.cpp:83 (run) - Starting IO manager (write)
2020-07-30 04:29:53.632858 I [6976/6976] CoreContext metadatadownload.cpp:423 (TelevisionGrabberWorks) - Television grabber not functional.  Aborting this run.
2020-07-30 04:29:53.633096 I [6976/6976] CoreContext platforms/mythpowerdbus.cpp:72 (~MythPowerDBus) - PowerDBus: Closing interfaces
2020-07-30 04:29:53.634607 I [6976/6976] CoreContext mythcontext.cpp:1665 (~MythContext) - Exiting
Regarding "Television grabber not functional", I'm not sure what sort of grabber is expected. Listing data is taken from the broadcasts.

Also curious is "Could not create /nonexistent/.mythtv". The backend user (mythtv) does not have a home directory, so where is it trying to create something?
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: My experience and questions with the Raspberry Pi 4

Post by bill6502 »

Could not create /nonexistent/.mythtv
The directory is based on the value of the user's home entry in /etc/password. Unless
HOME is specifically set before calling the program.

Note that MYTHCONFDIR can be set, which overrides HOME. It isn't in this case as
there's no log line containing: "Read conf dir = /some/other/directory".

The grabber being tested is for metadata, not listings. To see if metadata lookup is turned on,
look at the recording rule and press m.
rodr
Junior
Posts: 29
Joined: Sun Apr 12, 2015 5:57 pm
Australia

Re: My experience and questions with the Raspberry Pi 4

Post by rodr »

Thanks. That seems to answer another of my questions... the mythtv user should have a home directory.
rodr
Junior
Posts: 29
Joined: Sun Apr 12, 2015 5:57 pm
Australia

Re: My experience and questions with the Raspberry Pi 4

Post by rodr »

Further to the mention of WinTV-DualHD firmware in my first post, this page from Hauppauge is relevant. It turns out that "WinTV-dualHD and WinTV-soloHD for Europe" also applies to Australia, and the firmware indicated there is the official solution.
User avatar
bill6502
Developer
Posts: 2325
Joined: Fri Feb 07, 2014 5:28 pm
United States of America

Re: My experience and questions with the Raspberry Pi 4

Post by bill6502 »

Just note that a $HOME isn't required for the mythtv user. It's
one way to locate the directory that has things like config.xml
(and many other files and directories.)

Ref: https://www.mythtv.org/wiki/MYTHCONFDIR
klaeuser
Newcomer
Posts: 2
Joined: Fri Oct 30, 2020 1:34 pm
Germany

Re: My experience and questions with the Raspberry Pi 4

Post by klaeuser »

rodr wrote:
Tue Jul 28, 2020 10:45 pm

Rather than chase down problems like this so early in the game I decided to build from source. First without Ansible and using the dependencies listed at
... from_Source I quickly encountered "Package libcrystalhd-dev is not available, but is referred to by another package" with no obvious way to install libcrystalhd-dev.

Then building dependencies with Ansible worked better. The instructions said to run configure like this:

hmmm ... what OS are you running?
I'm playing around with the new 64 bit Pi OS.
Just tried to run that ansible stuff, but it just gave me an error saying that libcrystalhd-dev was not available.

I suppose, this happens because ansible is not aware of the aarch64 - Platform.
Did you install libcrystalhd-dev anyhow? Probably not ... I think there is none at all (and if you look at the Build Dependencies, they say it's required just for i386/amd64)
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: My experience and questions with the Raspberry Pi 4

Post by jfabernathy »

klaeuser wrote:
Fri Oct 30, 2020 3:14 pm

hmmm ... what OS are you running?
I'm playing around with the new 64 bit Pi OS.
Just tried to run that ansible stuff, but it just gave me an error saying that libcrystalhd-dev was not available.

I suppose, this happens because ansible is not aware of the aarch64 - Platform.
Did you install libcrystalhd-dev anyhow? Probably not ... I think there is none at all (and if you look at the Build Dependencies, they say it's required just for i386/amd64)
My experience is that ansible works for 32 bit Raspberry PI OS, but does not for 64 bit version of RPI OS. I used the dependency list and just removed libcrystalhd-dev name from the list of my dependency for 64 bit builds
klaeuser
Newcomer
Posts: 2
Joined: Fri Oct 30, 2020 1:34 pm
Germany

Re: My experience and questions with the Raspberry Pi 4

Post by klaeuser »

that might be because 'ansible_lsb id' is not set to "Raspbian" on the 64 bit OS - it's simply set to "Debian"

Therefore ansible goes the wrong way in roles/mythtv-deb/tasks/main.yml:

- name: add mythtv extra build libraries (Debian)
set_fact:
deb_pkg_lst:
- '{{ deb_pkg_lst }}'
- libcec-dev
- libcrystalhd-dev
when: ansible_distribution == "Debian" and ansible_lsb id != "Raspbian"

There should be another 'when condition' checking the platform - e.g. ansible_architecture != "aarch64"
But I'm completely new to ansible ...

I rather follow your advice :-)
Post Reply