libretro / libretro/RetroArch

[Bug] CRTSwitchRes: After exiting RetroArch, the resolution is set to 700×480 59.94Hz

Open
#10,854 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

switchres
Dominant language
C
Stars
14.1k
Forks
2.2k
Avg merge
7h 35m
Merged PRs (30d)
51

Description

Description

When exiting RetroArch in an Linux environment (e.g. Batocera distribution on X64) with CRTSwitchRes enabled, the resolution is set to 700x480px @59.94Hz. Especially when using another frontend like EmulationStation with a different resolution, maybe even with non-RetroArch emulators, this is annoying.

Expected behavior

When exiting RetroArch with CRTSwitchRes enabled, the resolution should be set to the resolution/refresh rate that was set before starting RetroArch.

Actual behavior

When exiting RetroArch with CRTSwitchRes enabled, the resolution is set to 700x480px @59.94Hz.

Steps to reproduce the bug
  1. Use a frontend like EmulationStation (e.g. by using RetroPie, Batocera etc.). Configure it so that it uses a resolution like 640x480@69.94Hz interlaced or 768x576@50Hz interlace (standard CRT TV resolution). Check if it is really enabled with xrandr.
  2. Start RetroArch with any game/core that does not use the standard resolution (e.g. NES, SNES, PSX).
  3. In the video settings, enable CRTSwitchRes (in my case "native", 15kHz)
  4. Exit RetroArch.
  5. Use xrandr to check the current resolution.
Bisect Results

The appropriate lines in the source code might be in gfx\display_servers\dispserv_x11.c, starting with line 104:
#ifdef HAVE_XRANDR if (crt_en) { snprintf(xrandr, sizeof(xrandr), "xrandr --newmode 700x480_59.94 13.849698 700 742 801 867 480 490 496 533 interlace -hsync -vsync"); system(xrandr); ...

Version/Commit
  • Git version: 1661b2ea6c
Environment information
  • OS: Batocera.linux 5.26, x64 version
  • X environment

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in gfx/display_servers/dispserv_x11.c around line 104, focusing on the HAVE_XRANDR and CRTSwitchRes handling shown in the report. Reproduce the issue with xrandr using the listed frontend and CRT resolutions; done means exiting RetroArch restores the resolution and refresh rate that were active before launch.

Written by the indexing model from the issue text.

Assessment

Tech stack
c, linux
Domain
desktop, operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.