high load on idle xbmc
#1
Hi - i have this - when xbmc is idling / or showing dimmed screensaver:

[
Code:
top - 11:38:03 up 18 min,  3 users,  load average: 0,83, 0,68, 0,39
Tasks: 126 total,   1 running, 125 sleeping,   0 stopped,   0 zombie
%Cpu(s): 17,9 us,  1,2 sy,  0,3 ni, 80,3 id,  0,3 wa,  0,0 hi,  0,0 si,  0,0 st
KiB Mem:   1798496 total,   585916 used,  1212580 free,     1304 buffers
KiB Swap:  3906552 total,        0 used,  3906552 free,   228172 cached

  PID USER      PR  NI  VIRT  RES  SHR S  %CPU %MEM    TIME+  COMMAND          
3754 xbmc      20   0  809m 167m  49m S  74,2  9,5   3:54.79 xbmc.bin          
3262 vdr       20   0  365m  48m 5716 S   2,7  2,7   0:49.09 vdr              
3364 root      20   0     0    0    0 S   2,0  0,0   0:16.95 cx23885[0] dvb    
   10 root      20   0     0    0    0 S   0,3  0,0   0:00.85 rcu_sched        
   29 root      20   0     0    0    0 S   0,3  0,0   0:02.15 kworker/0:1      
3357 root      20   0     0    0    0 S   0,3  0,0   0:02.86 kdvb-ad-0-fe-0    
3897 root      20   0 47412  788  440 S   0,3  0,0   0:00.11 udisks-daemon

strace of the pid gives tons of this:
Code:
read(4, "cpu  13228 1263 10688 355824 364"..., 1024) = 1024
clock_gettime(CLOCK_MONOTONIC, {983, 403944488}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 404190071}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 404360499}) = 0
recvfrom(15, 0x1c03554, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)
select(16, [15], NULL, NULL, {0, 0})    = 0 (Timeout)
read(17, 0x7ffff0027ae0, 4112)          = -1 EAGAIN (Resource temporarily unavailable)
clock_gettime(CLOCK_MONOTONIC, {983, 405164864}) = 0
read(16, 0x7fe11c337000, 4096)          = -1 EAGAIN (Resource temporarily unavailable)
fcntl(12, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
fcntl(12, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}) = 0
fcntl(12, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
access("/home/xbmc/.xbmc/userdata/Database/Addons15.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat(12, {st_mode=S_IFREG|0644, st_size=479232, ...}) = 0
lseek(12, 24, SEEK_SET)                 = 24
read(12, "\0\0%F\0\0\0u\0\0\0e\0\0\0\1", 16) = 16
fstat(12, {st_mode=S_IFREG|0644, st_size=479232, ...}) = 0
access("/home/xbmc/.xbmc/userdata/Database/Addons15.db-wal", F_OK) = -1 ENOENT (No such file or directory)
fstat(12, {st_mode=S_IFREG|0644, st_size=479232, ...}) = 0
fcntl(12, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
sched_yield()                           = 0
clock_gettime(CLOCK_MONOTONIC, {983, 414666642}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 414880934}) = 0
recvfrom(19, 0x1ccbeb4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(19, 0x1ccbeb4, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)
getpid()                                = 3754
clock_gettime(CLOCK_MONOTONIC, {983, 415619362}) = 0
sched_yield()                           = 0
sched_yield()                           = 0
sched_yield()                           = 0
clock_gettime(CLOCK_MONOTONIC, {983, 416459768}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 416629078}) = 0
sched_yield()                           = 0
clock_gettime(CLOCK_MONOTONIC, {983, 417016592}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 417232840}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 417427296}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 417595209}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 417761726}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 417957578}) = 0
recvfrom(15, 0x1c03554, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)
select(16, [15], NULL, NULL, {0, 0})    = 0 (Timeout)
read(17, 0x7ffff0027ae0, 4112)          = -1 EAGAIN (Resource temporarily unavailable)
clock_gettime(CLOCK_MONOTONIC, {983, 418748532}) = 0
read(16, 0x7fe11c337000, 4096)          = -1 EAGAIN (Resource temporarily unavailable)
fcntl(12, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
fcntl(12, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}) = 0
fcntl(12, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
access("/home/xbmc/.xbmc/userdata/Database/Addons15.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat(12, {st_mode=S_IFREG|0644, st_size=479232, ...}) = 0
lseek(12, 24, SEEK_SET)                 = 24
read(12, "\0\0%F\0\0\0u\0\0\0e\0\0\0\1", 16) = 16
fstat(12, {st_mode=S_IFREG|0644, st_size=479232, ...}) = 0
access("/home/xbmc/.xbmc/userdata/Database/Addons15.db-wal", F_OK) = -1 ENOENT (No such file or directory)
fstat(12, {st_mode=S_IFREG|0644, st_size=479232, ...}) = 0
fcntl(12, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
clock_gettime(CLOCK_MONOTONIC, {983, 427844356}) = 0

why? Is the Addons Db - corrupt? how to check? or is this supposed to be normal?

Board is Asrock ION330, System is debian wheezy, xbmc 12.1
Reply
#2
set v-sync to always enabled
Reply
#3
where? - and as important: why?
Reply
#4
System/Settings > System > Video output > Vertical blank sync > Always
Reply
#5
No effect at all - an di don't get the idea why v-sync settings should impact the complaining on this:

Code:
recvfrom(15, 0x1c03554, 4096, 0, 0, 0)  = -1 EAGAIN (Resource temporarily unavailable)
select(16, [15], NULL, NULL, {0, 0})    = 0 (Timeout)
read(17, 0x7ffff0027ae0, 4112)          = -1 EAGAIN (Resource temporarily unavailable)
clock_gettime(CLOCK_MONOTONIC, {983, 405164864}) = 0
read(16, 0x7fe11c337000, 4096)          = -1 EAGAIN (Resource temporarily unavailable)
fcntl(12, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
fcntl(12, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}) = 0
fcntl(12, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
access("/home/xbmc/.xbmc/userdata/Database/Addons15.db-journal", F_OK) = -1 ENOENT (No such file or directory)
Reply
#6
I'm in the same situation, running on 2:12.2~git20130502.170 on Precise LTS. I've tried the somewhat tenuous suggestion of changing v-sync from "Let the driver choose" to "Always", and it made no difference. The system still idles at 110+% CPU, and stutters SpotIMC playback. This didn't used to happen, as of a few months ago.

Interestingly, http://forum.xbmc.org/showthread.php?tid=137960 implies that to reduce the polling of the Addons15.db SQLite file, you should *disable* v-sync. I've also tried this, and it made no difference. I don't understand why it would need to poll so often either, what with availability of inotify on Linux systems.

strace reveals a similar issue with regards to Addons15.db-* as below -

fcntl(12, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
fcntl(12, F_SETLK, {type=F_RDLCK, whence=SEEK_SET, start=1073741826, len=510}) = 0
fcntl(12, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=1073741824, len=1}) = 0
access("/var/lib/htpc//.xbmc/userdata/Database/Addons15.db-journal", F_OK) = -1 ENOENT (No such file or directory)
fstat(12, {st_mode=S_IFREG|0644, st_size=1474560, ...}) = 0
lseek(12, 24, SEEK_SET) = 24
read(12, "\0\0a\343\0\0\1h\0\0\0019\0\0\0\6", 16) = 16
fstat(12, {st_mode=S_IFREG|0644, st_size=1474560, ...}) = 0
access("/var/lib/htpc//.xbmc/userdata/Database/Addons15.db-wal", F_OK) = -1 ENOENT (No such file or directory)
fstat(12, {st_mode=S_IFREG|0644, st_size=1474560, ...}) = 0
fcntl(12, F_SETLK, {type=F_UNLCK, whence=SEEK_SET, start=0, len=0}) = 0
sched_yield() = 0
recvfrom(19, 0x2758f34, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)
recvfrom(19, 0x2758f34, 4096, 0, 0, 0) = -1 EAGAIN (Resource temporarily unavailable)

Something has changed... I wish I knew what it was.
Reply

Logout Mark Read Team Forum Stats Members Help
high load on idle xbmc0