High CPU Usage on RPi4

Hi!

I have installed OSMC and after playing around for a while, I see a high CPU usage on idle for kodi.bin, about 30%.

I enabled debug logs, but saw nothing relevant there.
I have also tried other resolutions.
Shadertoys screensaver does not increase the CPU usage.
I have tried to recreate the ~/.kodi directory but still same CPU usage.
I had masked the udisks service (since I don’t want my external to be visible for kodi) and unmasked it again. Same CPU usage.

I tried to install the ‘Artic: Zephyr - Reloaded’ skin to try something lightweight. However, I got an SSL error. This looks also weird since I have no problem accessing this server from my chrome browser on my laptop:

osmc@osmc:~$ curl https://kodi.mirror.garr.it/addons/omega/skin.arctic.zephyr.mod/skin.arctic.zephyr.mod-
3.0.3.zip
curl: (60) SSL certificate problem: unable to get local issuer certificate
More details here: https://curl.se/docs/sslcerts.html

curl failed to verify the legitimacy of the server and therefore could not
establish a secure connection to it. To learn more about this situation and
how to fix it, please visit the web page mentioned above.

Any hint?

Logs here: https://paste.osmc.tv/gubuvageyo

What is on the screen when you see that? Rendering the Kodi screen is quite heavy on the CPU.

sudo apt-get install ca-certificates

I mean in the menus. Any menu shows the same amount of CPU or even higher. For instance, at the home menu using the default OSMC skin, I have nothing to be shown under Videos. The only thing to be updated is the system time. Still high CPU. Now at 50%.

Wrt the certificates:

osmc@osmc:~$ sudo apt-get install ca-certificates
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
ca-certificates is already the newest version (20210119).
ca-certificates set to manually installed.
0 upgraded, 0 newly installed, 0 to remove and 0 not upgraded.
osmc@osmc:~$ head -6 /etc/os-release
PRETTY_NAME="Open Source Media Center"
NAME="OSMC"
VERSION="March 2025"
VERSION_ID="2025.03-1"
ID=osmc
ID_LIKE=debian

Debian bookworm latest stable update was in 2023.
https://packages.debian.org/search?keywords=ca-certificates

Then just use curl -k

The command line was just a test. The error comes from kodi logs. For instance:

2025-04-19 10:08:23.454 T:8835    error <general>: CCurlFile::Stat - <https://kodi.mirror.garr.it/addons/omega/metadata.common.fanart.tv/metadata.common.fanart.tv-3.6.4.zip> Failed: SSL peer certificate or SSH remote key was not OK(60)
2025-04-19 10:08:23.624 T:8835    error <general>: CCurlFile::CReadState::FillBuffer - (0x611ace8) Failed: SSL peer certificate or SSH remote key was not OK(60)
2025-04-19 10:08:23.624 T:8835    error <general>: CCurlFile::Open - <https://kodi.mirror.garr.it/addons/omega/metadata.common.fanart.tv/metadata.common.fanart.tv-3.6.4.zip> Failed with code 0:

Is there a way in kodi settings for unsecure downloads? It does not look as a good idea anyway. I’d rather wait for an update of the ca-certificates package.

Besides, I don’t think this is related to the main issue, that is, the high cpu usage.

I have solved some SSL issues by:

  • enabling IPv6:
$ sudo sysctl -w net.ipv6.conf.eth0.disable_ipv6=0

For some reason it seems to be disabled by default (very old patch):

  • installing bookworm ca-certificates:

https://packages.debian.org/bookworm/all/ca-certificates/download

sudo dpkg -i ca-certificates_20230311_all.deb

Log is cleaner now.

Anyway still high CPU usage.

FTR, I have enabled persistent IPV6 on boot by setting IPv6.method=auto in:

osmc@osmc:~$ sudo vi /var/lib/connman/ethernet_dca632d6e543_cable/settings

After fixing network/SSL stuff, I could download the ‘Artic: Zephyr - Reloaded’ skin and saw a small CPU improvement. Since the problem seemed to be related to skin rendering, I start digging until I reached these advanced settings:

osmc@osmc:~$ cat ~/.kodi/userdata/advancedsettings.xml 
<advancedsettings>
  <gui>
    <algorithmdirtyregions>3</algorithmdirtyregions>
    <smartredraw>true</smartredraw>
  </gui>
</advancedsettings>

The important setting here is smartredraw. algorithmdirtyregions seems to be set to three by default, but it did not work (well) with other values (0, 1, 2).

With this settings, I get about a 7% CPU usage on idle. That’s much better.

Thanks @fzinken for your answers.

Interface is now smoother and more responsive.

To sum up:

  • update CA certificates,
  • enable IPv6,
  • enable smartredraw.

We keep the setting the way it is for a reason. You will otherwise get UI bugs, particularly with features like PVR.

I haven’t found any yet, and the improvement in user experience is huge. For a newcomer, PVR may be an advanced feature. Imho I would expect a fresh installation to go smooth and then as I start hacking the interface and adding new features, I would start solving issues, but not the other way around.

Anyway, if these settings introduce significant improvements but are otherwise sensible to bugs, It would be great to have a section in the web page (maybe a faq) about these tweaks so users can get the most for every case.

Well PVR was the most obvious example, but there are other situations where GUI elements just don’t get refreshed properly. There is a good reason why it’s not on by default

Regarding ca-certificates, which domains did you experience certificate issues with?

NVM, I see you gave an example above

1 Like

I’ve updated the ca-certificates now.

Still thinking about IPv6. Our user interface needs to support it better, but it’s probably time to flip the switch and enable it.