Significant RetroArch BFI Update

Everything about displays and monitors. 120Hz, 144Hz, 240Hz, 4K, 1440p, input lag, display shopping, monitor purchase decisions, compare, versus, debate, and more. Questions? Just ask!
ophidon
Posts: 14
Joined: 18 Mar 2014, 07:57

Significant RetroArch BFI Update

Post by ophidon » 20 Jan 2024, 09:13

As of the latest nightly, I've had a pretty decent sized update pushed into RetroArch for its internal software BFI. I am also the author of the previous version of BFI for RA. Available here: https://buildbot.libretro.com/nightly/

As per my commit notes:

- Adds BFI to dx10/11/12 in general.

- Updates existing BFI menu option descriptions to be somewhat more clear in how to use correctly.

- Adds Variable Strobe length via new 'Dark Frames' bfi sub-choice. Only valid at 180hz and above, as it must work with whole frames.

- Algorithm to auto select 'decent' Dark Frames choice, for any given selected BFI refresh rate. Will also avoid defaults that can cause Image Retention at any Hz higher than 120. (Impossible to avoid at 120 if you have an affected screen... get an OLED :D ) .

- Some sanity checking on selecting BFI or the other synchronizations options like Swap Interval > 1, that don't play well with BFI.

--

BFI addition to the dx render engines, and variable length strobe to adjust brightness vs clarity being the biggest additions.

So, one I just thought this would be the crowd most interested in this update, and two it would be the crowd that can most help me find any sticking points in how reasonably informed people fail to set it up correctly, or any actual bugs (I can only test myself from an nvidia gpu on Windows, with 240hz screens). I'd like feedback because I also plan to write a decent length BFI usage guide for the libretro doc site, to go along with the Obtaining Optimal V-Sync Performance guide I updated here: https://docs.libretro.com/guides/optimal-vsync/

That guide is important for this, because if you want software bfi that doesn't do annoying flickering (and I can assure you, with capable hardware, you can get it to where you get no flickers in hours of use), you need everything else set up correctly for smooth perfect frame pacing.

If you are unsure, and want to know why you might be interested in software implemented BFI like this over hardware implementation (on the little hardware that supports a 60hz strobe), especially on an LCD, by far the most critical advantage in my opinion is that eye strain from the flicker is FAR less than an equivalent hardware 60hz full backlight flicker, which makes it.. you know, actually usable, and not just cool 'in theory'. As has been discussed elsewhere, software BFI piggybacks off the rolling scanout of pixels that is happening anyway, which is much closer to how CRTs did things, than how hardware lcd BFI turns the entire backlight on and off instantly. There is also never any crosstalk, but even that I consider a much smaller advantage than the eye strain issue.

This is less of an issue on oled, where most all screens do even hardware BFI in this scan out fashion. But even LG is seemingly in the process of phasing out bfi in their newest panels, and as it is now, only offers a 50% duty cycle strobe, leading to nearly double the MPRT (aka nearly double the blur) of my recommended settings below.

Some quick usage notes to start you:

If you have an affected lcd (oled should apparently be safe) and try to use it at 120hz and see temporary image retention on your screen, disable it and use a different screen or just give up if you have to. Not all non-oleds are affected, but you shouldn't use this on one that is. It wont cause permanent damage, but the longer you run it that way, the longer it takes to self-correct, and there is no setting change that will counteract it and let you continue usage. This is a phase aligned voltage retention issue that has been known quite a while.

Next, while I've gone ahead and implemented support up to VERY high hz, my overall recommendation is the same as with the previous implementation. 180Hz with 2 out of 3 frames dark, leading to a ~5.55 MPRT at a brightness loss that within the range that can typically be compensated by raising your panel brightness, unless you sear your eyeballs with very high brightness settings for standard usage anyway. On almost all capable panels, to run at 180hz you will have to create a custom resolution, I believe there are guides on this exact site for doing so. Why they add refresh rates like 165hz and 200hz by default, but skip over the 60hz multiple, is beyond me.

Another factor with this recommendation is, as silly as it sounds, your pc performance even for lowly NES emulation on modern high-end CPUs, becomes a factor more and more as you increase the hz you're trying to use BFI at. At 180hz, to avoid problems you need to be able to output a frame in 1/3d the time it would have at 60hz. Using a super accurate NES emulator like Mesen, with a high quality CRT shader on, and run-ahead on at 1 frame.. even my 7700x with a 4090 drops a few frames (which leads to noticeable flicker) at 240hz, but not at 180hz.

This performance problem will go away in the future, -hopefully-, when the graphics api's increase the number of frames that can be buffered. They hopefully will think about that as screen refresh rates continue to skyrocket to 480hz and beyond. 4 is the typical limit for now, and for normal usage... allowing 4 frames to be buffered leads to truly awful input lag, but not for this BFI implementation. 4 actual frames are used to display one 'real' 60hz frame at 240hz! So work on the next real frame cant start while the previous is still rendering.

Also, 180hz, and all other odd multiples of 60hz are completely safe from the voltage retention issue mentioned above. Even intervals, other than 120Hz of course and regrettably for lcds, all default to a Dark Frames setting that -should- be immune as well. Consider that the voltage phases of frames are going to alternate between + and -, so what you want for an even multiple of 60hz, is to display an even number of 'on' pulses, 2 'on' out of four for 240hz, 2 or 4 'on' out of six for 360hz, etc.

Lastly, this is of course, only really useful for 60 fps games through RA, if you try to use it on 'newer' systems (aka lots of games from the ps1 era and beyond) that run at 20 or 30 fps, you will just be replacing awful motion blur with awful, sharp, double/triple images.

FlameOnion
Posts: 2
Joined: 25 Oct 2022, 06:24

Re: Significant RetroArch BFI Update

Post by FlameOnion » 17 Apr 2024, 07:17

How about BFI choices for pal/50hz, 100hz, 150,hz, 200hz, etc. I used nightly 2024-04-17_RetroArch.7z, and did not see them.

hickmankay
Posts: 1
Joined: 22 Apr 2024, 03:32
Location: https://doodlegames.io/doodle-jump
Contact:

Re: Significant RetroArch BFI Update

Post by hickmankay » 22 Apr 2024, 03:36

FlameOnion wrote:
17 Apr 2024, 07:17
How about BFI choices for pal/50hz, 100hz, 150,hz, 200hz, etc. I used nightly 2024-04-17_RetroArch.7z, and did not see them.
With those frequencies, which one is better for you? I'm looking into it

Supermodel_Evelynn
Posts: 136
Joined: 21 Aug 2022, 14:28

Re: Significant RetroArch BFI Update

Post by Supermodel_Evelynn » 24 Apr 2024, 08:15

Can you run new games like Tekken 8 etc with Retroarch and BFI?

Also how does this BFI compare to the github software "Desktop BFI"

Skyy
Posts: 10
Joined: 16 Feb 2024, 20:15

Re: Significant RetroArch BFI Update

Post by Skyy » 05 May 2024, 13:07

So if I read this right, does that mean when I setup things correctly I won't get image retention anymore on my 160hz screen when using RetroArch BFI?

User avatar
Chief Blur Buster
Site Admin
Posts: 11726
Joined: 05 Dec 2013, 15:44
Location: Toronto / Hamilton, Ontario, Canada
Contact:

Re: Significant RetroArch BFI Update

Post by Chief Blur Buster » 05 May 2024, 17:10

ophidon wrote:
20 Jan 2024, 09:13
- Algorithm to auto select 'decent' Dark Frames choice, for any given selected BFI refresh rate. Will also avoid defaults that can cause Image Retention at any Hz higher than 120. (Impossible to avoid at 120 if you have an affected screen... get an OLED :D ) .
I can't believe I missed this message, but Januarys were very busy months!

You can avoid image retention at ALL refresh rates, if you add an occasional duplicate frame to swap the cadence of the alternate-refresh-cycle voltage polarity. For example, 120Hz with 1 additional black frame every X minutes. That's how the Retrotink 4K "LCD Saver" feature works.

For more information see Image Retention Workarounds.

Kudos on everything else! I need to try this out.
Head of Blur Busters - BlurBusters.com | TestUFO.com | Follow @BlurBusters on Twitter

Image
Forum Rules wrote:  1. Rule #1: Be Nice. This is published forum rule #1. Even To Newbies & People You Disagree With!
  2. Please report rule violations If you see a post that violates forum rules, then report the post.
  3. ALWAYS respect indie testers here. See how indies are bootstrapping Blur Busters research!

Skyy
Posts: 10
Joined: 16 Feb 2024, 20:15

Re: Significant RetroArch BFI Update

Post by Skyy » 05 May 2024, 17:26

Chief Blur Buster wrote:
05 May 2024, 17:10
ophidon wrote:
20 Jan 2024, 09:13
- Algorithm to auto select 'decent' Dark Frames choice, for any given selected BFI refresh rate. Will also avoid defaults that can cause Image Retention at any Hz higher than 120. (Impossible to avoid at 120 if you have an affected screen... get an OLED :D ) .
I can't believe I missed this message, but Januarys were very busy months!

You can avoid image retention at ALL refresh rates, if you add an occasional duplicate frame to swap the cadence of the alternate-refresh-cycle voltage polarity. For example, 120Hz with 1 additional black frame every X minutes. That's how the Retrotink 4K "LCD Saver" feature works.

For more information see Image Retention Workarounds.

Kudos on everything else! I need to try this out.
I need to try this out too but I'm still not sure how this allows to insert an extra black frame every now and then so I would appreciate instructions when somebody figured it out.

BlurZapper
Posts: 17
Joined: 12 Sep 2017, 21:31

Re: Significant RetroArch BFI Update

Post by BlurZapper » 27 May 2024, 17:29

Thanks for the RetroArch BFI update, Ophidon. Earlier today I had issues using BFI on RetroArch, it would flicker a lot, but then after tweaking settings it seemed to have gone away mostly! My issue using BFI was that there is a noticeable black flicker each second or less which varied in frequency over time. It may be due to either the OLED monitor, or my PC not being able to maintain a stable framerate over time (due to micro-stutters maybe?). I read you mentioned BFI requires beefy hardware.

RetroArch Build 1.17.0 (Do I need the nightly build or something? I don't think so.)
RetroArch Settings: Video Driver "D3D12", resolution "2560x1440", Vertical Refresh set to the Reported Refresh Rate, 239.972hz,
Synchronization-->VSync "On", VSync Swap Interval "Auto", BFI "3" (240hz refresh rate), BFI - Dark Frames I've tried "1", "2", and "3". All other Synchronizations set to "Off".
I have HDR Enabled for RetroArch, but for some reason when I start the Dolphin Core, it says HDR--> "No Settings Found". Weird but unrelated to your BFI work.

Monitor: ASUS PG27AQDM (240hz OLED 1440p, firmware MCM106 with "Oled Anti-Flicker" Off. Note, using Anti-flicker on "Medium" or "Strong" causes a seizure-inducing flicker with BFI.)
GPU: RTX 2080
CPU: AMD 7800 X3D
RAM: DDR5 32GB
Nvidia Global Settings: GSync Enabled (Monitor is compatible but not approved), Fast Vertical Sync, 1 pre-rendered frame, preferred refresh rate "Highest Available", Low Latency Mode "Ultra".
Nvidia's RetroArch Settings: Same as Global. I have also experimented different settings but it doesn't remove BFI flicker.
Windows HDR is set "On".

A few questions / notes:
1. It seems 1 or 2 Dark Frames at 240hz does not work when I was playing on the Dolphin Core, its as if there is no BFI enabled at all. The brightness is not reduced at all, as if no BFI was used. For "3" BFI - Dark Frames, the brightness noticeably dimmed and the motion clarity is great, but there's just the subtle black flicker as mentioned before. At times it is playable, the flicker may be once every few seconds (cutscenes, slow moving / panning frames), but when playing / moving around, the flickering frequency is a few per second. As I said, probably has to do with GPU not being able to

2. Would my BFI - 3 Dark Frames setting be much brighter if HDR was enabled for the Dolphin Core?

3. Also, BFI only seems to work with gameplay that outputs 60fps? I played a few games at 30fps and the BFI caused unplayable, intense seizure-inducing black flickers. Is it because BFI 240hz isn't compatible for 30fps games? Would setting my refresh rate to 120hz not cause seizure-inducing black flickers?

If you need any extra info let me know.
Edit: I read your link "Optimal VSync Performance", there seems to be more to it to get software BFI to work properly. I fiddled with my RTSS, forgot about that, framerate limit was capped to 240, but altering this to match RetroArch's "Estimated hz" (239.866hz and a few others I tried) did not improve the black flicker, it is still intermittent, its like there's a game freeze stutter with a black flicker at a fixed interval.

sodaboy581
Posts: 11
Joined: 01 Feb 2022, 10:37

Re: Significant RetroArch BFI Update

Post by sodaboy581 » 29 May 2024, 09:56

Piggybacking off of the last post.

I don't think the BFI random flicker problem is solvable with cores that can have variable frame rates. For anything that's like Dreamcast, GameCube and newer, BFI in RetroArch isn't properly implemented to handle it.

Your best bet is to either just accept it for what it is or disable BFI when playing those cores.

I'm running with a 5600X, 3060Ti with a 240hz IPS LCD running at 180hz (so as to not have image retention) and have noticed the same behavior.

When I play arcade games like CPS-1, CPS-2 and NeoGeo via MAME, BFI is perfect, super excellent. Nary a flicker.

Start up something like MVC2 on Flycast? It's MOSTLY fine. You'll see a flickering as soon as the game starts loading and during the copyright notice, sometimes on the Capcom logo and sometimes during screen transitions. When FIGHTING it out, though, usually BFI is solid BUT you MAY get a rare flicker here and there. It's enough to put me off of it, though, so I just don't use BFI for Flycast.

Turning off all shaders and such doesn't seem to help either, it's just a thing when the FPS changes due to something the core does like loading or whatever and there is nothing you can do about it until RetroArch updates the code.

BlurZapper
Posts: 17
Joined: 12 Sep 2017, 21:31

Re: Significant RetroArch BFI Update

Post by BlurZapper » 29 May 2024, 21:46

Thanks for the reply Sodaboy! That makes a lot of sense, the older era console games had more stable framerates. It really was impressive to see the difference using BFI on a game like Metroid Prime, when turning at full speed you can track far field objects or the environment with your eyes and no movement really has any blur. With BFI off at 240hz, its a blurry mess when your camera rotates at moderate speeds.

Post Reply