anpaza / afrd

Auto Frame Rate Daemon for 64-bit AMLogic CPUs
GNU General Public License v3.0
35 stars 7 forks source link

Frequencies support #1

Closed mrrdmr closed 5 years ago

mrrdmr commented 5 years ago

Could you add 23.976, 29.97, 59.94 Hz support please?

anpaza commented 5 years ago

Just did it yesterday and commited now. If it's not a secret, in which environment are you using it?

mrrdmr commented 5 years ago

Thanks! S912 (M96X, 2Gb, 3.14 kernel, Vorke Z6 firmware). Haven't prepared build environment yet. Could you give me compiled binary please? Regards.
Can't compile due to old system glibc. Got from you X96MAX kernel using X96's ini file. Looks working but sometimes it doesn't return previous frequency state after end of playing any video.

anpaza commented 5 years ago

Hmm, so your firmware seems to use a recent Linux kernel? Because afrd relies on some changes in AMLogic kernel that happened during summer 2017; before that there were no kernel notifications about framerate changes.

You can extract yesterday compiled afrd binary from initramfs from kernel.img for X96 Max (S905X2) I have released yesterday: https://yadi.sk/d/TRduJuS9qlqM4g Note the ini file is not suitable for S912, take it from git/config/afrd-x92.ini.

The reason it sometimes doesn't return previous screen mode is that some codecs don't emit a FRAME_RATE_END_HINT event at the end of playback. This is also the case with X96 Max (kernel 4.9 and android 8.1), even after I patched most codecs in some cases you won't get events. But the framerate will be restored after you play some other movie with a correctly notifying decoder.

mrrdmr commented 5 years ago

I did this steps. Have mentioned issues with vlc player but spmc works correctly. Thank you, Andrey.

anpaza commented 5 years ago

You can debug such cases by running "afrd -vvv /etc/afrd.ini". It will display every received uevent. Another way is to run "dmesg -C; dmesg -w | grep FRAME_RATE". The kernel does a printk every time it emits a uevent. So, you must see the respective lines in kernel log, at the start and end of playback.

mrrdmr commented 5 years ago

You're right. No any uevent on vlc exit.