MAME emulator and 240Hz monitor

Talk about NVIDIA G-SYNC, a variable refresh rate (VRR) technology. G-SYNC eliminates stutters, tearing, and reduces input lag. List of G-SYNC Monitors.
Post Reply
User avatar
CorvusCorax
Posts: 40
Joined: 14 Nov 2020, 06:22

MAME emulator and 240Hz monitor

Post by CorvusCorax » 28 Apr 2021, 03:41

Hi all,

I recently discovered strange thing in MAME emulator.

When I set my monitor to 144Hz + G-sync emulated games works in native refresh rate, for example Raiden II in ~57Hz

but

When I set my monitor to 240Hz + G-sync the same game works in ~114Hz (double the native game refresh rate)

It's not big deal, because it's still smooth and works great. I'm just curious why it is working that way.

PedroPortnoy
Posts: 7
Joined: 23 Apr 2021, 07:56

Re: MAME emulator and 240Hz monitor

Post by PedroPortnoy » 01 May 2021, 07:39

What Monitor do you have?

My guess is it works that way because your monitor has different overdrive voltages for 144Hz and 240Hz. Usually, as far as I know, fast monitors have better responde times and less overshoot close to their maximum refresh rate.

That said, I suppose the GPU driver sets the LFC to start doubling your frames at higher framerates when you set your monitor to 240 Hz to avoid any ghosting/reverse ghosting. Just make sure your framerate isn't too close from the bottom of the VRR range: going in and out of LFC tends to cause noticeable flickering.

For example, my monitor is a Samasung Odyssey G7 27" (1440p 240Hz) and my LFC kicks in at around 90 FPS: anything below that is doubled. If my framerate fluctuates around this value: lots of flickering. What I do if I get performance around that framerate is either cap my framerate a little below that or change the VRR range with CRU to something like 60-240 (so it stays above) or 120-240 (so it stays below).

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

Re: MAME emulator and 240Hz monitor

Post by Chief Blur Buster » 01 May 2021, 14:10

Unless you're using strobed modes, LFC (repeat refresh cycle logic) can be superior to non-LFC when the framerate is steady.

On many 240 Hz LCD panels, 114 Hz can have superior picture quality to 57Hz by speeding up the inversion logic to avoid inversion artifacts from becoming visible (i.e. avoiding scrolling chess board textures). Also, flicker goes down too, since faster LCDs are more likely to decay quicker to rest state (white screen or black screen, depending on panel tech) when a lot of time has passed between refresh cycles. Even if the unrefreshed-too-long LCD fade is only a 1% or 2% brightness change at 57Hz, it can still produce visible flickering during low frame rates. Also, you can get fewer mode blackouts (more common on FreeSync or "G-SYNC Compatible") when frametimes briefly dip below VRR range without LFC kicking in at a high enough Hz.

So there you go, three big reasons a higher LFC trigger is superior for 240Hz+ monitors:
(A) Reduce inversion artifacts
(B) Reduce slight flicker of low frame rates (from pixel fade on panels that have been unrefreshed too long)
(C) Reduce occurence of 1-second blackouts (LFC failing to activate at a high enough framerate below framerates fall below VRR range)

LFC is 100% harmless (and actually beneficial) for steady-framerate material like emulators. Don't worry about it.

Blur Busters always recommends a higher minimum Hz for 240Hz+ G-SYNC monitors, i.e. 55Hz-240Hz or 65Hz-240Hz ranges instead of 30Hz-240Hz ranges. A higher LFC threshold has fewer poisons and bigger benefits on wide-VRR-ranges (240Hz+)

So LFC actually produces better image quality whenever the VRR range is wide enough, because native low-Hz LCDs have more artifacts than LFC-assisted low Hz.

On a related note -- for 240Hz-and-up monitors, where you prioritize image quality, I now universally recommend editing FreeSync ranges (via ToastyX CRU) from 48-240Hz into 55-240 or 65-240, even if you don't have the (C) problem (reduce occurrence of 1-second blackouts). You notice I include a safety margin away from common framerate numbers (e.g. 60fps) which is why I don't recommend a FreeSync range of "60-240" because you might rapidly modulate into/out of LFC mode when 60fps material subtly varies from 59fps-61fps -- it's the LFC transitions that are the most problematic. Transitions into and out of LFC (the enabling/disabling of frame doubling) can be seamless (invisible) but sometimes those repeat-refresh cycles can collide with new frames, lagging the new frames by between 0/240 and 1/240sec depending on when the new frame was presented while the monitor is busy repeat-refreshing the previous frame -- more common during erratic frame rates, since LFC logic tries to precisely time repeat-refreshes between two frames, in order to stay seamless. LFC has a smaller penalty on higher Hz, as a 240Hz FreeSync monitor refreshes in only 1/240sec (4 milliseconds) while a 75Hz FreeSync monitor refreshes in 1/75sec (13 milliseconds).
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!

User avatar
CorvusCorax
Posts: 40
Joined: 14 Nov 2020, 06:22

Re: MAME emulator and 240Hz monitor

Post by CorvusCorax » 03 May 2021, 05:24

Chief Blur Buster wrote:
01 May 2021, 14:10
Unless you're using strobed modes, LFC (repeat refresh cycle logic) can be superior to non-LFC when the framerate is steady.

On many 240 Hz LCD panels, 114 Hz can have superior picture quality to 57Hz by speeding up the inversion logic to avoid inversion artifacts from becoming visible (i.e. avoiding scrolling chess board textures). Also, flicker goes down too, since faster LCDs are more likely to decay quicker to rest state (white screen or black screen, depending on panel tech) when a lot of time has passed between refresh cycles. Even if the unrefreshed-too-long LCD fade is only a 1% or 2% brightness change at 57Hz, it can still produce visible flickering during low frame rates. Also, you can get fewer mode blackouts (more common on FreeSync or "G-SYNC Compatible") when frametimes briefly dip below VRR range without LFC kicking in at a high enough Hz.

So there you go, three big reasons a higher LFC trigger is superior for 240Hz+ monitors:
(A) Reduce inversion artifacts
(B) Reduce slight flicker of low frame rates (from pixel fade on panels that have been unrefreshed too long)
(C) Reduce occurence of 1-second blackouts (LFC failing to activate at a high enough framerate below framerates fall below VRR range)

LFC is 100% harmless (and actually beneficial) for steady-framerate material like emulators. Don't worry about it.

Blur Busters always recommends a higher minimum Hz for 240Hz+ G-SYNC monitors, i.e. 55Hz-240Hz or 65Hz-240Hz ranges instead of 30Hz-240Hz ranges. LFC has fewer poisons and bigger benefits on wide-VRR-ranges.

So LFC actually produces better image quality whenever the VRR range is wide enough, because native low-Hz LCDs have more artifacts than LFC-assisted low Hz.

On a related note -- for 240Hz-and-up monitors, where you prioritize image quality, I now universally recommend editing FreeSync ranges (via ToastyX CRU) from 48-240Hz into 55-240 or 65-240, even if you don't have the (C) problem (reduce occurrence of 1-second blackouts). You notice I include a safety margin away from common framerate numbers (e.g. 60fps) which is why I don't recommend a FreeSync range of "60-240" because you might rapidly modulate into/out of LFC mode when 60fps material subtly varies from 59fps-61fps -- it's the LFC transitions that are the most problematic. Transitions into and out of LFC (the enabling/disabling of frame doubling) can be seamless (invisible) but sometimes those repeat-refresh cycles can collide with new frames, lagging the new frames by between 0/240 and 1/240sec depending on when the new frame was presented while the monitor is busy repeat-refreshing the previous frame -- more common during erratic frame rates, since LFC logic tries to precisely time repeat-refreshes between two frames, in order to stay seamless. LFC has a smaller penalty on higher Hz, as a 240Hz FreeSync monitor refreshes in only 1/240sec (4 milliseconds) while a 75Hz FreeSync monitor refreshes in 1/75sec (13 milliseconds).
Thanks for answer. That was super informative :)

User avatar
CorvusCorax
Posts: 40
Joined: 14 Nov 2020, 06:22

Re: MAME emulator and 240Hz monitor

Post by CorvusCorax » 30 Jul 2023, 15:36

Chief Blur Buster wrote:
01 May 2021, 14:10
On a related note -- for 240Hz-and-up monitors, where you prioritize image quality, I now universally recommend editing FreeSync ranges (via ToastyX CRU) from 48-240Hz into 55-240 or 65-240, even if you don't have the (C) problem (reduce occurrence of 1-second blackouts). You notice I include a safety margin away from common framerate numbers (e.g. 60fps) which is why I don't recommend a FreeSync range of "60-240" because you might rapidly modulate into/out of LFC mode when 60fps material subtly varies from 59fps-61fps -- it's the LFC transitions that are the most problematic. Transitions into and out of LFC (the enabling/disabling of frame doubling) can be seamless (invisible) but sometimes those repeat-refresh cycles can collide with new frames, lagging the new frames by between 0/240 and 1/240sec depending on when the new frame was presented while the monitor is busy repeat-refreshing the previous frame -- more common during erratic frame rates, since LFC logic tries to precisely time repeat-refreshes between two frames, in order to stay seamless. LFC has a smaller penalty on higher Hz, as a 240Hz FreeSync monitor refreshes in only 1/240sec (4 milliseconds) while a 75Hz FreeSync monitor refreshes in 1/75sec (13 milliseconds).
I've set the Freesync operating range to 65-240 in the CRU as you suggested. It works great, but the question arises: Isn't it better to set, for example, 110-240? This way games running at 110fps will be displayed at 220Hz. Are there any advantages to this?

In the case of the 65-240, I can say for sure that there are benefits, because the monitor I have at 60Hz displays some screen disturbances in the form of a visible grid of pixels (checkerboard?).

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

Re: MAME emulator and 240Hz monitor

Post by Chief Blur Buster » 01 Aug 2023, 20:17

CorvusCorax wrote:
30 Jul 2023, 15:36
I've set the Freesync operating range to 65-240 in the CRU as you suggested. It works great, but the question arises: Isn't it better to set, for example, 110-240? This way games running at 110fps will be displayed at 220Hz. Are there any advantages to this?
There are diminishing returns involved, and then it get worse again.

You ideally want VRR(Min,Max) to be at least 2.4x difference or you might get stutters that appear despite VRR, since LFC only works reliably when VRR minimum and maximum Hz are significantly more than 2x difference (+ jitter error margin).

The other consideration is that if the display is busy automatically repeat-refreshing too frequently, the new frame may get bumped forward yet another 1/57sec (and a minor microstutter appears) if there's one too many LFC-based repeat-refreshing.

<Technical>
You want giant headroom between the previous repeat-refresh, and the emulator trying to present a new frame. So raising the headroom too much, can cause microstutters to come back (if you are sensitive to microstutters). LFC means the display/drivers is auto-repeating refresh cycles. A display repeating a refresh cycle (repainting an existing frame) is too busy to accept a new frame. You don't want repeat-refresh (LFC algorithm) to collide with the precise time that software wants to present a new frame. A high min Hz means the display is more frequently busy repeat-refreshing during low frame rates, making it less likely for a new frame to be presented at an exactly precise time (e.g. photons hitting your eyes at exactly 1/57sec apart for a new frame). That forces latency (extra VSYNC ON backpressure) combined with a forced microstutter if this forces an unintended refresh cycle timing divergence. Even if 240Hz VRR only adds a maximum 1/240sec stutter&lag penalty (4.2ms) for a repeat-refresh (LFC algorithm) colliding with drivers wanting to do a new-refresh (frame presentation).
</Technical>

I would only recommend trying triple-digit minimum-Hz LFC headroom trick at 300Hz+

Moral of the story -- Don't bring minimum Hz and maximum Hz too close together -- keep them apart like the dangerous halves of that explodey thing in Oppenheimer movie if you don't want VRR to be a synonym for AWOL.
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!

User avatar
CorvusCorax
Posts: 40
Joined: 14 Nov 2020, 06:22

Re: MAME emulator and 240Hz monitor

Post by CorvusCorax » 02 Aug 2023, 06:42

Chief Blur Buster wrote:
01 Aug 2023, 20:17
CorvusCorax wrote:
30 Jul 2023, 15:36
I've set the Freesync operating range to 65-240 in the CRU as you suggested. It works great, but the question arises: Isn't it better to set, for example, 110-240? This way games running at 110fps will be displayed at 220Hz. Are there any advantages to this?
There are diminishing returns involved, and then it get worse again.

You ideally want VRR(Min,Max) to be at least 2.4x difference or you might get stutters that appear despite VRR, since LFC only works reliably when VRR minimum and maximum Hz are significantly more than 2x difference (+ jitter error margin).

The other consideration is that if the display is busy automatically repeat-refreshing too frequently, the new frame may get bumped forward yet another 1/57sec (and a minor microstutter appears) if there's one too many LFC-based repeat-refreshing.

<Technical>
You want giant headroom between the previous repeat-refresh, and the emulator trying to present a new frame. So raising the headroom too much, can cause microstutters to come back (if you are sensitive to microstutters). LFC means the display/drivers is auto-repeating refresh cycles. A display repeating a refresh cycle (repainting an existing frame) is too busy to accept a new frame. You don't want repeat-refresh (LFC algorithm) to collide with the precise time that software wants to present a new frame. A high min Hz means the display is more frequently busy repeat-refreshing during low frame rates, making it less likely for a new frame to be presented at an exactly precise time (e.g. photons hitting your eyes at exactly 1/57sec apart for a new frame). That forces latency (extra VSYNC ON backpressure) combined with a forced microstutter if this forces an unintended refresh cycle timing divergence. Even if 240Hz VRR only adds a maximum 1/240sec stutter&lag penalty (4.2ms) for a repeat-refresh (LFC algorithm) colliding with drivers wanting to do a new-refresh (frame presentation).
</Technical>

I would only recommend trying triple-digit minimum-Hz LFC headroom trick at 300Hz+

Moral of the story -- Don't bring minimum Hz and maximum Hz too close together -- keep them apart like the dangerous halves of that explodey thing in Oppenheimer movie if you don't want VRR to be a synonym for AWOL.
Thank you very much for your extensive answer. Everything is clear, I will set 71-240Hz (because below 70Hz on my monitor there are slight artifacts in the form of a visible pixel grid). Thanks for the hint in the previous post about the CRU program. I really like shmups on MAME, and they mostly run between 57-61Hz, and it annoyed me that my 240Hz monitor with Freesync wasn't displaying them correctly. Now everything works great.

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

Re: MAME emulator and 240Hz monitor

Post by Chief Blur Buster » 05 Aug 2023, 23:06

CorvusCorax wrote:
02 Aug 2023, 06:42
Thank you very much for your extensive answer. Everything is clear, I will set 71-240Hz (because below 70Hz on my monitor there are slight artifacts in the form of a visible pixel grid). Thanks for the hint in the previous post about the CRU program. I really like shmups on MAME, and they mostly run between 57-61Hz, and it annoyed me that my 240Hz monitor with Freesync wasn't displaying them correctly. Now everything works great.
Fantastic to know that the VRR range tweak improved emulation quality!

60fps material has been an occasional problem with VRR + emulation because it's so close to the LFC threshold, and so close to the "stiction logic" of the LFC algorithm where 60fps may sometimes randomly be 60Hz or 120Hz. Or for the other reason that 60Hz may have worse quality than 120Hz (or vice-versa, depending on VRR panel!

Problems are commonly flicker effects or textured LCD inversion artifacts (chessboard texture effects / vertical interlacing / horizontal interlacing).

The 71-240Hz sounds about right, to fix these artifacts, allowing emulator 60fps to permanently trigger the VRR panel to be 120Hz, which is usually better quality if you're not using strobing.
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!

User avatar
CorvusCorax
Posts: 40
Joined: 14 Nov 2020, 06:22

Re: MAME emulator and 240Hz monitor

Post by CorvusCorax » 08 Aug 2023, 06:51

Chief Blur Buster wrote:
05 Aug 2023, 23:06
CorvusCorax wrote:
02 Aug 2023, 06:42
Thank you very much for your extensive answer. Everything is clear, I will set 71-240Hz (because below 70Hz on my monitor there are slight artifacts in the form of a visible pixel grid). Thanks for the hint in the previous post about the CRU program. I really like shmups on MAME, and they mostly run between 57-61Hz, and it annoyed me that my 240Hz monitor with Freesync wasn't displaying them correctly. Now everything works great.
Fantastic to know that the VRR range tweak improved emulation quality!

60fps material has been an occasional problem with VRR + emulation because it's so close to the LFC threshold, and so close to the "stiction logic" of the LFC algorithm where 60fps may sometimes randomly be 60Hz or 120Hz. Or for the other reason that 60Hz may have worse quality than 120Hz (or vice-versa, depending on VRR panel!)

Problems are commonly flicker effects or textured LCD inversion artifacts (chessboard texture effects / vertical interlacing / horizontal interlacing).

The 71-240Hz sounds about right, to fix these artifacts, allowing emulator 60fps to permanently trigger the VRR panel to be 120Hz, which is usually better quality if you're not using strobing.
BTW Setting 71-240Hz for my case It's not only good for emulation, a lot of games are locked at 60fps (especially older ones) and LFC is also helpful in that case.

Post Reply