View Single Post
Old 09-01-08, 11:47 AM   #3
Armedblade
Registered User
 
Join Date: Oct 2007
Posts: 23
Default first success in correcting OVERSCAN

Just wanted to share my experience in dealing with OVERSCAN in case it's beneficial to you as well. I was totally off on my initial approach This isn't intended to be a "how-to" so familiarity with xorg and it's configuration has been assumed.

TV: PANASONIC CT-30WX15

Some info is direct from:
http://www.mythtv.org/wiki/index.php...with_Modelines
All credit and thanks goes to its author(s).

Make sure Xorg.conf is pretty basic, no more than you need to get a picture.

Use:
Code:
X -verbose 6 > /tmp/xlog.txt 2>&1
Extract refresh rate info from the xlog.txt log:
Code:
(--) NVIDIA(0): --- EDID for PANASONIC-CTV (DFP-0) ---
(--) NVIDIA(0): EDID Version                 : 1.3
(--) NVIDIA(0): Manufacturer                 : MEI
(--) NVIDIA(0): Monitor Name                 : PANASONIC-CTV
<snip>
(--) NVIDIA(0): Valid HSync Range            : 15.0 kHz - 34.0 kHz
(--) NVIDIA(0): Valid VRefresh Range         : 59 Hz - 61 Hz
(--) NVIDIA(0): EDID maximum pixel clock     : 80.0 MHz
Hard code refresh rates to xorg:
Code:
Section "Monitor"
	Identifier	"PANASONIC CT-30WX15"
	#Option	 	"ExactModeTimingsDVI" "true" <--this is critical later
	
	HorizSync	15-34
	VertRefresh	59-61
EndSection
Extract base modeline information for the resolution we want to start with:
Code:
(--) NVIDIA(0):   720  x 480  @ 60 Hz
(--) NVIDIA(0):     Pixel Clock      : 27.00 MHz
(--) NVIDIA(0):     HRes, HSyncStart : 720, 736
(--) NVIDIA(0):     HSyncEnd, HTotal : 798, 858
(--) NVIDIA(0):     VRes, VSyncStart : 480, 489
(--) NVIDIA(0):     VSyncEnd, VTotal : 495, 525
(--) NVIDIA(0):     H/V Polarity     : -/-
Rewrite it as a Xorg Modeline:
Modeline_"MODENAME"_FF_H1_H2__H3_H4__V1_V2__V3_V4_ _FLAGS # <-- this is just to label things; use with legend below (_ used for spacing)
ModeLine "720x480" 27.00 720 736 798 858 480 489 495 525 -hsync -vsync

Tweak the modeline:
H1 and V1 is the total visible resolution, which obviously will be less when overscan is involved

The horizontal sync bar is given by the 4th and 5th numbers in the modeline (H2 and H3 above)
To move image left increase both of these
To move image right decrease both of these

The vertical sync bar is given by the 8th and 9th numbers (V2 and V3), and works the same way:
To move image up increase the numbers
To move image down decrease the numbers

I chose to use multiples of 5

Worksheet:
I had to drop visible resolution first, the wiki above has you do this last but the image moves each time so it was easier for me to just go with a resolution that I already knew was close to fitting the screen:
(H1 V1): visible resolution 632x430
ModeLine "720x480_new" 27.00 (632) 736 798 858 (430) 489 495 525 -hsync -vsync

Move Image Right [H2] [H3]; subtracted 25
Move Image Down {V2} {V3}; subtracted 25
ModeLine "720x480_new" 27.00 632 [701] [763] 858 430 {464} {470} 525 -hsync -vsync

Add the new modeline and make sure we refer to it and enable the ExactModeTimingsDVI option:
Code:
Section "Monitor"
	Identifier	"PANASONIC CT-30WX15"
	Option	 	"ExactModeTimingsDVI" "true" #<--this is critical later
	
	HorizSync	15-34
	VertRefresh	59-61
	
	ModeLine "720x480_new" 27.00 632 701 763 858 430 464 470 525 -hsync -vsync
EndSection

Section "Screen"
	Identifier	"Default Screen"
	Monitor		"PANASONIC CT-30WX15"
	Device		"Configured Video Device"

	SubSection "Display"
		Depth 24
		Modes "720x480_new"
	EndSubSection
EndSection
Notes:
When using the modeline make sure ExactModeTimingsDVI is enabled, this rids of most of the automagic the driver will do. I doesn't get rid of nvidia-auto-select so make sure you frequently check the log before you discount recent changes you have made
Each time, I used the "X -verbose 6 > /tmp/xlog.txt 2>&1" to test each modeline tweak on the bare grey screen and then hit CTRL-ALT-BACKSPACE to quit X
You may need to set "allowed_users=anybody" (temporarily) in /etc/X11/Xwrapper.config if you are getting not authorized errors when launching "X"
Contrary to my original approach, Htotal (V1), Vtotal (V4) needed to remain the same value, same as the starting modeline



LEGEND
MODENAME: any name you would like (but usually in the form of "640x480@60").
FF: Dot Clock (a.k.a. Pixel Clock Frequency or Bandwidth) (MHz) - How many dots it can output per second.
H1: Width - Number of horizontal pixels drawn to the visible part of the screen (e.g. 720).
H2 - H1: Front Porch - The amount of black pixels drawn to the right of the screen.
H3 - H2: Sync Pulse - The amount of time it takes to start another line.
H4 - H3: Back Porch - The amount of black pixels drawn to the left of the screen.
V1: Height - Number of vertical pixels drawn to the visible part of the screen (e.g. 480).
V2 - V1: Front Porch - The amount of black pixels drawn on the bottom of the screen.
V3 - V2: Vertical Blanking Interval (a.k.a VBI or Vertical Sync) - The amount of time it takes to move back up to the first line of the screen
V4 - V3: Back Porch - The amount of black pixels drawn to the top of the screen.
FLAGS: special stuff maybe necessary for drivers (sync-on-green, sync polarity, interlacing, etc)
Armedblade is offline   Reply With Quote