Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: MythTV: Users

Mythfrontend idle cpu consumption help

 

 

First page Previous page 1 2 3 4 5 6 Next page Last page  View All MythTV users RSS feed   Index | Next | Previous | View Threaded


mtdean at thirdcontact

Nov 18, 2009, 2:17 PM

Post #101 of 136 (2235 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On 11/18/2009 04:35 PM, jansenj wrote:
>> Also, when using OpenGL painter, the nvidia-settings OpenGL (not video)
>> Sync to Vblank setting may have an effect.
>>
> 1. I'm using the Qt painter, but I've seen the same issue with the GL
> painter.
> 2. I've tried that setting in poth positions for the Qt painter, still have
> the issue.

The OpenGL sync to vblank won't have an effect when using the Qt painter.

Since you seem to be using CPU frequency scaling, if you're using an AMD
processor, frequency scaling may decrease the memory speed/bandwidth,
which could artificially increase the CPU usage. Can you test it with
the governor set to Performance?

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jansenj+myth at gmail

Nov 18, 2009, 2:37 PM

Post #102 of 136 (2228 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

> Since you seem to be using CPU frequency scaling, if you're using an AMD
> processor, frequency scaling may decrease the memory speed/bandwidth, which
> could artificially increase the CPU usage. Can you test it with the
> governor set to Performance?
>
>
As I think I said before, I think this almost seems like a "busy wait"
somewhere. Because when I told my cpu to go to 2Ghz, it STILL utilized
14%. Something is consuming ~130ms of time every second almost regardless
of CPU speed.


jarpublic at gmail

Nov 18, 2009, 2:45 PM

Post #103 of 136 (2229 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

>  As I think I said before, I think this almost seems like a "busy wait"
> somewhere.  Because when I told my cpu to go to 2Ghz, it STILL utilized
> 14%.  Something is consuming ~130ms of time every second almost regardless
> of CPU speed.

I saw the same thing. I scaled my CPU a while back from Ondemand at
1.4 GHz to Performance 2.7 GHz and the CPU utilization stayed ~14%.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Nov 18, 2009, 2:46 PM

Post #104 of 136 (2229 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On 11/18/2009 05:37 PM, jansenj wrote:
>> Since you seem to be using CPU frequency scaling, if you're using an AMD
>> processor, frequency scaling may decrease the memory speed/bandwidth, which
>> could artificially increase the CPU usage. Can you test it with the
>> governor set to Performance?
> As I think I said before, I think this almost seems like a "busy wait"
> somewhere. Because when I told my cpu to go to 2Ghz, it STILL utilized
> 14%. Something is consuming ~130ms of time every second almost regardless
> of CPU speed.

Yes, there's a very tight select/poll loop in Qt's event dispatcher for
*nix systems that can be hit in some circumstances. But it's all just a
"wait for something" loop, so it doesn't really affect anything else
running on the system (as it's fine waiting while something else runs or
while the loop runs).

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jarod at wilsonet

Nov 18, 2009, 3:09 PM

Post #105 of 136 (2230 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Nov 18, 2009, at 5:46 PM, Michael T. Dean wrote:

> On 11/18/2009 05:37 PM, jansenj wrote:
>>> Since you seem to be using CPU frequency scaling, if you're using an AMD
>>> processor, frequency scaling may decrease the memory speed/bandwidth, which
>>> could artificially increase the CPU usage. Can you test it with the
>>> governor set to Performance?
>> As I think I said before, I think this almost seems like a "busy wait"
>> somewhere. Because when I told my cpu to go to 2Ghz, it STILL utilized
>> 14%. Something is consuming ~130ms of time every second almost regardless
>> of CPU speed.
>
> Yes, there's a very tight select/poll loop in Qt's event dispatcher for *nix systems that can be hit in some circumstances. But it's all just a "wait for something" loop, so it doesn't really affect anything else running on the system (as it's fine waiting while something else runs or while the loop runs).

I've paid zero attention to this thread, but is this possibly relevant?:

http://www.nvnews.net/vbulletin/showthread.php?t=140708&highlight=100%25+cpu

--
Jarod Wilson
jarod [at] wilsonet



_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


stichnot at gmail

Nov 18, 2009, 3:14 PM

Post #106 of 136 (2232 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Wed, Nov 18, 2009 at 3:09 PM, Jarod Wilson <jarod [at] wilsonet> wrote:
> I've paid zero attention to this thread, but is this possibly relevant?:
>
> http://www.nvnews.net/vbulletin/showthread.php?t=140708&highlight=100%25+cpu

Seems unlikely since people here are talking about 100% CPU
utilization in the mythfrontend process, not the Xorg process. But
it's certainly worth a try.

Jim
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jansenj+myth at gmail

Nov 18, 2009, 6:50 PM

Post #107 of 136 (2215 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

>
> Yes, there's a very tight select/poll loop in Qt's event dispatcher for
> *nix systems that can be hit in some circumstances. But it's all just a
> "wait for something" loop, so it doesn't really affect anything else running
> on the system (as it's fine waiting while something else runs or while the
> loop runs).
>
>
> Which, again, I would be fine with if everyone was experiencing the same
behavior.


ben.carlisle at gmail

Jan 18, 2010, 8:03 AM

Post #108 of 136 (1997 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Tue, Nov 17, 2009 at 5:25 AM, Dan <dansto.well+myth [at] gmail> wrote:
> 2009/11/11 jansenj <jansenj+myth [at] gmail>:
>> I guess I should ask, are there any unbuntu users with 0.22 that are NOT
>> having this problem as described in the original post? Or is it just the
>> select few on this thread?  I would assume this would be getting more
>> attention if it were every ubuntu user.
>
> I've just upgraded to mythbuntu 9.10 and yes I'm seeing *much* higher
> CPU usage with the frontend just sat there idle on the home page -
> around 7% on my system (details below). I've got the new mythbuntu
> theme selected, which doesn't seem to show any visible 'pulse'.

As another datapoint, I just upgraded to Mythbuntu 9.10 myself and am
experiencing the same.

Roughly 14% constant CPU usage when the box is being unused - along
with what I describe as 'general UI slowness(1)' when it is being used
(Mythbuntu theme). Interestingly I get lower CPU usage when playing
back HD (using VDPAU).

One thing that I've noticed is every 10 minutes or so it drops to 1-2%
CPU usage for about 1 minute. Using the Mythbuntu theme.

strace output (about 10 seconds of capture):
$ sudo strace -c -p 2223
% time seconds usecs/call calls errors syscall
------ ----------- ----------- --------- --------- ----------------
43.01 0.000886 0 5478 clock_gettime
33.74 0.000695 0 5478 5478 read
23.25 0.000479 0 2738 poll
0.00 0.000000 0 1 restart_syscall
0.00 0.000000 0 795 gettimeofday
0.00 0.000000 0 817 stat64
------ ----------- ----------- --------- --------- ----------------
100.00 0.002060 15307 5478 total

$ uname -a
Linux hostname 2.6.31-17-generic #54-Ubuntu SMP Thu Dec 10 16:20:31
UTC 2009 i686 GNU/Linux

$ mythbackend --version
Please include all output in bug reports.
MythTV Version : 22594
MythTV Branch : branches/release-0-22-fixes
Network Protocol : 50
Library API : 0.22.20091023-1
QT Version : 4.5.2
Options compiled in:
linux profile using_oss using_alsa using_pulse using_jack
using_backend using_dvb using_firewire using_frontend
using_glx_proc_addr_arb using_hdhomerun using_hdpvr using_iptv
using_ivtv using_joystick_menu using_libfftw3 using_lirc using_mheg
using_opengl_video using_opengl_vsync using_qtwebkit using_v4l
using_x11 using_xrandr using_xv using_xvmc using_xvmc_vld using_xvmcw
using_bindings_perl using_bindings_python using_opengl using_vdpau
using_ffmpeg_threads using_libavc_5_3 using_live using_mheg

$ cat /proc/cpuinfo|grep model
model : 107
model name : AMD Athlon(tm) 64 X2 Dual Core Processor 4000+

(1) This includes 0.5 - 1.0 sec response delays on UI menu selections,
2-3 sec fanart display, and other WAF-limiting symptoms.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jansenj+myth at gmail

Jan 18, 2010, 11:25 AM

Post #109 of 136 (1995 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

>
> As another datapoint, I just upgraded to Mythbuntu 9.10 myself and am
> experiencing the same.
>
> Roughly 14% constant CPU usage when the box is being unused - along
> with what I describe as 'general UI slowness(1)' when it is being used
> (Mythbuntu theme). Interestingly I get lower CPU usage when playing
> back HD (using VDPAU).
>
>
Welcome to the behavior that everyone seems to have using mythbuntu and
0.22.

If anyone has a proven hack to get the CPU usage down that disables menu
animations, I'd love to know about it. Something about myth consuming 14%
CPU no matter what the cpu or speed just doesn't seem right. What I don't
get is how it would be possible that some have reported running 0.22 and not
see this high CPU usage. If it is the pulse for animations as the root
cause everyone should be seeing this 14% usage with 0.22.


stichnot at gmail

Jan 18, 2010, 11:36 AM

Post #110 of 136 (1985 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Mon, Jan 18, 2010 at 8:03 AM, Ben <ben.carlisle [at] gmail> wrote:
> On Tue, Nov 17, 2009 at 5:25 AM, Dan <dansto.well+myth [at] gmail> wrote:
>> 2009/11/11 jansenj <jansenj+myth [at] gmail>:
>>> I guess I should ask, are there any unbuntu users with 0.22 that are NOT
>>> having this problem as described in the original post? Or is it just the
>>> select few on this thread?  I would assume this would be getting more
>>> attention if it were every ubuntu user.
>>
>> I've just upgraded to mythbuntu 9.10 and yes I'm seeing *much* higher
>> CPU usage with the frontend just sat there idle on the home page -
>> around 7% on my system (details below). I've got the new mythbuntu
>> theme selected, which doesn't seem to show any visible 'pulse'.
>
> As another datapoint, I just upgraded to Mythbuntu 9.10 myself and am
> experiencing the same.
>
> Roughly 14% constant CPU usage when the box is being unused

This is normal for 0.22. It may feel unseemly and aesthetically
displeasing, but it really has no impact on playback performance or
any other performance problems or delays you might be seeing.

> - along
> with what I describe as 'general UI slowness(1)' when it is being used
> (Mythbuntu theme).  Interestingly I get lower CPU usage when playing
> back HD (using VDPAU).
>
> $ mythbackend --version
> Please include all output in bug reports.
> MythTV Version   : 22594
> MythTV Branch    : branches/release-0-22-fixes
>
> (1) This includes 0.5 - 1.0 sec response delays on UI menu selections,
> 2-3 sec fanart display, and other WAF-limiting symptoms.

I think you are running a fairly old version of 0.22-fixes. I believe
most if not all of these delays are fixed. (It's certainly true in
trunk.)

One WAF-limiting delay you didn't explicitly mention is described in
ticket #7836 (http://svn.mythtv.org/trac/ticket/7836), namely a
5-second delay between selecting Watch Recordings and having the page
actually load, which may happen after the frontend hasn't made any DB
accesses within the past hour. This was fixed in trunk but curiously
not backported to 0.22-fixes.

Jim
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


stichnot at gmail

Jan 18, 2010, 11:44 AM

Post #111 of 136 (1992 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Mon, Jan 18, 2010 at 11:25 AM, jansenj <jansenj+myth [at] gmail> wrote:
>> As another datapoint, I just upgraded to Mythbuntu 9.10 myself and am
>> experiencing the same.
>>
>> Roughly 14% constant CPU usage when the box is being unused - along
>> with what I describe as 'general UI slowness(1)' when it is being used
>> (Mythbuntu theme).  Interestingly I get lower CPU usage when playing
>> back HD (using VDPAU).
>>
>
> Welcome to the behavior that everyone seems to have using mythbuntu and
> 0.22.
>
> If anyone has a proven hack to get the CPU usage down that disables menu
> animations, I'd love to know about it.

If you're into compiling mythtv from sources, try my suggestion
earlier in this thread:
http://www.gossamer-threads.com/lists/mythtv/users/406282#406282

Jim
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jansenj+myth at gmail

Jan 19, 2010, 7:04 AM

Post #112 of 136 (1960 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

>
> If you're into compiling mythtv from sources, try my suggestion
> earlier in this thread:
> http://www.gossamer-threads.com/lists/mythtv/users/406282#406282
>
>
Does anyone know of a simple tutorial that would allow me to build a test
version of the frontend without affecting the one my wife uses? Or will it
just simply build and run from whatever directory I build it in and not
touch the current installation? I've only used ubuntu packages in the past.


smalenfant at gmail

Jan 19, 2010, 8:58 AM

Post #113 of 136 (1959 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

I have Fedora Core 12 and seeing the mythfrontend started idle 7% usage.

16963 steve 20 0 379m 83m 3896 S 7.3 9.6 62:25.79 mythfrontend

model name : Intel(R) Core(TM)2 CPU 4300 @ 1.80GHz
stepping : 2
cpu MHz : 1203.000


Running the latest update from atrpms as of today. I think it is a bit silly
that CPU is used on a screen that doesn't move.

On Mon, Jan 18, 2010 at 2:36 PM, Jim Stichnoth <stichnot [at] gmail> wrote:

> On Mon, Jan 18, 2010 at 8:03 AM, Ben <ben.carlisle [at] gmail> wrote:
> > On Tue, Nov 17, 2009 at 5:25 AM, Dan <dansto.well+myth [at] gmail<dansto.well%2Bmyth [at] gmail>>
> wrote:
> >> 2009/11/11 jansenj <jansenj+myth [at] gmail <jansenj%2Bmyth [at] gmail>>:
> >>> I guess I should ask, are there any unbuntu users with 0.22 that are
> NOT
> >>> having this problem as described in the original post? Or is it just
> the
> >>> select few on this thread? I would assume this would be getting more
> >>> attention if it were every ubuntu user.
> >>
> >> I've just upgraded to mythbuntu 9.10 and yes I'm seeing *much* higher
> >> CPU usage with the frontend just sat there idle on the home page -
> >> around 7% on my system (details below). I've got the new mythbuntu
> >> theme selected, which doesn't seem to show any visible 'pulse'.
> >
> > As another datapoint, I just upgraded to Mythbuntu 9.10 myself and am
> > experiencing the same.
> >
> > Roughly 14% constant CPU usage when the box is being unused
>
> This is normal for 0.22. It may feel unseemly and aesthetically
> displeasing, but it really has no impact on playback performance or
> any other performance problems or delays you might be seeing.
>
> > - along
> > with what I describe as 'general UI slowness(1)' when it is being used
> > (Mythbuntu theme). Interestingly I get lower CPU usage when playing
> > back HD (using VDPAU).
> >
> > $ mythbackend --version
> > Please include all output in bug reports.
> > MythTV Version : 22594
> > MythTV Branch : branches/release-0-22-fixes
> >
> > (1) This includes 0.5 - 1.0 sec response delays on UI menu selections,
> > 2-3 sec fanart display, and other WAF-limiting symptoms.
>
> I think you are running a fairly old version of 0.22-fixes. I believe
> most if not all of these delays are fixed. (It's certainly true in
> trunk.)
>
> One WAF-limiting delay you didn't explicitly mention is described in
> ticket #7836 (http://svn.mythtv.org/trac/ticket/7836), namely a
> 5-second delay between selecting Watch Recordings and having the page
> actually load, which may happen after the frontend hasn't made any DB
> accesses within the past hour. This was fixed in trunk but curiously
> not backported to 0.22-fixes.
>
> Jim
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>


smalenfant at gmail

Jan 19, 2010, 9:02 AM

Post #114 of 136 (1958 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

I have Fedora Core 12 and seeing the mythfrontend started idle 7% usage.

16963 steve 20 0 379m 83m 3896 S 7.3 9.6 62:25.79 mythfrontend

model name : Intel(R) Core(TM)2 CPU 4300 @ 1.80GHz
stepping : 2
cpu MHz : 1203.000


Running the latest update from atrpms as of today. I think it is a bit silly
that CPU is used on a screen that doesn't move.

On Mon, Jan 18, 2010 at 2:36 PM, Jim Stichnoth <stichnot [at] gmail> wrote:

> On Mon, Jan 18, 2010 at 8:03 AM, Ben <ben.carlisle [at] gmail> wrote:
> > On Tue, Nov 17, 2009 at 5:25 AM, Dan <dansto.well+myth [at] gmail<dansto.well%2Bmyth [at] gmail>>
> wrote:
> >> 2009/11/11 jansenj <jansenj+myth [at] gmail <jansenj%2Bmyth [at] gmail>>:
> >>> I guess I should ask, are there any unbuntu users with 0.22 that are
> NOT
> >>> having this problem as described in the original post? Or is it just
> the
> >>> select few on this thread? I would assume this would be getting more
> >>> attention if it were every ubuntu user.
> >>
> >> I've just upgraded to mythbuntu 9.10 and yes I'm seeing *much* higher
> >> CPU usage with the frontend just sat there idle on the home page -
> >> around 7% on my system (details below). I've got the new mythbuntu
> >> theme selected, which doesn't seem to show any visible 'pulse'.
> >
> > As another datapoint, I just upgraded to Mythbuntu 9.10 myself and am
> > experiencing the same.
> >
> > Roughly 14% constant CPU usage when the box is being unused
>
> This is normal for 0.22. It may feel unseemly and aesthetically
> displeasing, but it really has no impact on playback performance or
> any other performance problems or delays you might be seeing.
>
> > - along
> > with what I describe as 'general UI slowness(1)' when it is being used
> > (Mythbuntu theme). Interestingly I get lower CPU usage when playing
> > back HD (using VDPAU).
> >
> > $ mythbackend --version
> > Please include all output in bug reports.
> > MythTV Version : 22594
> > MythTV Branch : branches/release-0-22-fixes
> >
> > (1) This includes 0.5 - 1.0 sec response delays on UI menu selections,
> > 2-3 sec fanart display, and other WAF-limiting symptoms.
>
> I think you are running a fairly old version of 0.22-fixes. I believe
> most if not all of these delays are fixed. (It's certainly true in
> trunk.)
>
> One WAF-limiting delay you didn't explicitly mention is described in
> ticket #7836 (http://svn.mythtv.org/trac/ticket/7836), namely a
> 5-second delay between selecting Watch Recordings and having the page
> actually load, which may happen after the frontend hasn't made any DB
> accesses within the past hour. This was fixed in trunk but curiously
> not backported to 0.22-fixes.
>
> Jim
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>


jansenj+myth at gmail

Jan 19, 2010, 12:28 PM

Post #115 of 136 (1959 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Tue, Jan 19, 2010 at 10:04 AM, jansenj
<jansenj+myth [at] gmail<jansenj%2Bmyth [at] gmail>
> wrote:

>
>
>> If you're into compiling mythtv from sources, try my suggestion
>> earlier in this thread:
>> http://www.gossamer-threads.com/lists/mythtv/users/406282#406282
>>
>>
> Does anyone know of a simple tutorial that would allow me to build a test
> version of the frontend without affecting the one my wife uses? Or will it
> just simply build and run from whatever directory I build it in and not
> touch the current installation? I've only used ubuntu packages in the past.
>
>

No luck, I can't get it to build and install to my own personal directory.
vdpau is complaining:
vdpau.h:47:25: error: vdpau/vdpau.h: No such file or directory

and if I skip vdpau, the install fails:
cd themes/ && /usr/bin/qmake themes.pro -unix QMAKE=/usr/bin/qmake -o
Makefile
Project ERROR: Please run ./configure
make: *** [themes//Makefile] Error 2


stichnot at gmail

Jan 19, 2010, 1:04 PM

Post #116 of 136 (1948 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Tue, Jan 19, 2010 at 12:28 PM, jansenj <jansenj+myth [at] gmail> wrote:
> No luck, I can't get it to build and install to my own personal directory.
> vdpau is complaining:
> vdpau.h:47:25: error: vdpau/vdpau.h: No such file or directory

Do you have the nvidia proprietary drivers installed on the machine
where you are doing the build? You will need this if you configured
with --enable-vdpau. I have the nvidia vdpau include files under
/usr/include :
/usr/include/vdpau/vdpau.h
/usr/include/vdpau/vdpau_x11.h

Try "locate vdpau.h" or "locate vdpau/vdpau.h" to see whether you have
these files.

Jim
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jansenj+myth at gmail

Jan 19, 2010, 1:15 PM

Post #117 of 136 (1951 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

No luck, I can't get it to build and install to my own personal directory.
vdpau is complaining:

> vdpau.h:47:25: error: vdpau/vdpau.h: No such file or directory
>
> and if I skip vdpau, the install fails:
> cd themes/ && /usr/bin/qmake themes.pro -unix QMAKE=/usr/bin/qmake -o
> Makefile
> Project ERROR: Please run ./configure
> make: *** [themes//Makefile] Error 2
>
>
Well, Even though the themes didn't install properly, I thought I'd give it
a try, and it seems to have worked.

I executed my modified version of the frontend, and it still sits at 14% yet
even after the hack from 70Hz refresh down to 5 refresh.
I changed both instances of:
drawTimer->start(1000 / 70);
to
drawTimer->start(1000 / 5);

So either, that was not the right way to affect the animation pulse rate, or
the root cause of this cpu usage is NOT the animation pulse.


jansenj+myth at gmail

Jan 19, 2010, 1:37 PM

Post #118 of 136 (1953 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

> Well, Even though the themes didn't install properly, I thought I'd give it
> a try, and it seems to have worked.
>
> I executed my modified version of the frontend, and it still sits at 14%
> yet even after the hack from 70Hz refresh down to 5 refresh.
> I changed both instances of:
> drawTimer->start(1000 / 70);
> to
> drawTimer->start(1000 / 5);
>
> So either, that was not the right way to affect the animation pulse rate,
> or the root cause of this cpu usage is NOT the animation pulse.
>
>
Not, only that, if it were the animation pulse, would it make sense that the
performance would be related to gui size? I resized my gui on my unmodified
frontend to 720x480, and it still just sits there at 14% utilization
(looking at the thread CPU usage in top)


stichnot at gmail

Jan 19, 2010, 1:38 PM

Post #119 of 136 (1957 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Tue, Jan 19, 2010 at 1:15 PM, jansenj <jansenj+myth [at] gmail> wrote:
> No luck, I can't get it to build and install to my own personal directory.
> vdpau is complaining:
>>
>> vdpau.h:47:25: error: vdpau/vdpau.h: No such file or directory
>>
>> and if I skip vdpau, the install fails:
>> cd themes/ && /usr/bin/qmake themes.pro -unix QMAKE=/usr/bin/qmake -o
>> Makefile
>> Project ERROR: Please run ./configure
>> make: *** [themes//Makefile] Error 2
>>
>
> Well, Even though the themes didn't install properly, I thought I'd give it
> a try, and it seems to have worked.
>
> I executed my modified version of the frontend, and it still sits at 14% yet
> even after the hack from 70Hz refresh down to 5 refresh.
> I changed both instances of:
> drawTimer->start(1000 / 70);
> to
> drawTimer->start(1000 / 5);
>
> So either, that was not the right way to affect the animation pulse rate, or
> the root cause of this cpu usage is NOT the animation pulse.

The other possibility is that your modified mythfrontend binary is
still dynamically linking against the original installed libraries.
Two different ways to check this:
1. "ldd /path/to/modified/mythfrontend" and see where libmyth*
libraries point to.
2. Add a logging statement before or after each drawTimer->start()
call and verify that it is being printed.

FYI, since it's been a long time, I tried again changing the 70Hz to
5Hz, and my mythfrontend idle CPU usage dropped from 7% to about 0.5%.

Jim
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jansenj+myth at gmail

Jan 19, 2010, 1:44 PM

Post #120 of 136 (1948 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

>
> The other possibility is that your modified mythfrontend binary is
> still dynamically linking against the original installed libraries.
> Two different ways to check this:
> 1. "ldd /path/to/modified/mythfrontend" and see where libmyth*
> libraries point to.
>

Yep, you're right:
libmythui-0.22.so.0 => /usr/lib/libmythui-0.22.so.0

What do I need to do different on my configure?
./configure --prefix=/home/justin/mythtv-bin
--runprefix=/home/justin/mythtv-bin --enable-proc-opt --disable-altivec
--disable-audio-arts --disable-joystick-menu --disable-firewire
--disable-ivtv --disable-v4l --disable-hdpvr --disable-dvb --disable-xvmc
--disable-xvmcw --disable-directfb --disable-audio-oss --disable-audio-arts
--disable-audio-jack

ideally, I'll add --enable-vdpau, but thats an off topic issue for me to
resolve with my vdpau install.


stichnot at gmail

Jan 19, 2010, 1:48 PM

Post #121 of 136 (1948 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Tue, Jan 19, 2010 at 1:44 PM, jansenj <jansenj+myth [at] gmail> wrote:
>
>>
>> The other possibility is that your modified mythfrontend binary is
>> still dynamically linking against the original installed libraries.
>> Two different ways to check this:
>> 1. "ldd /path/to/modified/mythfrontend" and see where libmyth*
>> libraries point to.
>
> Yep, you're right:
>  libmythui-0.22.so.0 => /usr/lib/libmythui-0.22.so.0
>
> What do I need to do different on my configure?
> ./configure --prefix=/home/justin/mythtv-bin
> --runprefix=/home/justin/mythtv-bin --enable-proc-opt --disable-altivec
> --disable-audio-arts --disable-joystick-menu --disable-firewire
> --disable-ivtv --disable-v4l --disable-hdpvr --disable-dvb --disable-xvmc
> --disable-xvmcw --disable-directfb --disable-audio-oss --disable-audio-arts
> --disable-audio-jack
>
> ideally, I'll add --enable-vdpau, but thats an off topic issue for me to
> resolve with my vdpau install.

Assuming you already did the "make install", you will want to add the
appropriate paths to the front of your PATH and LD_LIBRARY_PATH
environment variables. My guess is that LD_LIBRARY_PATH is unset, so
doing something like this (under bash) may fix it:

export LD_LIBRARY_PATH=/home/justin/mythtv-bin/lib

Jim
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


jansenj+myth at gmail

Jan 19, 2010, 1:58 PM

Post #122 of 136 (1948 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

>
> Assuming you already did the "make install", you will want to add the
> appropriate paths to the front of your PATH and LD_LIBRARY_PATH
> environment variables. My guess is that LD_LIBRARY_PATH is unset, so
> doing something like this (under bash) may fix it:
>
> export LD_LIBRARY_PATH=/home/justin/mythtv-bin/lib
>
> Yep, now I've got some compile issues to resolve evidently...I knew there
was a reason I was using the pre-built packages ;)


jansenj+myth at gmail

Jan 22, 2010, 2:11 PM

Post #123 of 136 (1729 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Thu, Oct 29, 2009 at 3:04 PM, jansenj
<jansenj+myth [at] gmail<jansenj%2Bmyth [at] gmail>
> wrote:

> I just noticed that when I do a "top" that mythfrontend.real is consuming
> almost 15% CPU when it is running at 1Ghz. I'm using mythbuntu theme with
> Qt on mythbuntu's 0.22-fixes packages. Any ideas what could have changed?
> Or is it something I could have changed?
>

I thought I'd reply to my original post.

The behavior here is without a doubt attributed to mythui pulse.

It looks like animate is called at 70Hz, and as it was said in this thread,
this can be dropped much lower if you don't have animations, but it takes
modifying source and rebuilding.

I'm astounded that the majority of the people reporting this behavior report
similar cpu usage levels, no mater what the clock speed of the cpu. In fact
I can have mine clocked at 1Ghz or 2Ghz, and both result in a 14%
utilization, so there seems to be an odd timing or wait component that
doesn't give up context, but I couldn't find one. But if we do the math,
every time animate runs, it consumes the cpu for a full 2ms.

It looks like Animate calls a bunch of pulses from all sorts of object
types: clocks, images, text...etc. It looks like to me, that all pulses
eventually end up calling mythuitype::pulse which sets up the screen to
redraw if it detected any motion or alpha blending changes. Then it loops
through and does a pulse on all the given children for that single item.

Something that confused me: I tried commenting out all the pulse bodies that
call mythuitype::pulse, and I still could get into a mode where 14%
utilization was seen. But if I comment out the body of mythuitype::pulse
the cpu usage drops way down, but myth doesn't work very well if you do
that. After all, it looks like for every iteration of animate
mythuitype::pulse gets called 39 times in my setup. That means, normally,
it is doing an alpha pulse and motion pulse 2700 times per second each. But
I wouldn't think that would add up to 140ms of time.


stichnot at gmail

Jan 22, 2010, 3:52 PM

Post #124 of 136 (1712 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On Fri, Jan 22, 2010 at 2:11 PM, jansenj <jansenj+myth [at] gmail> wrote:
> On Thu, Oct 29, 2009 at 3:04 PM, jansenj <jansenj+myth [at] gmail> wrote:
>>
>> I just noticed that when I do a "top" that mythfrontend.real is consuming
>> almost 15% CPU when it is running at 1Ghz.  I'm using mythbuntu theme with
>> Qt on mythbuntu's 0.22-fixes packages.  Any ideas what could have changed?
>> Or is it something I could have changed?
>
> I thought I'd reply to my original post.
>
> The behavior here is without a doubt attributed to mythui pulse.
>
> It looks like animate is called at 70Hz, and as it was said in this thread,
> this can be dropped much lower if you don't have animations, but it takes
> modifying source and rebuilding.
>
> I'm astounded that the majority of the people reporting this behavior report
> similar cpu usage levels, no mater what the clock speed of the cpu.  In fact
> I can have mine clocked at 1Ghz or 2Ghz, and both result in a 14%
> utilization, so there seems to be an odd timing or wait component that
> doesn't give up context, but I couldn't find one.  But if we do the math,
> every time animate runs, it consumes the cpu for a full 2ms.
>
> It looks like Animate calls a bunch of pulses from all sorts of object
> types: clocks, images, text...etc.  It looks like to me, that all pulses
> eventually end up calling mythuitype::pulse which sets up the screen to
> redraw if it detected any motion or alpha blending changes.  Then it loops
> through and does a pulse on all the given children for that single item.
>
> Something that confused me: I tried commenting out all the pulse bodies that
> call mythuitype::pulse, and I still could get into a mode where 14%
> utilization was seen.  But if I comment out the body of mythuitype::pulse
> the cpu usage drops way down, but myth doesn't work very well if you do
> that.  After all, it looks like for every iteration of animate
> mythuitype::pulse gets called 39 times in my setup.  That means, normally,
> it is doing an alpha pulse and motion pulse 2700 times per second each.  But
> I wouldn't think that would add up to 140ms of time.

Here's something I just discovered. Try adding "usleep(500);" as the
first line of the MythMainWindow::animate() method, and see what
happens to your idle CPU usage. Also try various values between say
100 and 1900. You should find some sweet spot where your CPU usage
drops below 1%.

Another thing to try is to change animate() so that it returns
immediately without doing anything (and you have to tolerate the fact
that the screen never updates). You should still find your CPU usage
at 14% (or 7% in my case). This indicates that neither animate() nor
anything it calls is the culprit.

I think the problem here is the QTimer class. It apparently tries
very hard to make the timer fire off at the precise interval with
perhaps near-microsecond accuracy. It would appear that it does an OS
sleep for most of the interval and then does a CPU-consuming busy-wait
for the last part. That last part appears to be almost 1ms
busy-waiting for the 7% crowd and almost 2ms for the 15% crowd.
Whether it's 1ms or 2ms probably depends on the version of the Qt
library and/or the kernel config options.

We probably don't need this level of timing precision in MythUI. One
possibility is to replace the use of QTimer for invoking animate()
with some less precise timer that doesn't busy-wait. Another
possibility is to somehow tie this in to the video sync.

Jim
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


mtdean at thirdcontact

Jan 22, 2010, 8:39 PM

Post #125 of 136 (1689 views)
Permalink
Re: Mythfrontend idle cpu consumption help [In reply to]

On 01/22/2010 06:52 PM, Jim Stichnoth wrote:
> I think the problem here is the QTimer class. It apparently tries
> very hard to make the timer fire off at the precise interval with
> perhaps near-microsecond accuracy. It would appear that it does an OS
> sleep for most of the interval and then does a CPU-consuming busy-wait
> for the last part. That last part appears to be almost 1ms
> busy-waiting for the 7% crowd and almost 2ms for the 15% crowd.
> Whether it's 1ms or 2ms probably depends on the version of the Qt
> library and/or the kernel config options.
>
> We probably don't need this level of timing precision in MythUI. One
> possibility is to replace the use of QTimer for invoking animate()
> with some less precise timer that doesn't busy-wait. Another
> possibility is to somehow tie this in to the video sync.
>

Yes. The timer wakes too early and it then uses a busy loop to wait.
This same thing was the reason some Qt apps had to be modified with
different timer values to "get everything in sync" when ported from Qt3
to Qt4.

Something like:

http://websvn.kde.org/trunk/KDE/kdebase/workspace/kwin/composite.cpp?r1=847403&r2=850941&pathrev=850941

Mike
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

First page Previous page 1 2 3 4 5 6 Next page Last page  View All MythTV users RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.