Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

framerates / timings not being updated correctly? #114

Open
dankcushions opened this issue Apr 11, 2018 · 9 comments
Open

framerates / timings not being updated correctly? #114

dankcushions opened this issue Apr 11, 2018 · 9 comments

Comments

@dankcushions
Copy link

following discussion in libretro/mame2003-plus-libretro#34 (comment) - it appears that mame2010 is somehow bypassing the default audio_max_timing_skew of 0.05, which should mean that games that are 57Hz (eg robocop) are sped up to 60Hz, with the audio respampled to match, UNLESS you lower that setting.

I haven't observed this issue myself but I ended up looking at the code and may have spotted the issue, if there is one.

maybe mame2010 is failing to update info->timing.fps when it loads a games with a fps that is not 60? in the code it appears this value defaults to 60:

info->timing.fps = refresh_rate;
and
static double refresh_rate = 60.0;

it looks like it's attempting to update it here:

refresh_rate = (machine->primary_screen == NULL) ? screen_device::k_default_frame_rate : ATTOSECONDS_TO_HZ(machine->primary_screen->frame_period().attoseconds);
- but i'd have to debug it to find out if it's getting the expected values.

hmm, also it is using the RETRO_ENVIRONMENT_SET_GEOMETRY callback which may not be sufficient to update timings. i think it might need to call RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO instead?

@r-type
Copy link
Contributor

r-type commented Apr 11, 2018

look at how i deal it for 2009 .
https://github.com/r-type/mame2009-libretro/search?utf8=%E2%9C%93&q=retro_fps&type=
in void osd_init(running_machine* machine)
should detect the refteshrate:

retro_fps    = ATTOSECONDS_TO_HZ(video_screen_get_frame_period(machine->primary_screen).attoseconds);
NEWGAME_FROM_OSD=1;

and set in retro_run treat this

if (NEWGAME_FROM_OSD == 1)
   {
      struct retro_system_av_info ninfo;

      retro_get_system_av_info(&ninfo);

      environ_cb(RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO, &ninfo);

      if (log_cb)
         log_cb(RETRO_LOG_INFO, "ChangeAV: w:%d h:%d ra:%f.\n",
               ninfo.geometry.base_width, ninfo.geometry.base_height, ninfo.geometry.aspect_ratio);

      NEWGAME_FROM_OSD=0;
}

@ghost
Copy link

ghost commented Apr 11, 2018

But there isn't an issue with MAME2010, it's playing the games at the correct refresh rate. MAME2003 is wrong.

@r-type
Copy link
Contributor

r-type commented Apr 11, 2018

if game info said 57Hz and game run at 60Hz then mame2010 not work as expected.
also if you change game with mame osd it will not change the refresh speed of the second game....

@dankcushions
Copy link
Author

@ZappaUtopia, as I've told you several times now, the default in retroarch is for audio_max_timing_skew to be set to 0.05. under this setting, a game of 57.4 fps will be sped up to 60fps (using a 60hz display). THAT is the expected behaviour.

@ghost
Copy link

ghost commented Apr 11, 2018

But that is the wrong refresh rate for some games. Thats probably why Mame2010 bypasses it so it plays at the correct speed. Like @r-type said above.

if game info said 57Hz and game run at 60Hz then mame2010 not work as expected

@dankcushions
Copy link
Author

dankcushions commented Apr 11, 2018

again, this is just how libretro/retroarch works (assuming default settings and a 60hz screen). if you want to stop what retroarch does by default, you simply change the settings and it will stop skewing such games. there's no need to bypass anything.

if any cores bypass it somehow, then they are simply not calling the libretro callbacks at the right times, hence this logged issue.

@ghost
Copy link

ghost commented Apr 12, 2018

I just noticed that lr-mame2010 doesn't even have a audio_max_timing_skew option. A few audio options are not there that are present in lr-mame2003.

@dankcushions
Copy link
Author

audio_max_timing_skew is a generic retroarch option and will display regardless of the loaded core. i think you need advanced options enabled to see it, though.

@ghost

This comment was marked as spam.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants