RPi 4 MythTV-light 31 issues

For discussion of topics specific to MythTV on Raspberry Pi devices
User avatar
jfabernathy
Senior
Posts: 367
Joined: Wed Feb 18, 2015 2:37 pm
United States of America

Re: RPi 4 MythTV-light 31 issues

Post by jfabernathy » Fri Jul 24, 2020 8:35 am

Rodyland wrote:
Fri Jul 24, 2020 3:56 am
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.
So I read the post link to the Raspberry forum, but do not understand the "compositor" and how to turn it on or off. Can you explain?

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

Re: RPi 4 MythTV-light 31 issues

Post by monkeypet » Sat Jul 25, 2020 1:00 am

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
jfabernathy wrote:
Fri Jul 24, 2020 8:35 am
Rodyland wrote:
Fri Jul 24, 2020 3:56 am
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.
So I read the post link to the Raspberry forum, but do not understand the "compositor" and how to turn it on or off. Can you explain?

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

Re: RPi 4 MythTV-light 31 issues

Post by jfabernathy » Sat Jul 25, 2020 10:58 am

Well, I'm confused about the need for a compositor. Here's what I did after MikeB updated his scripts yesterday.

1. Fresh install of Raspberry Pi OS and did a fully upgrade. rebooted
2. Clone the latest pi-utils from github.

Code: Select all

https://github.com/MikeB2013/pi-utils
3. run "pi-utils/pi-setup_mythtv_31.sh and reboot

When the system reboots I have mythfrontend running full screen. All I had to do was configure the backend and then configure the audio and video. It's working as expected.

Jim A

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

Re: RPi 4 MythTV-light 31 issues

Post by monkeypet » Sun Jul 26, 2020 7:34 am

Because of your post, I went looking at the script to see what the script did. I discovered that you can run mythfrontend without the X server. So if you disabled the GUI desktop via raspi-config, then use the following, mythfrontend will launch without the need for X or its compositor... this explains why you didn't see the issue with the newer kernel.

Code: Select all

QT_QPA_EGLFS_ALWAYS_SET_MODE="1" QT_QPA_PLATFORM=eglfs mythfrontend -O PowerOffTVOnExit=0 --logpath=/home/pi/logs


Full details https://www.mythtv.org/wiki/Raspberry_P ... n_Raspbian
jfabernathy wrote:
Sat Jul 25, 2020 10:58 am
Well, I'm confused about the need for a compositor. Here's what I did after MikeB updated his scripts yesterday.

1. Fresh install of Raspberry Pi OS and did a fully upgrade. rebooted
2. Clone the latest pi-utils from github.

Code: Select all

https://github.com/MikeB2013/pi-utils
3. run "pi-utils/pi-setup_mythtv_31.sh and reboot

When the system reboots I have mythfrontend running full screen. All I had to do was configure the backend and then configure the audio and video. It's working as expected.

Jim A

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

Re: RPi 4 MythTV-light 31 issues

Post by marks7389 » Thu Apr 22, 2021 6:39 pm

bigdarkspot wrote:
Wed Jul 22, 2020 10:29 pm
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...
I've been seeing exactly the same issue with the frontend segment faulting on startup. Tried applying the fix above, which prevents it from crashing but results in the monitor being driven at the highest available resolution which I don't want (2160p30 on content intended for a 50Hz frame rate doesn't work too well....) and no obvious way to change it.

After a lot of head scratching it turns out that my Pi 4 with the latest Raspberry Pi OS Buster has the DRM device on /dev/dri/card0, at least most of the time. Fixing run_mythfrontend.sh to force that on a Pi 4 fixes the issue and, having set the desired mode in /boot/config.txt, carries the desired mode across to the frontend.

I'm not entirely sure that behaviour is consistent though. On one occasion since I change it, it went back to crashing on startup but a reboot fixed it.

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

Re: RPi 4 MythTV-light 31 issues

Post by marks7389 » Fri Apr 23, 2021 8:42 pm

marks7389 wrote:
Thu Apr 22, 2021 6:39 pm
I'm not entirely sure that behaviour is consistent though. On one occasion since I change it, it went back to crashing on startup but a reboot fixed it.
As I suspected it isn't consistent. The right answer is to modify run_mythfrontend.sh to use /dev/dri/by-path/platform-gpu-card which links to whichever device is the correct one.

Code: Select all

if [ "$PI_MODEL" = 1 ]
then
      CARD="by-path/platform-gpu-card"
else
      CARD="card0"
fi

Post Reply