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

Android: Frame limiter causes app to shutdown on some devices #7170

Open
AJenbo opened this issue Jul 1, 2024 · 0 comments
Open

Android: Frame limiter causes app to shutdown on some devices #7170

AJenbo opened this issue Jul 1, 2024 · 0 comments
Milestone

Comments

@AJenbo
Copy link
Member

AJenbo commented Jul 1, 2024

Operating System

Windows x64

DevilutionX version

1.5.2

Describe

It appears that some devices will close apps that are not keeping up with the screen refresh rate. A user reported that when the frame limiter tries to keep the game running at 60fps on a 120hz display the app will be terminated with no error report or other indications after about 3 minutes.

We made the following conclusions:

  • The frame limiter isn't getting correct information regarding the display
  • V-sync and frame limiter should not be enabled at the same time, preferably we should change it to an enum and not two bool options (this would also help clear existing bad configs)
  • Android will enable v-sync after context switching between apps even if it was off when the app was started

It's a bit unclear if it's possible to query the v-sync status in SDL2, from what I read things have changed in this regard for SDL3, but maybe this works:

Uint32 flags;
if (SDL_GetRendererInfo(renderer, &flags) == 0) {
    if (flags & SDL_RENDERER_PRESENTVSYNC) {
        printf("VSync is enabled.\n");
    } else {
        printf("VSync is not enabled.\n");
    }
} else {
    // Handle error
    printf("Could not get renderer info! SDL_Error: %s\n", SDL_GetError());
}

It is in fact possible that we should more or less assume that all Android devices are vsync capable and should set it as enabled by default and not provide an option to switch it on (and have the limiter off as well).

To Reproduce

1: install DevilutionX on Android with a 120hz display and make sure it's set to 120hz and not 60hz.

Expected Behavior

No response

Additional context

No response

@AJenbo AJenbo added this to the 1.5.3 milestone Jul 1, 2024
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

1 participant