Kodi.bin consumes 18% of CPU time on my RPi4 on idle

  • Hi all,

    On idle, Kodi.bin consumes 18% of CPU time on my RPi4 when I run top. This seems wayy too much.

    Is there anything I need to disable to lower CPU usage?

    Or can I configure Kodi to go into power saving mode after some delay of inactivity? Will HDMI-CEC wake the device up though, in this case? This is critical to me.

    MF

    NB: love Libreelec. It is a fantastic addition to my home cinema setup. Congratulations to the team, great work.

  • On my RPi 3B+ the kodi.bin is at about 10 - 15% when idle. I think your 18% are still normal.

    Currently LE has no idle timer, just a screen saver. Try the CEC Adapter settings at Settings -> System -> Input -> Peripherals.

  • It seems a tad high. Is this a stock image or have you added loads of addons?

    Please provide a full debug log.

    How to post a log (wiki)

    1. Enable debugging in Settings>System Settings>Logging
    2. Restart Kodi
    3. Replicate the problem
    4. Generate a log URL (do not post/upload logs to the forum)

    use "Settings > LibreELEC > System > Paste system logs" or run "pastekodi" over SSH, then post the URL link
  • My setup is a stock 9.2.0 install. Single media source using SMB (SMB server is a Raspbian Buster). Wifi disabled. The only option I changed IIRC is adjust refresh rate on (on demand), so that 24p stays 24p. I haven't changed anything else, apart from updating the bootloader and USB3 firmware, see my previous thread. No plugin or anything.

    Not using USB ports. Using Ethernet and the HDMI plug next to the USB-C plug (the one supporting CEC). Official RPi4 power supply.

    I confirm CPU usage this morning was 17.8 to 18.2% (through ssh and 'top').

    So just now I switched on my TV, checked that nothing was running (i.e. no movie). Switching the TV on had the effect of enabling CEC. I pushed the "up" button on the remote once, that's all. Then switched the TV back off.

    Now top indicates that kodi.bin uses up 15.9% CPU usage, solid. So I suspect this is expected.

    Clearly there is margin for improvements in kodi.bin as 15.9% is just too much. I don't know if there is any kind of polling on something (CEC for instance), but if there is no polling, the application should not consume anything. I hope kodi.bin does not periodically refresh the screen when no video is running - this would be wrong.

  • On a fresh install of 9.2.0 I can confirm that idle Kodi CPU usage is about 15%. However, that is only on 1 core. So the average usage across all 4 cores is below 4%. (Tested with top, iostat, htop and nmon).

    Using a boring screensaver (black) drops this to ~10%

    Double "however". Turning HDMI off, drops CPU usage to around 1% after ~30s.

  • I guess it's possible to write a script to turn off HDMI when it's inactive (but how do you define inactive?) Also I don't believe CEC will wake it up.

    Your simplest solution - if you have a normal schedule - is to run a cron or systemd job to turn on HDMI at say 18:00 and turn it off at 23:00.

    TBH: It's not really worth it. The RPi4 probably only costs around £10 annually to run.

    A check on a S905x box the CPU usage is between 12--> 18% so it's not just RPi.

  • Hi all,

    On idle, Kodi.bin consumes 18% of CPU time on my RPi4 when I run top. This seems wayy too much.

    Is there anything I need to disable to lower CPU usage?

    Or can I configure Kodi to go into power saving mode after some delay of inactivity? Will HDMI-CEC wake the device up though, in this case? This is critical to me.

    MF

    NB: love Libreelec. It is a fantastic addition to my home cinema setup. Congratulations to the team, great work.

    Just found this message through a search........

    My Rpi4 uses aout 30% at idle....

  • yes. of course.

    it's kodi in top, that reports 30% CPU usage

    Not other running services.

    And yes: I've launched kodi with a clean /storage/.kodi/ just to make sure it is not a config issue

  • On a fresh install on rpi4 I have around 15-16% while idle and while in a menu where it does not display video posters (i.e. settings).

    It goes up to 25% and stays there when I select a menu item where there's video posters to display (i.e. movies, tv shows).

    The log does not show anything and there seems to be no animation on screen.

    Does anybody have an idea why it goes up when it has to display video posters? Something to do with refreshrate or something?