This is an old revision of the document!

Older 8-bit and 16bit systems, or arcade systems from the 80s and 90s were using 4:3 CRT screens. Modern displays are now 16:9 or wider, and can go up to 4K, i.e. 2160 pixels high (compared to 480 or 546 at the time!).

Having so many pixels to render on the screen is impactful on the system performance. When you have a 4K screen or an ultra-wide screen, Batocera will limit the resolution by default to HD 1920×1080. It's more than enough to render emulators, even the most recent one. However, when you have an ultra-wide monitor, display is stretched.

For 4K monitors, because the resolution is by default resized to 1920×1080, you might see a screen that looks like this one - actually it's what 1920×1080 is, centered in a 3840×2160 screen:

In order to cover the whole screen, the best solution is to set the VIDEO MODE to 1920×1080 – you can do that on a system-by-system basis in the PER SYSTEM ADVANCED CONFIGURATION screen.

Another use case is when you have a 1280×720 TV, for example, and you want to use bezels that are designed for 1920×1080. Batocera 5.27 can automatically resize the bezels, but sometimes you need to force the VIDEO MODE to take your 1280×720 resolution.

If you absolutely want to use the 4K resolution for whatever reason (shaders looking better, you have a non-standard wide format on your TV/monitor…), you can force the STRETCH BEZEL option too. Same thing, this is something you can do on a system-by-system basis. WARNING this has an impact on the emulation performance.

You can do it though ES as shown above, but you can also tweak your system with batocera.conf to make the aspect ratio better.

1. Know what are the resolutions available on your system + TV combination by entering the command batocera-resolution listModes:

 # batocera-resolution listModes
 0:2560x1440 60Hz
 1:2560x1080 60Hz
 2:1920x1080 60Hz
 3:1920x1080 60Hz
 4:1920x1080 60Hz
 5:1920x1080 60Hz
 6:1920x1080 60Hz
 7:1920x1080 50Hz
 8:1920x1080 50Hz
 9:1680x1050 60Hz
 10:1600x900 60Hz
 11:1280x1024 75Hz
 12:1280x1024 60Hz
 13:1440x900 60Hz
 14:1280x720 60Hz
 15:1280x720 60Hz
 16:1280x720 50Hz
 17:1024x768 75Hz
 18:1024x768 60Hz
 19:800x600 75Hz
 20:800x600 72Hz
 21:800x600 60Hz
 22:720x576 50Hz
 23:720x576 50Hz
 24:720x480 60Hz
 25:720x480 60Hz
 26:720x480 60Hz
 27:720x480 60Hz
 28:640x480 75Hz
 29:640x480 60Hz
 30:640x480 60Hz
 31:720x400 70Hz

2. Then, choose the mode from the list that is the one you want to force to RetroArch. For example, if I want to force 2560×1080 for the emulators, I can add in my batocera.conf:


Emulators will then all select mode 1 = 2560×1080 from the list above as their screen resolution. If I want to select a specific resolution only for a specific emulator, I can do that with for instance n64.videomode=1.

Batocera 5.27 and later will automatically resize 1920×1080 bezels to ultrawide by adding black borders on the sides. It will also resize full HD 1080 bezels to HD-ready 720p.

3. EmulationStation ignores this parameter. If you want to put ES in a specific resolution, you need to edit /etc/init.d/S31emulationstation and add the wanted resolution to the command line:

 HOME=/userdata/system LANG="${settings_lang}.UTF-8" SDL_NOMOUSE=1 /usr/bin/emulationstation --no-splash --resolution 2560 1080 &

Don't forget to batocera-save-overlay to keep it upon reboot.

4. If you ask for a 4K 3840×2160 resolution, but with a bezel that is HD 1920×1080, by default Batocera will add black borders around the bezel. If you want your display to be full screen, you can either:

  1. switch to a lower resolution (like 1920×1080)
  2. add a line mame.bezel_stretch=1 in your batocera.conf for each emulator you want to stretch. Or global.bezel_stretch=1 if you want to enable stretching to your native 4K resolution. WARNING this has an impact on the emulation performance.

This section is for PC x86 and x86_64, not for SBCs like Raspberry Pi or Odroid.

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:

# 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.1602696591.txt.gz
  • Last modified: 7 months ago
  • by lbrpdx