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

Mailing List Archive: MythTV: Users

Fixed!: Nvidia Sync to Vblank pegging cpu in X

 

 

MythTV users RSS feed   Index | Next | Previous | View Threaded


mythtv.org at elvenhome

Dec 16, 2006, 4:25 PM

Post #1 of 11 (14085 views)
Permalink
Fixed!: Nvidia Sync to Vblank pegging cpu in X

I've been fighting the scourge of myth causing X to consume 100% of the
CPU when Xv Sync to Vblank is turned on in nvidia-settings. Everything
works just fine with it unchecked but that is the only sync setting that
gives me a perfect picture with no tearing. Myth's native OpenGL sync
still tears a little. The problem turned out to be the modeline I was
using. It was a 1368x768 56Hz modeline which apparently triggered the
issue. I switched to a 1360x768 60Hz modeline and now everything works
peachy. X still starts consuming large amounts of CPU occasionally but
it quickly drops back down to the 2-4% range. I'm not 100% sure that it
was the refresh but a modeline change did the trick. Hopefully posting
this here will help point others that have the same problem in a new
direction.
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


adeffs.mythtv at gmail

Dec 18, 2006, 5:44 AM

Post #2 of 11 (13875 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

On 12/16/06, J. Miller <mythtv.org [at] elvenhome> wrote:
> I've been fighting the scourge of myth causing X to consume 100% of the
> CPU when Xv Sync to Vblank is turned on in nvidia-settings. Everything
> works just fine with it unchecked but that is the only sync setting that
> gives me a perfect picture with no tearing. Myth's native OpenGL sync
> still tears a little. The problem turned out to be the modeline I was
> using. It was a 1368x768 56Hz modeline which apparently triggered the
> issue. I switched to a 1360x768 60Hz modeline and now everything works
> peachy. X still starts consuming large amounts of CPU occasionally but
> it quickly drops back down to the 2-4% range. I'm not 100% sure that it
> was the refresh but a modeline change did the trick. Hopefully posting
> this here will help point others that have the same problem in a new
> direction.

Interesting. I have the same issue, that setting is the only way to
get tear-free output with Myth (though mplayer works fine without
it...). I've been using the NVidia default 1080p modeline, which I'd
hope would work correctly. Actually, come to think of it. I tried the
9xxx series drivers over the weekend. They seemed to work fine except
it kept using a 24Hz 1080p modeline, I couldn't force it to use a 30
or 60hz, and the 24hz caused MAJOR tearing, so the fact that it's
frequency related doesn't really surprise me. Perhaps I'll try one of
the custom modelines listed in the wiki to see if that fixes things.

--
Steve
Before you ask, read the FAQ!
http://www.mythtv.org/wiki/index.php/Frequently_Asked_Questions
then search the Wiki, and this list,
http://www.gossamer-threads.com/lists/mythtv/
Mailinglist etiquette -
http://www.mythtv.org/wiki/index.php/Mailing_List_etiquette
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


foobum at gmail

Dec 19, 2006, 8:11 AM

Post #3 of 11 (13882 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

On 12/17/06, J. Miller <mythtv.org [at] elvenhome> wrote:
>
> I've been fighting the scourge of myth causing X to consume 100% of the
> CPU when Xv Sync to Vblank is turned on in nvidia-settings. Everything
> works just fine with it unchecked but that is the only sync setting that
> gives me a perfect picture with no tearing. Myth's native OpenGL sync
> still tears a little. The problem turned out to be the modeline I was
> using. It was a 1368x768 56Hz modeline which apparently triggered the
> issue. I switched to a 1360x768 60Hz modeline and now everything works
> peachy. X still starts consuming large amounts of CPU occasionally but
> it quickly drops back down to the 2-4% range. I'm not 100% sure that it
> was the refresh but a modeline change did the trick. Hopefully posting
> this here will help point others that have the same problem in a new
> direction.
> _______________________________________________
> mythtv-users mailing list
> mythtv-users [at] mythtv
> http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
>


NVIDIA have added an option in (I think) 9626 to poll() instead of busy-wait
for vblank, which fixes the high cpu usage when sync to vblank is switched
on. It's called "UseEvents".


adeffs.mythtv at gmail

Dec 19, 2006, 4:24 PM

Post #4 of 11 (13827 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

On 12/19/06, foo bar <foobum [at] gmail> wrote:
> On 12/17/06, J. Miller <mythtv.org [at] elvenhome> wrote:
> > I've been fighting the scourge of myth causing X to consume 100% of the
> > CPU when Xv Sync to Vblank is turned on in nvidia-settings. Everything
> > works just fine with it unchecked but that is the only sync setting that
> > gives me a perfect picture with no tearing. Myth's native OpenGL sync
> > still tears a little. The problem turned out to be the modeline I was
> > using. It was a 1368x768 56Hz modeline which apparently triggered the
> > issue. I switched to a 1360x768 60Hz modeline and now everything works
> > peachy. X still starts consuming large amounts of CPU occasionally but
> > it quickly drops back down to the 2-4% range. I'm not 100% sure that it
> > was the refresh but a modeline change did the trick. Hopefully posting
> > this here will help point others that have the same problem in a new
> > direction.
>
> NVIDIA have added an option in (I think) 9626 to poll() instead of busy-wait
> for vblank, which fixes the high cpu usage when sync to vblank is switched
> on. It's called "UseEvents".

interesting, you mean in the nvidia-settings Xv section?

I'll have to give this a try.
--
Steve
Before you ask, read the FAQ!
http://www.mythtv.org/wiki/index.php/Frequently_Asked_Questions
then search the Wiki, and this list,
http://www.gossamer-threads.com/lists/mythtv/
Mailinglist etiquette -
http://www.mythtv.org/wiki/index.php/Mailing_List_etiquette
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


foobum at gmail

Dec 19, 2006, 4:43 PM

Post #5 of 11 (13854 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

On 12/20/06, Steven Adeff <adeffs.mythtv [at] gmail> wrote:
>
> On 12/19/06, foo bar <foobum [at] gmail> wrote:
> > On 12/17/06, J. Miller <mythtv.org [at] elvenhome> wrote:
> > > I've been fighting the scourge of myth causing X to consume 100% of
> the
> > > CPU when Xv Sync to Vblank is turned on in
> nvidia-settings. Everything
> > > works just fine with it unchecked but that is the only sync setting
> that
> > > gives me a perfect picture with no tearing. Myth's native OpenGL sync
> > > still tears a little. The problem turned out to be the modeline I was
> > > using. It was a 1368x768 56Hz modeline which apparently triggered the
> > > issue. I switched to a 1360x768 60Hz modeline and now everything
> works
> > > peachy. X still starts consuming large amounts of CPU occasionally
> but
> > > it quickly drops back down to the 2-4% range. I'm not 100% sure that
> it
> > > was the refresh but a modeline change did the trick. Hopefully
> posting
> > > this here will help point others that have the same problem in a new
> > > direction.
> >
> > NVIDIA have added an option in (I think) 9626 to poll() instead of
> busy-wait
> > for vblank, which fixes the high cpu usage when sync to vblank is
> switched
> > on. It's called "UseEvents".
>
> interesting, you mean in the nvidia-settings Xv section?
>
> I'll have to give this a try.
> --
> Steve
>

No - in the device section of xorg.conf

e.g.

Section "Device"
...
Option "UseEvents" "True"
EndSection


jim.herold at comcast

Dec 19, 2006, 6:11 PM

Post #6 of 11 (13818 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

On 12/17/06, J. Miller <mythtv.org [at] elvenhome> wrote:

> >
> > I've been fighting the scourge of myth causing X to consume 100% of the
> > CPU when Xv Sync to Vblank is turned on in nvidia-settings. Everything
> > works just fine with it unchecked but that is the only sync setting that
> > gives me a perfect picture with no tearing. Myth's native OpenGL sync
> > still tears a little. The problem turned out to be the modeline I was
> > using. It was a 1368x768 56Hz modeline which apparently triggered the
> > issue. I switched to a 1360x768 60Hz modeline and now everything works
> > peachy. X still starts consuming large amounts of CPU occasionally but
> > it quickly drops back down to the 2-4% range. I'm not 100% sure that it
> > was the refresh but a modeline change did the trick. Hopefully posting
> > this here will help point others that have the same problem in a new
> > direction.
> > _______________________________________________
> > mythtv-users mailing list
> > mythtv-users [at] mythtv
> > http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users
> >
>


> NVIDIA have added an option in (I think) 9626 to poll() instead of
> for vblank, which fixes the high cpu usage when sync to vblank is switched
> on. It's called "UseEvents".

My Modeline was already 1280x720 @ 60Hz. I've tried tweaking it a number of ways but never came up with a magic modeline that fixed the issue here.

Never thought to try the sync to vblank setting (thanks also to Steven Adeff for this suggestion). I knew it was recommended to disable that for XvMC, but never connected that it'd be a good idea for Xv as well. With the sync to vblank off everything looks great on my setup, and the X cpu usage hovers around 10% when watching 720p content.

I tried the "UseEvents" thing. Interestingly, it works, but increases the "wa" cpu usage in top, and therefore leaves less cpu idle time by roughly 20% when compared with just disabling the sync to vblank.

Thanks all for the help!
Jim


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


jkara00 at gmail

Dec 20, 2006, 2:01 AM

Post #7 of 11 (13847 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

>No - in the device section of xorg.conf

>e.g.

>Section "Device"
>...
>Option "UseEvents" "True"
>EndSection

incredible! this has brought my cpu levels from 98-100% down to 20% max

no more need to renice X.......thanks for the tip!


mcdent at gmail

Dec 20, 2006, 4:54 AM

Post #8 of 11 (13834 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

On 12/20/06, Johnny K <jkara00 [at] gmail> wrote:
> >No - in the device section of xorg.conf
>
> >e.g.
>
> >Section "Device"
> >...
> >Option "UseEvents" "True"
> >EndSection
>
> incredible! this has brought my cpu levels from 98-100% down to 20% max
>
> no more need to renice X.......thanks for the tip!
>


Hi,
I just posted a message regarding the problems I am seeing with X
appearing to lockup.
This seems to occur when moving rouund the menus in mythtv-setup fast
with the keyboard more than at other times.

I'm not sure if what I am seeing is related to this thread but I just
checked the
X process on this box when it is in its 'locked' state and it seems it
is consuming
all available CPU:-

root 4077 4074 15 Dec19 tty7 02:26:12 /usr/bin/X :0 -br
-audit 0 -auth /var/lib/gdm/:0.Xauth vt7

'top' shows:-

PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
4077 root 25 0 231m 74m 3940 R 99.9 7.4 146:08.06 Xorg


I'm using an Nvidia fx5200 , Athlon 64, motherboard is a nForce 3 chipset,
Ubuntu 6.10 and 0.20 myth packages.

Thanks for any insight in to this problem.

Mike

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


adeffs.mythtv at gmail

Dec 20, 2006, 5:53 AM

Post #9 of 11 (13859 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

On 12/19/06, Jim herold <jim.herold [at] comcast> wrote:
> On 12/17/06, J. Miller <mythtv.org [at] elvenhome> wrote:
> > > I've been fighting the scourge of myth causing X to consume 100% of the
> > > CPU when Xv Sync to Vblank is turned on in nvidia-settings. Everything
> > > works just fine with it unchecked but that is the only sync setting that
> > > gives me a perfect picture with no tearing. Myth's native OpenGL sync
> > > still tears a little. The problem turned out to be the modeline I was
> > > using. It was a 1368x768 56Hz modeline which apparently triggered the
> > > issue. I switched to a 1360x768 60Hz modeline and now everything works
> > > peachy. X still starts consuming large amounts of CPU occasionally but
> > > it quickly drops back down to the 2-4% range. I'm not 100% sure that it
> > > was the refresh but a modeline change did the trick. Hopefully posting
> > > this here will help point others that have the same problem in a new
> > > direction.
>
> > NVIDIA have added an option in (I think) 9626 to poll() instead of
> > for vblank, which fixes the high cpu usage when sync to vblank is switched
> > on. It's called "UseEvents".
>
> My Modeline was already 1280x720 @ 60Hz. I've tried tweaking it a number of ways but
> never came up with a magic modeline that fixed the issue here.
>
> Never thought to try the sync to vblank setting (thanks also to Steven Adeff for this
> suggestion). I knew it was recommended to disable that for XvMC, but never connected
> that it'd be a good idea for Xv as well. With the sync to vblank off everything looks great
> on my setup, and the X cpu usage hovers around 10% when watching 720p content.
>
> I tried the "UseEvents" thing. Interestingly, it works, but increases the "wa" cpu usage in
> top, and therefore leaves less cpu idle time by roughly 20% when compared with just
> disabling the sync to vblank.

normally the Xv Sync to vblank in nvidia-settings is what causes most
people's high Xorg cpu usage, so disabling it would fix that problem.
My, and from what I gather some others as well, issue was, doing this
would cause random tearing during very high motion camera pans, and a
constant warble-ish tear of the top 10% of the screen (not very
noticeable unless your looking for it, but still a problem). So I'm
hoping this will fix that, though I don't think I'll get the chance to
try it until next week (vacation).

One thing I did notice with using the 9xxx drivers was that X would
only let me use a 24hz 1080p modeline instead of the other builtin's I
use in 8776 (1920x1080_30 or 1920x1080_60). Which "works" with my tv,
it just causes other output issues since the video is 30hz... Perhaps
using an actual modeline will fix this. I'll have to play around and
see.

--
Steve
Before you ask, read the FAQ!
http://www.mythtv.org/wiki/index.php/Frequently_Asked_Questions
then search the Wiki, and this list,
http://www.gossamer-threads.com/lists/mythtv/
Mailinglist etiquette -
http://www.mythtv.org/wiki/index.php/Mailing_List_etiquette
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users


brian at interlinx

Dec 20, 2006, 3:43 PM

Post #10 of 11 (13827 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

On Tue, 2006-12-19 at 20:11 -0600, Jim herold wrote:
> Interestingly, it works, but increases the "wa" cpu usage in top,

This is, BTW, a good thing. "wa" is time spent by the CPU waiting for
I/O. IOW, the CPU has nothing it can do because _everything_ runnable
is blocked on some I/O operation completing. In this context it means
that that one simple change changed one single process from operating in
a mode of spinning the cpu on a NOOP to releasing the CPU for other
tasks to take advantage of instead. This is a most wonderful change!

> and therefore leaves less cpu idle time

Don't mistake a CPU high in "wa" as a busy CPU. "wa" is essentially
idle CPU. The only difference between truly idle and "wa" is that truly
idle means there are no process that want to do anything. "wa" means
there are processes that want to do something but are blocked waiting
for some data to be read/written to/from somewhere. When a process is
waiting in this mode, it gives up the CPU to let another process have it
while the first process does it's waiting.

> by roughly 20% when compared with just disabling the sync to vblank.

b.

--
My other computer is your Microsoft Windows server.

Brian J. Murrell
Attachments: signature.asc (0.18 KB)


jim.herold at comcast

Dec 21, 2006, 9:58 AM

Post #11 of 11 (13796 views)
Permalink
Re: Fixed!: Nvidia Sync to Vblank pegging cpu in X [In reply to]

>On Tue, 2006-12-19 at 20:11 -0600, Jim herold wrote:
>> Interestingly, it works, but increases the "wa" cpu usage in top,
>
>This is, BTW, a good thing. "wa" is time spent by the CPU waiting for
>I/O. IOW, the CPU has nothing it can do because _everything_ runnable
>is blocked on some I/O operation completing. In this context it means
>that that one simple change changed one single process from operating in
>a mode of spinning the cpu on a NOOP to releasing the CPU for other
>tasks to take advantage of instead. This is a most wonderful change!

>> and therefore leaves less cpu idle time

>Don't mistake a CPU high in "wa" as a busy CPU. "wa" is essentially
>idle CPU. The only difference between truly idle and "wa" is that truly
>idle means there are no process that want to do anything. "wa" means
>there are processes that want to do something but are blocked waiting
>for some data to be read/written to/from somewhere. When a process is
>waiting in this mode, it gives up the CPU to let another process have it
>while the first process does it's waiting.

>> by roughly 20% when compared with just disabling the sync to vblank.

Thanks for the info, that's good to know. I had assumed that wa was bad 'cause a process
had CPU locked up unable to do anything. Good to know that other processes can
jump in there if they have something to do.

Thanks again everybody for the help on this one!
_______________________________________________
mythtv-users mailing list
mythtv-users [at] mythtv
http://mythtv.org/cgi-bin/mailman/listinfo/mythtv-users

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.