Batocera.linux - Wiki

Only Cores That Matter

User Tools

Site Tools


display_issues

Display issues, where xrandr is your friend

This section is for PC x86 and x86_64.

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

For example, I have a 4k UHD TV, Batocera will display the highest display resolution available on my screen, but 4k isn't good for emulation: it's lagging. So, I need to force a smaller resolution.

First of all, you need to connect on your Batocera through SSH. 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

If you have an error message telling you “can't open display :0.0”, you need to physically log onto your Batocera system with the graphic display on. On a PC from EmulationStation, press F1 and then launch a terminal from there (F4).

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 available display resolution for your screen. This is an example with an old 4/3 screen, but this is the same principle for other screens.
The current resolution is marked with a “ * ”. I want to change it, so let's use vi - or any other text editor you are familiar with :

# vi ~/.xinitrc

You'll see a section with:

#####################
## CUSTOMISATIONS ###
# to customize your display, you can copy this file to ~/.xinitrc and then modify it

# rotate the screen
# xrandr -o left
# xrandr -o right
# xrandr -o inverted

# change the resolution
# xrandr -s 640x480

# change the resolution and the Hz
# xrandr -s 640x480 -r 60

#####################
#####################

Just uncomment the corresponding line. In my case, I want to force the 64×480 mode, so I just remove the first # character to:

...
# change the resolution
xrandr -s 640x480

# change the resolution and the Hz
...

Let's save and quit ([Esc]:wq for vi).
Actually, your Batocera's display isn't in full screen yet. You must see it only partially, so you have to enter the following commands into your SSH session:

# exec emulationstation --windowed

Then restart 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 system, you'll have to do this again, the resolution is forced just for this boot, next boot, resolution will be reset to the highest available again.
We need to force it for every boot.
As you can see at the beginning of this tutorial, we copied the xinitrc file to a temporary folder.
We need to erase the current xinitrc file with our modified version. It is the same as the first code block, but reversed:

# cp ~/.xinitrc /etc/X11/xinit/xinitrc
# batocera-save-overlay

Now, reboot your Batocera system, the display resolution should be good.
Also, xrandr can do screen rotation: very useful for old vertical screen arcade machines !

Hope this was easy for all.

display_issues.txt · Last modified: 2020/03/30 00:54 by lbrpdx