nV News Forums


nV News Forums (http://www.nvnews.net/vbulletin/index.php)
-   NVIDIA Linux (http://www.nvnews.net/vbulletin/forumdisplay.php?f=14)
-   -   High CPU usage in X server at 24Hz refresh (http://www.nvnews.net/vbulletin/showthread.php?t=106409)

uberjay 01-17-08 02:02 PM

High CPU usage in X server at 24Hz refresh
1 Attachment(s)
Hey everyone.

I'm having a strange problem with a low refresh rate for my HTPC. I'm trying to get 1080p24 working. (1920x1080 @ 24Hz). This is a supported mode for my display, and my nvidia hardware (GForce 7050 PV) seems to support it as well. The EDID information dumped on X startup looks like this:


(--) NVIDIA(0):  1920 x 1080 @ 24 Hz
(--) NVIDIA(0):    Pixel Clock      : 74.16 MHz
(--) NVIDIA(0):    HRes, HSyncStart : 1920, 2558
(--) NVIDIA(0):    HSyncEnd, HTotal : 2602, 2750
(--) NVIDIA(0):    VRes, VSyncStart : 1080, 1084
(--) NVIDIA(0):    VSyncEnd, VTotal : 1089, 1125
(--) NVIDIA(0):    H/V Polarity    : +/+
(--) NVIDIA(0):    CEA Format      : 32

My display is a Sony KDL-46XBR4. I had to tell the nvidia driver to ignore the VertRefresh range reported by the TV (which claims to support only 58.000-62.000 Hz) using:


Option        "ModeValidation" "DFP-0:NoVertRefreshCheck"
In the Screen section of /etc/X11/xorg.conf.

For more information about my setup and the symptoms, take a look at this avsforum post.

Now, I've finally tracked some some interesting data points:

* When running in 24Hz refresh mode, the CPU usage of the X server is very high--every time I experience strange frame skipping issues (see that avsforum post for more information on what the skips look like...), the X server is consuming an entire CPU core.

* The CPU usage is not consistently high. In other words, playing back the same sequence of video sometimes will play without glitches, and other times will not.

* When the video is playing without glitches, it looks VERY smooth (because the refresh rate is matched with the fps of the video), yet the CPU usage of the X server is still hovering around 40-50%.

* When using a 60Hz refresh mode, the X server never consumes more than 5% (and usually is using less). In this case, there are no frame glitches, but because of the fps/refresh mismatch there is some visible judder. (sad)

For reference, I am using mplayer with the XV video output driver, and have sync to vblank enabled (with nvidia-settings). I'm using the latest ndriver release (169.07). Attached are the zipped results of nvidia-bug-report.sh.

Any helpful information would be greatly appreciated.

EDIT: This comment mentions this exact issue, but apparently it is also an issue for 50Hz (I haven't got that far yet... heh). I wonder if there is a way to determine if the nvidia driver is at fault, or the X server is at fault? Profiling perhaps? Maybe someone on the inside at NVidia has some ideas. :)

uberjay 01-18-08 10:02 AM

Re: High CPU usage in X server at 24Hz refresh
Well... it appears as though enabling UseEvents gets rid of my cpu usage problem, but does not fix my frame skipping issues. So, perhaps whatever situation causes the CPU spike (when UseEvents is off) also causes the frame skipping, rather than the cpu usage being responsible for the skipping.

Anyone have an nvidia card running with 24Hz refresh and like to share your xorg.conf file? Perhaps there are additional things I could try tweaking.

Next on my list is to try the Xorg nv driver and see how that goes, since I don't need any 3D support.


sfer 10-11-08 07:10 AM

Re: High CPU usage in X server at 24Hz refresh
1 Attachment(s)
Sorry to dig up this old thread, but I'm having the exact same problem and haven't found any solutions for it.

I have a Geforce 7900 GTO and I'm running Ubuntu 7.04. Watching 24 fps video in mplayer with xv output and my display at 24 hz and vsync enabled in nvidia-settings causes seemingly random high cpu usage by the xorg process and video stuttering. The video stutters in a strange way, it shows frames back and forth, that is, it goes backwards a bit, then forwards and so on, making the video so irritating to watch it's no use. It seems to be triggered by the combination of 24 hz and vsync. If i remove either of them, everything works fine except that there's tearing or 3:2 pulldown judder.

If I configure mplayer to use opengl output, the video runs fine, but I get other mplayer-related problems so it's not a good solution.

Any help appreciated.

CME 10-11-08 10:27 AM

Re: High CPU usage in X server at 24Hz refresh
I have also the same problem when I run my LCD in a 576p/50hz mode and play 25fps or 50fps videos, i get the same strange frameskipping errors. When using OpenGL in mplayer, it works much better, but not perfect (nvidia 7800GTX, 177.80 driver, AMD Athlon 64bit X2 4400+, ubuntu 7.10 64bit). When i try to play the same video on my P2 400Mhz box running debian sid with an ati rage 3d pro, atyfb, directfb and the same 50hz modeline, then i have no frameskipping issues (also mplayer).

sfer 10-16-08 04:28 PM

Re: High CPU usage in X server at 24Hz refresh
Could someone from nvidia please comment on this? It seems strange that there aren't more complaints about this. Maybe the problem is limited so specific models? Everyone in this post has a 7xxx series card.

evanh 10-16-08 09:23 PM

Re: High CPU usage in X server at 24Hz refresh
The problem is simple. All VGA displays are low capped to 31 kHz minimum HSync. Or there abouts. No particular reason why they can't go lower, they just don't.

You are trying to go down to 27 kHz.

evanh 10-16-08 09:57 PM

Re: High CPU usage in X server at 24Hz refresh
So, to get a picture at all you can't be operating at 24 Hz VSync.

LauriM 12-14-08 01:30 AM

Re: High CPU usage in X server at 24Hz refresh

Originally Posted by sfer (Post 1810954)
It seems strange that there aren't more complaints about this. Maybe the problem is limited so specific models? Everyone in this post has a 7xxx series card.

I have the same problem on 9600GT. This bug is triggered if the video framerate is close to display refresh rate. It doesn't need to be 24Hz - this happens with 50/60Hz too (with 50/60fps video).

Even with lower frame rates and no CPU hogging Xv loses a frame every now and then.

OpenGL output works for me, although I would rather use Xv.

edit: a 60fps clip which triggers the problem can be found here

sfer 04-07-09 01:21 PM

Re: High CPU usage in X server at 24Hz refresh
1 Attachment(s)
I'm still having this problem with the 180.44 driver. To recap, 23.976 fps material in 24 Hz mode (nvidia-settings says 23.97) occasionally plays frames out of order, causing bad stutter. This only happens when vsync is on. Xorg also starts using 100% cpu. I also have a Sony tv, I wonder if it reports bad data causing this problem somehow. Nevertheless, I don't think it should cause this kind of trouble anyway

Nvidia devs, can you please take a look at this? I hate being stuck playing 24 Hz content with the inherently stuttering 60 Hz mode.

Also, I could try 48 Hz, but I have no idea how to make it available in nvidia-settings or if the tv can display it properly. The tv is my secondary monitor via twinview and only the primary monitor appears in the xorg.conf screen section so I don't see where I'm supposed to put the modelines. Not that I know what the modeline should say anyway.

Relevant parts of xorg.conf:


Section "Monitor"
    Identifier    "Monitor0"
    VendorName    "Unknown"
    ModelName      "Samsung SyncMaster"
    HorizSync      30.0 - 110.0
    VertRefresh    50.0 - 160.0
    Option        "DPMS"

Section "Device"
    Identifier    "Device0"
    Driver        "nvidia"
    VendorName    "NVIDIA Corporation"
    BoardName      "GeForce 7900 GT/GTO"
    Option        "NvAGP" "1"
    Option        "NoLogo" "1"

Section "Screen"

# Removed Option "metamodes" "CRT: 1600x1200_85 +1920+0, DFP: 1920x1080_60 +0+0"
    Identifier    "Screen0"
    Device        "Device0"
    Monitor        "Monitor0"
    DefaultDepth    24
    Option        "TwinView" "1"
    Option        "TwinViewXineramaInfoOrder" "CRT-0"
    Option        "metamodes" "CRT: 1600x1200_85 +1920+0, DFP: 1920x1080_60 +0+0; CRT: 1600x1200_85 +0+0, DFP: 1920x1080 +1600+0; CRT: 1600x1200_85 +0+0, DFP: NULL"
    SubSection    "Display"
        Depth      24

sfer 04-12-09 06:15 PM

Re: High CPU usage in X server at 24Hz refresh
I found a satisfactory workaround. Running mplayer with the gl renderer, framedrop, autosync 30 and the opengl vsync set to the tv with __GL_SYNC_DISPLAY_DEVICE the 24 fps videos work silky and smooth. Framedrop is essential for keeping the audio in sync. Without it, the sync drifts terribly whenever the playback fails to keep up the pace. When that happens, now there are subtle hitches at worst whereas xv would go berserk twitching frames back and forth. Seeking in the video is a little choppy but the playback settles down after a while, apparently after the next keyframe.

I took quite a while to figure this out. Too bad nvidia hasn't bothered to fix their xv implementation or respond to this thread. Well, using the gl output has the added benefit of better scaling when lscale=1 and cscale=1 are passed to it. Using fragment program colorspace conversion with yuv=2 reduces cpu usage to amounts comparable to xv. I guess I won't bother with xv anymore. By the way, can the gl output be used with vdpau?

Despite sounding negative, I'm going to happily enjoy my judder free movies now for the first time. :)

All times are GMT -5. The time now is 10:53 AM.

Powered by vBulletin® Version 3.7.1
Copyright ©2000 - 2015, Jelsoft Enterprises Ltd.
Copyright 1998 - 2014, nV News.