Kodi Community Forum

Full Version: [LINUX] cpufreq and xbmc for 1080p videos
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hi all,

I have a little problem with setting the cpufreq settings on my E6700 Core 2 Duo. By default, ubuntu sets it to "ondemand" mode to lower the clock when the cpu is idle. This is good enough for most of my videos. However, when I play 1080p videos, it gets quite choppy. If I change the cpufreq mode to "performance", then all the choppiness goes away and the videos are played at perfect 24fps.

My question is: Is there a way to tell XBMC to switch cpufreq mode to "performance" when playing 1080p videos, and switch back "ondemand" for all videos at lower resolution ?

Thanks.
FYI, my graphic card is a Radeon X1650 with open source driver. All the decoding is done on the CPU.
You can set the treshold, probably the treshold is too high for the load you're experiencing hence why it doesn't switch up and gets all choppy. You should be able to influence it through the following file:

/sys/devices/system/cpu/cpu0/cpufreq/ondemand/up_threshold (for your first core)
/sys/devices/system/cpu/cpu1/cpufreq/ondemand/up_threshold (for your second core)

Etc. Over here it's 95, I assume it's just a percentage.
Thanks. I put a value of 40 in the sysfs files you suggested. It doesn't help much. Apparently, the CPU overhead is quite large (causing cache misses?). Only "performance" governor gives me smooth 24fps playback.

I filed a feature request to XBMC developers: http://trac.xbmc.org/ticket/11057
Hopefully, they could put help with this.
The problem here is, when the cpu frequency is below a certain point, the cpu->gpu bandwidth is decreased, XBMC can't render the frames quick enough, this stalls the decoder as well, so the cpu usage doesn't get high enough for the cpu frequency to increase.
bobo1on1 Wrote:The problem here is, when the cpu frequency is below a certain point, the cpu->gpu bandwidth is decreased, XBMC can't render the frames quick enough, this stalls the decoder as well, so the cpu usage doesn't get high enough for the cpu frequency to increase.

I think you're right. I turn on the system-info in XBMC and I notice the CPU frequency jumps back and forth between 1.6Ghz and 2.66Ghz even though it should always stay on 2.66GHz for the whole video sequence. I even overclock my CPU to 3GHz and it's still there. Only, "Performance" governor fixes this problem.