freezy / dmd-extensions

A toolbox for virtual pinball dot matrix displays.
GNU General Public License v2.0
128 stars 54 forks source link

[DLL] Problems with refresh rate #45

Closed xantari closed 7 years ago

xantari commented 7 years ago

I just installed DMDExt and got it to work. I wanted to install it as it has round dots and color support.

I tested with only one game and found that there appears to be a problem with refresh rate. It is noticably delayed and seems to not refresh screen very well and presents a "ghosting" effect.

This issue does not occur with native VPM and I have a very powerful pincab (16GB DDR4, 4ghz Core i7-6700k, GTX 960, all SSD).

Is there something I can do to make it refresh better?

I noticed there is a VP to VPM sync option. Would that help? What value to put there?

Here is a video of VPM 2.9 Native sttng_l7 ROM:

https://www.youtube.com/watch?v=6YonPW27n7c

Here is a video of VPM 2.9 with DMD Ext sttng_l7 ROM.

https://www.youtube.com/watch?v=SYm8diAYX1U

NOTE: I had to set ignorear = true for sttng_l7 ROM in these videos otherwise right hand 10% of screen gets chopped off.

Using DMDExt 1.5.2 with VPM 2.9 SAM Build (rev 4245)

Here is my config file: DmdDevice.zip

freezy commented 7 years ago

Hmm that's a new one :)

VPM integration works by VPM calling dmdext directly, so there is no "refresh rate". Basically we render an image when VPM tells us to do so. Which makes me think it's an output-related problem, which is weird, because the virtual DMD is purely software and doesn't have to deal with anything complicated like the hardware DMDs do.

Do you have any other dmdext supported game (Pinball FX2, Pinball Arcade or Pro Pinball)? It would be interesting to know if you have the same problem there. Also, a log would be interesting, explanations how to get it are here.

xantari commented 7 years ago

Here is the log file. Also giving you my .reg settings for VPM for that ROM.

DmdDevicelog.txt

sttng_l7 registry.txt

Here are some ideas:

  1. Could it be the VPM to VP sync flag?
  2. Fast frames settings?
  3. The resolution at which I was originally running VPM (I have a 1920x1080 dmd monitor, so I had to size it very high). Perhaps setting it to 128x32 might solve the problem. Will try that tonight.
freezy commented 7 years ago

The dots are rendered with a GPU shader, so performance-wise, it should't be a problem (runs smoothly at 1440p on my machine). However, I assume you have a third DMD monitor? Maybe that's a problem. Can you try a test on your primary or secondary monitor?

xantari commented 7 years ago

Yes, I have 3 monitors all running at 1920x1080p @ 60hz. Will try that this evening.

xantari commented 7 years ago

So I finally got around to playing with this. The problem seems to be gone, but i'm not sure which setting did it.

Here is what I did:

  1. Set Frame Limit/VSync in Visual Pinbal to 1 (was 0)
  2. Set resolution for VPM for 1886 x 500 to 512 x 128 (4:1 ratio as suggested in forums that DMDs are typically 128 x 32, except for sega DMD's which I guess are 196 x 64)
  3. Set the showpindmd to 1 (use external dmd device), and showwindmd to 0 (hide the native VPM window)
  4. Set dmd_pos_x and dmd_pos_y to 0 and 0. Was initially set to my 3rd screen, which was 3996 x 500

What are the recommended settings for VPM when using external DMD device when using the virtual display driver?

I have questions on what proper setting should be for the following values:

  1. VP to VPM Sync level (currently set to 0)
  2. Proper Fast Frames setting? (Currently mine is set to 4294967295 or 0xffffffff)
freezy commented 7 years ago

Interesting. Can you move it back to the third screen and see if it stutters again? Maybe there is a limit on how many screens GPU shaders can be active at the same time...

I'm not aware of the sync level and fast frames settings. I suppose those are in VPX?

xantari commented 7 years ago

Just so I'm clear, the set dmd_pos_x and dmd_pos_y settings are the registry settings in VPM that I set to 0, 0. Since I have showwindmd to 0, i do not actually see that dmd window rendered.

So the only thing being rendered is the dmd extension virtual dmd window on my 3rd screen now.

Are you wanting me to put the dmd_pos_x and dmd_pos_y back to the original values (on the 3rd screen), even though showwindmd is 0, and not showing the VPM rendered DMD?

The sync level is a setting when you go into VPM and look at the game options. It says something like VP <-> VPM Sync Level.

The Fast Frames setting is a registry entry under the specific rom you are looking at. I'm not really sure what it controls to be honest.

xantari commented 7 years ago

My theory, but I have not tested it yet, is that VPM renders the information at 1886 x 500 (very high resolution), and the dmd extensions maybe was chocking on that much pixel data. Perhaps moving that down to 512 x 128 is what fixed the issue. For that matter, perhaps moving it down to the 128 x 32 would make it even more efficient.

I guess I don't really understand the rendering pipeline when using dmddevice.dll

freezy commented 7 years ago

Well, DmdDevice.dll gets DMD pixel data independently from VPM's internal rendering. Basically we always get a 4096 byte array with one byte per pixel. So in any test you should be able to ignore anything related to VPMs DMD because I don't think it concerns DmdDevice's virtual DMD.

That was also why I was confused about your statement about dmd_pos_x and dmd_pos_y. It looks like you meant the position of VPM's DMD, which I think is irrelevant.

So finally the third monitor where DmdDevice's virtual DMD was laggy is the same as before, only that you changed the resolution? Can you try to revert back to the same resolution as before to see if it gets laggy again?

freezy commented 7 years ago

Closing this, feel free to reopen when the problem reoccurs.