• 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 17
Near 100% CPU in fullscreen
#61
Hi guys,

If you still have the 100% CPU issue (like, you are unfortunate enough to have an ATI card on Linux without the opengl VBLANK support), you can try making the following change:

in xbmc/Application.cpp:
* change the constant singleFrameTime to, say, 33 (1000/fps)
* smile at the comment line right above

The GUI transitions will be just a little bit jerkier, but the idle CPU goes down to about 5% on my machine.

If I have time, I will send a proper patch -- I think xbmc should lower (or even stop) its rendering frequency on idle. CPU cycles should be treated with respect for an always-on program. Until then, this makes XBMC behave nicely for me.
Reply
#62
No luck here No

Updated source, made the change and compiled, still 100% cpu. I had hope since I have indeed the vblank sync error in the log when enabling vsync in Xbmc.

XBMC Linux Ubuntu 8.04 - Antec Fusion Black
Gigabyte MA78GM-S2H - AMD Athlon 64 X2 BE-2350
Corsair 2Go DDRII PC6400 - Samsung Spinpoint 500 Go
Sony Bravia KDL-40W4000 - Logitech Harmony 555
Reply
#63
sudo apt-get remove xserver-xgl

Im on Hardy Heron Kubuntu and had the 100% issue removing the above cured it but now it wont run full screen - im farily sure this is video card related but u might want to try it to prove a point

Shane
Reply
#64
I installed from alternate CD then installed chosen packages by apt. Wasnt on the dpkg list but tried anyway.

No luck, I do not have this package installed.

XBMC Linux Ubuntu 8.04 - Antec Fusion Black
Gigabyte MA78GM-S2H - AMD Athlon 64 X2 BE-2350
Corsair 2Go DDRII PC6400 - Samsung Spinpoint 500 Go
Sony Bravia KDL-40W4000 - Logitech Harmony 555
Reply
#65
I'm sorry to hear that Gaarv.

Can you add the following change to Application.cpp to figure out what's going on? (This log line helped me debug my idle CPU issue)

* ~line 2275, somewhere within if (g_videoConfig.GetVSyncMode() != VSYNC_ALWAYS)

if (lastFrameTime % 1279 < singleFrameTime) CLog::Log(LOGNOTICE, "lastFrameTime: %u singleFrameTime: %u currentTime: %u",lastFrameTime, singleFrameTime, currentTime);

This will log the frame rendering times in XBMC_HOME/xbmc.log roughly once a second.

The goal is to have sleep(nDelayTime) active most of the time on idle. That means that you should change singleFrameTime to at least twice the typical currentFrameTime - lastFrameTime.
Reply
#66
Thanks for the help Smile

I will make the change and try it tonight. Also, do yo think it would help by compiling with the debug option ?

XBMC Linux Ubuntu 8.04 - Antec Fusion Black
Gigabyte MA78GM-S2H - AMD Athlon 64 X2 BE-2350
Corsair 2Go DDRII PC6400 - Samsung Spinpoint 500 Go
Sony Bravia KDL-40W4000 - Logitech Harmony 555
Reply
#67
While you're still having problems, it wouldn't hurt. In my experience, the CPU usage does not increase much with DEBUG. Anyway, this logline is NOTICE so it will get written regardless.
Reply
#68
Below a pastebin with the change applied to build 14356 as follow :

Code:
2270       // only "limit frames" if we are not using vsync.
   2271       if (g_videoConfig.GetVSyncMode() != VSYNC_ALWAYS)
   2272       {
   2273         if (lastFrameTime + singleFrameTime > currentTime)
   2274           nDelayTime = lastFrameTime + singleFrameTime - currentTime;
   2275         Sleep(nDelayTime);
   2276          if (lastFrameTime % 1279 < singleFrameTime) CLog::Log(LOGNOTICE, "lastFrameTime: %u singleFrameTime: %u currentTime: %u",lastFrameTime, singleFrameTime, currentTime);
   2277       }

http://pastebin.ubuntu.com/29920/

I pasted from the start of the log as maybe it could bear some relevant information. The Notice part from the change is at the very bottom, but I dont have really a clue about it Laugh

XBMC Linux Ubuntu 8.04 - Antec Fusion Black
Gigabyte MA78GM-S2H - AMD Athlon 64 X2 BE-2350
Corsair 2Go DDRII PC6400 - Samsung Spinpoint 500 Go
Sony Bravia KDL-40W4000 - Logitech Harmony 555
Reply
#69
From the log I pasted I have : currentFrameTime - lastFrameTime = 50

So should I change singleFrameTime to at least 100 ?

XBMC Linux Ubuntu 8.04 - Antec Fusion Black
Gigabyte MA78GM-S2H - AMD Athlon 64 X2 BE-2350
Corsair 2Go DDRII PC6400 - Samsung Spinpoint 500 Go
Sony Bravia KDL-40W4000 - Logitech Harmony 555
Reply
#70
(sorry for keep posting to myself... figured I wouldnt have the time to try but did it anyway Laugh)

I changed singleFrameTime to 100 and now i'm down to 5-6% cpu on idle !

I still need to see how it translate on use (@work now...) but at last its something. It was bugging me for a long time.

Thanks a lot ovyg !!

XBMC Linux Ubuntu 8.04 - Antec Fusion Black
Gigabyte MA78GM-S2H - AMD Athlon 64 X2 BE-2350
Corsair 2Go DDRII PC6400 - Samsung Spinpoint 500 Go
Sony Bravia KDL-40W4000 - Logitech Harmony 555
Reply
#71
I installed following these instructions

I now have high speed full screen XBMC - on my t30 the ATI drivers just wont cut it on this but with these instructions works perfectly..

http://ubuntuforums.org/showthread.php?t=458675

I dont know if this is an older build but touch wood its perfect now on my laptop which will now return to its designated spot under the tv with a bluetooth keyboard and mouse..

Hope this is of help to someone

shane
Reply
#72
I've tracked down the root problem -- it seems that the ATI driver uses a busy loop to wait for vsync (driver settings, not xbmc). So it sits there consuming CPU, for example running

__GL_SYNC_TO_VBLANK=1 glxgears

results in the expected 60 fps, but with 100% CPU usage (it should be negligible if the driver did the right thing).

I'll open a bug against the ATI driver in their bug db. And if I have time this weekend I'll post a proper optional workaround that can make it to the xbmc code.
Reply
#73
Nice find, great job ovyg

XBMC Linux Ubuntu 8.04 - Antec Fusion Black
Gigabyte MA78GM-S2H - AMD Athlon 64 X2 BE-2350
Corsair 2Go DDRII PC6400 - Samsung Spinpoint 500 Go
Sony Bravia KDL-40W4000 - Logitech Harmony 555
Reply
#74
I added NoFlip 1 for a couple of weeks ago and it worked fine, but now I seem to have same problem again with 100% CPU usage in fullscreen.

Anyone else experience same problem?

Code:
Section "Device"
        Identifier      "Configured Video Device"
        Driver          "nvidia"
        Option          "NoLogo"        "True"
        Option          "NoFlip"        "1"
EndSection
Reply
#75
tsint Wrote:I added NoFlip 1 for a couple of weeks ago and it worked fine, but now I seem to have same problem again with 100% CPU usage in fullscreen.

Anyone else experience same problem?

Code:
Section "Device"
        Identifier      "Configured Video Device"
        Driver          "nvidia"
        Option          "NoLogo"        "True"
        Option          "NoFlip"        "1"
EndSection
I too have the 100% CPU problem back. The NoFlip option had worked, but no longer does. Nvidia 8600GT 14506 SVN.
Reply
  • 1
  • 3
  • 4
  • 5(current)
  • 6
  • 7
  • 17

Logout Mark Read Team Forum Stats Members Help
Near 100% CPU in fullscreen1