Skip to content

Fix bezel aspect ratio when no game info is available - #17308

Open
Ravenforce wants to merge 1 commit into
batocera-linux:masterfrom
Ravenforce:fix/bezel-core-aspect-ratio-no-info
Open

Ravenforce wants to merge 1 commit into
batocera-linux:masterfrom
Ravenforce:fix/bezel-core-aspect-ratio-no-info

Conversation

@Ravenforce

Copy link
Copy Markdown

Problem

When using TheBezelProject decorations, the game viewport was incorrectly positioned and scaled within the bezel.

The issue was already present in Batocera 43.x and showed the same symptoms in Batocera 44.

During the initial work on Batocera 43.x, our investigation focused on resolving a separate controller-related issue. We subsequently moved directly to Batocera 44, where the bezel issue was investigated further.

Environment

  • Batocera 43.x and 44
  • Raspberry Pi 5 (8 GB)
  • RetroArch / libretro
  • TheBezelProject decorations
  • OpenGL and Vulkan tested

Troubleshooting

The following settings and configurations were investigated:

  • Integer scaling settings
  • Viewport bias adjustments
  • OpenGL rendering
  • Vulkan rendering

Switching between OpenGL and Vulkan did not resolve the issue.

Root cause

The issue was traced to write_bezel_config() in batocera_launch_libretro/emulator.py.

When shader_bezel is false, the current implementation unconditionally selects the custom aspect ratio.

However, a custom aspect ratio is not always required.

Fix

The aspect ratio is now selected based on whether bezel adaptation is required:

  • custom is used when bezel adaptation is necessary.
  • core is used when no bezel adaptation is necessary.

This uses the core-provided aspect ratio when no bezel adaptation is required, while retaining the custom aspect ratio when adaptation is needed.

Testing

The change was tested on a Raspberry Pi 5 running Batocera 44 with TheBezelProject decorations.

The game viewport is now correctly centered and scaled within the bezel.

The fix remains effective after reverting previously modified graphics and scaling settings.

Related issues

Similar viewport positioning and scaling problems have previously been reported:

These reports describe related symptoms, although the underlying causes are not necessarily identical.

This change addresses the aspect-ratio selection in Batocera's bezel configuration generation.

@dmanlfc

dmanlfc commented Nov 8, 2026 •

Copy link
Copy Markdown
Collaborator

looks ok but fails the ruff format checks - https://github.com/batocera-linux/batocera.linux/actions/runs/42508840269/job/128903965113?pr=17308 have your AI fix it ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants