Occasionnal jerky scrolling on SNES core

Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

Hi all,

I've noticed that games having perfect scrolling on real hardware are sometimes a bit jerky on the MiSTer FPGA SNES core.

That can be noticed on Final Fansasy 5 world map or at the beginning of "Castlevania - Dracula X" : scroll the screen to the right or left continuously and you'll notice some hiccups (something like 1 frame every 10s). You can also see that while staring at the heart count number on the top-right part of the screen in Castlevania - Dracula X. This is displayed using a "one out of two frame" to fake transparency, and you'll notice that sometimes this simulated transparency is kind of blinking (you just need to grab some hearts of weapons on the first candles to activate that).

I agree that this is a bit hard to notice and that I might be a bit nitpicking here, but this scroll jerkyness is not happening on real hardware or even RetroArch / RetroPie.

I tested that on both HDMI and VGA output, with different cable length and settings in mister.ini, using the 20.11.06 SNES core.

Also, I've only notice that on the SNES core. NES games have perfectly smooth scrolling.

I'll be happy to provide more details or explanations on that issue if required.
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

As opposed to what I said, this is also happening with the NES core. I might be totally wrong here but this could be like caused by a slight difference in the real hardware display frequency and the HDMI one (causing some frames to be dropped to maintain sync ?). As I said, I also tried using the VGA output of the MiSTer, but connected to and OSSC adapter.

I'll see if I can build myself a VGA to SCART cable quickly and do the same test on a CRT... (anyway that's somethign I really need to do :)).

Or maybe there's an option in the mister.ini file that I just missed ?
PikWik
Posts: 279
Joined: Sat May 30, 2020 7:00 pm
Has thanked: 207 times
Been thanked: 74 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by PikWik »

hello!

couple things i would look at are what your vsync_adjust & vscale_mode are set to.
and yes, getting analog out to a CRT would be the best test to factor out the HDTV as the culprit.

for the vscale, what is your scaling set to?
for the vsync, what is your setting in mister.ini set to?

my first idea about what you're noticing is your TV/monitor not being compatible with variable pixel clocks on the fly, with vsync_adjust=2,
and youre seeing a visible screen "hiccup" every once in a while.

or, something in your OSSC needs to be adjusted (maybe try going directly from the mister to the TV, and bypass the OSSC)

------------

i have my mister setup for vsync_adjust=1 (with a samsung q80r) and all the cores ive tested do not show any signs of jerkiness.
Cyril1980
Posts: 9
Joined: Tue Jul 14, 2020 7:17 am
Has thanked: 5 times
Been thanked: 31 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by Cyril1980 »

Hi.

I just wanted to add to the already great advices in this thread that a large proportion of flat panel TVs have frame pacing issues. What you are describing is not surprising at all...
In my small series of tests this seemed to be somewhat linked to the video input lag of the TV: the more frames of lag, the highest the chance of “jerky scrolling”.
As a result, you may want to try “game mode” if not already set on your TV. It should help with that.
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

Thanks Cyril. I had the same suspicion about the TV first. I played with the settings (I had "Gaming mode" enabled) with no success. Also, I have other devices connected to the same TV (a RetroPie and an OSSC), the scrolling is perfectly smooth with them.

I did more tests this morning, I'll try to give as much details as possible:

Hardware used:
  • UltimateMiSTer Pro from RetroShop.pt
  • QE55Q6FNA Samsung QLED TV with these settings:
    • "Gaming mode" enabled
    • "Motion plus" disabled
    • "FreeSync" disabled.
  • 1m long HDMI cable.

Steps to reproduce:
  • Setup an SD Card using this MiSTer release: https://github.com/MiSTer-devel/mr-fusi ... .2.img.zip
  • Copy this SNES core release at the root of SD Card: https://github.com/MiSTer-devel/SNES_Mi ... 201106.rbf
  • Copy "Castlevania - Dracula X (U) [!].smc" (CRC32 is 7C4887E1) in a SNES folder.
  • Create a "MiSTer.ini" file at root with this content:

    Code: Select all

    [MiSTer]
    
    ; 0 - scale to fit the screen height.
    ; 1 - use integer scale only.
    ; 2 - use 0.5 steps of scale.
    ; 3 - use 0.25 steps of scale.
    vscale_mode=1
    
    ; Set to 1 for automatic HDMI VSync rate adjust to match original VSync.
    ; Set to 2 for low latency mode (single buffer).
    ; This option makes video butter smooth like on original emulated system.
    ; Adjusting is done by changing pixel clock. Not every display supports variable pixel clock.
    ; For proper adjusting and to reduce possible out of range pixel clock, use 60Hz HDMI video
    ; modes as a base even for 50Hz systems. 
    vsync_adjust=2
    
    ; 0 - 1280x720@60
    ; 1 - 1024x768@60
    ; 2 - 720x480@60
    ; 3 - 720x576@50
    ; 4 - 1280x1024@60
    ; 5 - 800x600@60
    ; 6 - 640x480@60
    ; 7 - 1280x720@50
    ; 8 - 1920x1080@60
    ; 9 - 1920x1080@50
    ;10 - 1366x768@60
    ;11 - 1024x600@60
    ;12 - 1920x1440@60
    ;13 - 2048x1536@60
    video_mode=8
    
    ; set to 1-10 (seconds) to display video info on startup/change
    video_info=10
    
  • Boot the MiSTer, select the SNES core and launch "Castlevania - Dracula X (U) [!].smc"
  • Start the game, destroy the first 3 candles to grab 2 hearts and the knife weapon.
  • After you grab the knife, you should notice that the heart counter on the upper right corner of the screen is quickly blinking.
  • Keep your eyes on this counter and look for small twinklings.
Observed:
  • With vsync_adjust=1 and vsync_adjust=2 in MiSTer.ini:
    • A twinkling is observed very regulary, every 13.9s.
    • If you switch the game from NSTC to PAL mode using the "Video Region" setting, the twinkling does not happen at all.
    • Note: the video info popup displayed at game start shows the following informations: 512x224 15.75KHz 60.1Hz - 1920x1080 148.75MHz 60.1Hz
  • With vsync_adjust=0 in MiSTer.ini:
    • A twinkling is observed very regulary, every 10.1s.
    • If you switch the game from NSTC to PAL mode using the "Video Region" setting, the twinkling happens at a high frequency (several times per seconds).
    • Note: the video info popup displayed at game start shows the following informations: 512x224 15.75KHz 60.1Hz - 1920x1080 148.5MHz 60.0Hz
I'll do more tests today (I think I still have a VGA monitor in the attic) and post results here.
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

So I've found an old Compaq monitor that I connected directly to the VGA output of the MiSTer. I only had to add "forced_scandoubler=1" in order to have a compliant frequency.

And this definitively fixes the jerkyness issue. Picture quality is also very good - I'd almost like to keep the MiSTer connected to it :)

I'll give another try with the OSSC - if the OSSC has no jerkyness with my other devices, and if the VGA output of the MiSTer is OK too, it should work in theory :)

Side question: I noticed that with the VGA output you can select some "Scandoubler fx". Do these cause extra lags when not set to "None" ?
Optiroc
Posts: 107
Joined: Sun May 24, 2020 7:29 pm
Has thanked: 7 times
Been thanked: 38 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by Optiroc »

My LG OLED55C7 used to have those issues with a few cores outputting at off-spec frame rates, but it was fixed with some firmware update during 2018. Amiga at ~50Hz was the worst offender, while SNES was always smooth.
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

Optiroc wrote: Wed Dec 23, 2020 9:12 pm My LG OLED55C7 used to have those issues with a few cores outputting at off-spec frame rates, but it was fixed with some firmware update during 2018. Amiga at ~50Hz was the worst offender, while SNES was always smooth.
Yep, I confirm that the problem is related to my TV: connecting the MiSTer to an HDMI Iiyama monitor works perfectly without jerkynes for both NES and SNES. So there's something about the 60.1Hz output that my Samsung does not like.

Anyway, there are things giving me hope:
  • I know a real SNES is working fine through OSSC on my TV. In theory it should have the same output frequency as the SNES MiSTer core. I'll check that (the OSSC displays the frequency of its input).
  • MiSTer is open source :) I'm tempted to try to rebuild the SNES or NES cores with an output frequency that would match the one my OSSC will report. Maybe there's only a crystal frequency to adjust ? I'll also need to check what's the toolchain used to build the .rbf.
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

Also, I noticed that the first 2018 releases of the SNES core had a 59.9Hz output, but sadly, I can't launch any game with them (it's staying stuck on a black screen after loading a game). Will give a try at the NES cores...
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

Another option could be to fix my TV. Normal settings do not help (I've tried everything), but maybe there's something to do in the hidden service menus to make the TV more tolerant with 60.1Hz (this post gives me some hope: viewtopic.php?p=5491#p5491) ?
Mills
Posts: 90
Joined: Mon Jun 08, 2020 2:52 pm
Has thanked: 15 times
Been thanked: 32 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by Mills »

I use a PC monitor with VGA input (connected using mister HDMI, with an HDMI->VGA adapter). Some cores will drop frames here and there, and I found the cause is always one of these:
-wrong refresh rate (PAL = 50, NTSC = 60)
-wrong aspect ratio (you'll have to add custom aspects to the cores in the ini)

All cores have perfect scrolling in my case, But some SNES and Game Boy games, have small issues, and I think this is caused by the games themselves, (because they are not scrolling at a constant speed), and the sharp image of monitors does not hide the artifats. In this case, adding blurr filters and scanlines helps a lot.

Also, modern TV's are really bad for mister, you have to be sure to disable everything, and find a lot of hidden menus. Even then, lag is huge.
PikWik
Posts: 279
Joined: Sat May 30, 2020 7:00 pm
Has thanked: 207 times
Been thanked: 74 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by PikWik »

those are good points, Mills!
i would be curious to see if you get any issues using an analog IO board and going directly from the d-sub/VGA to your PC monitor's input.

-----------------

the OP's TV and mine are very similar, they have the 2018 version of the samsung QLED and i have a 2019 samsung QLED

i have all the image/motion enhancement features turned off, disabled freesync, game mode enabled, and set my mister.ini to use vsync_adjust=1

one thing i do want to note about what ive noticed with my TV is that the TV will switch to the correct refresh rate of the core when i first load the core, but if i change the HDMI input/channel on my TV after a core was loaded and then change the HDMI input/channel back to the mister's HDMI input, i will see some frame rate issues like the OP was describing.
basically, if i change the channel of my TV after i load a core, i have to reload/restart the entire mister core or i will have frame rate issues.

but if i dont change the channel and have loaded the core with vsync_adjust=1, the scrolling and motion is perfect/smooth.
PikWik
Posts: 279
Joined: Sat May 30, 2020 7:00 pm
Has thanked: 207 times
Been thanked: 74 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by PikWik »

i see people have said modern HDTVs dont have decent input lag, but i have found the opposite to be true.

i have an original SNES with a SD2SNES, a CRT, and play a lot of those very difficult super mario world kaizo rom hacks.
i can feel the difference in input lag comparing a CRT to an HDTV, but i can compensate for the difference in a few minutes of playing.

my TV in game mode has a tested 13.7ms of input lag, and that combined with the 2ms-4ms of controller lag is undetectable to 98% of people.

samsung q70r, input lag test - https://youtu.be/2LVOv34gOBI?t=84
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Occasionnal jerky scrolling on SNES core

Unread post by aberu »

Try it at 1440p instead (https://www.retrorgb.com/mister-1440p-1 ... aling.html), see what happens. You are running a 4k tv at 1080p, and some modern tv's kinda handle lower resolutions than their native resolutions worse.

Also, what happens when you turn freesync on though? From what I remember the MiSTer doesn't necessarily *officially* support it (someone correct me if I'm wrong), but it does in fact sync up... See thread here --> viewtopic.php?t=1491

If you have issues, change the vsync_adjust= option and see how it works.
birdybro~
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

Thanks for the advices here.

PikWik, I also noticed that the reported refresh rate was not always the same depending on the core launch conditions. But even with a (good) reported 60.1Hz, the jerkyness is present. I also tried different desperate sequences (powering up TV while MiSTer already running, switching HDMI sources, etc...).

Aberu, I tried the 1440p video mode, this one is not supported by my TV. I also tried all other modes from 0 to 13, and all supported modes are showing the same jerkyness problem.

My feeling right now is that the MiSTer is the perfect device for my gaming room on CRTs. I'll keep the RetroPie for my living room - modern QLED setup. The RetroPie seems more modern-TVs friendly as it adapts its emulation speed to match standard display frequencies, and I understand that this is not the goal of the MiSTer.

That beeing said, I still need to understand why a SNES connected through an OSSC/SCART works perfectly on my Samsung, when the MiSTer connected through OSSC/VGA shows jerkyness. As I said, I suspect a very slight difference in the video signals or frequencies. With some luck, a small change in the NES/SNES video outputs could improve MiSTer accuracy and also fix my display issue here :) ?
User avatar
darksakul
Posts: 353
Joined: Mon May 25, 2020 4:34 pm
Has thanked: 397 times
Been thanked: 73 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by darksakul »

Keep in mind the actual SNES and NES have faster than spec refresh rates
The NES has a refresh of 60.10 Hz and the SNES has a refresh of 60.08 Hz.
The MiSTer reproduce the same video output

The solutions are ether slightly underclock the console or deal with the drop frames.

You say the actual SNES connected via OSSC works fine on your display despite the MiSTer does not?
Also what model of SNES you have and what mods if any were done to your SNES console?
Many SNES consoles need a Dejitter mod to display correctly as the SNES isn't putting out a proper NTSC/PAL spec video

Your MiSTer is being accurate to the original hardware.
It is my great regret that we live in an age that is proud of machines that think and suspicious of people who try to.
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

darksakul wrote: Fri Dec 25, 2020 12:52 pm Your MiSTer is being accurate to the original hardware.
Yep, that's what I was saying too, and I think that's a good thing :) The frame drops here does not come from the MiSTer HDMI output, it's really that my QLED TV does not like the 60.1Hz and drops one frame every 13.9s (same MiSTer with same settings works perfectly on an HDMI Iiyama monitor).
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

darksakul wrote: Fri Dec 25, 2020 12:52 pm You say the actual SNES connected via OSSC works fine on your display despite the MiSTer does not?
Also what model of SNES you have and what mods if any were done to your SNES console?
Many SNES consoles need a Dejitter mod to display correctly as the SNES isn't putting out a proper NTSC/PAL spec video
My SNES is a Euro model. Only mod is that it is swiched to 60Hz. The OSSC video output was definitively not the best one for SNES (there are several issues reported about SNES / OSSC, that fits what you're saying), but the sync / scrolling was perfect.
User avatar
darksakul
Posts: 353
Joined: Mon May 25, 2020 4:34 pm
Has thanked: 397 times
Been thanked: 73 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by darksakul »

I don't know that much about the 60hz mod for the SNES
All my experiences are with the US and Japanese models

is your Mister SNES core set as PAL or NTSC?
It is my great regret that we live in an age that is proud of machines that think and suspicious of people who try to.
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

The 60Hz mod is just a single-wire change somewhere on the PCB, quite easy to do. It switches the SNES VDP from PAL (50Hz) to NTSC (60Hz or so), I'm pretty sure the video signal result is the same as a US or Japanese SNES.

I observe the scrolling problems only when the SNES core is configured to 60Hz (well, 60.1Hz). If I change to PAL / 50Hz, no problems at all (that frequency seems well supported).
User avatar
aberu
Core Developer
Posts: 1192
Joined: Tue Jun 09, 2020 8:34 pm
Location: Longmont, CO
Has thanked: 247 times
Been thanked: 411 times
Contact:

Re: Occasionnal jerky scrolling on SNES core

Unread post by aberu »

Louthrax wrote: Fri Dec 25, 2020 12:34 pm Aberu, I tried the 1440p video mode, this one is not supported by my TV. I also tried all other modes from 0 to 13, and all supported modes are showing the same jerkyness problem.
Something seems wrong to me then on that front because your TV does support 1440p@60hz in game mode (and "120hz" in the horrible motion plus mode I think).

As for freesync, have you enabled freesync on your TV and what does it do then? I noticed you disabled it and I asked if you tried turning it on, but you didn't let me know :P

What's the signal chain from the MiSTer to your TV?

Have you done the latest firmware update to your TV? This doesn't require you to go into the service menu for it.
birdybro~
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

So,that suprised me, but the 60Hz mod on a PAL SNES really does not yield in the same output frequency as a genuine NTSC model. OSSC reports 60.08Hz for the MiSTer as expected, but 59.53Hz when I plug my SNES.

After googling for "59.53Hz + SNES", I discovered this was a known fact: https://videogameperfection.com/forums/ ... 60hz-only/.

Aberu, I tried the freesync options (there are 2 choices on my Samsung: Ultimate and Simple, both do not improve things). I also tried to activate the "Motion Plus" option with blur/vibration reduction, this only resulted in ugly effects on the picture.

As for the signal chain, that's a simple HDMI cable between the MiSTer and the TV. I tried different HDMI cables of various lengths and quality, same result.

Also, my TV is up to date with the latest firmware (version 1310). I was a bit surprised it did not support the 1440p mode, I'll double check with my RetroPie.

Thanks all for the help here. My only hope to solve my problem would be a fix from Samsung (not betting to much on that), or find something in the TV engineering menu (not to much hope either). Or maybe one day a "compatiblity mode" to the MiSTer to round-up the output frequency to the nearest "standard" values for HDMI (well, that would be at the cost of less accurate emulation).

Waiting for that, the MiSTer will move to my gaming room. I built myself a VGA to SCART cable yesterday, picture quality is great on my old Sony Trinitron :) And I'm finally amazed that the MiSTer is finally more faithful to true NTSC SNES than my modded SNES !
Louthrax
Posts: 22
Joined: Sun Dec 20, 2020 7:38 pm

Re: Occasionnal jerky scrolling on SNES core

Unread post by Louthrax »

Final point to the story: I checked the jerkyness again with my 59.53Hz SNES + OSSC (same method as described before, checking the heart counter twinkling in Dracula X)... and it's definitively jerky too (this time every 2.38s). I did not notice that at the time, it's less obvious to notice compared to the MiSTer on scrolling only (maybe because it's more frequent, I also have scanlines enabled on the OSSC).

It really looks like the frame-drop frequency is related to the delta with standard 60Hz (the greater the delta the higher the frame drop frequency). I was wrongy assuming that my Samsung was able to display at it's input frequency, but that does not seem to be the case (it always displays at standard 60Hz, and uses the latest "captured" frame - that implies that the frame is captured, so more lag ?).

Only FreeSync should provide something totally OK I guess, along with less lag... Is it supposed to be officially supported by the MiSTer (or could we hope for some improvements in this direction) ?
grizzly
Top Contributor
Posts: 381
Joined: Tue Jun 16, 2020 12:22 pm
Has thanked: 58 times
Been thanked: 77 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by grizzly »

Anything over 1080p is overclocking the DE-10 nano's pixelclock and the silicone lottery therefore makes some people for example have a mister that works for 1440p, and some have a max of 1200p, and then some like me have 1080p as max.
Sure it can be the screen/tv that does not like what comes out of the mister at 1440p/1200p but in most cases it is probably bad luck in the silicone lottery.
AtomicShroom
Posts: 172
Joined: Sun Mar 07, 2021 12:28 pm
Has thanked: 31 times
Been thanked: 48 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by AtomicShroom »

I have the same issue it seems. I'm unable to get a perfectly smooth framerate on the SNES core.

MiSTer connected via HDMI to my Samsung HDTV. I also tried it on another older Toshiba HDTV I have lying around and the same issues manifested.

It's butter smooth for the most part, but every few seconds, the framerate has a tiny hiccup, a stutter.

I tried vsync_adjust 0, 1, and 2, and none of them produce the desired effect. They all end up having these micro-stutters, just at different intervals.

What else can I try?
grizzly
Top Contributor
Posts: 381
Joined: Tue Jun 16, 2020 12:22 pm
Has thanked: 58 times
Been thanked: 77 times

Re: Occasionnal jerky scrolling on SNES core

Unread post by grizzly »

Maybe try different resolutions as in 720p/480p?
Will probably not help but it´s pretty fast and easy to try so why not.
Post Reply