or Connect
AVS › AVS Forum › Video Components › Home Theater Computers › HTPC - Linux Chat › frames skipping backwards with 24Hz refresh
New Posts  All Forums:Forum Nav:

frames skipping backwards with 24Hz refresh

post #1 of 12
Thread Starter 
Hey everyone. I've been a long time reader (searcher? of avsforum, and finally got to the point where I need some interactive assistance.

I'm putting together a linux-based HTPC using Ubuntu 7.10. The on-board video in my system is an NVidia GForce 7050PV. It's a Shuttle SN68PTG6 barebones system, with an Athlon dual core 6400+ cpu.

Pretty much everything is working well with the system, except for last night's project: 24Hz refresh rate for film sourced material. I have a display (Sony KDL-46XBR4) that supports 1080p24. Before asking my question, I'll give some useful information for those who might have this TV (or maybe others in the same line?). The EDID reported by the TV includes a mode for 1080p24:

Code:
(--) 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
HOWEVER, because of the support vertrefresh range reported by the TV, this mode is discarded by the NVidia driver when X starts up:

Code:
(--) NVIDIA(0): Valid VRefresh Range         : 58 Hz - 62 Hz
After much debugging and reading seemingly endless amounts of information online, I discovered the magical option to tell the nvidia driver to ignore the valid vrefresh range. Add the following to your "Screen" section in /etc/X11/xorg.conf:

Code:
Option         "ModeValidation" "DFP-0:NoVertRefreshCheck"
...assuming the TV is detected as DFP-0. (adjust the device identifier accordingly if you are crazy enough to have more than one flat panel attached to your system...)

After that, I was able to switch between 60Hz and 24Hz. I leave my resolution set to 1920x1080, since it seems to look a lot nicer if i let the video card/computer do the upscaling.

As a side note, if you want to make the NVidia driver not do the hardware upscaling to what it thinks is the best resolution (as seen in nvidia-settings as "front end" and "back end" resolutions), add the following option to your "Screen" section, too:

Code:
Option     "FlatPanelProperties" "Scaling = Native"
... I wouldn't recommend it though, unless you have a specific need to output a lower resolution signal to the TV.

Finally, on to my current issue. This is difficult to explain, so bear with me.
Most of the time, the 24Hz refresh rate looks great with my various 24fps sources, but occasionally the video frames appear to be displayed in the wrong order! In other words, a sequence of frames will be displayed, then jump BACK, then forward again to compensate. Basically, as you're viewing the video, every second (when it's bad), the video will flicker back in time for a fraction of a second. The audio is unaffected.

I'm using mplayer (latest svn with a couple patches applied--the ffmpeg truehd and eac3 decoders), the xv video output driver, and a command like the following to play media:

mplayer -fps 24000/1001 /blah/blah/FEATURE_1.EVO

Oddly enough, I've only seen the problem with VC-1 encoded media (e.g., playing directly off a mounted HD-DVD), but not with h.264 re-encoded video. I'm not sure if that was just a fluke, or what. I'm not sure how the codec would cause this kind of trouble... Tonight I'm going to give the gl/gl2 video output drivers a try to see if this is some weird mplayer/xv/nvidia bug and/or bizarreness.

I'd appreciate any clues anyone has to offer!
post #2 of 12
Might be easier to use 48Hz or 72Hz, even multiples of 24fps...
post #3 of 12
Thread Starter 
Hm. Those two refresh rates are not supported by the display, at least according to its EDID information. Should I try a custom modeline?

I'm still trying to figure out what this could have to do with the refresh rate, and why it only appears to happen when I use the lower refresh.
post #4 of 12
Accoring to

http://forum.hd-dvd.com/showpost.php...1&postcount=37

and

http://forums.highdefdigest.com/showthread.php?p=439051

you might want to simply feed the panel 60Hz and let the panel do the pulldown and frame repition to 120Hz
post #5 of 12
You may have discovered the secret to time travel, too
post #6 of 12
Thread Starter 
But, according to your two links, my display is one of the (apparently few) that actually supports bypassing pulldown when fed a 24Hz signal. (the KDL-46XBR4, with motion enhancer disabled...) Looks like it just does 5:5:5 frame repetition (or temporal interpolation) to match the native 120Hz refresh rate.
post #7 of 12
Thread Starter 
Now here's an interesting piece of information...

When I'm running in 24Hz mode, the X server is using 100% of one of my CPU cores! This is very odd, considering it uses at most 5% when running at 60Hz.

I can't really explain this behavior, but I suspect somehow X is burning WAY too much CPU than it has to. Unfortunately, it's probably the damn nvidia binary driver consuming the extra processing power. (rightfully or not, that is the question...) Maybe people on the nvidia forum would have a better idea.
post #8 of 12
Quote:
Originally Posted by uberjay View Post

When I'm running in 24Hz mode, the X server is using 100% of one of my CPU cores! This is very odd, considering it uses at most 5% when running at 60Hz.

The X server itself? That's weird. Is that when you're playing video or just idling? Try using the "nv" driver if it supports your chipset, and see if the CPU usage is still off the chart.
post #9 of 12
Thread Starter 
Quote:
Originally Posted by nitrogen View Post

The X server itself? That's weird. Is that when you're playing video or just idling? Try using the "nv" driver if it supports your chipset, and see if the CPU usage is still off the chart.

Ah, interesting. If I use the "UseEvents" driver option, the CPU usage goes back down to reasonable levels. Sadly, it doesn't fix my frame skipping issues. I'm getting close to trying a different video card, or perhaps the open source driver, as long as it supports the 7 series GeForce. (since I don't need any 3D support.)

From NVidia's driver README:

Code:
Option "UseEvents" "boolean"

    Enables the use of system events in some cases when the X driver is
    waiting for the hardware. The X driver can briefly spin through a tight
    loop when waiting for the hardware. With this option the X driver instead
    sets an event handler and waits for the hardware through the 'poll()'
    system call. Default: the use of the events is disabled.
post #10 of 12
Does it happen if you step through the source frame by frame?
post #11 of 12
Thread Starter 
Ah, I'm not sure about that, but I'll give it a try tonight. One interesting data point is that I haven't been able to get the problem to happen with VLC playing the same video file. Unfortunately VLC doesn't seem to be as efficient as mplayer and can't play some of the higher bitrate 1080p content I have. (e.g., I have Planet Earth on HD-DVD, which is just perfect for reproducing this issue.)

The other strange thing is it's so inconsistent. I was starting to think it was heat related, because I managed to watch 20 minutes of video without the problem occurring, but then it started again. Maybe it's an mplayer bug? That would be better than a video driver bug.

So weird.
post #12 of 12
Thread Starter 
No it does not happen when single stepping through the video in mplayer. Additionally, it doesn't happen when I play the same video with VLC, making me think this may be an mplayer issues after all... I'm going to post a bug report on the mplayer-users list to see if I can get to the bottom of this!
New Posts  All Forums:Forum Nav:
  Return Home
  Back to Forum: HTPC - Linux Chat
AVS › AVS Forum › Video Components › Home Theater Computers › HTPC - Linux Chat › frames skipping backwards with 24Hz refresh