MythTV 31 - High CPU usage during playback

For discussion of topics specific to MythTV on OSX
Post Reply
gocubsgo
Newcomer
Posts: 7
Joined: Fri Nov 29, 2019 7:05 pm
United States of America

MythTV 31 - High CPU usage during playback

Post by gocubsgo » Sat Nov 21, 2020 7:00 pm

I finally updated my backend to v31, so I’m now using the macOS v31 frontend build from SourceForge. First of all, thanks to everyone that made those builds possible.

The trouble I’m having is no matter what playback profile I select, the CPU usage is high enough on my MacBook Pro to send the fan spinning full blast. Activity Monitor says mythfrontend.real is using between 40 and 60% during playback. I don’t know what it was with v30, but it wasn’t enough to cause the fan to spin up.

I’m guessing this is related to the “Significant changes to video decoding and playback.” comment in the v31 release notes. Are others seeing excessive CPU usage? Any suggestions for reducing it while still maintaining decent playback quality? I tried VideoToolBox (hardware decode), but playback was not good.

gocubsgo
Newcomer
Posts: 7
Joined: Fri Nov 29, 2019 7:05 pm
United States of America

Re: MythTV 31 - High CPU usage during playback

Post by gocubsgo » Sat Nov 21, 2020 7:45 pm

Well, I may have already found a solution. This is a MacBook Pro with a Retina screen. I had the idea to select "Open in Low Resolution" in the Get Info box. After that, I noticed no drop in quality in the interface or video playback, but the fan no longer spins up. Even with the High Quality playback profile, CPU usage usually stays below 40%. This is with the app running fullscreen.

jhoyt
Junior
Posts: 74
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: MythTV 31 - High CPU usage during playback

Post by jhoyt » Sat Nov 21, 2020 8:52 pm

I think what you discovered is probably the best fix for the time being. Mark had to put in quite a few changes to get video playback in non-low resolution mode working.

What version of macOS are you running? What version of the MythFrontend did you grab?

I ask because if you're running Catalina - make sure to grab the Catalina build as it had significant performance enhancements for me when testing higher resolution video.

The only downside to low resolution mode is that if you have any 4k material you'll have to switch back to view it.

BTW - macports is currently doing a substantial update to their QT5 packages (mostly to update to the latest version and support Big Sur - maybe even the new Apple Silicon). I'm optimistic after diving through some of the code that this should help some of the issues. ...although it may also introduce some new bugs to chase down. Once qt5.15 is released (and has a working qt-qtwebkit package) I'm going try to release some updated applications. When testing I'll try to see if I notice a change in CPU load during playback.

gocubsgo
Newcomer
Posts: 7
Joined: Fri Nov 29, 2019 7:05 pm
United States of America

Re: MythTV 31 - High CPU usage during playback

Post by gocubsgo » Sat Nov 21, 2020 10:07 pm

This system is running Big Sur and I'm using MythFrontend-31-intel-10.15.7-v31-eb3c84de5f. Sadly, I have no 4K recordings available. But I will try a Big Sur build once one is available.

jhoyt
Junior
Posts: 74
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: MythTV 31 - High CPU usage during playback

Post by jhoyt » Sat Nov 21, 2020 10:17 pm

Thanks this helps me try to troubleshoot. i haven't tested much since upgrading my main system to Big Sur (upgraded yesterday).

In Big Sur Apple upgraded Xcode to 12.2 which is causing a lot of chaos since it's modified a lot of things to be compatible with the new Apple Silicon. I'll post when I get a Big Sur build working. Just a warning - it's going to be a while. The macports guys are working through a ton of headaches due to Xcode 12.2 and the Apple rev of versions away from the 10.X family to 11.X.

jhoyt
Junior
Posts: 74
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: MythTV 31 - High CPU usage during playback

Post by jhoyt » Sun Nov 22, 2020 9:56 pm

I just posted some new Catalina builds for v31 and v32. These use Xcode 12.2. Testing on my on my Big Sur system (11.0.1), I am only using ~20% of a cpu during playback. I'm optimistic that they'll fix your playback issues since they use the latest SDK.

For settings, I am using the "Open GL High Quality" playback profile
-> Decoder is standard
-> Video Renderer is OpenGL YV12
-> Max CPUs 2
-> Deinterlacers is set to High Quality
--> Prefer OpenGL deinterlacers is checked
--> Prefer drive deinterlacers is unchecked
-> Deinterlacers (double rate) set to High Quality
--> Prefer OpenGL deinterlacers is checked
--> Prefer drive deinterlacers is unchecked
Realtime Priority threads are enabled

I did manage to get a Big Sur version of v31 to build with an early prerelease version of qt 5.15.1 from macports. The video played back great, but mythfrontend couldn't access the audio subsystem. I have filed a issue report on the MythTV website - hopefully someone who knows the underpinnings of QT or mythfrontend can help me work through the issue...

jhoyt
Junior
Posts: 74
Joined: Thu Aug 27, 2015 10:11 am
United States of America

Re: MythTV 31 - High CPU usage during playback

Post by jhoyt » Tue Nov 24, 2020 7:31 pm

So I managed to work through the Big Sur qt and audio issues for v31 and will be uploading the files shortly.

My CPU usage for this build is
  • ~35% for OpenGL
  • ~15% for VideoToolBox
WARNING - I had to graft the master-prev32 audio updates onto v31 to get it working so there may be some unintended bugs. Once the mythtv devs work through my issue report (https://github.com/MythTV/mythtv/issues/284) and commit any appropriate changes I'll rebuild and post the dmg files.

WARNING 2 - I also had to help out getting qt5.15.2 ready in macports (https://trac.macports.org/ticket/61103) - so there could be some bugs there as well...

Post Reply