User Tools

Site Tools


Display issues, where xrandr is your friend

This tutorial is usefull if you have display issues, if you need to rotate your screen, or anything else.

For example, I have a 4k FHD TV, Batocera will display the highest display resolution avaliable on your screen, but 4k isn't good emulation, it's lagging, so I need to reduce the resolution.

First of all, you need to connect on your Batocera through SSH, let's use Putty for this !
You can find a “How to” by following this link.

Okay, now you're connected on your Batocera, let's begin.

$ cp /etc/X11/xinit/xinitrc ~/.xinitrc
$ export DISPLAY=:0.0
$ xrandr

Search this section on xrandr :

Screen 0: minimum 8 x 8, current 1366 x 768, maximum 32767 x 32767
LVDS1 connected primary 1366x768+0+0 (normal left inverted right x axis y axis) 290mm x 160mm
1366x768 60.03*+ 40.03
1024x768 60.00
1024x576 60.00
960x540 60.00
800x600 60.32 56.25
864x486 60.00
640x480 59.94 

Here's the avaliable display resolution for your screen. This is an example with an old 4/3 screen, but this is the same.
Where is the “ * ” is the actual resolution, I want to change it, so let's use the vi :

$ vi ~/.xinitrc

And add this : “xrandr -s displayxresolution” under the “${settings_output}”,

/recalbox/scripts/ setoutput "${settings_output}"

xrandr -s 640x480

Let's save and quit.
Actually, your Batocera's display isn't in full screen, you must see it partially, so, write this on the SSH :

$ exec emulationstation --windowed

Then reboot Emulstation :

$ /etc/init.d/S31emulationstation stop
$ /etc/init.d/S31emulationstation start

Batocera should be in full screen with the right resolution.
/!\ BUT /!\ If you reboot the Batocera, you'll have to do this again, the resolution is forced just for this boot, next boot, resolution will be reset to the highest avaliable.
We need to force it everytime, at every boot.
If you see the beginning of this tuto, we've copied the xinitrc file to a temporary folder.
But we need to erase the actual xinitrc with our modified file, this is the same as the first code, but in reverse :

$ cp ~/.xinitrc /etc/X11/xinit/xinitrc

Now, reboot your Batocera, the display resolution should good.
But xrandr can do screen rotation too, very usefull for old arcade machines integration !

Hope this was easy for all.

en/display_issues.txt · Last modified: 2018/06/07 15:04 by dindon