CPU load when idle on Linux
#16
@fritsch:

Ok, so i will have a look at the dirty regions management. Hope it helps a little.

@wyrm:

Thanks for the info! Now it is clear, what causes the CPU-load. And that there is no hope to find another skin, which consumes less...Tongue
The only thing that i still don't understand:
When Kodi goes in sleep-mode (the screen gets darker), why does the system still collect infos 100 times per second? It could simply do nothing than waiting for an input.
But to change the actual behavior would cause a great coding effort i suggest?!

EDIT:
Maybe a "deep-sleep-mode" would be a good suggestion for a feature-request? Big Grin
Reply
#17
(2017-02-21, 11:32)contadino Wrote: @fritsch:

Ok, so i will have a look at the dirty regions management. Hope it helps a little.

Already enabled by default, you might gain a little by changing the dirty region algorithm, but don't think you will see a lot of different. Go look at the Kodi wiki for details on dirty region. One thing you will see is a setting for dirty region visualisation, this might point out if your skin is updating the screen when things are idle. One thing that can do this is scrolling text (which you should turn off in the skin if you can).
Quote:@wyrm:

Thanks for the info! Now it is clear, what causes the CPU-load. And that there is no hope to find another skin, which consumes less...Tongue
I like to think my skin is pretty light weight on system resources, but there is only so much that can achieve as we still have to display a set minimum amount of info on screen.

Quote:The only thing that i still don't understand:
When Kodi goes in sleep-mode (the screen gets darker), why does the system still collect infos 100 times per second? It could simply do nothing than waiting for an input.
But to change the actual behavior would cause a great coding effort i suggest?!

EDIT:
Maybe a "deep-sleep-mode" would be a good suggestion for a feature-request? Big Grin
You are incorrectly assuming how things work. As mentioned before by and large, Kodi runs a big game loop. For example

Game Loop

1 read user input
2 if movement
. move to appropriate item and read details from database if required
3 check if any displayable info has changed and update as required
4 starting at top of current screens skin file process tags and display output to frame buffer.
...
50 display frame buffer
51 return to 1

Event loop

1 If no event sleep
2. If event is top of frame
3 render screen
4. If event is timer event
5. execute timer action
6. If event is navigation event
7. update gui
...

Now what we currently have is more like the first example with a number of bits that are more like the second. Ideally what we want is the second example but to get there is going to take a very large rewrite of Kodi. So even if the screen goes blank, Kodi is still running thru the game loop so that the various things that need to happen, happen (this includes waiting for user input). As I said this is way way beyond my pay grade. Also I'm pretty sure we don't have anyone available with the knowledge, time and sheer bloody mindedness to currently make this happen. That and except for a very few people that realise just what a benefit this would be to Kodi there would be no apparent change to Kodi, so most users would not appreciate just what a heroic effort it was.

Wyrm
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#18
Again thanks for the detailed information!
I think it is clear now HOW Kodi works. But to me it is still unclear WHY Kodi works like that. Angel

To my opinion it is quite useless to run the full loop when Kodi is in sleep mode. Kodi is expected to do nothing when sleeping.
Wouldn't it make things much easier to have a sleep-loop, where Kodi is just waiting for a user-input and then changing back to the standard game-loop?

But i understand, that it is very work intensive to make big changes in the code.
AND i really do not want to give any advices, because i am no coder at all - my programming skills end with Z80-machine-code-programming of a Sinclair Spectrum... Big Grin
So i am really thankful, that there are nice people like you, who create parts of this huge piece of software und share it for free! Thanks a lot!!
Reply
#19
@contadino
I guess it could by called technical debt.
It works and there isn't really a great need to change that in comparison to stuff like hevc-decoding and so on....

Still, you could stop kodi if not needed Wink
Kodi 21.0α | Ubuntu 22.04.3 | Kernel 6.4.x | intel i5-12600K | Gigabyte Z690 Gaming X DDR4 | Corsair 2x8192MB (DDR4-3200) | HDPlex H5v2 | HDPlex 400W HiFi DC-ATX | Pioneer VSX-934 | LG 65B7D
Reply
#20
(2017-02-21, 17:23)contadino Wrote: Again thanks for the detailed information!
I think it is clear now HOW Kodi works. But to me it is still unclear WHY Kodi works like that. Angel

Simple answer, history. It was coded like that because that was what was required for the original Xbox. As to coding this, nothing to do with me, the previous explanation I gave was pretty much what was explained to me by the then XBMC team manager. Different dev's have differing priorities and interests when it comes to coding projects within Kodi. This is just not something that anyone is willing or interested in tackling. There is currently work under way to clean up various parts of the code that might in the future lead to moving away from the game loop. Until then, it is what it is.

Wyrm
If required a FULL debug log can now be submitted from the skin in settings->skin settings->support. Or follow instructions here if you can't access skin settings.

FAQ's located at :- http://kodi.wiki/view/Add-on:AppTV
Reply
#21
(2017-01-23, 10:17)zpaolo Wrote: I have Kodi installed on a Gigabyte Brix with the following setup:
CPU Braswell N3150, 4 GB of RAM
Ubuntu 16.04 LTS up to date at 23-Jan-2017
Kodi 16.1 Jarvis with Confluence skin
Kodi 17 RC 3 with Estuary skin (not together, but tested with both)

With both versions of Kodi, when the system is idle Kodi CPU usage is always about 15% to 20%. The same version of Kodi installed on a Macbook pro 13" (late 2013 2.4 Ghz model) takes up to 5% or 6% CPU when idle.

Is this normal? Anyone with a similar setup can confirm that this CPU usage is not too high for some reason? I'm aware that the N3150 is less powerful than the i5 in the Macbook, but maybe someone can confirm this findings.

Thank you all!
Reply
#22
Hi, I think the solution is here: https://twigstechtips.blogspot.com/2013/...le-in.html
BBTW change the  xmbc references for kodi (remember xmbc was the original name of kodi).

I'am ussing an cheap acer laptop whit  intel celeron N3050  .
the idle CPU was 120% but, after the "advancedsettings.xml" the idle CPU lower to 10% - 23%.

I hope this could help you.
Reply

Logout Mark Read Team Forum Stats Members Help
CPU load when idle on Linux0