<div dir="ltr"><div dir="ltr"><br></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, Dec 14, 2021 at 11:36 AM James Abernathy <<a href="mailto:jfabernathy@gmail.com">jfabernathy@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">I run mythfrontend from the console on my Raspberry Pi 4 under Bullseye aarch64. When it starts up it's great, but about 50% of the time it fails due to:<div>drmModeGetResources failed (Operation not supported)<br></div><div><br></div><div>I have to reboot until it starts up correctly.  This is on a UHD 4K TV. It seems to happen more than on a FHD TV. I'll attach the script (modified from MikeB2013's pi-utils) I run to start it and 2 log files: one a capture of the console and one the mythfrontend log file.</div><div>-------------------------------------------------</div><div>#!/bin/bash<br><br># script to run mythfrontend from version 31 on Raspberry Pi under Raspian Buster using EGLFS<br># can be added to .bashrc to allow autostart of mythfrontend on boot<br><br># Last Modified 24 July 2020<br><br># Author Mike Bibbings<br><br>#check for any arguments on command line, if so use for mythfrontend command, so we can use different parameters<br>#e.g. run_mythfrontend.sh --logpath /home/pi --loglevel debug<br># if no arguments set --logpath /tmp<br>if [ -z "$*" ] ; then<br>        ARGUMENTS="--logpath /tmp -O PowerOffTVOnExit=0"<br>else<br>      ARGUMENTS="$*"<br>fi<br><br>echo "Starting MythTV Frontend -- this may take a few seconds -- Please wait"<br><br>echo performance | sudo tee /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor<br><br>#get first 2 characters<br>CURRENT_REFRESH=60<br><br>CURRENT_RES="1920x1080"<br><br>RESOLUTION="$CURRENT_RES@$CURRENT_REFRESH"<br><br>echo "Setting screen to $RESOLUTION"<br><br># we need override file to force correct resolution.<br># QT defaults to using EDID from connected hdmi device<br># pi2/3 use /dev/dri/card0,  pi4 /dev/dri/card1<br># find out which model of Pi we have<br><br><br>CARD="card1"<br><br>#file created everytime this script is run,avoids checking previous and current resolution everytime<br>bash -c "cat >/home/pi/pi_mythfrontend.json" <<ENDOFSCRIPTINPUT<br>{<br>    "device": "/dev/dri/${CARD}",<br>    "outputs": [<br>        { "name": "HDMI1", "mode": "${RESOLUTION}" }<br>    ]<br>}<br>ENDOFSCRIPTINPUT<br><br>#for QT debug add to command line QT_QPA_EGLFS_DEBUG=1 QT_LOGGING_RULES=qt.qpa.*=true<br>QT_QPA_EGLFS_ALWAYS_SET_MODE="1" QT_QPA_PLATFORM=eglfs QT_QPA_EGLFS_DEBUG=1 QT_LOGGING_RULES=qt.qpa.*=true QT_QPA_EGLFS_KMS_CONFIG=/home/pi/pi_mythfrontend.json mythfrontend $ARGUMENTS<br># fixup keyboard after exit from mythfrontend, bug in QT causes segment fault which kills keyboard input<br>kbd_mode -u<br># restore cursor<br>setterm  --cursor on<br><br>exit 0<br></div><div>-----------------------------</div><div>Starting MythTV Frontend -- this may take a few seconds -- Please wait<br>performance<br>Setting screen to 1920x1080@60<br>qt.qpa.egldeviceintegration: EGL device integration plugin keys: ("eglfs_emu", "eglfs_kms_egldevice", "eglfs_kms", "eglfs_x11")<br>qt.qpa.egldeviceintegration: EGL device integration plugin keys (sorted): ("eglfs_kms", "eglfs_emu", "eglfs_kms_egldevice", "eglfs_x11")<br>qt.qpa.egldeviceintegration: Trying to load device EGL integration "eglfs_kms"<br>qt.qpa.eglfs.kms: Loading KMS setup from "/home/pi/pi_mythfrontend.json"<br>qt.qpa.eglfs.kms: Requested configuration (some settings may be ignored):<br>      headless: false <br>     hwcursor: true <br>      pbuffers: false <br>     separateScreens: false <br>      virtualDesktopLayout: 0 <br>     outputs: QMap(("HDMI1", QMap(("mode", QVariant(QString, "1920x1080@60"))("name", QVariant(QString, "HDMI1")))))<br>qt.qpa.eglfs.kms: New DRM/KMS via GBM integration created<br>qt.qpa.egldeviceintegration: Using EGL device integration "eglfs_kms"<br>qt.qpa.eglfs.kms: platformInit: Opening DRM device<br>qt.qpa.eglfs.kms: GBM: Using DRM device "/dev/dri/card1" specified in config file<br>qt.qpa.eglfs.kms: Using backend-provided DRM device /dev/dri/card1<br>qt.qpa.eglfs.kms: Creating GBM device for file descriptor 4 obtained from "/dev/dri/card1"<br>qt.qpa.eglfs.kms: Initalizing event reader for device 0x55c92a68f0 fd 4<br>qt.qpa.eglfs.kms: Querying EGLDisplay<br>qt.qpa.eglfs.kms: Event reader thread: entering event loop<br>drmModeGetResources failed (Operation not supported)<br>qt.qpa.input: libinput: event0  - Wireless Keyboard/Mouse: is tagged by udev as: Keyboard<br>qt.qpa.input: libinput: event0  - Wireless Keyboard/Mouse: device is a keyboard<br>qt.qpa.input: libinput: event1  - Wireless Keyboard/Mouse: is tagged by udev as: Mouse<br>qt.qpa.input: libinput: event1  - Wireless Keyboard/Mouse: device is a pointer<br>qt.qpa.input: libinput: event2  - Wireless Keyboard/Mouse Consumer Control: is tagged by udev as: Keyboard<br>qt.qpa.input: libinput: event2  - Wireless Keyboard/Mouse Consumer Control: device is a keyboard<br>qt.qpa.input: libinput: event5  - Harmony Keyboard Mouse: is tagged by udev as: Mouse<br>qt.qpa.input: libinput: event5  - Harmony Keyboard Mouse: device is a pointer<br>qt.qpa.input: libinput: event6  - Harmony Keyboard: is tagged by udev as: Keyboard<br>qt.qpa.input: libinput: event6  - Harmony Keyboard: device is a keyboard<br>qt.qpa.input: libinput: event7  - Harmony Keyboard Consumer Control: is tagged by udev as: Keyboard<br>qt.qpa.input: libinput: event7  - Harmony Keyboard Consumer Control: device is a keyboard<br>qt.qpa.input: libinput: event8  - Harmony Keyboard System Control: is tagged by udev as: Keyboard<br>qt.qpa.input: libinput: event8  - Harmony Keyboard System Control: device is a keyboard<br>qt.qpa.input: libinput: event3  - vc4: is tagged by udev as: Keyboard Pointingstick<br>qt.qpa.input: libinput: event3  - vc4: device is a pointer<br>qt.qpa.input: libinput: event3  - vc4: device is a keyboard<br>qt.qpa.input: libinput: event4  - vc4: is tagged by udev as: Keyboard Pointingstick<br>qt.qpa.input: libinput: event4  - vc4: device is a pointer<br>qt.qpa.input: libinput: event4  - vc4: device is a keyboard<br>qt.qpa.input: Using xkbcommon for key mapping<br>no screens available, assuming 24-bit color<br>2021-12-14 11:14:15.102024 I  Setup Interrupt handler<br>2021-12-14 11:14:15.102048 I  Setup Terminated handler<br>2021-12-14 11:14:15.102057 I  Setup Segmentation fault handler<br>2021-12-14 11:14:15.102065 I  Setup Aborted handler<br>2021-12-14 11:14:15.102071 I  Setup Bus error handler<br>2021-12-14 11:14:15.102079 I  Setup Floating point exception handler<br>2021-12-14 11:14:15.102087 I  Setup Illegal instruction handler<br>2021-12-14 11:14:15.102101 I  Setup Real-time signal 0 handler<br>2021-12-14 11:14:15.102112 I  Setup User defined signal 1 handler<br>2021-12-14 11:14:15.102119 I  Setup User defined signal 2 handler<br>2021-12-14 11:14:15.102125 I  Setup Hangup handler<br>2021-12-14 11:14:15.102548 C  mythfrontend version: master [v32-Pre-3144-g8d60da4ac4] <a href="http://www.mythtv.org" target="_blank">www.mythtv.org</a><br>2021-12-14 11:14:15.102554 C  Qt version: compile: 5.15.2, runtime: 5.15.2<br>2021-12-14 11:14:15.102643 I  Debian GNU/Linux 11 (bullseye) (arm64)<br>2021-12-14 11:14:15.102647 N  Enabled verbose msgs:  general<br>2021-12-14 11:14:15.102832 N  Setting Log Level to LOG_INFO<br>2021-12-14 11:14:15.113288 I  Added logging to the console<br>2021-12-14 11:14:15.113323 N  Using runtime prefix = /usr<br>2021-12-14 11:14:15.113328 N  Using configuration directory = /home/pi/.mythtv<br>2021-12-14 11:14:15.113388 I  Assumed character encoding: en_US.UTF-8<br>2021-12-14 11:14:15.113438 N  Setting 'PowerOffTVOnExit' being forced to '0'<br>2021-12-14 11:14:15.114043 I  Added logging to /tmp/mythfrontend.20211214161415.1360.log<br>2021-12-14 11:14:15.114390 I  Loading en_us translation for module mythfrontend<br>2021-12-14 11:14:15.115077 I  Empty LocalHostName. This is typical.<br>2021-12-14 11:14:15.115090 I  Using a profile name of: 'rpi4-mythtv' (Usually the same as this host's name.)<br>2021-12-14 11:14:15.115232 I  Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000<br>2021-12-14 11:14:16.638604 N  Setting QT default locale to en_US<br>2021-12-14 11:14:16.638616 I  Current locale en_US<br>2021-12-14 11:14:16.638714 N  Reading locale defaults from /usr/share/mythtv//locales/en_us.xml<br>2021-12-14 11:14:16.676535 E  PowerDBus: No UPower interface. Unable to monitor battery state<br>2021-12-14 11:14:16.698512 I  Power: On AC power<br>2021-12-14 11:14:16.698543 I  Power: Supported actions: Restart,Shutdown<br>2021-12-14 11:14:16.698572 N  Setting 'PowerOffTVOnExit' being forced to '0'<br>2021-12-14 11:14:16.706057 I  Listening on TCP <a href="http://0.0.0.0:6547" target="_blank">0.0.0.0:6547</a><br>2021-12-14 11:14:16.707395 I  Listening on TCP [::]:6547<br>2021-12-14 11:14:16.822177 I  Loading en_us translation for module mythfrontend<br>2021-12-14 11:14:16.842117 I  VRR: No variable refresh rate support detected<br>2021-12-14 11:14:16.842128 E  Display: Qt has no screens!<br>2021-12-14 11:14:16.842166 N  Display: Desktop video mode: 1920x1080 60.000Hz<br>2021-12-14 11:14:16.854076 I  InputHandler: Starting<br>2021-12-14 11:14:16.854916 E  LIRC: Failed to connect to Unix socket '/var/run/lirc/lircd'<br>                        eno: No such file or directory (2)<br>2021-12-14 11:14:16.854994 I  No joystick configuration found, not enabling joystick control<br>2021-12-14 11:14:16.855438 I  UDPListener: Enabling<br>2021-12-14 11:14:16.857565 I  Binding to UDP <a href="http://0.0.0.0:6948" target="_blank">0.0.0.0:6948</a><br>2021-12-14 11:14:16.857710 I  Binding to UDP [::]:6948<br>2021-12-14 11:14:16.891795 I  Using Frameless Window<br>2021-12-14 11:14:16.891800 I  Using Full Screen Window<br>2021-12-14 11:14:16.891864 I  Qt: Cannot create window: no screens available<br>Handling Aborted<br>./run_mythfrontend.sh: line 51:  1360 Aborted                 QT_QPA_EGLFS_ALWAYS_SET_MODE="1" QT_QPA_PLATFORM=eglfs QT_QPA_EGLFS_DEBUG=1 QT_LOGGING_RULES=qt.qpa.*=true QT_QPA_EGLFS_KMS_CONFIG=/home/pi/pi_mythfrontend.json mythfrontend $ARGUMENTS<br>The keyboard is in some unknown mode<br>Changing to the requested mode may make your keyboard unusable, please use -f to force the change.<br>---------------------------------------</div><div>2021-12-14 11:14:15.102024 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Interrupt handler<br>2021-12-14 11:14:15.102048 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Terminated handler<br>2021-12-14 11:14:15.102057 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Segmentation fault handler<br>2021-12-14 11:14:15.102065 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Aborted handler<br>2021-12-14 11:14:15.102071 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Bus error handler<br>2021-12-14 11:14:15.102079 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Floating point exception handler<br>2021-12-14 11:14:15.102087 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Illegal instruction handler<br>2021-12-14 11:14:15.102101 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Real-time signal 0 handler<br>2021-12-14 11:14:15.102112 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup User defined signal 1 handler<br>2021-12-14 11:14:15.102119 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup User defined signal 2 handler<br>2021-12-14 11:14:15.102125 I [1360/1360] thread_unknown signalhandling.cpp:179 (SetHandlerPrivate) - Setup Hangup handler<br>2021-12-14 11:14:15.102548 C [1360/1360] thread_unknown mythcommandlineparser.cpp:2797 (ConfigureLogging) - mythfrontend version: master [v32-Pre-3144-g8d60da4ac4] <a href="http://www.mythtv.org" target="_blank">www.mythtv.org</a><br>2021-12-14 11:14:15.102554 C [1360/1360] thread_unknown mythcommandlineparser.cpp:2801 (ConfigureLogging) - Qt version: compile: 5.15.2, runtime: 5.15.2<br>2021-12-14 11:14:15.102643 I [1360/1360] thread_unknown mythcommandlineparser.cpp:2803 (ConfigureLogging) - Debian GNU/Linux 11 (bullseye) (arm64)<br>2021-12-14 11:14:15.102647 N [1360/1360] thread_unknown mythcommandlineparser.cpp:2805 (ConfigureLogging) - Enabled verbose msgs:  general<br>2021-12-14 11:14:15.102832 N [1360/1360] thread_unknown logging.cpp:686 (logStart) - Setting Log Level to LOG_INFO<br>2021-12-14 11:14:15.113288 I [1360/1363] Logger logging.cpp:274 (run) - Added logging to the console<br>2021-12-14 11:14:15.113323 N [1360/1360] thread_unknown mythdirs.cpp:203 (InitializeMythDirs) - Using runtime prefix = /usr<br>2021-12-14 11:14:15.113328 N [1360/1360] thread_unknown mythdirs.cpp:204 (InitializeMythDirs) - Using configuration directory = /home/pi/.mythtv<br>2021-12-14 11:14:15.113388 I [1360/1360] CoreContext mythcorecontext.cpp:287 (Init) - Assumed character encoding: en_US.UTF-8<br>2021-12-14 11:14:15.113438 N [1360/1360] CoreContext mythcommandlineparser.cpp:2836 (ApplySettingsOverride) - Setting 'PowerOffTVOnExit' being forced to '0'<br>2021-12-14 11:14:15.114043 I [1360/1362] LogForward loggingserver.cpp:110 (FileLogger) - Added logging to /tmp/mythfrontend.20211214161415.1360.log<br>2021-12-14 11:14:15.114390 I [1360/1360] CoreContext mythtranslation.cpp:62 (load) - Loading en_us translation for module mythfrontend<br>2021-12-14 11:14:15.115077 I [1360/1360] CoreContext mythcontext.cpp:628 (LoadDatabaseSettings) - Empty LocalHostName. This is typical.<br>2021-12-14 11:14:15.115090 I [1360/1360] CoreContext mythcontext.cpp:635 (LoadDatabaseSettings) - Using a profile name of: 'rpi4-mythtv' (Usually the same as this host's name.)<br>2021-12-14 11:14:15.115232 I [1360/1360] CoreContext mythcontext.cpp:884 (TestDBconnection) - Start up testing connections. DB localhost, BE , attempt 0, status dbAwake, Delay: 2000<br>2021-12-14 11:14:16.638604 N [1360/1360] CoreContext mythcorecontext.cpp:1852 (InitLocale) - Setting QT default locale to en_US<br>2021-12-14 11:14:16.638616 I [1360/1360] CoreContext mythcorecontext.cpp:1885 (SaveLocaleDefaults) - Current locale en_US<br>2021-12-14 11:14:16.638714 N [1360/1360] CoreContext mythlocale.cpp:120 (LoadDefaultsFromXML) - Reading locale defaults from /usr/share/mythtv//locales/en_us.xml<br>2021-12-14 11:14:16.676535 E [1360/1360] CoreContext platforms/mythpowerdbus.cpp:102 (Init) - PowerDBus: No UPower interface. Unable to monitor battery state<br>2021-12-14 11:14:16.698512 I [1360/1360] CoreContext mythpower.cpp:353 (PowerLevelChanged) - Power: On AC power<br>2021-12-14 11:14:16.698543 I [1360/1360] CoreContext mythpower.cpp:135 (Init) - Power: Supported actions: Restart,Shutdown<br>2021-12-14 11:14:16.698572 N [1360/1360] CoreContext mythcommandlineparser.cpp:2836 (ApplySettingsOverride) - Setting 'PowerOffTVOnExit' being forced to '0'<br>2021-12-14 11:14:16.706057 I [1360/1360] CoreContext serverpool.cpp:415 (listen) - Listening on TCP <a href="http://0.0.0.0:6547" target="_blank">0.0.0.0:6547</a><br>2021-12-14 11:14:16.707395 I [1360/1360] CoreContext serverpool.cpp:415 (listen) - Listening on TCP [::]:6547<br>2021-12-14 11:14:16.822177 I [1360/1360] CoreContext mythtranslation.cpp:62 (load) - Loading en_us translation for module mythfrontend<br>2021-12-14 11:14:16.842117 I [1360/1360] CoreContext mythvrr.cpp:93 (Create) - VRR: No variable refresh rate support detected<br>2021-12-14 11:14:16.842128 E [1360/1360] CoreContext mythdisplay.cpp:624 (InitScreenBounds) - Display: Qt has no screens!<br>2021-12-14 11:14:16.842166 N [1360/1360] CoreContext mythdisplay.cpp:545 (Initialise) - Display: Desktop video mode: 1920x1080 60.000Hz<br>2021-12-14 11:14:16.854076 I [1360/1360] CoreContext devices/mythinputdevicehandler.cpp:53 (Start) - InputHandler: Starting<br>2021-12-14 11:14:16.854916 E [1360/1360] CoreContext devices/lirc.cpp:198 (Init) - LIRC: Failed to connect to Unix socket '/var/run/lirc/lircd'<br>                  eno: No such file or directory (2)<br>2021-12-14 11:14:16.854994 I [1360/1360] CoreContext devices/jsmenu.cpp:140 (ReadConfig) - No joystick configuration found, not enabling joystick control<br>2021-12-14 11:14:16.855438 I [1360/1372] UDP mythudplistener.cpp:34 (DoEnable) - UDPListener: Enabling<br>2021-12-14 11:14:16.857565 I [1360/1372] UDP serverpool.cpp:556 (bind) - Binding to UDP <a href="http://0.0.0.0:6948" target="_blank">0.0.0.0:6948</a><br>2021-12-14 11:14:16.857710 I [1360/1372] UDP serverpool.cpp:556 (bind) - Binding to UDP [::]:6948<br>2021-12-14 11:14:16.891795 I [1360/1360] CoreContext mythmainwindow.cpp:659 (Init) - Using Frameless Window<br>2021-12-14 11:14:16.891800 I [1360/1360] CoreContext mythmainwindow.cpp:675 (Init) - Using Full Screen Window<br>2021-12-14 11:14:16.891864 I [1360/1360] CoreContext mythcommandlineparser.cpp:2816 (operator()) - Qt: Cannot create window: no screens available<br></div></div></blockquote><div><br></div><div> I have tried to simplify the key part of the command from this:</div><div><br></div><div>QT_QPA_EGLFS_ALWAYS_SET_MODE="1" QT_QPA_PLATFORM=eglfs QT_QPA_EGLFS_DEBUG=1 QT_LOGGING_RULES=qt.qpa.*=true QT_QPA_EGLFS_KMS_CONFIG=/home/pi/pi_mythfrontend.json mythfrontend $ARGUMENTS<br></div><div><br></div><div>to this:</div><div><br></div><div>QT_QPA_EGLFS_ALWAYS_SET_MODE="1" QT_QPA_PLATFORM=eglfs QT_QPA_EGLFS_DEBUG=1 QT_LOGGING_RULES=qt.qpa.*=true  mythfrontend $ARGUMENTS<br></div><div><br></div><div>It runs, but the CONFIG is defaulting to my UHD 4K parameters so the FPS jitter goes from +/-0.03 to  +/- 1.29. and the picture is no longer smooth. With the config it's supposed to make it 1080P. When it works it's great.</div><div><br></div><div>Jim A<br></div><div><br></div></div></div>