bennettpeter / android-MythTV-Leanfront

:tv: MythTV Android TV frontend
GNU General Public License v3.0
45 stars 9 forks source link

Automatic refresh rate switching does not work #67

Closed jarnos closed 10 months ago

jarnos commented 1 year ago

I installed 20230731-leanfront-release-v0-435-ge22bffc.apk to my new Android TV 11 device. I can enable "Match original frame rate" in Playback settings, but when I start playback, it complains with temporary notification it can not switch to 50Hz even though the TV can do it for sure. It works fine with my older Android TV 9 device, which has v0-381-gf51ee45. BTW will this setting become unneeded with Android TV 12?

bennettpeter commented 1 year ago

I just tried it with my Android 12 box (Google TV). It switched refresh rate and reported back "Using refresh rate 50.00".

Check that refresh rate 50 is available in the android settings at the resolution you are using.

The program uses a list of resolutions and refresh rates returned by the operating system and if a suitable rate is not found there (frame rate or a multiple of the framerate), it gives the message that there is no suitable frame rate.

Android 11 and 12 and Exoplayer have some new methods for setting frame rate which make it easier than before. I don't know if they are applied by default, I have not looked into it. I don't know when the Exoplayer changes came in, perhaps I need to upgrade the version of exoplayer used by leanfront.

jarnos commented 1 year ago

Yes it is. But there is no 60Hz mode, but some 59.something according to settings.

jarnos commented 1 year ago

How does it get list of resolutions and refresh rates?

bennettpeter commented 1 year ago
Display display = getActivity().getWindowManager().getDefaultDisplay();
Display.Mode[] modes = display.getSupportedModes();
for (Display.Mode mode : modes) {
    mode.getPhysicalHeight()
    mode.getPhysicalWidth()
    mode.getRefreshRate()
}
jarnos commented 12 months ago

BTW I updated the software in my old Mi TV Stick to the same version. It reports it is using the correct refresh rate, but playback is not fluent for some reason.

jarnos commented 11 months ago

I wonder, if there is something wrong with my Nokia Streaming Box 8010 since the automatic refresh rate switching does not work by it. If you want me to test which modes it gives, I need more complete instructions.

jarnos commented 11 months ago
Display display = getActivity().getWindowManager().getDefaultDisplay();
Display.Mode[] modes = display.getSupportedModes();
for (Display.Mode mode : modes) {
    mode.getPhysicalHeight()
    mode.getPhysicalWidth()
    mode.getRefreshRate()
}

Is the rate exactly the same I see in Android settings? Is there a problem for the frontend in choosing the best mode, if the numbers are not natural (integer) numbers?

bennettpeter commented 11 months ago

I don't know an easy way to find out what mode choices the program is given with that code. They may not be the same choices as the settings app supports.

Sometime I will look into the new features in Android 11 and Exoplayer for automatic refresh rate switching. Perhaps that will help.