I’ve been using osmc in my raspberry pi 3.
From the last updates I’ve noticed an increasing cpu usage (measured with top) by kodi.
In the july update, with the system idle (hdd was even in standby) it was using around +20% of cpu.
After the last august update, kodi keeps using +40% cpu time.
After a quick observation on both a 4K and Pi2, the idle load pretty much doubled. Both systems have been rebooted twice after the update and are up for 60 minutes. So the Kodi process should be back to normal.
To me an indicator that this is something to investigate.
I just ran the updates but didn’t have a chance to actually notice any changes to the responsiveness. Needs more time in front of the screen.
Since no other processes are using any resources to speak of, Kodi pretty much is the system load. Not that this would be of any actual help but from memory here are the old top numbers compared to the new (factual) ones:
To be honest CPU usage always fluctuate and updates can bring a change. But looking at the last 7 days of my Vero CPU I can not say that there is such a significant change from before and after. Will check my Pi3 after I have done the update.
Logs:
For the logs I’ve done a simple: sudo journalctl | paste-log
Do you suggest another approach for more detailed logs ?
CPU usage:
Yes, Transmission is installed but usually idle.
My major concern is not Overall CPU usage but the specific Kodi component.
Just kodi is using around 40% of cpu time, with july update it was around 20%.
The system is now up for 11 hours, kodi using around 45% CPU
Please look at the following snip from top:
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
447 osmc 20 0 611896 124644 44864 R 45.1 16.6 467:51.13 kodi.bin
19387 osmc 20 0 3072 1776 1400 R 1.0 0.2 0:00.11 top
15554 root 20 0 0 0 0 S 0.3 0.0 0:00.10 kworker/2:0
1 root 20 0 22084 3376 2144 S 0.0 0.5 0:33.00 systemd
SSH:
Yes. Ssh is temporary open to the world.
Ssh is running in a non-standard port.
The PI is connected to a router which usually have that port closed.
I’ve opened the port in the router in order to do the post update tests.
The router is running with a dynamic WAN IP which usually change sin a daily basis.
Usually, I try to connect to ssh using a vpn connection (openswan, installed also in the pi).
KODI was on the main menu.
placed it on settings menu.
and … KODI cpu usage decreased from 45% to … 4% !!!
awesome !
good call
Now, just a question: Why is that KODI on the main menu is continually using 45% cpu ? (when it was 20% with previous kodi version ? anyone knows what changed in kodi to make this ?)
That is what we have to find out next (eg with debug logging) but for the moment suggest one more test go to main screen and put it on a menu without modules (eg the Power menu) and check CPU load
It seems to be something at the image rendering level:
Everytime KODI is in a menu which has movie snippets (images) CPU usage raises to 45%.
If in a menu without images, it lowers to 4%-5%
Yeah seems like that while I am not sure if it is the rendering or actually the database request causing it.
Can you enable debugging and check the logs?
I will only be later able to do so.
(I will try: At the moment I’m at the office connected trough vpn and vnc to remotely control osmc at home - it is very slow to use the graphic interface - if i’m not able to do it now, I will surely do it once I get home)
The system is running 1080x1920@23.98 fps display.
More than 40% cpu consuming by kodi in stand-by when in main menu.
Entering in any sub-menu lowers the cpu usage for less than 10%. Any sub-menu ! Even in movies and tv-shows sub-menus with the image snippets loaded (so, I assume it is not related with images rendering).
Changing the skin for Estuary lowers the cpu usage form 40% to 30%, but gives higher cpu usage in sub-menus from less than 10% to middle 20%.
I have enabled debug mode for some minutes with osmc skin, several times alternating from main menu to sub-menus and waiting for a stable cpu usage.
kodi.log is here for that time: https://paste.osmc.tv/aluviyukog.coffee
The only thing that calls my attention in the logI see as different is the loading of the python script when opening the main menu window: /home/osmc/.kodi/addons/script.skinshortcuts/default.py
Not much to add except to corroborate the increased CPU usage of kodi process, from averaging 20-30 % to 40-50. Not using OSMC skin, before or after. I do run a bunch other stuff, like transmission but so did before also. There was an sqlite update so might have something to do with that, may be not.
I’ve also made a new test by moving out ~/.kodi directory and so forcing a fresh kodi startup.
After some minutes for obvious initialization I get the same 45% CPU usage when in main menu and only main menu.
Also tried disabling the recent entries widget for movies and tv shows. No difference whatsoever.
[edit]
In another test I now have the video menu displayed for 39 minutes with and average of only 5% CPU usage.