[Bug] CRTSwitchRes: After exiting RetroArch, the resolution is set to 700×480 59.94Hz
Nobody has claimed this yet.
- 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
- 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.
- Start RetroArch with any game/core that does not use the standard resolution (e.g. NES, SNES, PSX).
- In the video settings, enable CRTSwitchRes (in my case "native", 15kHz)
- Exit RetroArch.
- 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
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- 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