Strange switchres behaviour

Hi guys!

I’m running Retroarch 1.9.7 on a Windows 10 computer, i5-10600k CPU, R7 260X GPU, using Calamity’s CRT Emudriver with the generic 15kHz preset. I’ve enabled CRT switchres and use a CRT TV. I have no other monitors, this is a purpose built emulation PC. Power options are set to max performance, I’ve done a lot of other gaming optimizations in Windows as well.

I’m trying to get rid of some occational audio pops and crackles in Snes9x, using Super Metroid to test. I have to switch audio driver to xaudio and increase buffer to 40 ms to make them go away; this seems high to me, I’d think the rig would be able to manage Wasapi and a shorter buffer size.

I’m looking for sync issues, as the crackles only happen now and again, and seem unrelated to the intensity of the action on the screen (they can just as easily happen on the start menu). However, I’m having trouble understanding Retroarch’s refresh rate behaviour.

As I understand it, it’s important to run the “estimated refresh rate” to get a baseline for proper audio sync. When I run it I get 60.006 Hz. When I press ok the value transfers to the vertical refresh rate, which changes from 60.000 Hz to 60.006 Hz. I am however unable to save this value by saving the Retroarch config; the next time I open Retroarch the vertical refresh rate is back to 60.000 Hz. The menu item called “set display-reported refresh rate”, however, is at 60.006.

When I open Snes9x the vertical refresh rate seems to change again; without me doing anything it’s suddenly 60.099 Hz. If I run the estimated refresh rate again I get the same result as before, 60.006 Hz. Again, I can transfer this to the vertical refresh rate, but it won’t save; the next time I open the game the vertical refresh rate (and the set display reported refresh rate) are back to 60.099 Hz.

Any ideas as to what’s happening here?

1 Like

Yeah, this is the SNES’ native refresh rate, so with switchres enabled, it will automatically change the refresh rate to match.

AFAIK, using the estimated refresh rate calculation likewise won’t be as important with switchres enabled.

Ah, ok, thanks!

Thing is, in Mesen I can use Wasapi with 10 ms buffer, and no crackling. In Snes9x i need to use xaudio + have a buffer size of 40 ms to avoid crackling. Using Vulkan as video driver on both, max swapchain 2 and runahead 1 (but turning of runahead and increasing swapchain to 2 won’t let me get away with a smaller buffer)

Does this sound right? If not, any idea as to what the problem might be?

Ok, I discovered something.

I recently updated Retroarch (extracted the new version into the old folder and let it rewrite). This crackling problem strangely doesn’t happen when I open Super Metroid with a core I haven’t used since the update (Bses mercury performance); it was able to play with wasapi and 10 ms buffer. BUT when I make a new content directory override for the folder the crackling reappeared and stuck around, even though I went back to the same settings that had given me no crackling before I saved the override!

It seems my “old” folder overrides give me great performance, but the ones written with the new version give me crackles on the same settings.

Edit: I deleted all my configs and started from scratch (same folder, all new configs). I can set audio driver to Wasapi and buffer to 24 ms in the main Retroarch config, and Super Metroid plays without crackles. If I make a content directory override without changing any settings and reload, the crackles reappear. When I look at the directory override file it only contains one thing: a refresh rate. If I delete this file again the crackles disappear.

Have I found a bug here?

Investigated more, and finally know how to get around the problem.

After I updated Retroarch, it now saves a video refresh rate in the content directory override config, whenever I make one of those. The older version didn’t do that. If I load the game with this file, there are crackles. If I delete the file, or remove the line with the refresh rate, I’m ok, so that’s my solution; manually remove the line. Tedious, but works; preferrable to having to use xaudio and a 40 ms buffer (which also cures the crackling).

Using the old version of Retroarch (which I have in a backup folder) also works of course, but the new version adds some improvements, and seems to be better at reverting to desktop resolution after quitting, the old one would often stay on 240p.

I thought maybe the “use custom refresh rate” in the switchres menu was the setting that made Retroarch add the refresh rate line to the content directoy override config, but it doesn’t seem like it.

Surely, this must be a bug.

1 Like