Jump to content
  • 0
Ender

Emulator slow-down issue

Question

Maybe I should just make a github issue for this, but I thought I'd see if anyone here has any ideas first.  The emulator has run smoothly for me until recently, when I got a 4k TV as a monitor.  It usually ran at 100% no issues, with minimal occasional audio stuttering.  But since I got the TV it usually runs at around 97% and the audio stutters.  It's still the same resolution window as before, I usually run with "-scale 2".  It's also happening without the "-scale" option.  This is happening for both the emulator release downloaded from the github repo, and one that I've compiled myself.

Share this post


Link to post
Share on other sites

8 answers to this question

Recommended Posts

  • 0
5 hours ago, desertfish said:

Silly question perhaps but does the "try-it-out" in-browser emulator work for you?      Second question: what happens when you dial back the desktop resolution to what you had before?   (as opposed to just running the emulator with the same window size)

(asking this because I think your cpu should be fast enough to run the native emulator just fine...)

The in-browser emulator seems to run fine, no stuttering, I forgot to mention that.  Changing the desktop resolution doesn't seem to matter (which surprised me. what the heck is going on?!).  I even tried turning off HDR since this TV supports it so I had turned it on.  Still no difference.

Edit: OK, so I think I figured it out.  After I got this TV I messed around with my NVIDIA control panel settings, and I had set the max fps to 58 for some reason (since I don't have HDMI 2.1 yet I can only do 60hz refresh rate).  Limiting it in this way seems to have made the emulator run slightly slower than it would.  I don't think I need this since I think it's mainly for G-sync and I have that turned off right now (yet again I'd need HDMI 2.1 for that).  Once I turned that off it seems to be back to normal.

Share this post


Link to post
Share on other sites
  • 0

Shrug. I'm guessing your PC was only barely capable of running the emulator at full speed before, and asking SDL2 to blit the pixels is pushing it over by some small quantity.

For reference, I comfortably run the emulator at full speed on a 4K display, scale 2, quality nearest, on the following machine specs:

  • Intel Core i7-9700K @ 3.60GHz
  • 32 GB of DDR4-2132 memory
  • GeForce RTX 2080 TI (I doubt this is relevant, but maybe SDL2 is using hardware acceleration to perform the blit).

Share this post


Link to post
Share on other sites
  • 0
2 hours ago, StephenHorn said:

Shrug. I'm guessing your PC was only barely capable of running the emulator at full speed before, and asking SDL2 to blit the pixels is pushing it over by some small quantity.

For reference, I comfortably run the emulator at full speed on a 4K display, scale 2, quality nearest, on the following machine specs:

  • Intel Core i7-9700K @ 3.60GHz
  • 32 GB of DDR4-2132 memory
  • GeForce RTX 2080 TI (I doubt this is relevant, but maybe SDL2 is using hardware acceleration to perform the blit).

Seems like it.  I'm just surprised that the resolution of the window doesn't seem to matter.  Also, games seem to still be fine, when running at the same resolutions I played them at before.  It's only the emulator I've had any sort of issue with.  For the record, this PC is a bit old at this point, it definitely can't do games at 4K.  I still only have a GTX 1070 (which I'm planning to upgrade soon) and an Intel Core I7-6700K @ 4.00GHz. However, I'd at least expect things to run like they did before if it's at the same resolution it was at previously.

Share this post


Link to post
Share on other sites
  • 0

Silly question perhaps but does the "try-it-out" in-browser emulator work for you?      Second question: what happens when you dial back the desktop resolution to what you had before?   (as opposed to just running the emulator with the same window size)

(asking this because I think your cpu should be fast enough to run the native emulator just fine...)

Share this post


Link to post
Share on other sites
  • 0

Yay glad you found the solution.

I don't understand though how limiting the display frame rate is of any consequence to the speed the application runs, but hey

Share this post


Link to post
Share on other sites
  • 0
45 minutes ago, desertfish said:

Yay glad you found the solution.

I don't understand though how limiting the display frame rate is of any consequence to the speed the application runs, but hey

Looks like the emulator updates at 60fps.

Quote

     if (sdlTicks - last_perf_update > 5000) {
         int32_t frameCount = frames - perf_frame_count;
         int perf = frameCount / 3;
 
         if (perf < 100 || warp_mode) {
             sprintf(window_title, "Commander X16 (%d%%)", perf);
             video_update_title(window_title);
         } else {
             video_update_title("Commander X16");
         }
 
         perf_frame_count = frames;
         last_perf_update = sdlTicks;
     }

That's basically updating the window title every 5 seconds and calculating the percent based on 300 frames having passed (which means 60fps).  So it would make sense that an external factor limiting it to 58 would cause it to be slower than what it expects. 

Edited by Ender

Share this post


Link to post
Share on other sites
  • 0
22 minutes ago, Ender said:

Looks like the emulator updates at 60fps.

That's basically updating the window title every 5 seconds and calculating the percent based on 300 frames having passed (which means 60fps).  So it would make sense that an external factor limiting it to 58 would cause it to be slower than what it expects. 

Metrics are so metric. )

Share this post


Link to post
Share on other sites
  • 0

Yes, the emulator expects to flip the buffers and present a new frame every 60fps, which matches the display rate of the final X16. If the system doesn't allow that, then the emulator will run slow.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...

Important Information

Please review our Terms of Use