RetroArch
RetroArch copied to clipboard
Retroarch ignoring root directory switchres.ini
Description
switchres.ini files only work as core overrides, the contents of the root directory ini file is ignored completely and treated as default values (arcade_15).
Expected behavior
The root directory switchres.ini (placed in the same folder as retroarch.exe) should produce proper results when modified if no core override INI file exists.
Actual behavior
Changes to the root directory switchres.ini make no difference.
Steps to reproduce the bug
- have a properly functioning CRT setup with CRTEmuDriver and a card that supports it
- create a switchres.ini and place it in the RA root directory, edit a value such as h_shift
- enable INI mode for switchres and restart retroarch, see no changes to the h_shift
- create a corename.switchres.ini override with an edited h_shift
- run a game on the core, see that h_shift now produces effects
I stumbled upon this after struggling to create custom crt_range for my television set and having VMM produce proper modelines but having RetroArch generate nothing but the default arcade_15 preset modelines. I then created an override switchres file for cores and finally RA began producing modelines consistent with VMM. Because I plan on using the same settings for most cores, having to create an override file for each core is less ideal than being able to use one main switchres.ini to handle everything I don't wish to override.
Bisect Results
I haven't tested with previous versions, so I don't know if this behavior was ever consistent with my expectations, maybe I'm misunderstanding how the main .ini file setup works on Windows or it's just still in early stages of implementation.
Version/Commit
- RetroArch: 1.19.1
Environment information
- OS: windows 10 64
Also, strangely, override corename.switchres.ini files work when a display is connected through a card with CRTEmudriver even when no root-directory INI file exists; a display connected through the main card requires both the root-directory INI file (in order to work at all) and the override INI (in order to work properly).
@alphanu1 @substring Might have some feedback, thank you ;)
There is also this bug where it should look for the file in \ini\ but it doesn't
Taken from swichres readme file
switchres GitHub *A default switchres.ini file will be searched in the current working directory, then in .\ini on Windows, ./ini then /etc on Linux. *
It definitely requires an .ini file in the root directory at least for my DOS mode switchres to work. Changes to that INI file don't make any difference but the contents of the file still matter because I tried blanking it out and it failed to function when I did.
The whole thing is really tricky at the moment and it's almost a miracle that I have it working at all but I'm glad that I do because having it working is amazing.
Windows 😒 I don't have a windows CRT setup, but I'll do my best.
Could it be that it's just the monitor definition that is not loaded from the .ini in the root dir ?
rgui Main Menu->Settings->Video->CRT SwitchRes
CRT SwitchRes: INI CRT Super Resolution: Native
Retroarch.cfg
crt_switch_resolution = "4"
crt_switch_resolution_super = "0"
With switchres.ini file not present in the root of the Retroarch folder
INFO] [CRT]: Requested Resolution: [email protected] orientation: normal
[INFO] [CRT] Video context is: wgl
[INFO] [CRT]: Current running core FCEUmm
[DEBUG] 256x224 rotation: 0 rotated: 0 core rotation:0
[INFO] Switchres: Calculating best video mode for [email protected] orientation: normal
[INFO] Switchres: Modeline "800x480_60i 15.656005KHz 60.099827Hz" 16.266589 800 833 909 1039 480 483 489 521 interlace -hsync -vsync
[INFO] set_desktop_mode: \\.\DISPLAY20 (800x480@60) flags(2)
[INFO] sr_set_mode: successfully switched to [email protected]
[INFO] [CRT]: Setting Aspect Ratio: 1.714286
[INFO] [CRT]: Setting Video Screen Size to: 768x448
[INFO] [Video]: Video refresh rate changed to 60.100 Hz.
Symbolic soft link from C:\ini\switchres.ini to the root of the Retroarch folder.
INFO] [CRT]: Requested Resolution: [email protected] orientation: normal
[INFO] [CRT] Video context is: (null)
[INFO] [CRT]: Current running core FCEUmm
[DEBUG] 256x224 rotation: 0 rotated: 0 core rotation:0
[INFO] Switchres: Calculating best video mode for [email protected] orientation: normal
[INFO] Switchres: Modeline "256x224_60 15.625955KHz 60.099827Hz" 5.172191 256 266 290 331 224 233 236 260 -hsync -vsync
[INFO] set_desktop_mode: \\.\DISPLAY20 (256x224@60) flags(0)
[INFO] sr_set_mode: successfully switched to [email protected]
[INFO] [CRT]: Setting Aspect Ratio: 1.142857
[INFO] [CRT]: Setting Video Screen Size to: 256x224
[INFO] [Video]: Video refresh rate changed to 60.100 Hz.
The ini file should be searched for first in \ini\ but it completely ignores this.
According to Switchres it should search for the file ini file:
A default switchres.ini file will be searched in the current working directory, then in .\ini on Windows, ./ini then /etc on Linux
So If there is no ini file in the RA root folder RA or an override folder it should search for the file in \ini\
But it doesn't...
This is how it works on Linux so shouldn't it be the same on windows? Better to have one main ini file instead of the same file spread across multiple directories.
Lately some people reported the same problem ... only to find out that their current working directory wasn't the one of the Retroarch .exe. Could this be checked and confirm if it fixes (or not) this issue ?
Lately some people reported the same problem ... only to find out that their current working directory wasn't the one of the Retroarch .exe. Could this be checked and confirm if it fixes (or not) this issue ?
The last time I checked, you have to have a switchres.ini file in the root directory ~but the contents don't matter~. In order for switchres to produce functional results, you need to use the subdirectory method IN ADDITION to having that file. It's an incomprehensible bug.
Edit: See previous post:
It definitely requires an .ini file in the root directory at least for my DOS mode switchres to work. Changes to that INI file don't make any difference but the contents of the file still matter because I tried blanking it out and it failed to function when I did.
Well, making sure that the conditions to have the switchres.ini alongside with retroarch.exe are here is still required + have CWD being the .exe folder, I'd appreciate a test and report :)
- have CWD being the .exe folder
I have no idea what you're referencing.
CWD = current working directory. If you're launching RA through a bat file, the working directory may not be set to the retroarch.exe folder, and rather to the bat file dir. In other words, switchres will look in the current folder for a switchres.ini, and not try to find the .exe path and then look for a .ini there.
To test it an easy way: just open the explorer, browse to the retroarch.exe directory, double-click on it, then start a rom. And confirm (or not) that the switchres.ini sitting next to retroarch.exe is read.
Ah. I hate when programs rely on that method, but I haven't tried it with Retroarch AFAIK. Any automation I do, I usually make sure that the working directory is the same as the program being launched, but yeah different programs act weird if you don't specify that.
Either way, Retroarch doesn't actually follow the directions in the rootdir switchres.ini, at least as far as my own testing has gone. But it needs that file and its contents to be there.
Well, without proper tests the way I asked, we're just chit-chatting and going in circle, can't investigate further. Anyway, log verbosity must be set to maximum in Retroarch and vesbosity set to 3 in switchres.ini
All of my tests have been done with the Retroarch root folder being the working directory. I will attempt to reproduce the issue with logs, thank you for the suggestion.
For some reason the .ini simply isn't read at all now, root, /ini/, /config/core/gamename.switchres.ini
It was working a couple of weeks ago but in a broken fashion (loading sometimes if you had loaded something else with a switchres.ini first or something like that) CRT switchres mode is set to 4 (INI) in retroarch.cfg like usual, I tested without the /ini/ switchres present too, with and without a corename.switchres.ini present as well. No difference.
It's as if there's no switchres.ini reading at all right now, it just does the usual 15kHz function to switch res, which works, but limits your customizability you had with .ini for exceptions where you wanted to do something very custom.
Edit: Upon further testing, corename.switchres.ini is read, but never gamename.switchres.ini, regardless of there being a root switchres.ini or corename.switchres.ini or not, gamename.switchres.ini is never read for any core, triple checked the name to match the gamename for the .cfg and romfile name to be absolutely sure.
CRT switchres mode is set to 4 (INI) in retroarch.cfg like usual, I tested without the /ini/ switchres present too, with and without a corename.switchres.ini present as well. No difference.
I'm still using 1.19, so I have no idea if 1.20 changed anything, but...
My method is to keep switchres off in the main retroarch.cfg and include system-specific CFG files alongside the system-specific INI files that turn it on. Attempting to start retroarch in switchres mode just screws everything up.
System specific config example:
crt_switch_resolution = "4"
crt_switch_resolution_super = "0"
aspect_ratio_index = "24"
video_scale_integer = "true"
It's also good practice to back up your retroarch.cfg file once you have a setup that works. I go a step further and make sure I have to manually save changes to it instead of having it saved on close.
logs gentlemen please, logs ... That is most possible verbose logs from Retroarch and, when switchres.ini is read, set its verbosity to 3
CRT switchres mode is set to 4 (INI) in retroarch.cfg like usual, I tested without the /ini/ switchres present too, with and without a corename.switchres.ini present as well. No difference.
I'm still using 1.19, so I have no idea if 1.20 changed anything, but...
My method is to keep switchres off in the main retroarch.cfg and include system-specific CFG files alongside the system-specific INI files that turn it on. Attempting to start retroarch in switchres mode just screws everything up.
System specific config example:
crt_switch_resolution = "4" crt_switch_resolution_super = "0" aspect_ratio_index = "24" video_scale_integer = "true"It's also good practice to back up your retroarch.cfg file once you have a setup that works. I go a step further and make sure I have to manually save changes to it instead of having it saved on close.
Ah, will give this a go today, that makes sense, root switchres and no core startup switchres being the culprits the screws up every switchres above that.
I already do have backup copies handy : D but I'm familiar with all the retroarch.cfg options at this point from all the years using it and fine tuning things, testing for input lag with slowmo recordings, different hardware setups, input devices and such.
@substring Log doesn't help here from what I've checked, when it works like with Flycast.switchres.ini it'll simply show that it loaded it in the log, when there's a gamename.switchres.ini file above it that it should load nothing changes, it just loads Flycast.switchres.ini as if nothing failed.
[INFO] [CRT]: Loading switchres.ini core override file from F:\RetroArchNewAstroCity\config\MAME\MAME.switchres.ini [INFO] [CRT]: Loading switchres.ini content directory override file from F:\RetroArchNewAstroCity\config\MAME\mame.switchres.ini
In both cases.
I'd appreciate you don't trim the logs since you don't know what I'm looking for ;) I really need a complete debug log
I'd appreciate you don't trim the logs since you don't know what I'm looking for ;) I really need a complete debug log
Yeah I know, I hope this helps somehow (linked further down), but there's not much is happening there. I just tested 720 (720.switchres.ini which has the user mode set to 2560x480, forced it to 480 as I lack midres with my current chassis). Loads MAME.switchres.ini then it tries to load a mame.switchres.ini content directory one for some reason (that isn't there). The only switchres files in there are roms/MAME/MAME.switchres.ini, roms/MAME/720.switchres.ini and roms/MAME/spacefb.switchres.ini (set to 2560x480 too just as a test), all named as their respective .cfg/.opt/.slang files, these configs just contain shader and audio filter related stuff. (I also set vulkan and d3d11 in this test just to see if that made a difference)
(To avoid confusion, MAME.cfg = core config while mame.cfg is the name it assigns to the content directory override, double checked this by saving a content directory override in RA, seeing it create mame.cfg, which I removed after)
Switchres does change the monitor refresh correctly with Space Firebird, reason I picked it is that it's 61Hz, if it fails to set 61Hz the game audio starts stutterig/skipping as the game really doesn't like 60Hz. Windows and Settings>Video also shows that the 61Hz modeline got switched to.
If I change MAME.switchres.ini to 2560x480, or anything, it actually loads whatever I put there as it should do just as the debug log reports. So I can edit MAME.switchres.ini with that 480 usermode and it does it perfectly for 720, just that it does it for all games now.
Thanks!
https://pastebin.com/Y3kFeGBZ
There being a root switchres.ini or not did not change this behavior, or there being a retroarch.cfg crt_switch_resolution = "1" or 0. (MAME.cfg having the crt_switch_resolution = "4" instead), no combination of these things did anything. All it can do is load MAME.switchres.ini
logs gentlemen please, logs ... That is most possible verbose logs from Retroarch and, when switchres.ini is read, set its verbosity to 3
Well, after finally coming back to this months later and using Retroarch 1.20.0, it seems the rootdir switchres.ini is now working for me, just as long as I have the requested resolutions installed in Windows. I'm not sure if modeline generation is possible in anything other than Linux.