Kodi Community Forum

Full Version: XBMC using 50% to 60% CPU when idle sitting in the GUI doing nothing?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Pages: 1 2 3
My xbmc installation uses 50% - 60% cpu when it's just showing the settings screen. There's no animation there, any ideas where I can start looking for anything wrong?

System: pentium m 1.7GHz, nvidia 9500 w vdpau (also tried software, GLSL etc), outputting 720x576 interlaced pal. software rev 19867 on fedora 9 (kernel 2.6.26.6-79.fc9.i686), installed with configure & make install. xbmc log; http://pastebin.com/m11851c85

From googling a bit it seems that this might be due to flaws in the gui system, and that it will be fixed in a future version?
iampivot Wrote:My xbmc installation uses 50% - 60% cpu when it's just showing the settings screen. There's no animation there, any ideas where I can start looking for anything wrong?

System: pentium m 1.7GHz, nvidia 9500 w vdpau (also tried software, GLSL etc), outputting 720x576 interlaced pal. software rev 19867 on fedora 9 (kernel 2.6.26.6-79.fc9.i686), installed with configure & make install. xbmc log; http://pastebin.com/m11851c85

From googling a bit it seems that this might be due to flaws in the gui system, and that it will be fixed in a future version?

settings -> enable vsync always.
Can't be a flaw since I don't have that high cpu usage when idle. Might be a nvidia driver issue. Are u using the latest beta driver from nvidia, if not then try that. Play around with the vsync settings in the nvidia control panel and in xbmc options. Your cpu usage when idle is definately too high.

boba
I get the same under Linux, have done with this and the previous release of XBMC (first one I installed), even sitting idle looking at a directory listing the system is using 20% CPU power.
A quick strace of the process shows it doing a heck of a lot of timer calls:

Code:
gettimeofday({1241905622, 840881}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 601770006}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 170821}, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 602226629}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 170821}, ...}) = 0
getpid()                                = 8677
clock_gettime(CLOCK_MONOTONIC, {11502, 602870855}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 170821}, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 603281967}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 170821}, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 603684586}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 170821}, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 604097561}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 174821}, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 604496736}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 174821}, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 604758983}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 604880380}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 174821}, ...}) = 0
gettimeofday({1241905622, 844432}, NULL) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 605214178}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 174821}, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 605401858}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 174821}, ...}) = 0
clock_gettime(CLOCK_MONOTONIC, {11502, 605692333}) = 0
getrusage(RUSAGE_SELF, {ru_utime={793, 921617}, ru_stime={493, 174821}, ...}) = 0


davilla Wrote:settings -> enable vsync always.

Tried this, no change.
@Garp, what are your system stats?

There are a lot of factors that can attribute to (or skew your perception of) this problem. Please see the dozen or so other threads on this topic. I don't feel like repeating myself again.
It seems to be skin related. I tried out the xTV skin and now my processor seems to be at 30 - 50% when showing a movie directory listing.
can you ssh to the box while xbmc is running and run:
Code:
top

and give us the output
While showing the home page with the xTV skin.

Code:
top - 18:10:04 up 23:40,  5 users,  load average: 0.11, 0.18, 0.21
Tasks:  93 total,   3 running,  90 sleeping,   0 stopped,   0 zombie
Cpu(s): 10.0%us,  3.7%sy,  0.0%ni, 86.4%id,  0.0%wa,  0.0%hi,  0.0%si,  0.0%st
Mem:   1554940k total,  1420568k used,   134372k free,   166136k buffers
Swap:   755044k total,      192k used,   754852k free,  1083524k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                  
11024 root      20   0  424m  75m  25m R 42.9  5.0 216:48.31 xbmc.bin                                                  
2066 root      20   0  3612  748  548 R  2.3  0.0  13:41.61 lircd                                                      
22147 root      20   0  147m 5940 2956 S  2.0  0.4   1:43.12 vdr                                                        
1740 root      20   0 34504 1352  880 S  1.0  0.1   1:43.69 rsyslogd                                                  
2101 uucp      20   0  1996  812  672 S  1.0  0.1  17:00.16 LCDd                                                      
2108 root      20   0  2064  436  340 S  0.7  0.0   9:45.77 lcdproc                                                    
  441 root      15  -5     0    0    0 S  0.3  0.0   0:18.14 ata/0                                                      
1524 root      15  -5     0    0    0 S  0.3  0.0   2:05.29 kondemand/0                                                
9704 root      20   0  2360 1028  812 R  0.3  0.1   1:24.73 top                                                        
    1 root      20   0  1952  776  568 S  0.0  0.0   0:01.01 init                                                      
    2 root      15  -5     0    0    0 S  0.0  0.0   0:00.00 kthreadd                                                  
    3 root      RT  -5     0    0    0 S  0.0  0.0   0:00.00 migration/0                                                
    4 root      15  -5     0    0    0 S  0.0  0.0   1:21.61 ksoftirqd/0

Am wondering if somehow the cpu usage might be lower than what is actually reported by top?

Just let me know if I can provide any more debug info, gdb backtrace etc.
probably irrelevant (with regards to the problem) but you shouldn't run xbmc as root.
True, but it's always easier to get a system properly configured first then deal with permission issues later.

Running with top -H, it seems that there are two threads;

Code:
top - 23:51:58 up 1 day,  5:22,  6 users,  load average: 0.17, 0.42, 0.78
Tasks: 175 total,   6 running, 169 sleeping,   0 stopped,   0 zombie
Cpu(s):  9.0%us,  1.0%sy,  0.0%ni, 88.0%id,  0.0%wa,  1.7%hi,  0.3%si,  0.0%st
Mem:   1554940k total,  1421496k used,   133444k free,   140040k buffers
Swap:   755044k total,      188k used,   754856k free,  1128552k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                  
31280 root      20   0  296m  50m  20m R 56.1  3.3  48:56.55 xbmc.bin                                                  
31324 root      20   0  296m  50m  20m S 10.0  3.3  10:44.34 xbmc.bin                                                  
22471 root      20   0  3612  720  512 R  5.6  0.0   6:52.02 lircd

Is there a way to find out what the threads do from the debug log or similar?
During movie playback;

Code:
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                      
2264 root      20   0  415m  67m  24m R 38.1  4.4   0:16.30 xbmc.bin                                                                                                      
2066 root      20   0  415m  67m  24m S 24.2  4.4   0:56.18 xbmc.bin                                                                                                      
2263 root      20   0  415m  67m  24m S  9.0  4.4   0:04.24 xbmc.bin

Stopping playback;

Code:
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                      
2066 root      20   0  380m  72m  24m S 56.3  4.8   1:11.98 xbmc.bin                                                                                                      
2282 root      20   0  380m  72m  24m S  5.6  4.8   0:00.44 xbmc.bin

So I assume that thread with pid 2066 would be the gui thread? I can't find the thread id in the debug log however.
duped
althekiller Wrote:@Garp, what are your system stats?

There are a lot of factors that can attribute to (or skew your perception of) this problem. Please see the dozen or so other threads on this topic. I don't feel like repeating myself again.

PPA version of XBMC 9.04 (and previous version, though I can't give you a specific number)

2.6.28-11-generic #42-Ubuntu SMP Fri Apr 17 01:57:59 UTC 2009 i686 GNU/Linux

I'm rolling a .29 release as I'm using SQLite for other stuff on the system and there is a nasty SQLite performance bug that is fixed in it, will see what happens under that.

P4 3.0Ghz, 2Gb RAM, Nvidia 6200 PCI graphics card running 180.44 version drivers.
I am on 95% cpu load with xbmc showing the pm3 menu.
- Svn Revision: 20506
- Intel® Core™2 CPU T7200 @ 2.00GHz
- Ati 1400 card
- vsync always enabled
- fresh .xbmc folder
Same here on windows with latest aeon and 0.9.4.

<= 50% and more usage on a dual core cpu in idle mode (just hanging around in the main menu).

When i disable vertical blank sync (always), i get < 10 % usage in idle mode.

What is this option good for?
Pages: 1 2 3