# EmuELEC 4.3 1280x800 overscan

**URL:** <https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078>\
**Category:** General\
**Created:** [April 12, 2022, 5:46pm UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078 "2022-04-12T17:46:10Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![octopusgreen](https://avatars.discourse-cdn.com/v4/letter/o/22d042/32.png) [@octopusgreen](https://emuelec.discourse.group/u/octopusgreen)\
**Post date:** [April 12, 2022, 5:46pm UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/1 "2022-04-12T17:46:10Z")

</div>

Hi everyone  
my setup specs  
device: WeTek Play 2  
cpu model: amlogic s905h rev c  
EmuELEC version: EmuELEC-Amlogic.aarch64-4.3-Generic.img  
monitor: eyoyo 16:10 inch LCD monitor 1280x800  
i could tell the image is cut off on the top and not looking right.  
i went into the emuelec.conf file and changed the

## Set video mode ee\_videomode=1080p60hz

to

## Set video mode ee\_videomode=1280x800p60hz

hoping that would fix the problem but it is still the same overscan screen  
any help would be greatly appreciated thank you everyone.

---

<div class="post-metadata">

**Author:** ![octopusgreen](https://avatars.discourse-cdn.com/v4/letter/o/22d042/32.png) [@octopusgreen](https://emuelec.discourse.group/u/octopusgreen)\
**Post date:** [April 14, 2022, 1:21am UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/2 "2022-04-14T01:21:19Z")

</div>

Udate i found a post on  
[Screen overscan · Issue #145 · EmuELEC/EmuELEC · GitHub](https://github.com/EmuELEC/EmuELEC/issues/145#issuecomment-602711944)  
so i launched terminal and put in these lines  
fbset -fb /dev/fb0 -g 1280 800 1280 1600 32  
echo 0 0 1279 799 \> /sys/class/graphics/fb0/free\_scale\_axis  
echo 45 25 1235 775 \> /sys/class/graphics/fb0/window\_axis  
echo 0x10001 \> /sys/class/graphics/fb0/free\_scale  
and after i put in them lines the overscan is gone in the terminal the screen is perfect.  
but when i exit the terminal the overscan comes back.  
i do not know how to save the settings to keep the changes.  
the post has 4 steps i can only understand 2 out of 4.  
and i cannot find the setres.sh file in emuelec on winscp.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [April 19, 2022, 1:52pm UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/3 "2022-04-19T13:52:08Z")

</div>

SSH in, Copy the setres.sh to /emuelec/bin:  
cp /usr/bin/setres.sh /emuelec/bin  
Then modify the file to include the custom resolution.

---

<div class="post-metadata">

**Author:** ![octopusgreen](https://avatars.discourse-cdn.com/v4/letter/o/22d042/32.png) [@octopusgreen](https://emuelec.discourse.group/u/octopusgreen)\
**Post date:** [April 19, 2022, 5:04pm UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/4 "2022-04-19T17:04:44Z")

</div>

Thank you so much Langerz82 for helping me. i am new to the hole inner workings of emuelec.  
i have tried what you said about copying the setres.sh file from /usr/bin to /emuelec/bin and  
modifying it with the lines i used in the terminal but its not working and l don’t think i’m doing it right

#!/bin/sh

# SPDX-License-Identifier: GPL-2.0-or-later

# Copyright (C) 2019-present Shanti Gilbert ([shantigilbert · GitHub](https://github.com/shantigilbert))

# Read the video output mode and set it for emuelec to avoid video flicking.

# This file sets the hdmi output and frame buffer to the argument in pixel width.

# Allowed argument example ./setres.sh 1080p60hz ← For height 1080 pixels.

# set -x #echo on

# 1080p60hz

# 1080i60hz

# 720p60hz

# 720p50hz

# 480p60hz

# 480cvbs

# 576p50hz

# 1080p50hz

# 1080i50hz

# 576cvbs

# arg1, 1 = Hides, 0 = Show.

show\_buffer ()  
{  
echo $1 \> /sys/class/graphics/fb0/blank  
echo $1 \> /sys/class/graphics/fb1/blank  
}

blank\_buffer()  
{

# Blank the buffer.

dd if=/dev/zero of=/dev/fb0 bs=12M \> /dev/null 2\>&1  
}

BPP=32  
HZ=60

MODE=$1  
CUR\_MODE=`cat /sys/class/display/mode`;

# If the current display is the same as the change just exit.

[-z “$MODE”] && exit 0;  
[[$MODE == “auto”]] && exit 0;

# Removed because if try to set invalid video mode it becomes a valid MODE

# in display/mode and then when trying to revert back this becomes true exiting.

#[[“$MODE” == “$CUR\_MODE”]] && exit 0;

if [[! “$MODE” == _“x”_]]; then  
case $MODE in  
_p_) H=$(echo $MODE | cut -d’p’ -f 1) ;;  
_i_) H=$(echo $MODE | cut -d’i’ -f 1) ;;  
_cvbs_) H=$(echo $MODE | cut -d’c’ -f 1) ;;  
esac  
fi

HZ=${MODE:(-4):2}  
if [[! -n “$HZ”]] || [[$HZ -eq 50]]; then  
HZ=60  
fi

# hides buffer

show\_buffer 1

case $MODE in  
480p_hz|480i_hz|576p_hz|720p_hz|1080p_hz|1440p_hz|2160p_hz|576i_hz|720i_hz|1080i_hz|1440i_hz|2160i_hz)  
W=$(($H_16/9))  
[[“$MODE” == “480”_]] && W=854  
DH=$(($H_2))  
W1=$(($W-1))  
H1=$(($H-1))  
fbset -fb /dev/fb0 -g $W $H $W $DH $BPP  
fbset -fb /dev/fb1 -g $BPP $BPP $BPP $BPP $BPP  
echo $MODE \> /sys/class/display/mode  
echo 0 \> /sys/class/graphics/fb0/free\_scale  
echo 1 \> /sys/class/graphics/fb0/freescale\_mode  
echo 0 0 $W1 $H1 \> /sys/class/graphics/fb0/free\_scale\_axis  
echo 0 0 $W1 $H1 \> /sys/class/graphics/fb0/window\_axis  
echo 0 \> /sys/class/graphics/fb1/free\_scale  
;;  
480cvbs)  
fbset -fb /dev/fb0 -g 1280 960 1280 1920 $BPP  
fbset -fb /dev/fb1 -g $BPP $BPP $BPP $BPP $BPP  
echo 0 0 1279 959 \> /sys/class/graphics/fb0/free\_scale\_axis  
echo 30 10 669 469 \> /sys/class/graphics/fb0/window\_axis  
echo 640 \> /sys/class/graphics/fb0/scale\_width  
echo 480 \> /sys/class/graphics/fb0/scale\_height  
echo 0x10001 \> /sys/class/graphics/fb0/free\_scale  
;;  
576cvbs)  
fbset -fb /dev/fb0 -g 1280 960 1280 1920 $BPP  
fbset -fb /dev/fb1 -g $BPP $BPP $BPP $BPP $BPP  
echo 0 0 1279 959 \> /sys/class/graphics/fb0/free\_scale\_axis  
echo 35 20 680 565 \> /sys/class/graphics/fb0/window\_axis  
echo 720 \> /sys/class/graphics/fb0/scale\_width  
echo 576 \> /sys/class/graphics/fb0/scale\_height  
echo 0x10001 \> /sys/class/graphics/fb0/free\_scale  
;;  
1280x800p60hz)  
fbset -fb /dev/fb0 -g 1280 800 1280 1600 32  
echo 0 0 1279 799 \> /sys/class/graphics/fb0/free\_scale\_axis  
echo 45 25 1235 775 \> /sys/class/graphics/fb0/window\_axis  
echo 0x10001 \> /sys/class/graphics/fb0/free\_scale  
;;  
 x)  
W=$(echo $MODE | cut -d’x’ -f 1)  
H=$(echo $MODE | cut -d’x’ -f 2 | cut -d’p’ -f 1)  
[! -n “$H”] && H=$(echo $MODE | cut -d’x’ -f 2 | cut -d’i’ -f 1)  
if [-n “$W”] && [-n “$H”]; then  
DH=$(($H_2))  
W1=$(($W-1))  
H1=$(($H-1))  
fbset -fb /dev/fb0 -g $W $H $W $DH $BPP  
fbset -fb /dev/fb1 -g $BPP $BPP $BPP $BPP $BPP

# [[“$MODE” = “720x480p”\*]] && MODE=$(echo “${H}p${HZ}hz”)

```
	echo $MODE > /sys/class/display/mode
	echo 0 > /sys/class/graphics/fb0/free_scale
	echo 1 > /sys/class/graphics/fb0/freescale_mode
	echo 0 0 $W1 $H1 > /sys/class/graphics/fb0/free_scale_axis
	echo 0 0 $W1 $H1 > /sys/class/graphics/fb0/window_axis
	echo 0 > /sys/class/graphics/fb1/free_scale      
fi
;;

```

esac

blank\_buffer

# shows buffer

show\_buffer 0

# End of reading the video output mode and setting it for emuelec to avoid video flicking.

# The codes can be simplified with “elseif” sentences.

# The codes for 480I and 576I are adjusted to avoid overscan.

# Forece 720p50hz to 720p60hz and 1080i/p60hz to 1080i/p60hz since 50hz would make video very choppy.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [April 20, 2022, 7:12am UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/5 "2022-04-20T07:12:54Z")

</div>

Also make sure you set 1280x800p60hz in the emuelec video settings (you might have to apply a custom setting), or for the emulator select native video and 1280x800p60hz if it’s there or just auto will use the emuelec setting.

Also paste the modified setres.sh file here:  
[https://gist.github.com/](https://gist.github.com/)  
and provide the link as the nested code seems to be breaking.

---

<div class="post-metadata">

**Author:** ![octopusgreen](https://avatars.discourse-cdn.com/v4/letter/o/22d042/32.png) [@octopusgreen](https://emuelec.discourse.group/u/octopusgreen)\
**Post date:** [April 20, 2022, 11:06am UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/6 "2022-04-20T11:06:16Z")

</div>

I pasted the modified file [emuelec 4.3 modified file · GitHub](https://gist.github.com/octopusgreen/d64b4f7461778592541353fc4196567e)  
I made a custom file in /usr/config/ called EE\_VIDEO\_MODE and inside of it i put 1280x800p60hz  
and also in /storage/.config/emuelec/configs file emuelec.confg i replaced

## Set video mode

ee\_videomode=1080p60hz  
to

## Set video mode

ee\_videomode=1280x800p60hz  
and auto is set for all emulators.  
Again thank you so much for helping me out Langerz82.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [April 20, 2022, 1:33pm UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/7 "2022-04-20T13:33:41Z")

</div>

Maybe just also have in your code:

```auto
  1280x800p60hz)              
        fbset -fb /dev/fb0 -g 1280 800 1280 1600 32 
        echo 0 0 1279 799 > /sys/class/graphics/fb0/free_scale_axis
        echo 45 25 1235 775 > /sys/class/graphics/fb0/window_axis
	echo 1200 > /sys/class/graphics/fb0/scale_width
	echo 800 > /sys/class/graphics/fb0/scale_height
        echo 0x10001 > /sys/class/graphics/fb0/free_scale
        ;;  

```

I think that should be all. Oh hang on 4.3 might have the PATH order mixed up as there was a patch done to re-order it.  
If you do: echo $PATH  
it should be:

```auto
/emuelec/scripts:/emuelec/bin:/usr/bin/batocera:/storage/roms/bios/jdk/bin/:/usr/bin:/usr/sbin

```

If emuelec/bin isnt before /usr/bin then in you will have to modify the 99-emuelec.conf in the source and re-build to have near the top:

```auto
export PATH="/emuelec/scripts:/emuelec/bin:/usr/bin/batocera:/storage/roms/bios/jdk/bin/:$PATH"

```

---

<div class="post-metadata">

**Author:** ![octopusgreen](https://avatars.discourse-cdn.com/v4/letter/o/22d042/32.png) [@octopusgreen](https://emuelec.discourse.group/u/octopusgreen)\
**Post date:** [April 20, 2022, 3:19pm UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/8 "2022-04-20T15:19:51Z")

</div>

I put in the code you sent me in the modified setres.sh file  
1280x800p60hz)  
fbset -fb /dev/fb0 -g 1280 800 1280 1600 32  
echo 0 0 1279 799 \> /sys/class/graphics/fb0/free\_scale\_axis  
echo 45 25 1235 775 \> /sys/class/graphics/fb0/window\_axis  
echo 1200 \> /sys/class/graphics/fb0/scale\_width  
echo 800 \> /sys/class/graphics/fb0/scale\_height  
echo 0x10001 \> /sys/class/graphics/fb0/free\_scale  
;;  
But no change.  
I did the echo $PATH code in the terminal and this is that it showed  
/emuelec/scripts:/emuelec/bin:/usr/bin/batocera:/usr/bin:/usr/sbin

---

<div class="post-metadata">

**Author:** ![octopusgreen](https://avatars.discourse-cdn.com/v4/letter/o/22d042/32.png) [@octopusgreen](https://emuelec.discourse.group/u/octopusgreen)\
**Post date:** [April 21, 2022, 10:13am UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/9 "2022-04-21T10:13:57Z")

</div>

Big update it did work! The code you posted Langerz82 that i put into the modified setres.sh file  
Then dropped that file in emuelec/bin thru using ssh worked but i I didn’t see the changes until i went into something like a game or the terminal and then existed back to the main screen of emuelec then the overscan was gone.The screen  
stays normal untill i shutdown emuelec and when start emuelec back up the overscan comes back so  
I just need to into a game or the terminal again exit and its fixed. I’m Super happy it’s fixed i only i have to do that little thing to fix the overscan no biggie.  
Thank you emuelec.discourse.group and thank you  
Langerz82.

---

<div class="post-metadata">

**Author:** ![EmuELEC](https://yyz2.discourse-cdn.com/free1/user_avatar/emuelec.discourse.group/emuelec/32/26_2.png) [@EmuELEC](https://emuelec.discourse.group/u/EmuELEC)\
**Post date:** [April 21, 2022, 3:37pm UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/10 "2022-04-21T15:37:29Z")

</div>

You can edit `/storage/.config/custom_start.sh` and add your commands there

---

<div class="post-metadata">

**Author:** ![octopusgreen](https://avatars.discourse-cdn.com/v4/letter/o/22d042/32.png) [@octopusgreen](https://emuelec.discourse.group/u/octopusgreen)\
**Post date:** [April 22, 2022, 10:32am UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/11 "2022-04-22T10:32:43Z")

</div>

I ssh into /storage/.config/custom\_start.sh and under the text where it says

# Any commands that you want to run before the frontend begins should go here

i put in this code

1280x800p60hz)  
fbset -fb /dev/fb0 -g 1280 800 1280 1600 32  
echo 0 0 1279 799 \> /sys/class/graphics/fb0/free\_scale\_axis  
echo 5 35 1275 785 \> /sys/class/graphics/fb0/window\_axis  
echo 1200 \> /sys/class/graphics/fb0/scale\_width  
echo 800 \> /sys/class/graphics/fb0/scale\_height  
echo 0x10001 \> /sys/class/graphics/fb0/free\_scale  
;;  
and saved it and restarted emuelec but the code didn’t change the resolution.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [April 22, 2022, 3:36pm UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/12 "2022-04-22T15:36:12Z")

</div>

lol no:  
try first setting the custom res by doing in ssh:

```auto
echo 1280x800p60hz > /storage/.config/EE_VIDEO_MODE

```

clear the contents of custom\_start.sh and just add:

```auto
/emuelec/bin/setres.sh $(cat /storage/.config/EE_VIDEO_MODE)

```

and that should switch to that res on startup. If in future you want to change resolutions edit the EE\_VIDEO\_MODE file for your other resolution.

---

<div class="post-metadata">

**Author:** ![Langerz82](https://avatars.discourse-cdn.com/v4/letter/l/bc79bd/32.png) [@Langerz82](https://emuelec.discourse.group/u/Langerz82)\
**Post date:** [April 23, 2022, 2:07am UTC](https://emuelec.discourse.group/t/emuelec-4-3-1280x800-overscan/1078/13 "2022-04-23T02:07:50Z")

</div>

sorry I should have said you also need the correct headers in your custom\_start.sh file.  
So you could either have in /storage/.config/custom\_start.sh file:

```auto
#!/bin/sh

/emuelec/bin/setres.sh $(cat /storage/.config/EE_VIDEO_MODE)

```

or alternatively if you want to use the Emuelec setting ee\_videomode in emuelec.conf:

```auto
#!/bin/sh

# load the profile script.
. /etc/profile

/emuelec/bin/setres.sh $(get_ee_setting ee_videomode)

```

All the best and good luck. ^-^
