HW deinterlacing

  • Works. Reboot only from shell, but works! (I have to edit the Dialogbuttonmenu.xml so I hope it will be possible from the menu)

    The remote (from the Allwinner H3 MXQ Pro TV-Box) works also. So it is now a very good alternative to Amlogic S905, because with these Boxes some HD Channels are not working.

    Allwinner shows a clear good picture.

    Thanks

  • runnershigh I rebased sources on top of latest LE master and uploaded it here: Index of /test/deinterlacing/ But I didn't test them. Can you do that?

    Hi jernej,

    I have tried the latest version LibreELEC-H6.arm-9.80-devel-20200908233818-08c8d60.tar on a Tanix tx6 box streaming video through the tvheadend addon. Deinterlacing does not seem to work for 1080i streams.

    Do I have to turn on some settings in the menu or should it be on by default? Does playing a video with an addon make any difference?

    Regarding the addon repositories, the default Libreelec repository can't be loaded. I had to unsquash SYSTEM and replace links in:

    Code
    /usr/share/kodi/addons/repository.libreelec.tv/addon.xml

    with this repository Index of /addons/9.80.4/ARMv8/arm/

  • Hi ,

    i recently bought a T95max (tanix tx6 variant) and tried the image LibreELEC-H3.arm-9.80-devel-20200908233609-08c8d60.tar, it didn't worked for me, i had no deinterlace option available in kodi. I decided to bit the bullet and build the image myself using a very recent baseline (9.80-devel-20201031184520-cf5a710-tanix-tx6) and your patchset. it still wouldn't work until i realized that module wasn't loaded because projects/Allwinner/linux/linux.aarch64.conf file didn't have have the following change:

    Code
    # CONFIG_VIDEO_MEM2MEM_DEINTERLACE is not set
    +CONFIG_VIDEO_SUN50I_DEINTERLACE=m
     CONFIG_VIDEO_SUN8I_DEINTERLACE=m

    after this change, everything looks good, i can get the deinterlace option from kodi and it works. However your patchset needs some more work, I tried to open an xvid/avi file and this crashed kodi - i suspect the deinterlace module (/dev/video1) cannot work with decoded frames sourced outside of v4l cedrus codec(/dev/media0) or there is a problem with video pipeline. logs below is the tail end of debug logging, just before kodi crashed.

  • i recently bought a T95max (tanix tx6 variant) and tried the image LibreELEC-H3.arm-9.80-devel-20200908233609-08c8d60.tar,

    You're using H3 image on H6 board? I guess you just linked wrong image.

    However your patchset needs some more work, I tried to open an xvid/avi file and this crashed kodi - i suspect the deinterlace module (/dev/video1) cannot work with decoded frames sourced outside of v4l cedrus codec(/dev/media0) or there is a problem with video pipeline.

    At the time I made those patches, SW decoding path was a bit different...

    I have tried the latest version LibreELEC-H6.arm-9.80-devel-20200908233818-08c8d60.tar on a Tanix tx6 box streaming video through the tvheadend addon. Deinterlacing does not seem to work for 1080i streams.

    I have no idea if video from addons is handled any differently. My test case are video files from storage media.

  • You're using H3 image on H6 board? I guess you just linked wrong image.

    my mistake indeed, i meant to link to the H6 image name ;)

    At the time I made those patches, SW decoding path was a bit different...

    i didn't mean this as a criticism - just reporting this potential problem, the patches still apply cleanly though on a more recent baseline. The deinterlace module works great from most 50Hz television feeds i gave but i did see the odd tearing from pure 1080i channels, quite visible on soccer games, not sure if this a real issue or an artifact from macro blocking due to borderline SNR on some of the satellite transponders i tried with.

    i am curious though, i had a peek at the source code, looks like there isn't much options to configure it; how is it meant to work ? does it gets its clues from the decoder itself using motion vectors, etc... or can it work independently using an 'external' source; i.e. from a software decoder.

  • Based on quovodis' suggestions, I successfully compiled the latest version from the main repo with jernej's patches and the following change:

    Code
    +CONFIG_VIDEO_SUN50I_DEINTERLACE=m

    I have no idea if video from addons is handled any differently. My test case are video files from storage media.

    Good news, it works with the tvheadend addon and deinterlaces 1080i channels. However, it looks like it is also deinterlacing 1080p channels. I haven't investigated it any further yet. I am curious about the same thing as quovodis. It would be great, if you could elaborate a bit on how the code is meant to work.

    After making these modifications a new issue arose - the Tanix TX6 box overheats and shuts down after aprox. 5 minutes. I removed the lid and put a fan on it, which makes it run considerably cooler (around 65 deg. C).

  • jernej,

    i've tried your latest patches against yesterdays master commit, and it looks good. deinterlacing works and software decoding is also working. thank you !

    i'm not noticing any power or heat related problem when watching live tv on the T95max using TVHeadend plugin - I hardly believe it's better built than the Tanix TX6 when considering how cheap it is.

    At the same time, I'm a little perplexed with the deinterlacer itself. On my box, it looks it's only performing BOB method, I've noticed the usual tell of judder and ghosting associated with this deinterlacing algorithm. Surely the H6 hw must be capable of better advanced deinterlacing like the PI or other SoC can do.

  • At the same time, I'm a little perplexed with the deinterlacer itself. On my box, it looks it's only performing BOB method, I've noticed the usual tell of judder and ghosting associated with this deinterlacing algorithm. Surely the H6 hw must be capable of better advanced deinterlacing like the PI or other SoC can do.

    Yes, of course, it's capable of better modes than just bob. However, there is no documentation what any option means and how to put it in different modes. It's entirely possible that I misconfigured it. However, at this stage I'm happy that it at least works to some degree...

  • zillevdr Can you try following H5 update for deinterlacing? I get greenish frames but that could be also due to damaged board (I have also network issues on it)

    LibreELEC-H5.arm-9.80-devel-20201221201705-c7aa22f.tar

    Hi Jernej,

    here it deinterlaced fine. But 1080i h264 have artefacts when the picture are moving. This are also without deinterlacer. I think the artefacts are from decoder. It's only a short test. I can't say much about quality.

    Thank you very much!

    Edit: Can I found a git with kernel deinterlacer driver? I will back port to kernel 5.8. This kernel run clean without artefacts.

    Edited once, last by zillevdr (December 22, 2020 at 10:17 AM).

  • We just discovered that this PR ffmpeg, Allwinner: Update H264 request API patches by jernejsk · Pull Request #4606 · LibreELEC/LibreELEC.tv · GitHub introduces H264 decoding issues. Before that it works much better. You can add this patch http://ix.io/2JaK to linux patch collection. I plan to include it in master soon.

    Note that HW deinterlace support was introduced recently, so you'll have a bit of work to combine all required patches and maybe fix them.