Overclocking to improve playback performance?

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

Overclocking to improve playback performance?

Post by jfabernathy »

I'm running overclocking tests and wonder if others have seen improvement with playback performance on a Raspberry PI 4 4GB Mythtv v31 Combo FE/BE.

What I'm running:
RPI 4 with 4GB RAM. Raspberry PI OS 32bit
Mythtv v31 combo FE/BE built with these instructions: https://mythtv-rp4.blogspot.com/2020/11 ... rpi-4.html

Overclocking changes to /boot/config.txt

Code: Select all

over_voltage=6
arm_freq=2000
I'm using a case with a fan and heatsinks on the chips and I'm staying ~60C temp when testing playback

I think the following settings give me the best playback on interlaced content.

Playback profile settings:
tested using UHD 4K TV set to 1080P
improvement seen on 1920x1080@29.97fps and 1280x720@59.94fps

Decoder MMAL (Decode Only)
Max CPUs 4
Deblocking Filter Checked
Video Renderer OpenGL YV12
Deinterlacer Quality (SR) Medium quality
Prefer OpenGL deinterlacers Unchecked
Prefer driver Deinterlacer Unchecked
Deinterlacer Quality (DR) Medium quality
Prefer OpenGL Deinterlacer Unchecked
Prefer driver Deinterlacer Unchecked
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Overclocking to improve playback performance?

Post by jfabernathy »

I forgot to add that, to me, the overclocking and using the software OpenGL decoding and deinterlacing saw enough improvement that I don't find myself annoyed by the picture so I can just watch, enjoy, and not think about it.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Overclocking to improve playback performance?

Post by gedakc »

Yesterday I took the plunge and ordered an RPi4 4GB for use as a combined MythTV FE/BE PVR. I plan to use it with a Seagate USB3 2TB hard drive and a dual tuner HDHomeRun Connect network tuner.

The RPi4 Kit I ordered has an aluminum case which acts as a passive heat sink, and I'm curious if I'll be able to overclock it enough to get decent playback performance. My preference is to not have any fan noise, but I am open to resorting to a fan based case if needed.

Now for my question.

Did you try different levels of overclocking, and if so at what point did the playback performance become acceptable?

I appreciate all the work done by the MythTV developers to make using an RPi4 possible and also to the MythTV users who share their experiences in the forum and the mailing lists.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Overclocking to improve playback performance?

Post by jfabernathy »

gedakc wrote:
Fri Jan 01, 2021 10:56 pm

Did you try different levels of overclocking, and if so at what point did the playback performance become acceptable?

I appreciate all the work done by the MythTV developers to make using an RPi4 possible and also to the MythTV users who share their experiences in the forum and the mailing lists.
I watched a lot of Youtube videos on RPI4 and overclocking and cooling. Some of the passive cases could handle the overclocking.
I used the MagPi article on overclocking as a guide and stopped at 2000Mhz with over_voltage of 6, and arm_freq_min=1000. Then I compared the video quality. So I don't have what's good enough. Raspberrypi.org says you can run at <80C without throttling or damaging the part. The throttling was arbitrarily set to 80C for safety concerns for the user.

But I'm becoming away that some of the broadcasters are messing with their video quality to reduce bandwidth. Sometimes what I see is a problem is not the RPI, but the original signal being jerky due to lower fps that the broadcasters are causing.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Overclocking to improve playback performance?

Post by gedakc »

It sounds like some of the passive cooling cases might work well.

My plan is to use the MythTV Light packages from Peter, the setup scripts from Mike, and your instructions on your blog to set up my RPi4.

I often use Closed Captions that I suspect will put additional load on the RPi. I plan to document my findings to add to the knowledge shared in the MythTV community.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Overclocking to improve playback performance?

Post by gedakc »

I built an RPi4 4GB MythTV combined FE/BE with Raspberry Pi OS lite 2020-12-02 and the MythTV Light packages (31.0-54-g445cf1fe6b-0) following these very helpful instructions How I installed MythTV v31 on my RPI 4.

With this setup I did notice the odd judder while watching 1080i MPEG2 ATSC content. The judder was most noticeable when the screen was panning left or right. In an effort to get rid of the judder I tried some overclocking. With config.txt parameters of over_voltage=6 and arm_freq=2000 the temperature peaked at 76 deg C. However, and this is subjective, I did not think the quality improved much so I left my RPi4 running with no overclocking.

The positive thing I learned with the overclocking is that my passive cooling aluminum case was able to keep the RPi4 within the operating temperature range.

Today I enabled the GL (Fake KMS) OpenGL desktop driver and this seems to have made the biggest difference. The steps to enable the driver are:

Code: Select all

sudo raspi-config
Then choose:

Code: Select all

6. Advanced Options
     A2 GL Driver
        G2 GL (Fake KMS) OpenGL desktop driver with fake KMS
When I chose OK, a driver was downloaded, but it was quick and I didn't catch the name of it. I rebooted after to ensure that the changes would take effect.

Now when I watch 1080i MPEG2 ATSC content I have not observed any judder (then again maybe my eyes are getting tired and lazy). I will have to watch more content to see if the judder has been eliminated completely.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Overclocking to improve playback performance?

Post by jfabernathy »

gedakc wrote:
Fri Jan 15, 2021 12:10 am

Today I enabled the GL (Fake KMS) OpenGL desktop driver and this seems to have made the biggest difference. The steps to enable the driver are:

Code: Select all

sudo raspi-config
Then choose:

Code: Select all

6. Advanced Options
     A2 GL Driver
        G2 GL (Fake KMS) OpenGL desktop driver with fake KMS
When I chose OK, a driver was downloaded, but it was quick and I didn't catch the name of it. I rebooted after to ensure that the changes would take effect.

Now when I watch 1080i MPEG2 ATSC content I have not observed any judder (then again maybe my eyes are getting tired and lazy). I will have to watch more content to see if the judder has been eliminated completely.
when I first started using the RPI4, the Fake KMS OpenGL driver was the default, so I never mentioned that to anyone in install instructions. Maybe I should have. I checked on another RPI4 that I use that has never had Mythtv on it and it had that driver installed by default.

Code: Select all

[pi4]
# Enable DRM VC4 V3D driver on top of the dispmanx display stack
dtoverlay=vc4-fkms-v3d
max_framebuffers=2
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Overclocking to improve playback performance?

Post by gedakc »

Before enabling the GL (Fake KMS) OpenGL desktop driver I also have the same two lines as you do in /boot/config.txt:

Code: Select all

dtoverlay=vc4-fkms-v3d
max_framebuffers=2
Curious as to whether my memory was deceiving me I reproduced the steps and there is definitely a GL driver package downloaded.

Following are more detailed steps to enable the GL (Fake KMS) OpenGL desktop driver:

Code: Select all

sudo raspi-config
Use arrows, space bar, tab, and enter keys to change the following settings:

Code: Select all

6. Advanced Options
     A2 GL Driver
        G2 GL (Fake KMS) OpenGL desktop driver with fake KMS
When I chose OK the screen switched to the console and displayed the following package download:

Code: Select all

Reading package lists... Done
Building dependency tree
Reading state information... Done
The following NEW packages will be installed:
  gldriver-test
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 3,580 B of archives.
After this operation, 21.5 kB of additional disk space will be used.
Get:1 http://archive.raspberrypi.org/debian buster/main armhf gldriver-test all 0.6 [3,580 B]
Fetched 3,580 B in 0s (12.0 kB/s)
Selecting previously unselected package gldriver-test.
(Reading database ... 68087 files and directories currently installed.)
Preparing to unpack .../gldriver-test_0.6_all.deb ...
Unpacking gldriver-test (0.6) ...
Setting up gldriver-test (0.6) ...
Created symlink /etc/systemd/system/multi-user.target.wants/gldriver-test.service → /lib/systemd/system/gldriver-test.service.
When the download completed the screen returned to raspi-config with the following options:

Code: Select all

G1 Legacy        Original non-GL desktop driver
G2 GL (Fake KMS) OpenGL desktop driver with fake KMS
I choose second one and OK. Then I was presented with the message:

Code: Select all

The fake KMS GL driver is enabled.
I chose OK, then Finish.

I rebooted before testing to ensure the driver was loaded and active.

With this new driver I do see a definite improvement when watching 1080i MPEG2 ATSC TV shows.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Overclocking to improve playback performance?

Post by gedakc »

Following are the results of my video playback testing using a CanaKit RPi4 4GB with passive cooling aluminum case.

The tl;dr is video playback is pretty good with mythfrontend on the same RPi4 that hosts mythtbackend. For the best video playback try Kodi with the MythTV PVR client.

Following are my overclocking observations using mythfrontend with the earlier described MMAL video profile when watching a football game:

Code: Select all

/boot/config.txt parameters   | Max Temp (degC) | Observations
----------------------------- | --------------- | ------------
no overclocking               |              55 | Good video quality for many TV shows,
                              |                 | sports has some judder (jump in video playback)
over_voltage=2, arm_freq=1750 |              63 | Sports still has some judder
over_voltage=6, arm_freq=2000 |              76 | Sports still has some judder
Out of curiosity I tried installing Kodi with the MythTV PVR client and discovered that the judder disappeared completely.

To install Kodi on Raspberry Pi OS Lite 2020-12-02 I followed Guide: Kodi on Raspberry Pi OS / Raspbian Buster.

To install Kodi I used:

Code: Select all

sudo apt install kodi kodi-pvr-mythtv kodi-inputstream-adaptive
To start Kodi from the command line:

Code: Select all

kodi
Then I configured and enabled the MythTV PVR Client add-on.

Note that all of the above software is installed on the same RPi4 (kodi along with mythfrontend and mythbackend).

To summarize, the video playback experience with mythfrontend was acceptable and pleasant for many TV shows. However when fast panning is involved (like in sports) then judder (a jump in the image) can appear. There was no judder when I used Kodi with the MythTV PVR client for video playback.
Last edited by gedakc on Tue Jan 19, 2021 5:06 pm, edited 1 time in total.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Overclocking to improve playback performance?

Post by jfabernathy »

agree with your assessment. Particularly on Kodi with kodi-pvr-mythtv addon. If you can stand the Kodi UI, then it's a good frontend for Mythtv.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Overclocking to improve playback performance?

Post by gedakc »

I definitely prefer mythfrontend for watching MythTV recordings.

I recall you mentioned building a MythTV v30 RPi4 PVR for use when camping. Is MythTV v30 video playback better quality (for example, no judder)?
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Overclocking to improve playback performance?

Post by jfabernathy »

gedakc wrote:
Tue Jan 19, 2021 5:09 pm
I definitely prefer mythfrontend for watching MythTV recordings.

I recall you mentioned building a MythTV v30 RPi4 PVR for use when camping. Is MythTV v30 video playback better quality (for example, no judder)?
I thought v30 was much better and you could run it from the RPI OS Desktop environment. Last time I went camping I just took a FireTV 4K stick and used the RPI4 as a backend only, which it does very well.

It's pretty easy to build V30 on the RPi 4. Just grab a spare SSD and try it. I think these instructions should still work for v30.
https://mythtv-rp4.blogspot.com/2019/12 ... -pi-4.html
May want to check any of the comments in the pi-utils scripts for v31 specific setup and change that to v30. Also you don't need to jump through hoops to boot from USB anymore.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Overclocking to improve playback performance?

Post by gedakc »

Thanks for the prompt response, link to your instructions, and version edit suggestions. I will give v30 a try and report back.
gedakc
Junior
Posts: 96
Joined: Fri Jul 18, 2014 1:28 am
Canada

Re: Overclocking to improve playback performance?

Post by gedakc »

It took jumping through some hoops to get MythTV v30 running. Unfortunately the video playback quality does not appear to be perfect in v30 either.
User avatar
jfabernathy
Senior
Posts: 577
Joined: Wed Feb 18, 2015 2:37 pm
Location: Raleigh, NC
United States of America

Re: Overclocking to improve playback performance?

Post by jfabernathy »

gedakc wrote:
Wed Jan 20, 2021 10:52 pm
It took jumping through some hoops to get MythTV v30 running. Unfortunately the video playback quality does not appear to be perfect in v30 either.
I guess that's why I took my FireTV 4K stick on my last trip.
Post Reply