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

[libretro] retro_get_system_av_info always reports 59.94 fps #14748

Open
3 of 5 tasks
Jamiras opened this issue Aug 20, 2021 · 1 comment
Open
3 of 5 tasks

[libretro] retro_get_system_av_info always reports 59.94 fps #14748

Jamiras opened this issue Aug 20, 2021 · 1 comment
Labels
Libretro Issue on Libretro but not all ports.

Comments

@Jamiras
Copy link

Jamiras commented Aug 20, 2021

Game or games this happens in

All

What area of the game / PPSSPP

When I run a game at 30fps, the core still reports 60fps. This is hardcoded in the libretro interface here:

info->timing.fps = 60.0f / 1.001f;

The actual framerate of the core appears to be managed by how much audio data is pushed through the audio callback. The audio callback will block until there's room in the audio buffer for the pushed data, thus making the core.step take one frame to execute. When the audio being pushed by a single core.step is enough for 1/30th of a second, only 30 calls to core.step can occur per second. Since this is less than the 60fps that the core claims it should be generating, the frontend may start dropping renders to try to achieve the 60fps target rate. This causes the actual framerate to be even less than the 30fps being generated.

What should happen

I believe the framerate reported by the retro_system_av_info structure should reflect the actual number of frames being generated, and the RETRO_ENVIRONMENT_SET_SYSTEM_AV_INFO environment callback should be called if/when the fps changes.

The workaround is to set the ppsspp_frame_duplication setting to "enabled", thus causing the core to actually generate 60fps. But the default value for that is "disabled", and most users won't know to change it.

Logs

No response

Platform

Windows

Mobile phone model or graphics card

Radeon RX 480

PPSSPP version affected

libretro core 005f145

Last working version

n/a

Graphics backend (3D API)

OpenGL / GLES

Checklist

  • Test in the latest git build in case it's already fixed.
  • Search for other reports of the same issue.
  • Try resetting settings or older versions and include if the issue is related.
  • Try without any cheats and without loading any save states.
  • Include logs or screenshots of issue.
@unknownbrackets
Copy link
Collaborator

unknownbrackets commented Aug 21, 2021

I don't know anything about libretro's audio handling and don't use it, but I will tell you that a physical PSP always produces 59.94.

You can read an explanation of why PPSSPP doesn't produce exactly that many frames here:
#14315 (comment)

We used to time emulation based on audio (back in like PPSSPP v0.4.x or something), and changed to using vsyncs because games are very inconsistent (and allowed to be) in how they buffer audio. Is it another limitation of libretro that it's only designed to time things based on audio?

Sounds like maybe the setting to force frame output should be on always. PPSSPP on libretro is already slower and more buggy due to libretro limitations anyway, so presumably someone would run PPSSPP proper if they wanted better frameskip, speed, or compatibility anyway.

-[Unknown]

@LunaMoo LunaMoo added the Libretro Issue on Libretro but not all ports. label Aug 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Libretro Issue on Libretro but not all ports.
Projects
None yet
Development

No branches or pull requests

3 participants