RPi 4 MythTV-light 31 issues

For discussion of topics specific to MythTV on Raspberry Pi devices
bigdarkspot
Newcomer
Posts: 8
Joined: Wed Jul 22, 2020 6:33 am
United States of America

RPi 4 MythTV-light 31 issues

Post by bigdarkspot »

I had a functional installation of mythtv-light v30 on my Raspberry Pi 4. I needed to update the OS on my backend, and the upgraded version of the OS only had packages for mythtv v31, so I had to update my frontend on the Pi 4.

So I uninstalled Mythtv-light and mythplugins-light, changed the repo to point to the v31 repo, and re-installed both packages.

The upgraded version of mythtv has a few problems.

The worst of the problems, is that whenever the Mythtv window is in front, the graphics get shuffled, so they become illegible (it looks like the horizontal sync on an old school tv is out of whack, except that it's static, not moving around). As soon as I move another window in front of it, the graphics draw correctly, and you can read the menus clearly.

The second problem, is that the fonts come out really big, so the text of the menu options gets cut off. I was able to partially fix this by setting the text zoom to 50%, but the fonts still don't look right, the characters are wider than they are tall, so the fonts look squished.

The third problem i was able to fix manually, but probably should be fixed in the package. In order for the mythgame plugin to load, the minizip1 package needs to be installed. I installed it, and now mythgame shows up on the menus. this should probably be marked as a dependency in the package. I haven't been able to test out mythgame, due to the other issues, but at least the menu options are there.

Does anybody have any idea how to fix either of the first 2 issues?

Thanks,

Jeff
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by jfabernathy »

Well, I've been experimenting with the RPi4 and mythtv for a long time. While it makes a good backend, I have yet to tolerate watching it as a frontend. On action content it has issues. Maybe now that Raspberry Pi OS has moved to the Linux 5.4 kernel we will see some fixes.

However, based on you mentioning the "Mythtv window" I assume you are trying to run mythtv-frontend as a desktop application, which worked in v30 just fine. That is not the case with V31. You have to run it as a console app without a desktop. Bascially dedicate a RPi4 to mythtv-frontend. Even then I find the RPi4 lacking as a mythtv frontend.

If the RPi4 is your only choice for a frontend and you are willing to dedicate it to use as a frontend, then you might get close to what you need.

When I've made a workable front end on v31, I started with a fresh install of Raspberry Pi OS and done a full-upgrade. Then I use the pi-utils that MikeB put together. https://github.com/MikeB2013/pi-utils The utility, pi-setup_mythtv_31.sh, will install the v31 mythtv-light, setup the gpu memory split, change to console auto login, and put the scripts for run the frontend via QT in /home/pi.

When you boot you will be at the console and you could get back to the Desktop with 'startx' or you can run mythtv-frontend with './run_mythfrontend.sh

Since you are on a Rpi4 use the MMAL with Standard, OpenGL, software since there is no MPEG2. At least that's what I have to do in the USA for OTA streams.
bigdarkspot
Newcomer
Posts: 8
Joined: Wed Jul 22, 2020 6:33 am
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by bigdarkspot »

I just tried setting the frontend up without a desktop environment, using the MikeB scripts, starting with a fresh OS install. It looks like it tries to start up after a reboot, but I get a seg-fault on line 103 of the run_mythfrontend.sh script.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by jfabernathy »

bigdarkspot wrote:
Wed Jul 22, 2020 6:31 pm
I just tried setting the frontend up without a desktop environment, using the MikeB scripts, starting with a fresh OS install. It looks like it tries to start up after a reboot, but I get a seg-fault on line 103 of the run_mythfrontend.sh script.
If everything is going normally, you will get a seg fault on exit from mythfrontend. That is why the run_mythfrontend.sh has some logic after the exit to recover from the Seg Fault. Some QT bug.
bigdarkspot
Newcomer
Posts: 8
Joined: Wed Jul 22, 2020 6:33 am
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by bigdarkspot »

The segfault is while trying to start mythfontend, not after exiting. It won't even start up.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by jfabernathy »

bigdarkspot wrote:
Wed Jul 22, 2020 8:04 pm
The segfault is while trying to start mythfontend, not after exiting. It won't even start up.
Do you get this error message while the frontend is trying to start up and before the Seg Fault??

Code: Select all

Could not queue DRM page flip on screen HDMI1 (Invalid argument)
I get about 4 or 5 of them in a row. I just started getting them after I did a fresh install with Raspberry Pi OS and updated to the Linux kernel 5.4.51.
When I try to run either run_mythsetup.sh or run_mythfrontend.sh it loops forever on that error. If I ssh in to the RPi4 and killall mythfrontend or killall mythtv-setup it exits the program and then gets the Seg Fault that is known about and has a workaround in the shell script.

Something has definitely changed recently and I suspect it's the kernel change and related changes. A few weeks ago I did the same install as today and it worked fine.
bigdarkspot
Newcomer
Posts: 8
Joined: Wed Jul 22, 2020 6:33 am
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by bigdarkspot »

I get that error when I run mythfrontend without using the startup script, but when I use the startup script, it just exits after trying to ping the display's EDID:

Here is a transcript of stdout and stderr when trying to use the startup script:

Code: Select all

Starting MythTV Frontend -- this may take a few seconds -- Please wait
performance
Setting screen to 1920x1080@60
drmModeGetResources failed (Operation not supported)
no screens available, assuming 24-bit color
2020-07-22 14:11:27.838260 I  Setup Interrupt handler
2020-07-22 14:11:27.838323 I  Setup Terminated handler
2020-07-22 14:11:27.838340 I  Setup Segmentation fault handler
2020-07-22 14:11:27.838356 I  Setup Aborted handler
2020-07-22 14:11:27.838371 I  Setup Bus error handler
2020-07-22 14:11:27.838388 I  Setup Floating point exception handler
2020-07-22 14:11:27.838403 I  Setup Illegal instruction handler
2020-07-22 14:11:27.838422 I  Setup Real-time signal 0 handler
2020-07-22 14:11:27.838443 I  Setup User defined signal 1 handler
2020-07-22 14:11:27.838458 I  Setup User defined signal 2 handler
2020-07-22 14:11:27.838473 I  Setup Hangup handler
2020-07-22 14:11:27.838743 C  mythfrontend version: fixes/31 [v31.0-54-g445cf1fe6b] www.mythtv.org
2020-07-22 14:11:27.838762 C  Qt version: compile: 5.11.3, runtime: 5.11.3
2020-07-22 14:11:27.838880 I  Raspbian GNU/Linux 10 (buster) (arm)
2020-07-22 14:11:27.838888 N  Enabled verbose msgs:  general
2020-07-22 14:11:27.839731 N  Setting Log Level to LOG_INFO
2020-07-22 14:11:27.850457 I  Added logging to the console
2020-07-22 14:11:27.850547 N  Using runtime prefix = /usr
2020-07-22 14:11:27.850559 N  Using configuration directory = /home/pi/.mythtv
2020-07-22 14:11:27.850659 I  Assumed character encoding: en_US.UTF-8
2020-07-22 14:11:27.851588 I  Added logging to /tmp/mythfrontend.20200722211127.1336.log
2020-07-22 14:11:27.852112 I  Loading en_us translation for module mythfrontend
2020-07-22 14:11:27.852729 I  Empty LocalHostName. This is typical.
2020-07-22 14:11:27.852751 I  Using a profile name of: 'LivingRoomTV' (Usually the same as this host's name.)
2020-07-22 14:11:27.852971 I  Start up testing connections. DB 192.168.1.125, BE , attempt 0, status dbAwake, Delay: 2000
2020-07-22 14:11:29.879456 N  Setting QT default locale to en_US
2020-07-22 14:11:29.879498 I  Current locale en_US
2020-07-22 14:11:29.879625 N  Reading locale defaults from /usr/share/mythtv//locales/en_us.xml
2020-07-22 14:11:29.906874 I  DisplayRPI: Connected to display 'HDMI1'
2020-07-22 14:11:29.935790 I  EDID: Version:1.3 Size:256 Exensions:1
2020-07-22 14:11:29.935825 I  EDID: Gamma:2.2 sRGB:0
2020-07-22 14:11:29.935843 I  EDID: Display chromaticity:-
2020-07-22 14:11:29.935858 I  EDID: Red:	0.6533,	0.3311
2020-07-22 14:11:29.935871 I  EDID: Green:	0.2959,	0.6211
2020-07-22 14:11:29.935883 I  EDID: Blue:	0.1484,	0.0518
2020-07-22 14:11:29.935896 I  EDID: White:	0.3135,	0.3291
2020-07-22 14:11:29.935912 I  EDID: Physical address: 1.1.0.0
Handling Segmentation fault
./run_mythfrontend.sh: line 103:  1336 Segmentation fault      QT_QPA_PLATFORM=eglfs QT_QPA_EGLFS_KMS_CONFIG=/home/pi/pi_mythfrontend.json mythfrontend $ARGUMENTS
The part that worries me the most is this:

Code: Select all

drmModeGetResources failed (Operation not supported)
no screens available, assuming 24-bit color
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by jfabernathy »

bigdarkspot wrote:
Wed Jul 22, 2020 9:20 pm
I get that error when I run mythfrontend without using the startup script, but when I use the startup script, it just exits after trying to ping the display's EDID:

Here is a transcript of stdout and stderr when trying to use the startup script:

The part that worries me the most is this:

Code: Select all

drmModeGetResources failed (Operation not supported)
no screens available, assuming 24-bit color
I've seen that problem before and it would occur until I rebooted. The Seg Fault is the one that is expected. If it fails after a fresh boot to the console there is a problem. You should see all the same traffic on the console even with the script. I run is as:

Code: Select all

./run_mythfrontend.sh --logpath /tmp --loglevel debug
I added the additional debug logging.
Jim A
bigdarkspot
Newcomer
Posts: 8
Joined: Wed Jul 22, 2020 6:33 am
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by bigdarkspot »

alright, this is strange:

when I run run run_mythfrontend.sh from the same HDMI port that I ran pi-setup_mythtv_31.sh, I get the crash that I pasted above.... when I move my HDMI cord to the other output on the pi, it doesn't crash, but I don't get any UI, and I get the

Code: Select all

Could not queue DRM page flip on screen HDMI1 (Invalid argument)
error.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by jfabernathy »

looks like we are chasing the same issue. I just burned a new microSD with raspberry pi OS and booted it, updated it and then cloned the pi-utils.
Then I installed mythtv-light using pi-setup_mythtv_31.sh After the install I rebooted.
When I run "./run_mythfrontend" mine gets to the

Code: Select all

Could not queue DRM page flip on screen HDMI1 (Invalid argument)
and loops till I kill it.
bigdarkspot
Newcomer
Posts: 8
Joined: Wed Jul 22, 2020 6:33 am
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by bigdarkspot »

Ok, I've made some progress, thanks to a QT developer's post to some forum somewhere...

I changed the run_mythfrontend.sh script. I changed the end section to look like this:

Code: Select all

export QT_QPA_EGLFS_ALWAYS_SET_MODE="1"
#for QT debug add to command line QT_QPA_EGLFS_DEBUG=1 QT_LOGGING_RULES=qt.qpa.*=true
QT_QPA_PLATFORM=eglfs mythfrontend $ARGUMENTS
# fixup keyboard after exit from mythfrontend, bug in QT causes segment fault which kills keyboard input
kbd_mode -u
# restore cursor
setterm  --cursor on

exit 0
I got rid of the part referencing the json file:

Code: Select all

QT_QPA_EGLFS_KMS_CONFIG=/home/pi/pi_mythfrontend.json
and added the export:

Code: Select all

export QT_QPA_EGLFS_ALWAYS_SET_MODE="1"
Now it no longer crashes, it shows the user interface. The only problem I have now is that it freezes when you try to play back a recording. I'm about to dig in to that issue...
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by jfabernathy »

okay that worked for me also and the playback is most likely a config issue. on video playback set profile to MMAL, standard, opengl, CPU=4, Low quality. I think you'll get it from there.
Jim A
bigdarkspot
Newcomer
Posts: 8
Joined: Wed Jul 22, 2020 6:33 am
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by bigdarkspot »

the playback seems to have fixed itself. I left it 'frozen' for awhile while I took care of some other things, and it eventually started playing back. after that, any subsequent playbacks happened without any delay. Looks like it's fixed... this also fixed my audio issue from the other thread...now I appear to have 5.1 as well...

Thanks for the back and forth on this one.

Jeff
User avatar
monkeypet
Junior
Posts: 49
Joined: Tue Feb 11, 2014 7:18 pm
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by monkeypet »

The worst of the problems, is that whenever the Mythtv window is in front, the graphics get shuffled, so they become illegible (it looks like the horizontal sync on an old school tv is out of whack, except that it's static, not moving around). As soon as I move another window in front of it, the graphics draw correctly, and you can read the menus clearly.
The garbled screen was caused by the kernel upgrade and discussed here:
https://www.raspberrypi.org/forums/view ... f&start=50

A workaround can be downgrading the kernel, but when i did that I lost my digital audio output.

Another workaround, suggested by a user here is to start the compositor,
If you are using a custom .xsession file, you can start the compositor by doing the following, add /usr/lib/raspi-config/cmstart.sh :

Code: Select all

pi@raspberrypi:~ $ cat /home/pi/.xsession
#!/bin/bash
/usr/lib/raspi-config/cmstart.sh &
sleep 5s
/home/pi/bin/start.mythfrontend
There is also a settings option to enable the compositor if you are using the default desktop, it should be on by default.

WARNING: Starting the compositor, you will see glitchy MPEG2 playback on the Pi 4 even with overclocking. More details in this thread, viewtopic.php?f=46&t=3791. For the time being, I switch over to Kodi/MythTV PVR plugin, video playback is smooth on it.

EDIT1: Added how to start the compositor based on another user's comment.
EDIT2: Added glitchy playback and Kodi info, link to the MPEG2 thread.
Last edited by monkeypet on Sat Jul 25, 2020 9:07 pm, edited 3 times in total.
Rodyland
Newcomer
Posts: 1
Joined: Fri Jul 24, 2020 3:01 am
Australia

Re: RPi 4 MythTV-light 31 issues

Post by Rodyland »

FWIW I'm seeing the same problem as of doing an update last night. Might have to try the kernel downgrade.

EDIT: Downgrade of kernel as per the link posted above "worked" in that the image was fixed, but audio was lost.

EDIT2: Re-upgraded, enabled the compositor, sound and video now working.
Post Reply