Dirty regions - what CPU usage decrease should I expect?
#16
Kempniu Wrote:Couldn't agree more Smile And that's what I plan on doing in the long run, though my insightful nature prohibits me from simply getting over my high CPU utilisation when others report their CPU is almost idle in menus, that's all Smile

Hehe for sure. I'm mostly somewhat scared that skinners are gonna stop adding dynamic eye candy just because users want 0% CPU Smile. Low CPU is good but in the end I don't care how much CPU is used on my htpc as long as it looks good (single application use benefit), ofcourse knowing it does so without overheating and silently is awesome Smile

Dirty Region mostly help rendering and as a result drags down CPU when its needed for rendering (drivers uses cpu etc.) we still do a crapload of computations each frame Smile This is next step is to get a more event driven rendering, this will surely drag down CPU usage a lot!
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#17
topfs2 Wrote:I'm mostly somewhat scared that skinners are gonna stop adding dynamic eye candy just because users want 0% CPU Smile

Heaven forbid! The question is really simple here - why does person A get 2% CPU load while person B gets 20% CPU load using the same skin on the same processor. We're talking order of magnitude here!
Reply
#18
Well it matters less about processor and more about the gpu, the drivers and possible overhead from rendering. Dirty regions limits what we tell the gpu to do and on some drivers that results inlots of CPU overhead which is removed when we use diretyregion.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#19
Just to make myself perfectly clear - the values I provided were taken directly from top output for xbmc.bin, i.e. they applied to a single logical CPU core. If you divide those values by 4 (2 Atom cores + Hyper-Threading) then Confluence uses around 5% CPU when idle without dirty regions enabled, which is more than acceptable. X3lectric, when you mentioned 2% CPU usage, how did you gather that information?

To explain even better, my current top output using Transparency! is:

Code:
top - 13:44:07 up 2 days,  1:50,  1 user,  load average: 0.74, 0.39, 0.33
Tasks: 112 total,   2 running, 110 sleeping,   0 stopped,   0 zombie
[b][color=red]Cpu(s):  8.7%us[/color][/b],  0.9%sy,  0.0%ni, 90.0%id,  0.0%wa,  0.0%hi,  0.4%si,  0.0%st
Mem:   3115376k total,  3025564k used,    89812k free,   282312k buffers
Swap:        0k total,        0k used,        0k free,  2324752k cached

  PID USER      PR  NI  VIRT  RES  SHR S [b][color=red]%CPU[/color][/b] %MEM    TIME+  COMMAND
7141 xbmc      20   0  366m 177m  34m R   [b][color=red]38[/color][/b]  5.8 425:14.76 xbmc.bin
Reply
#20
confluence

Code:
top - 14:17:49 up  3:15,  1 user,  load average: 0.71, 0.75, 1.09
Tasks: 140 total,   1 running, 139 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.5%us,  0.3%sy,  0.0%ni, 99.0%id,  0.0%wa,  0.0%hi,  0.2%si,  0.0%st
Mem:   3096432k total,   797960k used,  2298472k free,    42428k buffers
Swap:  6070468k total,        0k used,  6070468k free,   487136k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
1394 xbmc      20   0  280m 144m  30m S    3    4.8        92:22.05 xbmc.bin

That's a total of %3 as I see it.
Reply
#21
Kempniu Wrote:If you divide those values by 4 (2 Atom cores + Hyper-Threading)

A little off topic but wanted to add that you can't calculate it like that, hyperthreading doesn't make it 4 cores, its still just 2 but the context switching is lots faster thus you limit that overhead when you have a system with many threads doing work. So yeah you gain some performance on multithreaded stuff but dividing it down by 4 isn't really correct Smile

/offtopic
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#22
so it is ontopic, I believe you can change number of threads used via advancedsettings.xml

presently I have mine set to 8 as a test, maybe its overkill. I have latest (actually beta) drivers for nvidia Lucid (XBMCLive's base OS) 280.11 but no much change from 275.25 stable (have them both on my ppa's on my signature)
Reply
#23
topfs2 Wrote:A little off topic but wanted to add that you can't calculate it like that, hyperthreading doesn't make it 4 cores, its still just 2 but the context switching is lots faster thus you limit that overhead when you have a system with many threads doing work. So yeah you gain some performance on multithreaded stuff but dividing it down by 4 isn't really correct Smile

/offtopic

hmm, I think I was a bit fast to say. It depends on how top shows the % abit. If they refer 100% of virtual core is 50% of the real core you could divide by 4. I think I need to revoke that statement for now Smile

@X3lectric the one in as.xml is just bg loading or the thread pool executioner (job manager) afaik. We use many many more threads than just those.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#24
XBMC-WIKI Wrote:<bginfoloadermaxthreads>

Control the number of threads in the background info loader thread pool (thumb generagor, flagging, etc). Useful for tuning platforms that are low on CPU, like Xbox and Intel Atom based systems.
<bginfoloadermaxthreads>5</bginfoloadermaxthreads>

it be interesting to know what the etc refers to and if thers more concise explanation as wiki is sorta open-ended, specially when I haven't been able to get some shut eye in two days and counting, sorry that was OFFT
Reply
#25
X3lectric Wrote:it be interesting to know what the etc refers to and if thers more concise explanation as wiki is sorta open-ended, specially when I haven't been able to get some shut eye in two days and counting, sorry that was OFFT

Yeah thats the thread pool in the jobmanager. Its used for anything which is temporary. Downloading of addons, copying files. Its used for a number of stuff, if you git grep for CJob you'll see what inherits that. Its also used for some off mainthread GUI stuff like the popup on what to do when a new media is detected (usb drive etc).

We use a bunch of other threads though for stuff which isn't temporary. All servers have atleast one thread each (Webserver, UPnP, TCP Server, eventserver). Then you have addons which have threads. Then the players owns at the least one thread each (dvdp is 2 or 3 IIRC). So when xbmc is busy you might be looking at 20 threads or something.
If you have problems please read this before posting

Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.

Image

"Well Im gonna download the code and look at it a bit but I'm certainly not a really good C/C++ programer but I'd help as much as I can, I mostly write in C#."
Reply
#26
It's actually the threadpool in the bg info loaders, not the job manager.

And it's also inaccurate now anyway, as I believe we use a CJobQueue anyway for loading a lot of background stuff (eg for grabbing stream details, extracting video thumbs etc.)

Thus, it's probably not actually doing anything anymore Smile

Cheers,
Jonathan
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#27
Okay, we know now that we're talking about the same values. Still surprised then, it's 3% versus 20% on the same hardware.
Reply
#28
Kempniu Wrote:Just to make myself perfectly clear - the values I provided were taken directly from top output for xbmc.bin, i.e. they applied to a single logical CPU core. If you divide those values by 4 (2 Atom cores + Hyper-Threading) then Confluence uses around 5% CPU when idle without dirty regions enabled, which is more than acceptable. X3lectric, when you mentioned 2% CPU usage, how did you gather that information?

To explain even better, my current top output using Transparency! is:

Code:
top - 13:44:07 up 2 days,  1:50,  1 user,  load average: 0.74, 0.39, 0.33
Tasks: 112 total,   2 running, 110 sleeping,   0 stopped,   0 zombie
[b][color=red]Cpu(s):  8.7%us[/color][/b],  0.9%sy,  0.0%ni, 90.0%id,  0.0%wa,  0.0%hi,  0.4%si,  0.0%st
Mem:   3115376k total,  3025564k used,    89812k free,   282312k buffers
Swap:        0k total,        0k used,        0k free,  2324752k cached

  PID USER      PR  NI  VIRT  RES  SHR S [b][color=red]%CPU[/color][/b] %MEM    TIME+  COMMAND
7141 xbmc      20   0  366m 177m  34m R   [b][color=red]38[/color][/b]  5.8 425:14.76 xbmc.bin

use percent idle, it's easier to calc. -> 90.0%id
this only applies when xbmc is the major cpu user.
Reply
#29
Kempniu Wrote:Okay, we know now that we're talking about the same values. Still surprised then, it's 3% versus 20% on the same hardware.

I ended up disabling dirty regions, it is/was causing avoc with my system...

Enabled dirty regions with or without nofliptimeout with or without vdpau enabled.

1) some HD files drag ass, its like a its playing at a lower fps than its supposed except its not and theres no dropped frames either. Effect like a really bad slow motion but its not really. Hard to explain.

2) Pulling up (o) while playback the darkened area with the text is flickering mostly os second line

3) Further testing when I navigated to xbmc>settings>system video output and pull up test patterns it flickers like mad, continuously, if nofliptimeout is set the flickering stops and pattren disaperas completly after whatver timeout is set, 1000...

4) When enabled dirty region visualization the patterns dont flicker and all above issues seem to be gone. Which is really odd.

5) With vdpau disabled and dirty regions enabled xbmc hangs, doesn't crash just hangs there at random points navigating.

6)debug logs show nothing

I ended up disabling dirty regions after a week today in fact after a bit of a discussion on IRC

the compiled version of xbmc (I compile) doesnt seem to have any influence on what I described above.

ATM running XBMCLive (lucid based).

XBMC, Platform: Linux (Ubuntu 10.04.3 LTS, 2.6.32-33-generic i686). Built on Jul 29 2011 (Git:20110729-29bfb97)

default skin.
Reply
#30
Check the gpu load with "nvidia-smi -a" or "watch nvidia-smi -a" to have it update every 2 seconds, that's where the real gain is.
Reply

Logout Mark Read Team Forum Stats Members Help
Dirty regions - what CPU usage decrease should I expect?0