Comments (13)
On a sidenote, I plan to do a ECE style core (may call it differently since it wouldn't be identical to ECE) and that would include fluydsynth which would alleviate the problem somewhat.
from dosbox-svn.
This should be fixed in RetroArch and not in the core.
The SET_AV_INFO switching behavior is controlled by that.
Ideally MIDI shouldn't need to be reinitialized at all for this but I think RA just reinits everything.
from dosbox-svn.
What are the implications of not doing a RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO
? I changed the code as follows, and I still get pixel-perfect sync but without the annoying video reinit:
diff --git a/libretro/libretro.cpp b/libretro/libretro.cpp
index c920cd0a..9996c789 100644
--- a/libretro/libretro.cpp
+++ b/libretro/libretro.cpp
@@ -1350,7 +1350,7 @@ void retro_run (void)
/* Dynamic resolution switching */
if (RDOSGFXwidth != currentWidth || RDOSGFXheight != currentHeight ||
- (fabs(currentFPS - render.src.fps) > 0.05f && render.src.fps != 0 && variable_refresh))
+ (variable_refresh && render.src.fps != 0 && currentFPS != render.src.fps))
{
struct retro_system_av_info new_av_info;
retro_get_system_av_info(&new_av_info);
@@ -1358,27 +1358,22 @@ void retro_run (void)
new_av_info.geometry.base_width = RDOSGFXwidth;
new_av_info.geometry.base_height = RDOSGFXheight;
- if (fabs(currentFPS - render.src.fps) > 0.05f && variable_refresh)
+ if (variable_refresh)
{
new_av_info.timing.fps = render.src.fps;
new_av_info.timing.sample_rate = (double)MIXER_RETRO_GetFrequency();
-
- environ_cb(RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO , &new_av_info);
if (log_cb)
log_cb(RETRO_LOG_INFO,"[dosbox] refresh rate changed %f => %f\n", currentFPS, render.src.fps);
-
currentFPS = render.src.fps;
}
- else
- {
- environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &new_av_info);
- if (log_cb)
- log_cb(RETRO_LOG_INFO,"[dosbox] resolution changed %dx%d => %dx%d\n",
- currentWidth, currentHeight, RDOSGFXwidth, RDOSGFXheight);
- currentWidth = RDOSGFXwidth;
- currentHeight = RDOSGFXheight;
- }
+ environ_cb(RETRO_ENVIRONMENT_SET_GEOMETRY, &new_av_info);
+ if (log_cb)
+ log_cb(RETRO_LOG_INFO,"[dosbox] resolution changed %dx%d => %dx%d\n",
+ currentWidth, currentHeight, RDOSGFXwidth, RDOSGFXheight);
+
+ currentWidth = RDOSGFXwidth;
+ currentHeight = RDOSGFXheight;
}
bool updated = false;
from dosbox-svn.
It shouldn't work, GEOMETRY as the name implies changes... GEOMETRY if it works it's probably a RA bug, I'm just following the SPEC.
from dosbox-svn.
#define RETRO_ENVIRONMENT_SET_GEOMETRY 37
/* const struct retro_game_geometry * --
* This environment call is similar to SET_SYSTEM_AV_INFO for changing
* video parameters, but provides a guarantee that drivers will not be
* reinitialized.
* This can only be called from within retro_run().
*
* The purpose of this call is to allow a core to alter nominal
* width/heights as well as aspect ratios on-the-fly, which can be
* useful for some emulators to change in run-time.
*
* max_width/max_height arguments are ignored and cannot be changed
* with this call as this could potentially require a reinitialization or a
* non-constant time operation.
* If max_width/max_height are to be changed, SET_SYSTEM_AV_INFO is required.
*
* A frontend must guarantee that this environment call completes in
* constant time.
*/
from dosbox-svn.
Yes, it seems like a bug. I had disabled the "sync to exact content framerate" option in RA by accident, and (weirdly) this results in perfect sync with the above patch. Enabling that option breaks sync and timing.
It's a pretty awesome bug though, I must say. I'll be using it personally since it fixes the problem completely 😁
from dosbox-svn.
@twinaphex any words on this.
It actually works. You can change refresh rate without re initializing everything, so what's the point of AV_INFO other than changing the resampler rate?
Bug, or should it grant a change in the spec?
from dosbox-svn.
On a second thought... it shouldn't change the spec... a bug in one frontend shouldn't mean the spec should be changed. Also it may work on one driver or platform and not in another.
Bug should be fixed but.. if it works on all drivers maybe the SET_AV_INFO env should be reimplemented in RA to not reinit unless really neccesary. I figure the only really necessary use cases would be to increase MAX_WIDTH/HEIGHT and/or change resampler rate.
It may only work because DOSBox is in fact running decoupled from the libretro run loop, so I figure a test core that can change refresh rate on the fly should be written to test this.
from dosbox-svn.
@realnc does the FPS counter reflect the change with your patch? can't test right now.
IE: is it working at 70 or whatever it switches to?
from dosbox-svn.
Yes, the FPS counter shows the correct value when the game switches to a different refresh.
from dosbox-svn.
MIDI generally hangs on AV_INFO changes, or on exit, that's a RA issue, I feel like the underlying issue here is solved
from dosbox-svn.
I would like to keep this bug open though, and close it when/if RA or libretro change or add an API to do an AV_INFO change without driver re-init. For as long as this doesn't happen, it's going to be an issue for this core. It's not just MIDI. It's also the screen flashing and digital sound is also freezing for the duration of the switch.
from dosbox-svn.
This was merged:
So we can finally close this one!
from dosbox-svn.
Related Issues (20)
- Screen flooded with text in Prince of Persia HOT 3
- Feature request: shut down the core when a game exits HOT 1
- Emulated mouse button order changed compared with deprecated libretro dosbox port HOT 4
- Inconsistent .conf file naming when created and read (DOSBox-SVN CE) HOT 1
- MT-32 / Munt HOT 7
- Some Titus-produced games fail to detect Adlib/SB16 HOT 1
- Relative paths in playlist unsupported by core HOT 10
- Nintendo Switch Internal FPS problem HOT 2
- Can't see second HDD in Windows 98?
- Automatic image loading? HOT 3
- Core timing mode? HOT 3
- Problems in some games
- Dosbox input! HOT 3
- Update? HOT 3
- There's not an accurate core timing for FPS into Jill of the jungle game, Retroarch HOT 3
- Core options vs Conf file options HOT 1
- Retrorch does not close when using this core with the "Exit HOT 3
- Feature request : "addkey" command
- ogg not working
- MUNT Windows driver not recognized nor found by emulator HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from dosbox-svn.