Constant low cpu usage when idle
#1
Long time user and I love xbmc... But, I decided to use my day off today to get on a power-usage kick.

I'm running XBMC on Ubuntu 10.10 (xubuntu was my start point). When I'm sitting at a menu (pretty much any menu in the system), xbmc is using ~13%'ish cpu time. When I play a file, cpu usage drops to ~4% (go go vdpau). When I pause a file in playback, it stays ~5%. When the xbmc screensaver kicks in (I just use the black screen), it stays ~5% (regardless of whether a video is paused, or I'm at a menu).

So, one question is .... "Why does it need to use 13%'ish cpu time drawing a menu?" I've seen some forum posts saying it's because this is from an xbox, and the drawing loop is such that it has to always run, and that it will take some time to iron out, but those posts are a few years old.

The next question is more of a bug report (and take it with a grain of salt as I've just been learning some of this today)... When idle (ie, no video playing), no matter whether the xbmc screen saver has kicked in, my cpu will not descend to C4 sleep; it is stuck spending virtually all of its time in C2. Normally, I wouldn't think twice, however....

If a video is playing, but paused, it will spend a third or more of its time in C4, even if a menu is showing such that cpu usage is ~15%. It seems there's something that pausing a video sets that lets the cpu sleep much better.

Now for the specs that haven't been covered:

OS : Ubuntu 10.10 (started with an xubuntu disk)
XBMC Version : Latest!!!!! .... Just kidding. I'm using the Ubuntu nightly svn ppa (which hasn't been updated in a while) team-xbmc-svn-ppa (Link : https://launchpad.net/~team-xbmc-svn/+archive/ppa)... No idea what svn revision it is, unfortunately, but the notes in the PPA say it was done 10 weeks ago.
Kernel Junk : 2.6.35-24-generic x86_64

Reproduction Steps
1. Start up XBMC, completely idle. Witness .... some amount of cpu usage (depends on cpu, of course).
2. In an ssh window, run powertop (consult your distro on install).
3. See that in powertop, it spends pretty much all of its time in C2 (again, this could be cpu specific)
4. Start playing a video, and pause it.
5. Go back to powertop. It should be using a significantly smaller chunk of time in C2, instead going deeper (BWWWAAAAAMMMM). My cpu yielded ~6% in C4 at a menu, and ~35% in C4 when paused on a video. It stayed ~35% when popping out to menus etc while the video was paused.

Debug Log : Dunno if it'll be useful for this, but here you go http://pastebin.com/p6Y2RXeK

Skin : I've tried a couple, and they have all yielded the same, but I use Confluence as my daily skin.

Specs : Intel e6300, 4gig of ram, GeForce 9300, nForce 730i
Reply
#2
XBMC currently redraws the screen as fast as it can up to your refresh rate while sitting at the home screen. It redraws ALL of the screen (not just what's changing) which is why it uses a bunch of CPU. I have my machines setup to screensaver "black" after a short amount of time, which causes the machine to stop drawing the home screen.
Reply
#3
dan1son Wrote:XBMC currently redraws the screen as fast as it can up to your refresh rate while sitting at the home screen. It redraws ALL of the screen (not just what's changing) which is why it uses a bunch of CPU. I have my machines setup to screensaver "black" after a short amount of time, which causes the machine to stop drawing the home screen.

Yup, me too on the black screensaver thing. I remember watching my machine from my office when I first started using xbmc and thinking "Why is it using that much cpu when idle?" The black screensaver certainly brought that down (Though, honestly... I don't really get why it has to use any cpu when in full blackout, but it is drawing that black screen really really fast lol). The question about actual cpu usage was more in the vein of "I figure I know why it's doing this, but I'm just triple checking."

The main reason for the post was the different C states that I saw and how various states in XBMC drastically affected cpu C states. I know, I could just go drastically undervolt the cpu in bios to get the same thing, but I'd rather not have to worry about it, and it's nice that more power is there if needed, without me having to reboot the machine, tweak the bios, etc.
Reply

Logout Mark Read Team Forum Stats Members Help
Constant low cpu usage when idle0