High CPU usage when kodi 17.1 window not visible

  Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Post Reply
waddles Offline
Junior Member
Posts: 14
Joined: Jan 2014
Reputation: 0
Post: #1
I have noticed an issue since upgrading to 17.1 where the CPU usage escalates to 100% when the Kodi window is not in focus any more. More accurately, if some part of the Kodi window is visible it idles at around 12%-15% CPU but as soon as the Kodi window is entirely obscured it jumps straight up to 100%. This happens both in windowed mode and in fullscreen mode (ie, by switching to another desktop). The power draw increases and fans come on at full speed, sucking the life out of my battery.

I did not have this problem with 16.1, which could sit idle in the background all day doing nothing.

Paging @xayide and @FernetMenta who seem to be familiar with previous reports of high CPU usage.
(This post was last modified: 2017-04-22 14:00 by waddles.)
find quote
waddles Offline
Junior Member
Posts: 14
Joined: Jan 2014
Reputation: 0
Post: #2
https://drive.google.com/file/d/0BxQZLSe...R3Q00/view

Debug log, but nothing obvious in it. It does not report the CPU stats afaict.
find quote
waddles Offline
Junior Member
Posts: 14
Joined: Jan 2014
Reputation: 0
Post: #3
I just noticed this issue does not occur if Kodi is paused during playback. The CPU drops to 2-3% when paused even when I defocus the window, however if I pause then press 'm' to display the playback menu, it sends the CPU straight up to 100% when I defocus the window.

This really smells like a skin problem but I also tried the default skin, Estuary, and it also exhibits the same problem.
find quote
Derek Offline
Posting Freak
Posts: 1,710
Joined: Aug 2009
Reputation: 23
Location: Bonnie Scotland
Post: #4
what you using to check this and is it just one core popping up to 100%?

try using top from a terminal see what that says.
find quote
waddles Offline
Junior Member
Posts: 14
Joined: Jan 2014
Reputation: 0
Post: #5
I'm watching MacOS' Activity Monitor but running top in a terminal shows it go up to 75% too. It seems to be only 1 core though as overall usage remains at about 10%.

I can reliably replicate the issue using Estuary. The main menu and settings grid do not produce high cpu. When I go into 'Interface settings', highlighting the black side menus does not produce high cpu but highlighting the blue settings in the main section does trigger the bug and produces high cpu.

btw Estuary typically runs at about 2-3% cpu when idle compared to my default skin Transparency! which runs at about 12-15% cpu when idle.
find quote
Derek Offline
Posting Freak
Posts: 1,710
Joined: Aug 2009
Reputation: 23
Location: Bonnie Scotland
Post: #6
yeah i use transparency aswell but dont have this bug i cant seem to replicate it. what CPU?
find quote
waddles Offline
Junior Member
Posts: 14
Joined: Jan 2014
Reputation: 0
Post: #7
It's in the debug log: Host CPU: Intel® Core™ i7-4770HQ CPU @ 2.20GHz, 8 cores available

Remember, it's ok so long as some part of the kodi window is visible but as soon as the kodi window is entirely obscured either by covering it by another window or switching desktops, that is when the cpu usage skyrockets.
find quote
waddles Offline
Junior Member
Posts: 14
Joined: Jan 2014
Reputation: 0
Post: #8
I backed up then deleted my ~/Library/Application Support/Kodi directory to reset everything back to default.

Debug log using fresh profile: https://drive.google.com/file/d/0BxQZLSe...RnLU0/view

It definitely triggers with a fresh profile using Estuary

  1. In a terminal window:
    Code:
    mv "~/Library/Application Support/Kodi" "~/Library/Application Support/Kodi.bak"
  2. Start Kodi 17.1
  3. Navigate to Settings -> Player settings, leaving the focus on 'Videos' in the black area
    • Switch to a different desktop or completely obscure the kodi window
    • Result: No difference in cpu usage
  4. Focus the 'Play next video automatically' or any other item in the blue area
    • Switch to a different desktop or completely obscure the kodi window
    • Result: cpu usage skyrockets
find quote
b4ttlecat Offline
Junior Member
Posts: 1
Joined: Apr 2017
Reputation: 1
Post: #9
I can confirm this on my 2016 MBP, Sierra 10.12.4 (16E195).
find quote
Derek Offline
Posting Freak
Posts: 1,710
Joined: Aug 2009
Reputation: 23
Location: Bonnie Scotland
Post: #10
Ive tried this on my late 2009 imac 27" and a almost brand new mac pro with dual displays and but its a bloody high spec one for 3d rendering but still rungs Kodi Smile hehe

Thats a hell of a lot of plugins loading there wouldnt be surprised if one is hogging CPU time or ram?
(This post was last modified: 2017-04-19 21:31 by Derek.)
find quote
Memphiz Offline
Kodi MVP
Posts: 16,023
Joined: Feb 2011
Reputation: 225
Location: germany
Post: #11
There is a feature that should limit gui rendering to 5fps as soon as the whole kodi window is obfuscated. Maybe that limiter is broken...

AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
find quote
Waltman Offline
Senior Member
Posts: 292
Joined: Dec 2012
Reputation: 6
Location: below sea level
Post: #12
I can conform this issue too !

How to post a debug log ; MacOS acces the hidden userdata folder ; How to post a question ; How to fix gatekeeper issues
find quote
Memphiz Offline
Kodi MVP
Posts: 16,023
Joined: Feb 2011
Reputation: 225
Location: germany
Post: #13
Scratch my last post. That feature that is limiting the GUI has been dropped in april 2016. I have a hard time to reproduce that issue though. Unfocusing doesn't do anything for me. Has Kodi to be windowed or fullscreen? Or are you using the osx fullscreen mode or something? (which can be started by pressing the green buble in the title bar when windowed)?

AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
find quote
Waltman Offline
Senior Member
Posts: 292
Joined: Dec 2012
Reputation: 6
Location: below sea level
Post: #14
(2017-04-21 18:45)Memphiz Wrote:  Scratch my last post. That feature that is limiting the GUI has been dropped in april 2016. I have a hard time to reproduce that issue though. Unfocusing doesn't do anything for me. Has Kodi to be windowed or fullscreen? Or are you using the osx fullscreen mode or something? (which can be started by pressing the green buble in the title bar when windowed)?

memphiz, i run full screen. And it only happens when Kodi is not on the homescreen, But in a submenu like recently added, movies, tv-shows, in season etc. I alway return kodi to home screen to prevent the fan acting up when i am working on another workspace.

How to post a debug log ; MacOS acces the hidden userdata folder ; How to post a question ; How to fix gatekeeper issues
(This post was last modified: 2017-04-21 21:56 by Waltman.)
find quote
waddles Offline
Junior Member
Posts: 14
Joined: Jan 2014
Reputation: 0
Post: #15
Ah, now that is interesting. I use Transparency! skin by default and while testing Mac's fullscreen mode (toggle with ⌘F), I noticed that cpu only rises when the mouse is focused on the left menu list and not when it is focused on the right list of 3 titles in the current stage, depending on which stage is selected.

Eg. focus on "Videos", "Movies" or "TV Shows" etc and cpu rises,
[Image: uc?export=view&id=0BxQZLSealWeeQzZXYmhLZlBuR1k]

also focus on an episode in "TV Shows" (focus on the right menu) and cpu rises
[Image: uc?export=view&id=0BxQZLSealWeeRDFPWmpSb1I5OVk]

but focus on a movie title in "Videos" or an addon in "Add-Ons" and cpu does not rise
[Image: uc?export=view&id=0BxQZLSealWeeTTdOMm9zYXQ5eEE]

So it changes depending on what elements of the skin are highlighted, regardless of which skin is in use.
(This post was last modified: 2017-04-22 02:28 by waddles.)
find quote
Post Reply