Skip to main content
New Participant
July 17, 2025

native request refresh rate

  • July 17, 2025
  • 1 reply
  • 84 views

I want native android app to request refresh rate change like openxr app does using
https://registry.khronos.org/OpenXR/specs/1.0/html/xrspec.html#xrRequestDisplayRefreshRateFB

I tried to do it using ANativeWindow_setFrameRate but it doesn't work. I guess compositor ignores request from 2d apps as they control only small part of the the display.

I'm using as simple test
https://github.com/android/ndk-samples/tree/master/native-activity
After quest 2 is forced to run in 120fps using ADB, ORV metrics tool shows that app easily provides 120 frames.
Profiler shows that frames are on display only 8.35ms.

App is running in passthrough mode.
Just need an api to change refresh rate from android native app

    This topic has been closed for replies.

    1 reply

    New Participant
    July 23, 2025

    https://github.com/meta-quest/Meta-OpenXR-SDK/tree/main/Samples/XrSamples/XrCompositor_NativeActivity
    This sample allows to change refresh rate using thumb stick click and I confirmed using profiler and OVR Metrics tool it actually changes it. Like magic.

    Next I've changed 
    https://github.com/meta-quest/Meta-OpenXR-SDK/blob/7b16fc57f50e38e9e004d652eacf48c1124ae1ae/Samples/XrSamples/XrCompositor_NativeActivity/Projects/Android/AndroidManifest.xml#L48
    just comment out
    <!-- <category android:name="org.khronos.openxr.intent.category.IMMERSIVE_HMD" />-->
    in order to make app 2d

    Secondly set default refresh rate
    https://github.com/meta-quest/Meta-OpenXR-SDK/blob/7b16fc57f50e38e9e004d652eacf48c1124ae1ae/Samples/XrSamples/XrCompositor_NativeActivity/Src/XrCompositor_NativeActivity.c#L3111
    to 

    OXR(appState.pfnRequestDisplayRefreshRate(appState.Session, 120.0f));

    and it actually changes refresh rate.
    Yes it can't render 120 frames unless you don't look at the app window.

    Nevertheless quest accepts xr request to change refresh rate even if it is 2d app.
    Although it ignores such request from ANativeWindow_setFrameRate