Jerky video: trying to run Mythfrontend without desktop environment

For discussion of topics specific to MythTV on Raspberry Pi devices
Post Reply
AdamJacobs
Junior
Posts: 18
Joined: Sat Dec 26, 2020 5:58 pm
Great Britain

Jerky video: trying to run Mythfrontend without desktop environment

Post by AdamJacobs »

I have set up a Raspberry Pi 3B+ as a front end to a MythTV system, using MythTV Light 0.31. It mostly works OK, but the video is a bit jerky.

Having googled this, I have paid for a hardware MPEG decoding key and set that up. I have also set the GPU memory to 320. Despite that, it's still a bit jerky.

I also saw a suggestion to configure the Raspberry Pi to log into a non-graphical mode and start mythfrontend from there, to avoid the overhead of having to run a desktop GUI on top of the mythfrontend. There seem to be good reports of that improving the video quality.

I've even seen 2 methods of starting mythfrontend without the desktop GUI, but neither of them works for me.

Following the instructions on the MythTV wiki for Raspberry pi, in the section "Frontend Setup on Raspbian" (sorry I can't link to it, for some reason this forum won't let me post a URL), I have tried typing

Code: Select all

QT_QPA_PLATFORM=eglfs mythfrontend
at the terminal, but it does not start mythfrontend. Rather, I get the error message:

Code: Select all

Could not find DRM Device!
Aborted
An alternative method is described at in this forum in a thread entitled "Raspberry Pi 4 MPEG 2 HD playback not smooth".

This says to create an ~/.xsession file with the following lines

Code: Select all

#!/bin/bash
/usr/bin/mythfrontend
I'm not sure if that's supposed to do something automatically on startup, but it doesn't.

A variation on that plan is also described on the MythTV Wiki for Raspberry Pi in the section "Running without a desktop environment or window manager", using the matchbox-window-manager package. I tried that as well, but that also didn't work.

I must confess to not being familiar with .xsession files. Is there some other step I need to do to make them do something at startup? Or alternatively, is there a way to get the first method to work without the error about the DRM Device?

Or is disabling the GUI unnecessary anyway and there is a different trick to get smooth video playback?

Many thanks in advance
User avatar
Steve Goodey
Moderator
Posts: 219
Joined: Fri Feb 07, 2014 6:30 pm
Location: Colchester, England
Great Britain

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by Steve Goodey »

Not to answer your question but you'll be able to post links once you've posted a few more times, it's to stop spammers.
Don't forget the Wiki.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by jfabernathy »

Use the pi-utils to install and configure V31 on RPIs. https://github.com/MikeB2013/pi-utils

my blog basically uses that https://mythtv-rp4.blogspot.com/2020/11 ... rpi-4.html

However, IMHO, the RPI3B+ is not usable for HD content with Mythtv V31
The RPI4 is barely watchable on 1080i 720p mpeg2 content in the USA.

Just saw that Amazon has FireTV 4K for $29.99 and it's way better that any RPI for a Mythtv frontend
AdamJacobs
Junior
Posts: 18
Joined: Sat Dec 26, 2020 5:58 pm
Great Britain

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by AdamJacobs »

Thank for the replies.

I've already installed MythTV light, which works fine apart from the jerky video. If I use the pi-utils as you suggest, is it possible that that might configure it differently so that the video is smoother?
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by jfabernathy »

AdamJacobs wrote:
Sun Dec 27, 2020 12:59 pm
Thank for the replies.

I've already installed MythTV light, which works fine apart from the jerky video. If I use the pi-utils as you suggest, is it possible that that might configure it differently so that the video is smoother?
Since using the pi-utils method takes me 10 minutes to setup a fresh RPi with Frontend and 30 minutes to do a combo, I'd just do it fresh, but I have nothing but time on my hands right now. You could try and see if it solves anything.

However, don't forget the tweaks from https://www.mythtv.org/wiki/Raspberry_Pi#RPi3_Specific particularly the video playback profiles stuff
at https://www.mythtv.org/wiki/Raspberry_P ... ck_Profile

But at the end of the day the RPI is not fast enough for a real media player if you care about deinterlacing and dropped frames. Even the RPI4 is not good enough IMHO. I use a lot of RPI's in my house and RV, but mostly for non-display functions. I think the RPI4 is a great backend, and with Kodi, not a bad frontend. But since the RPI4 is $75 and the FireTV 4K is $30 and a lot better at MythTV that's what I use.
AdamJacobs
Junior
Posts: 18
Joined: Sat Dec 26, 2020 5:58 pm
Great Britain

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by AdamJacobs »

Well I figured this out. It is indeed possible to get mythtv to start without booting to GUI first. The trick is to type startx at the terminal after setting up the .xsession file as described in the documentation.

This has improved things to some extent, but TBH not to the point where it's wonderful. I think you are probably right that a RPi 3 is not adequate for playing video with MythTV 0.31.

This is kind of annoying, because before setting up a new server I'd tested a RPi 3 as a frontend for my old system running MythTV 0.29, and it worked just fine. Now contemplating whether the easiest thing might be to downgrade my server to 0.29.

I'm also interested in the FireTV option that you mentioned. Would that involve installing the Android version of MythTV? I just tried that on my phone, and it looks like one limitation of that is that it doesn't play music. Is there any way to get that working on the Android version?
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by jfabernathy »

AdamJacobs wrote:
Wed Dec 30, 2020 6:15 pm

I'm also interested in the FireTV option that you mentioned. Would that involve installing the Android version of MythTV? I just tried that on my phone, and it looks like one limitation of that is that it doesn't play music. Is there any way to get that working on the Android version?
You would need to install either the android version of mythtv-frontend or mythtv-leanfront. Please see the Andorid link at https://www.mythtv.org/wiki/Android.
The links to download the apk's are on that page.
AdamJacobs
Junior
Posts: 18
Joined: Sat Dec 26, 2020 5:58 pm
Great Britain

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by AdamJacobs »

OK, I think I have come up with a good solution.

I have installed Kodi on my RPi. Although the way Kodi connects to the MythTV backend is slightly more limited than the way the proper MythTV frontend does, the limitations are mostly fairly minor. The functionality that I use 90% of the time is there in Kodi. The main limitation is that advanced options for setting up recordings are not available from Kodi, but I can always go to my desktop PC and use MythWeb if I want to set any advanced options.

The picture quality is *way* better using Kodi. No problems at all with playing recordings with perfectly good picture quality.

Interestingly, if I look at my CPU usage while either MythTV or Kodi is playing a recording, it's completely maxed out with MythTV, with all CPUs around 90% load. With Kodi it's closer to 10%. No doubt that has a lot to do with the difference in picture quality.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by jfabernathy »

AdamJacobs wrote:
Fri Jan 01, 2021 12:37 pm
OK, I think I have come up with a good solution.

I have installed Kodi on my RPi. Although the way Kodi connects to the MythTV backend is slightly more limited than the way the proper MythTV frontend does, the limitations are mostly fairly minor. The functionality that I use 90% of the time is there in Kodi. The main limitation is that advanced options for setting up recordings are not available from Kodi, but I can always go to my desktop PC and use MythWeb if I want to set any advanced options.

The picture quality is *way* better using Kodi. No problems at all with playing recordings with perfectly good picture quality.

Interestingly, if I look at my CPU usage while either MythTV or Kodi is playing a recording, it's completely maxed out with MythTV, with all CPUs around 90% load. With Kodi it's closer to 10%. No doubt that has a lot to do with the difference in picture quality.
If you can use Kodi, you might want to get LibreELEC for the RPI. I find that no matter how good I configure Kodi on Raspberry PI OS, I can't get as good a video playback as LibreELEC. The only downside is it's frontend only; no combo with backend.
User avatar
monkeypet
Junior
Posts: 49
Joined: Tue Feb 11, 2014 7:18 pm
United States of America

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by monkeypet »

AdamJacobs wrote:
Fri Jan 01, 2021 12:37 pm
OK, I think I have come up with a good solution.

I have installed Kodi on my RPi. Although the way Kodi connects to the MythTV backend is slightly more limited than the way the proper MythTV frontend does, the limitations are mostly fairly minor. The functionality that I use 90% of the time is there in Kodi. The main limitation is that advanced options for setting up recordings are not available from Kodi, but I can always go to my desktop PC and use MythWeb if I want to set any advanced options.

The picture quality is *way* better using Kodi. No problems at all with playing recordings with perfectly good picture quality.

Interestingly, if I look at my CPU usage while either MythTV or Kodi is playing a recording, it's completely maxed out with MythTV, with all CPUs around 90% load. With Kodi it's closer to 10%. No doubt that has a lot to do with the difference in picture quality.
Kodi's picture quality is much better than the MythFrontend. However, it doesn't have subtitles and I have been so used to the MythFrontend interface, so I stay in MythFrontend. If you need to run MythFrontend, get at least a Raspberry Pi 4. I have been using it for awhile now on my primary TV, after some RaspberianOS updates, the picture quality better and definitely usable.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Jerky video: trying to run Mythfrontend without desktop environment

Post by gedakc »

Kodi has a few different ways to support subtitles. To try to get subtitles (which are embedded in the MPEG2 file) to display one needs to enable a parsing feature.

The setting is under something like Settings -> System -> Player -> Language and the option to activate is Enable parsing for closed captions.

You might find more information my Using an Inexpensive Raspberry Pi 2 as a Cheap Frontend to MythTV with Kodi: I. Enable Subtitle Parsing for Closed Captions tutorial

My experience is that Kodi is nowhere near as good as MythTV for parsing out the subtitles. MythTV almost always is able to display all the subtitles, whereas it is more hit-and-miss with Kodi.
Post Reply