Announcement

Collapse
No announcement yet.

Announcement

Collapse
No announcement yet.

AFRd Auto Frame Rate Daemon Works with 64-bit Amlogic Processors

Collapse
This is a sticky topic.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    AFRd Auto Frame Rate Daemon Works with 64-bit Amlogic Processors



    Automatic frame rate switching in TV box ensures video output matches the video frame rate in order to avoid skipped frames (judder) from time to time, and makes the videos much smoother to watch, especially to trained eyes.

    The problem is that the feature is not always implemented, and/or does not work for all apps. AFRd auto frame rate daemon aims to solve this issue by automatically switching video output to match the video framerate ? e.g. 23.976 fps or 59.94 fps ? on Android TV boxes powered by one of Amlogic 64-bit processors, be it S905, S905X, S905X2, S912, S905W and other more recent Armv8 processors from the company.

    AFRd Auto Frame Rate Daemon for Amlogic

    Developed by Andrey Zabolotny (anpaza), AFRd is Linux daemon can be linked to either bionic for Android, or glibc for Linux operating systems, and the source code can be found on Github.

    It relies on two techniques to detect the video frame rate, and adequately change video output (HDMI) frame rate:
    • Kernel uevent-based notifications available in AmLogic 3.14 kernels up to Kernel 4.9 used in Android 7 and 8. Example of uevent when a 29.976 fps movie is started (FRAME_RATE_HINT contains the info):


    1
    2
    3
    4
    5
    6
    7
    8
    9
    change@/devices/virtual/tv/tv
    ACTION=change
    DEVPATH=/devices/virtual/tv/tv
    SUBSYSTEM=tv
    FRAME_RATE_HINT=3203
    MAJOR=254
    MINOR=0
    DEVNAME=tv
    SEQNUM=2787
    • In newer kernels or when uevent notifications are not generated, video decoder notifications emitted at the start and end of playback are used instead. Example of video start:
      1
      2
      3
      4
      5
      6
      add@/devices/vdec.25/amvdec_h264.0
      ACTION=add
      DEVPATH=/devices/vdec.25/amvdec_h264.0
      SUBSYSTEM=platform
      MODALIAS=platform:amvdec_h264
      SEQNUM=2786
      Since the frame rate is not shown in the data, the daemon will check /sys/class/vdec/vdec_status when the event above is detected:
      1
      2
      3
      4
      5
      6
      7
      8
      9
      vdec channel 0 statistics:
      device name : amvdec_h264
      frame width : 1920
      frame height : 1080
      frame rate : 24 fps
      bit rate : 856 kbps
      status : 63
      frame dur : 4000
      ...
      Frame dur is used is not zero, otherwise frame rate data is selected with 23 fps meaning 23.976 fps, 29 is 29.970fps and 59 represents 59.94 fps.

    The installation will be easily in Android, as Andrey provides an apk (ru.cobra.zap.afrd-0.3.2.apk) which you can install in your rooted TV box. AFRD screenshot Click to Enlarge
    Then you can enter the app to enable/disable auto frame rate, and adjust other settings such as preferred frequencies. It?s also possible to directly edit AFDR configuration, and/or control the daemon through an API as explained in details in the Github page.

    Source:
    CNXsoft
    https://www.cnx-software.com/2019/07...gic-processors


    treboR
    Please consider
    Donating to Freaktab

    #2
    this is really nice work !!

    i had a problem with the youtube on beelink GT1 , there was screen flickering and green flashes when you choose any quality heigher than 720 P
    but now all fixed

    on the down side the screen is going black every time there is a change in the rate which is annoying , but overall nice work

    thx

    Comment


      #3
      I have a Mini M8S II and a Mecool M8S Pro W and have tried AFRd on both. Both a rooted and I can run the program.

      On the Mini M8S II, the green turns green and then appears to lose connection with the TV with loss of HDMI signal. The power light on the Mini M8S II is still on, however there is no response to the remote and I have to reboot it.

      On the Mecool M8S Pro W, the media plays but the frame rate is not correct and still flickers. It doesn't appear to change the TV refresh rate.

      Just hoping to see if other people have these devices and managed to get AFRd to work.

      Otherwise, wonder if it would be a good idea to create a list of devices that do work with AFRd

      Thanks

      Comment

      Working...
      X