Linux High CPU usage on Xubuntu 19.10 while Idle
#31
The output of udevadm was generated while kodi was running with a buggy udev implementation. The test should be repeated without kodi running.
Reply
#32
Further: those kind of events should not trigger wakeup. checkout udev_monitor_filter_add_match_subsystem_devtype
Reply
#33
(2020-01-12, 12:10)FernetMenta Wrote: The output of udevadm was generated while kodi was running with a buggy udev implementation. The test should be repeated without kodi running.

[email protected]s2hsieh  Could you do that please? Quit kodi and let the sudo udevaddm monitor run again? Events gone or still there?
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#34
As far as I understand the code, only devices mapped in CPeripherals are considered later. Hence udev_monitor should only filter for those devices. No ugly workaround needed.
Reply
#35
Why not doing it step by step? No one has PRd the sleep workaround, no one will. I just wanted to find out:

- is it the poll that wakes up?
- which devices wakes it up?
- Think about a real solution

Setting a udev monitor filter is trivial.
Quote:From f46b169bee664b6fe959b677e2e7152b41262116 Mon Sep 17 00:00:00 2001
From: fritsch <[email protected]>
Date: Sun, 12 Jan 2020 12:02:53 +0100
Subject: [PATCH] PeripheralBusUSBLibUdev: Filter on input only

---
 .../platform/linux/peripherals/PeripheralBusUSBLibUdev.cpp | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/xbmc/platform/linux/peripherals/PeripheralBusUSBLibUdev.cpp b/xbmc/platform/linux/peripherals/PeripheralBusUSBLibUdev.cpp
index 07c45a3e96..df3f2c2832 100644
--- a/xbmc/platform/linux/peripherals/PeripheralBusUSBLibUdev.cpp
+++ b/xbmc/platform/linux/peripherals/PeripheralBusUSBLibUdev.cpp
@@ -81,6 +81,13 @@ CPeripheralBusUSB::CPeripheralBusUSB(CPeripherals& manager) :
 
   /* set up a devices monitor that listen for any device change */
   m_udevMon = udev_monitor_new_from_netlink(m_udev, "udev");
+
+  /* filter to only receie USB subsystem events */
+  if (udev_monitor_filter_add_match_subsystem_devtype(m_udevMon, "usb", NULL) < 0)
+  {
+    CLog::Log(LOGERROR, "Could not limit filter on USB only");
+  }
+
   udev_monitor_enable_receiving(m_udevMon);
 
   CLog::Log(LOGDEBUG, "%s - initialised udev monitor", __FUNCTION__);
-- 
2.20.1
Edit: On could add "block" or "input" additionally / instead of course. As I did not write the original Peripherals implementation I don't really know what we want to auto detect here. "usb" sounds like a good candidate for starters.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#36
(2020-01-12, 08:41)fritsch Wrote: No. For Leia: https://github.com/xbmc/xbmc/blob/Leia/d....Ubuntu.md

Make sure to not skip anything from this document, it would have installed Python if you would have followed it.

I didn't skip anything though. The master branch build just fine. And my system does have python, it's just not finding it. Hence I had to specify where to find it in the build config command.

Also, the output of that udev command does look similar with or without kodi running. givuniremi (paste), It just doesn't turn my laptop into a jet engine when kodi isn't running.
Reply
#37
Perfect.

Now, please revert the patch from above and try:  2915793 (post) please
does this also work for you?

Jet-Machine :-)

Btw. you should file an upstream bug with some Ubuntu folks about the thermal stuff, that's not normal.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#38
You cond't run thinkpad fanctonrol in the background, do you? And constantly changing trip points?
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#39
Cmake cannot find CAP CCache ClangFormat MDNS Sndio and Doxygen during build configuration. I missed these last time due to lack of error at the end of the output.
which libs are actually missing exactly? I see instructions for building dependencies, but I don't know where these belong.

And I don't have fan control installed.
Reply
#40
It appears the "sudo apt build-dep kodi" command didn't get all the required dependencies for building kodi, (although I should mention that no errors were given), so I used the explicit "sudo apt install ..." command. Long story short, I can confirm the new patch does indeed work for me.

Any idea when the next kodi bug release will be out with this patch? Or do I just have to keep an eye on the git repo.
Reply
#41
I will push it to master this evening and backport to Leia. From here 18.6 should have it. IF I can manage that in time ... real life + job ... you know.
First decide what functions / features you expect from a system. Then decide for the hardware. Don't waste your money on crap.
Reply
#42
Thanks, especially with all the help with debugging.
Reply
#43
Hello. 

I have a Linux Mint, and has also issue with high CPU when KODI is idle... 

I read this thread before with Kodi 18.5 installed. 
Then I installed nightly build, the problem seemed gone. 

After I saw 18.6 released, I got back to stable version (I prefer to use stable). 

Then high CPU idle returned. 

Ok then, I go back to Nightly 19... 
Started yesterday, today the CPU is at 150-180%... running Kodi... 

What detail should I post to debug the situation? 

Thank you in advance... 

LuiKang
Reply
#44
If I manually killall -9 kodi-x11, then restarts kodi, that works. 

I tried to put that to cron - I couldn't start Kodi because of that error:
Error: /usr/lib/x86_64-linux-gnu/kodi/kodi-gbm not found

I've read about the Kodi addon CronXBMC, but
1. I couldn't find it, how to install it on Linux (ok, im n00b)
2. I don't think it will work, because manually I can't exit Kodi when it hung up (CPU is like 120-150%), just with kill process. 

Any help please?
Reply
 
Thread Rating:
  • 0 Vote(s) - 0 Average



Logout Mark Read Team Forum Stats Members Help
High CPU usage on Xubuntu 19.10 while Idle00
This forum uses Lukasz Tkacz MyBB addons.