mywebsitenamegoogleads
mywebsitenamegoogleads
Matching refresh rate with input framerate to reduce judder
Matching refresh rate with input framerate to reduce judder ; final part
I have mentioned over the past few years on how to make mythtv set your display to best match the video being played.
This is something commonly done by your bluray player, PS3 etc.. If you watch a 24fps video, it usually sets your display at 24Hz..
I have written code a while back that achieves the same result with mythtv ; and for the most part, it’s almost configuration less.
This is a two cases scenario however, for most, the basic one will be sufficient and they won’t bother with the advanced case.
In both cases, there’s only one configuration to set in MythTV.
Go to Utilities / Setup -> Setup -> Appearance
Go to the “Video Mode Settings” page, and check “Separate video modes for GUI and TV playback”
For GUI and Video Output, enter the native resolution of your screen ; for a full HD TV, that is 1920x1080. Rate should be set as “Any”
Select Next until you reach the end of the configuration screen, that’s it.
Basic scenario.
Most TV reports their capabilities via the EDID. This includes the resolutions and refresh rates supported.
Like:
1920x1080 24Hz
1920x1080 50Hz
1920x1080 60Hz
1280x720 60Hz
...
MythTV can extract this information, and will then automatically set up the screen refresh rate to best match the content being played. So if watching a 24fps video, and if your TV supports 24Hz this is what it will use.
If there’s no matching refresh rate, it will use the highest one available (usually 60Hz).
No additional configuration is required except when using nvidia graphic adapters.
You need to either run the nvidia-settings application and uncheck in the GPU section “Force Full GPU scaling”
or edit /etc/X11/xorg.conf
and add in the screen section:
Option "FlatPanelProperties" "Scaling = Native"
Advanced Scenario
One problem with the scenario described above ; is that the Earth isn’t flat and standard refresh rates aren’t integers in all part of the world.
You may have read that PAL is 50Hz and NTSC is 60Hz... Not quite so. some PAL standards are 50Hz, but NTSC (and PAL-M/N) is 59.94Hz (actually 60Hz * 1000 / 1001)
The signal being interlaced, the effective frame rate is 29.97fps.
24Hz in NTSC countries is actually 23.976Hz (60Hz / 1.001 / 2.5).
The problem is that the X11 framework that allows changing resolution and refresh rates on the fly (called XRANDR) only supports integers. So it can not easily tell the difference between 24Hz and 23.976Hz.
As far as I know, with Intel and ATI graphic adapters using MythTV, 24, 50 and 60Hz is the best you will get. With nvidia adapters however, nvidia has put a work around this limitation by presenting a unique refresh rate per screen configuration.
So it will show as the list of available rates: 50, 51, 52, 53 etc... when 50 is 50Hz, 51 is 59.97, 52 is 60Hz etc...
To get access to those “rates”, you must make sure the “Dynamic TwinView” is active (that’s the default).
In the ideal world, whatever your TV reports through the EDID should be sufficient. Unfortunately for me, none of my TVs reports all the required information, and worse, the default X11 behaviour failed to properly work. The solution here worked on all my TVs (Panasonic projector, Sony Bravia TV, samsung TV, all 1920x1080)
The idea is to ignore the EDID rates information; and use the EIA/CEA-861B standard modelines. This is done with the X option:
Option"ExactModeTimingsDVI" "True"
Option"UseEDIDFreqs" "False"
Here is my backend screen configuration, it has two screens connected, a Panasonic AE-4000 projector, and a 17” LCD screen.
Section "ServerLayout"
Identifier "Layout0"
Screen 0 "Screen0" 0 0
Screen 1 "Screen1" LeftOf "Screen0"
EndSection
Section "Extensions"
Option "Composite" "Disable"
EndSection
Section "ServerFlags"
Option "Xinerama" "0"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Panasonic AE-4000"
Option "DPMS"
# 1920x1080p @ 50Hz (EIA/CEA-861B)
ModeLine "1920x1080@50" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 60Hz (EIA/CEA-861B)
ModeLine "1920x1080@60" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 24Hz (EIA/CEA-861B)
ModeLine "1920x1080@24" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 23.976Hz (EIA/CEA-861B)
ModeLine "1920x1080@23.976" 74.175 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
# 1920x1080i @ 50Hz (EIA/CEA-861B)
Modeline "1920x1080@50i" 74.250 1920 2448 2492 2640 1080 1085 1095 1125 +hsync +vsync Interlace
# 1920x1080i @ 60Hz (EIA/CEA-861B)
Modeline "1920x1080@60i" 74.250 1920 2008 2052 2200 1080 1085 1095 1125 +hsync +vsync interlace
# 1920x1080p @ 59.94Hz (EIA/CEA-861B)
ModeLine "1920x1080@59.94" 148.350 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
# 1920x1080i @ 59.94Hz (EIA/CEA-861B)
Modeline "1920x1080@59.94i" 74.175 1920 2008 2052 2200 1080 1085 1095 1125 +hsync +vsync Interlace
# 1920x1080p @ 25Hz (EIA/CEA-861B)
#ModeLine "1920x1080@25" 74.250 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 29.97Hz (EIA/CEA-861B)
#ModeLine "1920x1080@29.97" 74.175 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 30Hz (EIA/CEA-861B)
#ModeLine "1920x1080@30" 74.250 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
HorizSync20.0 - 150.0
VertRefresh 23.0 - 90.0
Option"ExactModeTimingsDVI" "True"
Option"UseEDIDFreqs" "False"
EndSection
Section "Monitor"
Identifier "Monitor1"
VendorName "Unknown"
ModelName "ViewSonic VX715"
Option "DPMS"
EndSection
Section "Device"
Identifier "Videocard0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 8600 GT"
Option "CustomEDID" "DFP-0:/etc/X11/viewsonic-edid.bin; DFP-1:/etc/X11/panasonic-edid.bin"
Option "ConnectedMonitor" "DFP-0,DFP-1"
Option "UseDisplayDevice" "DFP-1"
Option "UseEvents" "True"
Option "ModeValidation" "NoVesaModes, NoXServerModes"
BusID "PCI:1:0:0"
EndSection
Section "Device"
Identifier "Videocard1"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 8600 GT"
Option "ConnectedMonitor" "DFP-0,DFP-1"
Option "UseDisplayDevice" "DFP-0"
Option "UseEvents" "True"
BusID "PCI:1:0:0"
Screen 1
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
Option "FlatPanelProperties" "Scaling = Native"
Option "TwinView" "0"
SubSection "Display"
Depth 24
Modes "1920x1080@50" "1920x1080@60" "1920x1080@24" "1920x1080@23.976" "1920x1080@50i" "1920x1080@60i" "1920x1080@59.94" "1920x1080@59.94i"
EndSubSection
EndSection
Section "Screen"
Identifier "Screen1"
Device "Videocard1"
Monitor "Monitor1"
DefaultDepth 24
Option "TwinView" "0"
Option "FlatPanelProperties" "Scaling = Native"
Option "metamodes" "DFP-0: nvidia-auto-select +0+0"
SubSection "Display"
Depth 24
EndSubSection
EndSection
You’ll see in the “Monitor” section, that I commented out "1920x1080@25", "1920x1080@29.97" and "1920x1080@30". That’s because my TV doesn’t support it. To find out which one your TV actually supports ; run xrandr.
It will show something like:
Screen 0: minimum 640 x 480, current 1920 x 1080, maximum 1920 x 1080
default connected 1920x1080+0+0 0mm x 0mm
1920x1080 50.0* 51.0 52.0 53.0 54.0 55.0 56.0 57.0 58.0 59.0 60.0 61.0 62.0 63.0 64.0
Now go through all values using xrandr and see which one your screen supports. It it doesn’t support it, it will usually displays nothing, or like on my sony: “signal not supported”.
so type:
xrandr -r 51
You’ll see the screen flicker. Usually the TV has an info button, that will show the refresh rate in use.
doing: tail /var/log/Xorg.0.log
yield:
(II)Jun 07 13:29:40 NVIDIA(0): Setting mode "1920x1080@60"
so you now rate 51 is 1920x1080 at 60Hz.
For a single screen configuration (Sony Bravia 46X3100).
Section "Extensions"
Option "Composite" "Disable"
EndSection
Section "Monitor"
Identifier "Monitor0"
VendorName "Unknown"
ModelName "Sony 46X3100"
Option "DPMS"
# 1920x1080p @ 50Hz (EIA/CEA-861B)
ModeLine "1920x1080@50" 148.500 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 60Hz (EIA/CEA-861B)
ModeLine "1920x1080@60" 148.500 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 24Hz (EIA/CEA-861B)
ModeLine "1920x1080@24" 74.250 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 23.976Hz (EIA/CEA-861B)
ModeLine "1920x1080@23.976" 74.175 1920 2558 2602 2750 1080 1084 1089 1125 +hsync +vsync
# 1920x1080i @ 50Hz (EIA/CEA-861B)
Modeline "1920x1080@50i" 74.250 1920 2448 2492 2640 1080 1085 1095 1125 +hsync +vsync Interlace
# 1920x1080i @ 60Hz (EIA/CEA-861B)
Modeline "1920x1080@60i" 74.250 1920 2008 2052 2200 1080 1085 1095 1125 +hsync +vsync interlace
# 1920x1080p @ 59.94Hz (EIA/CEA-861B)
ModeLine "1920x1080@59.94" 148.350 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
# 1920x1080i @ 59.94Hz (EIA/CEA-861B)
Modeline "1920x1080@59.94i" 74.175 1920 2008 2052 2200 1080 1085 1095 1125 +hsync +vsync Interlace
# 1920x1080p @ 25Hz (EIA/CEA-861B)
#ModeLine "1920x1080@25" 74.250 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 29.97Hz (EIA/CEA-861B)
#ModeLine "1920x1080@29.97" 74.175 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
# 1920x1080p @ 30Hz (EIA/CEA-861B)
#ModeLine "1920x1080@30" 74.250 1920 2008 2052 2200 1080 1084 1089 1125 +hsync +vsync
HorizSync20.0 - 150.0
VertRefresh 23.0 - 90.0
Option"ExactModeTimingsDVI" "True"
Option"UseEDIDFreqs" "False"
EndSection
Section "Device"
Identifier "Videocard0"
Driver "nvidia"
VendorName "NVIDIA Corporation"
BoardName "GeForce 8600 GT"
Option"UseDisplayDevice" "DFP-0"
Option“UseEvents" "True"
Option "ModeValidation" "NoVesaModes, NoXServerModes"
BusID "PCI:1:0:0"
EndSection
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 24
Option "FlatPanelProperties" "Scaling = Native"
Option "TwinView" "0"
SubSection "Display"
Depth 24
Modes "1920x1080@50" "1920x1080@60" "1920x1080@24" "1920x1080@23.976" "1920x1080@50i" "1920x1080@60i" "1920x1080@59.94" "1920x1080@59.94i"
EndSubSection
EndSection
Now that X has been configured to see all the possible refresh rates ; MythTV will be able to switch to the most suitable rate as required...
Monday, 7 June 2010