Overscan on CRT


I’m trying to setup EmuElec on my A95X F3 (Generic S905X3 AmLogic TV Box) to play PSX emulator games on my old Sony Trinitron CRT.

I’m already on “480cvbs” video display mode, and I have already added the command to shift the picture into the correct place as well, referenced here: Composite Output Isn't Working Correctly A95X F3 - #4 by Langerz82

Now I’m finding that the picture is substantially overscanned, the text at the bottom and top of the screen is significantly cut off, and in full screen situations the left and right are also cut off.

I’ve tried to read some posts about manually editing settings in the fb0 directory, such as this post here: EmuELEC 4.3 1280x800 overscan, but I can’t understand what they’re doing exactly, and therefore cannot modify exactly what they’re doing to work for my setup.

I guess I have two questions:

  1. Is the current state of the picture really “640 x 480” exactly, and my TV is displaying it wrong, or
  2. If the current picture is being stretched, how do I fix it so that it displays 1:1?


@Drambemu Hello again,
You have to do two things, since your tv operates in widescreen mode the internal resolution probably need to in WS mode as well. You can do this with the following command in SSH:

echo 1920 1080 > /storage/.config/cvbs_resolution.txt

Then you need to re-scale it with the following for example:

echo "ee_videowindow=55 15" >> /emuelec/configs/emuelec.conf

Please note - If you have adjusted the ee_videowindow before you need to remove the previous entry from the /emuelec/configs/emuelec.conf file.

Best of luck.

This doesn’t make sense to me. The TV is 4:3, not widescreen, and is 480i, not 1080p. It would probably be a very bad idea trying to emulate at 1080p on a little android box.

The TV isnt widescreen it receives the signal at 720x480 which is why you had to resize the screen to fit, what this does though is effectively squashes the aspect, so if you have an internal resolution in widescreen with the scaling it should (theoretically) make the ratio closer to 4:3 which is what you want.
You could even drop the native wide resolution to lower then 1080p say 480p but the ES text may appear quite big because it does not scale properly. You could try 720x480 and see if that works with:

echo 720 480 > /storage/.config/cvbs_resolution.txt

But I’m not sure how it would appear, give it a shot! :slight_smile:

I’m pretty sure it’s already running at 720x480, though I don’t know how to check, also I thought I didn’t resize the screen I just moved it.

By default if you havent changed it the internal resolution for cvbs is 1024x768:

Moving the borders with ee_videowindow effectively rescales the width and height, but does not keep uniformity unless it’s calculated into the adjustments manually. This should roughly keep the aspect ratio of 4:3 if you left the default res of 1024x768.

echo “ee_videowindow=55 13” >> /emuelec/configs/emuelec.conf

Why couldn’t I just set the internal resolution to 640 x 480?

You can do that too. However, bear in mind when ES loads the font wont scale with the lower resolution so the text descriptions may appear quite large. 800x600 may be a little better for the ES display, up to you really. All the 4:3 resolutions (1024x768, 800x600, 640x480) all will use the same resizing values which is:

echo “ee_videowindow=55 13” >> /emuelec/configs/emuelec.conf

I have no idea what this videowindow command is actually doing, your description didn’t really clarify it. I have drawn some diagrams to demonstrate what I mean.

This is what I was originally expecting the command to do, i.e., take the correct size window and move it into the correct position.

Here is what I suspect is actually happening after your descriptions:

Why does this “videowindow” command need to be used at all? What does it do?

I’ll try setting real resolution to 640x480 right now just to see what will happen.

ee_videowindow does not simply transform the image by moving it across. it instead sqaushes the image. NTSC widescreen appears to the tv as 720x480 but your tv is only showing a portion of it (about 610x405 pixels), the ee_videowindow command the squashes it 55 pixels from the left and 13 from the top. It’s this function which disrupts the display ratio somewhat if you are not taking into account preserving the 4:3 aspect ratio.

If it did not squash the image and simply moved it, the 640x480 display would be off-screen still except to the right, like your left problem your having.

If you set the resolution to other than cvbs dont forget to disable with # at the start or remove the ee_videowindow option in your emuelec.conf.

1 Like

I can confirm that setting internal and external resolutions to 640x480 did not fix the problem at all, and in fact appeared to have exactly the same result regardless of the presence of the ee_videowindow 10 5 command.

NTSC widescreen appears to the tv as 720x480 but your tv is only showing a portion of it (about 610x405 pixels

If I understand what you’re saying, the TV is actually “4:3” but due to the way it scans, the visible portion of the screen is 3:2, therefore rendering as 720x480, which is 3:2, is much closer to the actual shape of the visible screen?

I don’t understand why we are dealing with widescreen in any way, shape, or form, this is not a widescreen television and the original PSX content is certainly not widescreen either.

What is the point in rendering widescreen then squishing it into 4:3 when you can just render as 4:3 instead?

I suppose the options at this point are trying to find the exact render resolution that fits the TV, or squashing more accurately, as the previous sqaush was not enough and text at the bottom of the screen was visibly cut off still.

Is there any good reason not to render at very close to the visible resolution of the TV and just shift it into place without squishing?

You could try selecting 640x480 then:
echo “ee_videowindow=55 13 674 453” >> /emuelec/configs/emuelec.conf
I have no idea if this will work but it’s worth a try.

This doesn’t appear to have changed anything.

Is there not some setting to shift the picture?

check the /emuelec/configs/emuelec.conf file for lines that start with ee_videowindow, maybe you have another record which is overriding your other values you supply.
ee_videowindow you can transform the window without scaling by supplying 4 values. Hang on I just realized my values earlier were wrong, try:
echo “ee_videowindow=55 13 605 453” >> /emuelec/configs/emuelec.conf

edit: 3rd parameter changed.

What internal resolution are you expecting to have in order for this to work?

Mine is still set to 640x480 I think, and previously was set to 1280x960 by default.

It should be set to 640x480 or 480cvbs.

If you set it to “480cvbs” this is exactly what the default settings look like:

These latest settings you gave me to try have catastrophic problems with these default settings mentioned in the picture. With the 640x480 settings it didn’t appear to do anything. I’ll try reverting though just to be sure.

Setting all of those values back to 640x480 just went back to the default state where the picture is clearly shifted down and to the left.

emuelec-setup-guide.odt - OpenOffice Writer-2023-04-14 21_38_39

I suspect I changed the wrong values.

I think the script you are using has a bug in the way it uses those values.

If you want to change the internal resolution you should add the numbers in /storage/.config/cvbs_resolution.txt for example: “640 480”

Then if you want to shift or scale the screen use the ee_videowindow variable with 2 numbers for uniform shift and scaling (X,Y), or 4 digits for (X, Y, Width, Height). In /emuelec/configs/emuelec.conf:
If you supplied say:

ee_videowindow=40 0

That should shift the image right and preserve ratios, but you will have the bottom cropped and left and right possibly be cropped too. So you have to resize it and to preserve the ratio 4:3 what you do to the X-dimension you have to apply the same ratio to Y-dimension.

echo “ee_videowindow=55 21 609 457” >> /emuelec/configs/emuelec.conf

If I have done the math correct that should shift and preserve ratio, It is numerically impossible to shift the screen and have it fit exact in the screen and preserving ratio at the same time. Your welcome to adjust the values in ee_videowindow to try but I’m quite sure some stretching will occur or black borders to fit within the screen.

Dont change the values in setres.sh unless you know what your are doing.

Shouldn’t these two files directly contradict each other then? I don’t see why I shouldn’t just delete setres.sh if it is dictating contradictory settings. There’s no way it’s a good idea for setres.sh to be indicating internal res of 1280x960, scaled res of 720x480, and the other file to 640x480, then another scaling with videowindow.

Resetting setres.sh to default values, then putting 640 480 in the cvbs_resolution.txt file, with the ee_videowindow command you recommended, caused similar corruption seen above.

When you put setres.sh in /emuelec/bin it overrides the one provided by the system. You should change anything in setres.sh, it’s not designed to be editable to end users.
You should only be using cvbs_resolution.txt to change the internal resolution and ee_videowindow to make display adjustments and that is all.
I have no idea what you are doing or have done but if your getting a corrupt picture its the wrong thing.