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

[Bug]: Refresh rate switching not working on Google TV - 24fps content stutter #1151

Open
JJD2K opened this issue Mar 6, 2024 · 41 comments
Open
Assignees
Labels
bug Something isn't working enhancement New feature or request

Comments

@JJD2K
Copy link

JJD2K commented Mar 6, 2024

Problem description

Please use the new refresh rate switching in Google TV 12 to avoid 24fps stutter:
https://developer.android.com/media/optimize/performance/frame-rate)
https://www.reddit.com/r/AndroidTV/comments/xro84w/current_state_of_frame_rate_matching_in_android/

Current refresh rate switching has never worked if Nova is used on Android TV or Google TV natively - not from an external player.

Steps to reproduce the issue

Play a 24 fps movie on a Google TV and watch a scene with a panning or moving camera.

Expected behavior

No response

Your phone/tablet/androidTV model

TCL C845

Operating system version

Google TV 12

Application version and app store

Latest from Google Playstore

Additional system information

No response

Debug logs

No response

@JJD2K JJD2K added the bug Something isn't working label Mar 6, 2024
@courville
Copy link
Contributor

I understand your request. I have a question though: if you disable Frame Rate Matching of Android 12 in Android settings, does the adaptive refresh rate of nova works on your TCL Android TV (to be enabled in nova settings)?
My current take is that the two options are not compatible.

@JJD2K
Copy link
Author

JJD2K commented Mar 6, 2024

I have not seen such a setting - I will check, but I do not think it exists.
Nova refresh rate switching has NEVER worked on Android TV - I reported that to you before. I mean running Android on TV - it is working from external player - my Mibox does switch to 24fps and does not stutter, but if I play from TV it does not switch and it stutters.
This issue is not related to TCL - I have the same issue on SONY.

There were some XML manifest settings that you had to set in the package to mark NOVA as a MEDIA APP - otherwise those API do not work. You did not try those. (this was some years ago maybe things changed now)

P.S. I checked and there is no refresh rate matching settings - NOVA is the one that should set the refresh rate - it will not work on its own.
KODI plays perfectly on 24fps without enabling refresh rate switch in its settings - I read somewhere that they use this new API.

@phhusson
Copy link
Contributor

phhusson commented Mar 6, 2024

There are pretty much no INI files in Android... Maybe they are relevant to your platform but then it's specific to your platform.
Got any reference to INI file?

@JJD2K
Copy link
Author

JJD2K commented Mar 6, 2024

@phhusson That is not true - there is an application manifest - I meant XML

@JJD2K
Copy link
Author

JJD2K commented Mar 6, 2024

Nova has to notify the framework for the frame rate:
https://developer.android.com/training/tv/playback/framerate

@phhusson
Copy link
Contributor

phhusson commented Mar 6, 2024

We do notify the framework for the framerate, using this API:
https://developer.android.com/reference/android/view/WindowManager.LayoutParams#preferredDisplayModeId

And this API has been available since much longer (Android 6) than the one you linked (Android 12) (which isn't related to manifest either?)

It is indeed possible that your TVs are non-conformant, but I don't have the budget to buy those. If you have an actual source of information saying that your TV is indeed non-conformant on preferredDisplayModeId, but it is conformant on SurfaceControl.setFrameRate() we might take a look.

@courville
Copy link
Contributor

courville commented Mar 6, 2024

OK I will try to check tomorrow what a Sony TV replies.
@JJD2K would you please be able to post here the output of: adb shell dumpsys on your TCL Android 12 TV?

@JJD2K
Copy link
Author

JJD2K commented Mar 6, 2024

I wrote that it is not TV specific - I reported years ago that Nova refresh rate switching does not work on Android TV 6+ up to Google TV 12. I also had found info that those APIs to work it was necessary to mark the app as VIDEO in the manifest file - It was long ago I do not know if that info is still relevant at all.

@JJD2K
Copy link
Author

JJD2K commented Mar 6, 2024

@courville Yes I will provide them. I will also enable refresh rate info in developer options as both TVs do not display INFO if running an app.

Did you see my replies about multi-channel? I will be glad to test those too if you have any recommendations.
Thank you very much for your replies.

@courville
Copy link
Contributor

I wrote that it is not TV specific - I reported years ago that Nova refresh rate switching does not work on Android TV 6+ up to Google TV 12. I also had found info that those APIs to work it was necessary to mark the app as VIDOE/MEDIA in the manifest file - It was long ago I do not know if that info is still relevant at all.

Uh strange... I use nova adaptive refresh rate on Google Chromecast (sabrina), fireTV stick and nvidia shield with current nova releases.

@JJD2K
Copy link
Author

JJD2K commented Mar 6, 2024

@courville You missed what I wrote - those devices are connected via HDMI. The TV apps work directly on the TV - that is the difference. I guess you did not understand the difference. I already wrote that it works on my Mibox which is also connected via HDMI.
The issue is it does not work running the app directly on the TV - it does not stream via HDMI.

@courville
Copy link
Contributor

OK back to square one (your statement about "not TV specific" was misleading to me): please provide the dumpsys (full one). I will try on Android TV Sony TV tomorrow.

@JJD2K
Copy link
Author

JJD2K commented Mar 6, 2024

I am sorry, I meant that it is not specific to a particular TV model or Android version. If you are running Nova on the TV it does not work. If you are running Nova on external device connected via HDMI it does work.
I hope that clarifies.

@courville
Copy link
Contributor

Thanks for sharing the dumpsys. It reveals that your panel only supports one mode:

    mSupportedModes=
      DisplayModeRecord{mMode={id=1, width=3840, height=2160, fps=60.000004, alternativeRefreshRates=[]}}

Thus nova cannot switch to a display mode with a refresh rate matching the video fps.
Android 12 with "match content frame rate" feature could be the solution but would involve some internal motion compensation preserving the current display mode via SurfaceControl.setFrameRate or the same API would switch dto a display mode that is not advertized.

Before going further, have you seen any other video player to properly handle the 24fps video on your TV?

@JJD2K
Copy link
Author

JJD2K commented Mar 7, 2024

@courville
Thank you very much for looking at these core features. I really believe they are important for more users than you think - mobile phones, tablets, TVs - all run Nova without HDMI.

KODI is playing the same files without any stutter. It also can pass-through without issues. There is an option for refresh rate switching in KODI, but it plays well regardless if it is ticked or not. I guess Nova is using different libs to decode or is configured differently. 24fps without 3:2 pulldown is a disaster.
I read somewhere that KODI already supports that API, but I can not be sure about that - you have to check.
24fps stutter in Nova is noticeable with different strength on different files. On some files, it is very obvious and totally unwatchable, while on other files it is noticeable mainly in panning shots where the camera is moving or rotating slowly.

Those supported modes can not be correct. This TV supports up to 144hz and VRR. Plus Mibox does switch it to 24fps running Nova. (external HDMI device)

The option to show the debug refresh rate is not present in the developer options on the TV - I do not know why. Do you know any way of checking the refresh rate? The INFO button on both SONY and TCL does nothing when running an app from the TV - it shows info only for HDMI signals. I will connect a keyboard to the tv later and check the KODI debug info to see what refresh rate is running - I think CTRL+i or CTRL+o was displaying real-time decoding info.

@JJD2K
Copy link
Author

JJD2K commented Mar 7, 2024

KODI plays the same file very smooth, regardless if refresh rate switching is on or off.
Pressing "O" (info try also CTRL+O) I see that it constantly changes the System rendering speed between 60.52 nad 59.52
Probably it is doing 3:2 pulldown.

@courville
Copy link
Contributor

OK let's add an adaptive refresh rate to nova that calls SurfaceControl.setFrameRate for API>31 and try it out.

@courville courville self-assigned this Mar 9, 2024
@courville courville added the enhancement New feature or request label Mar 9, 2024
@JJD2K
Copy link
Author

JJD2K commented Mar 9, 2024

@courville That will be great thank you. If you want me to test something let me know.

courville added a commit to nova-video-player/aos-Video that referenced this issue Mar 9, 2024
@courville
Copy link
Contributor

courville commented Mar 9, 2024

@JJD2K, I gave it a shot but I do not see a lot of difference with my setup (chromecast hd on LG tv). Please comment if you observe any improvement on your side by selecting the third option in the adaptive refresh rate setting menu.
Test apk is there https://drive.google.com/file/d/1ms9Ju_jqeEIjaC0GDymsUE-7KEjPpIo5/view?usp=sharing
I could have done something wrong on the implementation.

@JJD2K
Copy link
Author

JJD2K commented Mar 9, 2024

I believe you can not test it on a device that is connected via HDMI - I think the OS should run on the TV itself for it to work.
I will test and let you know.
Thank you very much.

@JJD2K
Copy link
Author

JJD2K commented Mar 10, 2024

Thank you very much for the update, unfortunately it makes no difference.
I sent you the file that I tested with.
I did more tests and observed something strange with Kodi.
I tested KODI and Nova on the Mibox.

  1. With refresh rate switching ON, both play smooth and I see the TV switching to 24fps
  2. With refresh rate OFF both stutter

I then ran Kodi on the TV and with refresh rate switching OFF it plays smooth which is very strange. The TV does not indicate any refresh mode switching. I do not know what KODI does but it plays as smooth as if the switching is ON.
I will test Kodi on my old Sony with old Android and if it plays well there too then it uses something different than the new Android TV 12 API. Maybe it is doing 3:2 pulldown if running on TV ? I do not know.

@courville
Copy link
Contributor

courville commented Mar 10, 2024

I then ran Kodi on the TV and with refresh rate switching OFF it plays smooth which is very strange. The TV does not indicate any refresh mode switching. I do not know what KODI does but it plays as smooth as if the switching is ON.

perhaps it is your TV that does the rate matching.
On google chromecast (sabrina), I have an android setting under display and sound with "adjust as a function of frame rate" and there are 3 options: fluid, non-fluid, never. I guess that fluid does not allow display refresh rate switch and would apply pulldown and non-fluid would allow rate switching. I will test.

EDIT: all what I can test is via HDMI with chromecast 4k.
With mode 2, I get:

adb shell dumpsys SurfaceFlinger | grep mode
DesiredDisplayModeSpecs (DisplayManager): default mode ID: 12, allowGroupSwitching = 1, primary range: [0.00fps 60.00fps], app request range: [0.00fps inffps]
Current mode: {id=12, hwcId=12, fps=23.98, width=1920, height=1080 group=16}
(mode override by backdoor: no)
Max supported DV mode: 2160p30hz,DV_RGB_444_8BIT,

Clearly with mode 2, nova does not manage to get DesiredDisplayModeSpecs known.
With mode 1, I get:

$ adb shell dumpsys SurfaceFlinger | grep mode
DesiredDisplayModeSpecs (DisplayManager): default mode ID: 5, allowGroupSwitching = 1, primary range: [0.00fps 60.00fps], app request range: [0.00fps inffps]
Current mode: {id=5, hwcId=5, fps=59.94, width=1920, height=1080 group=8}Display 4620251171937191956 color modes:
    Current color mode: ColorMode::NATIVE (0)
DesiredDisplayModeSpecs (DisplayManager): default mode ID: 12, allowGroupSwitching = 1, primary range: [0.00fps 60.00fps], app request range: [0.00fps inffps]
Current mode: {id=12, hwcId=12, fps=23.98, width=1920, height=1080 group=16}

With mode 1, the refresh rate switch happens to match video fps.

@courville
Copy link
Contributor

Update: when using Surface.CHANGE_FRAME_RATE_ALWAYS i.e. using videoSurface.setFrameRate(wantedFps, Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE, Surface.CHANGE_FRAME_RATE_ALWAYS); instead of videoSurface.setFrameRate(wantedFps, Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE);, I manage to witness rate switching in mode 2 with android setting "non-fluid" mode:

$ adb shell dumpsys SurfaceFlinger | grep mode
DesiredDisplayModeSpecs (DisplayManager): default mode ID: 5, allowGroupSwitching = 1, primary range: [0.00fps 60.00fps], app request range: [0.00fps inffps]
Current mode: {id=12, hwcId=12, fps=23.98, width=1920, height=1080 group=16}

courville added a commit to nova-video-player/aos-Video that referenced this issue Mar 10, 2024
…ME_RATE_ALWAYS that we have fixed video fps

According to: https://developer.android.com/media/optimize/performance/frame-rate

> For video apps, the compatibility parameter passed to setFrameRate() should be set to Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE to give an additional hint to the Android platform that the app will use pulldown to adapt to a non-matching display refresh rate (which will result in judder).

See nova-video-player/aos-AVP#1151
@courville
Copy link
Contributor

BTW I checked xbmc code and there is no videoSurface.setFrameRate which would mean that it is not using Android 12+ matching frame rate feature.

@courville
Copy link
Contributor

courville commented Mar 10, 2024

@JJD2K please test the following apk that should apply pulldown if "fluid" rate matching is selected or change refresh rate on "non-fluid" android option (that you might not have on your TV).
If this does not work on your side, I guess that I will need a TCL TV to debug and this is not going to happen magically (I have no access to Android 12 TV...).

@courville
Copy link
Contributor

For the record, looking at adb dumpsys SurfaceFlinger, I see:

  • with mode 2 and android fluid setting, it sees nova requests 23.98fps
Display 4620251171937191956 HWC layers:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 Layer name
           Z |  Window Type |  Comp Type |  Transform |   Disp Frame (LTRB) |          Source Crop (LTRB) |     Frame Rate (Explicit) (Seamlessness) [Focused]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 SurfaceView[org.courville.nova/com.a[...]ideo.player.PlayerActivity](BLAST)#0
  rel      0 |            0 |     DEVICE |          0 |    0  140 1920  940 |    0.0    0.0 1920.0  800.0 | 23.98fps ExactOrMultiple SeamedAndSeamless    [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 org.courville.nova/com.archos.mediacenter.video.player.PlayerActivity#0
  rel      0 |            1 |     DEVICE |          0 |    0    0 1920 1080 |    0.0    0.0 1920.0 1080.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
  • with mode 0 android fluid setting:
Display 4620251171937191956 HWC layers:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 Layer name
           Z |  Window Type |  Comp Type |  Transform |   Disp Frame (LTRB) |          Source Crop (LTRB) |     Frame Rate (Explicit) (Seamlessness) [Focused]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 SurfaceView[org.courville.nova/com.a[...]ideo.player.PlayerActivity](BLAST)#0
  rel      0 |            0 |     DEVICE |          0 |    0  140 1920  940 |    0.0    0.0 1920.0  800.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 org.courville.nova/com.archos.mediacenter.video.player.PlayerActivity#0
  rel      0 |            1 |     DEVICE |          0 |    0    0 1920 1080 |    0.0    0.0 1920.0 1080.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
  • with mode 2 and android non-fluid setting, I get the same as fluid setting:
Display 4620251171937191956 HWC layers:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 Layer name
           Z |  Window Type |  Comp Type |  Transform |   Disp Frame (LTRB) |          Source Crop (LTRB) |     Frame Rate (Explicit) (Seamlessness) [Focused]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 SurfaceView[org.courville.nova/com.a[...]ideo.player.PlayerActivity](BLAST)#0
  rel      0 |            0 |     DEVICE |          0 |    0  140 1920  940 |    0.0    0.0 1920.0  800.0 | 23.98fps ExactOrMultiple SeamedAndSeamless    [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 org.courville.nova/com.archos.mediacenter.video.player.PlayerActivity#0
  rel      0 |            1 |     DEVICE |          0 |    0    0 1920 1080 |    0.0    0.0 1920.0 1080.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------

It indicates that nova's request is indeed propagated to Android using the last code change (which is progress).

@courville
Copy link
Contributor

@JJD2K please let me know on your TV if you have an android setting that deals with matching frame rate in your "display and sound" section.

@JJD2K
Copy link
Author

JJD2K commented Mar 10, 2024

@courville
Hi, a lot of info :)
No I do not have such option - I wrote that before. I have carefully searched both picture settings and also system settings as those options are scattered all over.

The only options that could be related are in PICTURE-ADVANCED-MOTION:
Refresh rate: Standard/Performance (this does not seem to make any difference - description says for games with refresh rate between 50-60 Hz)
Dynamic Acceleration: ON/OFF (this forces higher refresh rate regardless of the content)

I do not think that those are related to this API. I will carefully read your messages, test and provide info.

@JJD2K
Copy link
Author

JJD2K commented Mar 10, 2024

@JJD2K please test the following apk that should apply pulldown if "fluid" rate matching is selected or change refresh rate on "non-fluid" android option (that you might not have on your TV). If this does not work on your side, I guess that I will need a TCL TV to debug and this is not going to happen magically (I have no access to Android 12 TV...).

Is pulldown applied by default? Why not just make it an option in the refresh rate setting or is it too hard to be optional?

@JJD2K
Copy link
Author

JJD2K commented Mar 10, 2024

Disabled
Display 0 HWC layers:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 Layer name
           Z |  Window Type |  Comp Type |  Transform |   Disp Frame (LTRB) |          Source Crop (LTRB) |     Frame Rate (Explicit) (Seamlessness) [Focused]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 SurfaceView[org.courville.nova/com.a[...]ideo.player.PlayerActivity](BLAST)#0
  rel      0 |            0 |     DEVICE |          0 |    0  276 3840 1882 |    0.0    0.0 3840.0 1606.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 org.courville.nova/com.archos.mediacenter.video.player.PlayerActivity#0
  rel      0 |            1 |     DEVICE |          0 |    0    0 3840 2160 |    0.0    0.0 1920.0 1080.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------

Refresh rate switching on

Display 0 HWC layers:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 Layer name
           Z |  Window Type |  Comp Type |  Transform |   Disp Frame (LTRB) |          Source Crop (LTRB) |     Frame Rate (Explicit) (Seamlessness) [Focused]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 SurfaceView[org.courville.nova/com.a[...]ideo.player.PlayerActivity](BLAST)#0
  rel      0 |            0 |     DEVICE |          0 |    0  276 3840 1882 |    0.0    0.0 3840.0 1606.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 org.courville.nova/com.archos.mediacenter.video.player.PlayerActivity#0
  rel      0 |            1 |     DEVICE |          0 |    0    0 3840 2160 |    0.0    0.0 1920.0 1080.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------

Frame rate matching on

Display 0 HWC layers:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 Layer name
           Z |  Window Type |  Comp Type |  Transform |   Disp Frame (LTRB) |          Source Crop (LTRB) |     Frame Rate (Explicit) (Seamlessness) [Focused]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 SurfaceView[org.courville.nova/com.a[...]ideo.player.PlayerActivity](BLAST)#0
  rel      0 |            0 |     DEVICE |          0 |    0  276 3840 1882 |    0.0    0.0 3840.0 1606.0 | 23.98fps ExactOrMultiple SeamedAndSeamless    [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 org.courville.nova/com.archos.mediacenter.video.player.PlayerActivity#0
  rel      0 |            1 |     DEVICE |          0 |    0    0 3840 2160 |    0.0    0.0 1920.0 1080.0 |                                              [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------

I guess the pull-down mode is never on for me.

@JJD2K
Copy link
Author

JJD2K commented Mar 10, 2024

I put code formatting it outputs crap above. How did you add those code boxes?

@JJD2K
Copy link
Author

JJD2K commented Mar 10, 2024

This is what I get when KODI plays fluently:

Display 0 HWC layers:
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 Layer name
           Z |  Window Type |  Comp Type |  Transform |   Disp Frame (LTRB) |          Source Crop (LTRB) |     Frame Rate (Explicit) (Seamlessness) [Focused]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 SurfaceView[org.xbmc.kodi/org.xbmc.kodi.Main](BLAST)#1
  rel      0 |            0 |     DEVICE |          0 |    0  278 3840 1884 |    0.0    0.0 3840.0 1606.0 | 60.00fps           Exact SeamedAndSeamless    [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 org.xbmc.kodi/org.xbmc.kodi.Main#0
  rel      0 |            1 |     CLIENT |          0 |    0    0 3840 2160 |    0.0    0.0 1920.0 1080.0 | 60.00fps           Exact SeamedAndSeamless    [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------
 SurfaceView[org.xbmc.kodi/org.xbmc.kodi.Main](BLAST)#0
  rel      0 |            0 |     CLIENT |          0 |    0    0 3840 2160 |    0.0    0.0 1920.0 1080.0 | 60.00fps           Exact SeamedAndSeamless    [*]
---------------------------------------------------------------------------------------------------------------------------------------------------------------

@courville
Copy link
Contributor

I guess the pull-down mode is never on for me.

In the last one at least your tv got the request from nova to get the 23.98fps ExactOrMultiple SeamedAndSeamless

@courville
Copy link
Contributor

courville commented Mar 10, 2024

This is what I get when KODI plays fluently:

Kodi seems to request 60.00fps Exact SeamedAndSeamless which is not present in the other modes...
Nova requests 23.98fps ExactOrMultiple SeamedAndSeamless.

@courville
Copy link
Contributor

I put code formatting it outputs crap above. How did you add those code boxes?

you need to put triple backquote for code block

@JJD2K
Copy link
Author

JJD2K commented Mar 10, 2024

Can you add forced pull-down mode with the KODI 60fps settings in the refresh rate switching options?
Is Nova using the same libs as KODI? If yes it should work.

@courville
Copy link
Contributor

Nova and KODI have very different code base. This is not straightforward.
Are the results provided on surface layers based on latest apk shared i.e. https://drive.google.com/file/d/1S5uUp_ZGlDYLbWYiVGdBV-6vdxhhXC8b/view?usp=sharing
Do you confirm that this apk does not provide any improvement?

@JJD2K
Copy link
Author

JJD2K commented Mar 11, 2024

Yes the results are from the latest APK.
I asked for forced pull-down because the settings you pointed are not common and if you are checking them to enable pull-down they will not exist on other devices.

courville added a commit to nova-video-player/aos-Video that referenced this issue Mar 15, 2024
courville added a commit to nova-video-player/aos-Video that referenced this issue Mar 15, 2024
…ME_RATE_ALWAYS that we have fixed video fps

According to: https://developer.android.com/media/optimize/performance/frame-rate

> For video apps, the compatibility parameter passed to setFrameRate() should be set to Surface.FRAME_RATE_COMPATIBILITY_FIXED_SOURCE to give an additional hint to the Android platform that the app will use pulldown to adapt to a non-matching display refresh rate (which will result in judder).

See nova-video-player/aos-AVP#1151
@JJD2K
Copy link
Author

JJD2K commented Mar 31, 2024

https://developer.android.com/media/optimize/performance/frame-rate

There is an example code at the end of the above page.

However, there are scenarios where preferredDisplayModeId should be used instead of setFrameRate(), such as the following:

If the app wants to change the resolution or other display mode settings, use preferredDisplayModeId.
The platform will only switch display modes in response to a call to setFrameRate() if the mode switch is lightweight and unlikely to be noticeable to the user.

If the app prefers to switch the display refresh rate even if it requires a heavy mode switch (for example, on an Android TV device), use preferredDisplayModeId.

Apps that can't handle the display running at a multiple of the app's frame rate, which requires setting presentation timestamps on each frame, should use preferredDisplayModeId.

@courville
Copy link
Contributor

@JJD2K nova uses either preferredDisplayModeId or setFrameRate depending on adaptive refresh rate mode selected (setFrameRate was the last added part of this issue). You can have a look at Player.java code.
We do use part of the code referenced in https://developer.android.com/media/optimize/performance/frame-rate when relevant for Video Players.

@JJD2K
Copy link
Author

JJD2K commented Apr 16, 2024

JustPlayer has feature called Tunneled playback, which when enabled plays extremely smooth.
It is a NATIVE android API and is worth checking:
https://medium.com/google-exoplayer/tunneled-video-playback-in-exoplayer-84f084a8094d
I do not know if it can be used with NOVA decoder libs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants