[BUG] S905X Krypton: Bad chroma upsampling

  • EDIT:
    As it turns out, the root cause is not low quality upscaling, but rather bad chroma upsampling (due to forced deinterlacing) in general.


    All SD and 720p upscaling looks awful.
    Much worse than in Jarvis (7.0.3.012c), worse than on RPi2 and worse than even regular Bilinear upscaling.

    Device type:
    S905X
    Build:
    7.90.beta2
    Device:
    Mini M8S II 2GB/16GB

    How to reproduce:
    Start any SD video and compare to Jarvis.

    Sample:
    Happens with every SD or 720p video.

    Specs from video in log:

    Support logs:
    Attached.
    The video only ran for a few minutes.
    Even the SD video triggered 2 frame skips in that short period of time (other bug report).

  • Yeah but the Jarvis upscaling is something I could live with (I barely watch SD anymore and it is not as obvious on 720p content).
    In Krypton however, it looks unbearably blocky -> unwatchable.

    Thanks for your help. :)

  • Keep in mind that Krypton uses a new, significantly updated and altered "VideoPlayer", replacing the long-used player built upon since the Xbox days (see Video Player section on Krypton RC announcement page).

    Things will be different, things will break, things will need to improve with time. This isn't likely to be anything specific to these custom builds. I would suggest testing performance on other platforms first and reporting it directly in the Kodi.tv forums if similar results are achieved, which I suspect will be.

    TBH, apart from the pretty lipstick (new GUI), I don't find Krypton to be up to the standards set by Jarvis in many ways. It's normal... This is a big milestone jump for them in several regards and I don't expect things to really start smoothing out again until Leia (v18). In the meantime, like you said... Jarvis worked. It still does. There's no reason to move to Krypton prematurely.

  • I have to say that I disagree.
    Krypton builds for Raspberry Pi have basically been rock solid since very early nightlies and the new video player only improved things on RPis (perfect A/V sync).
    Video (and upscaling) quality has not degraded the slightest on the Pis in Krypton.

    However, I am not even able to reproduce that kind of flawless playback on the S905X with Jarvis.
    Audio is always slightly out of sync and I experience subtle micro-stutters, which are not put down as frame drops or skips...


    Anyhow - the video upscaling is left to the hardware on RPIs. It is my understanding, that this is the same for AMLogic devices?
    At least I cannot change the upscaling method when hardware acceleration is enabled, same as on Pis.
    If that is the case, a new video player (software) should not even have a negative impact...

  • That really means nothing. Kodi 17 has been absolutely horrid on the majority of Android devices out there while excellent on others that Team Kodi favors from day one (eg. Shield). Aside from being obsolete due to its lack of x265 support, the Raspberry Pi is a popular and standardized hardware set that makes Team Kodi's ability to implement device-specific enhancements very easy and practical where possible, and they have an official build specifically dedicated to the device range. The same cannot be said for every flavor of chipset out there across countless Android devices.

    The new VideoPlayer "(software)" (as you put it) is the interface for all hardware interaction for playback. Whether it offloads to hardware based decoding when present or CPU-intensive software-level decoding when not, it's involved in every video you attempt to play. Of course it has an impact. It's the entire backbone of Kodi's video playback.

    To explain it in what I would hope is a sound and logical manner for you, my understanding is that LE 7.90 Krypton builds are still using the same drivers/kernels/device trees as the Jarvis build you're indicating works OK. The only difference is that the build is compiled with Krypton rather than Jarvis. If not for changes in Krypton itself (which there are many), you should for the most part be able to expect the exact same overall performance from it as you would Jarvis. Unless a tweak was present in the Jarvis LE builds that improved performance in scaling but is no longer present, it's not LE build related. It's a Kodi issue.

    To be clear, I'm not saying that there are no optimizations that may be possible on the LE side. That is definitely the beauty of kzsaq's builds... They can be far more optimized than stock Kodi ever could, because he has the luxury of optimizing for a more limited device range than Team Kodi does. I'm still relatively new to these builds overall myself, so I'll let kszaq weigh in rather than insist upon external factors to LE being the root cause. I'm simply reminding you that there's an entirely new engine under the hood in Krypton, and I'm suggesting you attempt to reproduce on alternate platforms to confirm if it's expected behavior. For one, if you run Kodi 17 through Android on that same box, is the upscaling any better? I'd suspect not, and that right there would confirm it's not an LE level issue and would be better served engaging Team Kodi for. My point is largely a reminder to temper your current expectations regarding Krypton.

  • Thank you for your help and explanations.
    No need to be condescending however. ;)

    The only other reference I have is an Android tablet (Samsung Galaxy Tab S 8.4) where Krypton also works fine and video playback has not degraded.
    Upscaling is just as good as it was in Jarvis.
    I deleted the original Android on the S905X box almost instantly, because I have witnessed before how messy Android-based Kodi generally is - so I did not see a need for it...


    I have a suggestion for a solution or at least workaround...
    It should be possible to let Kodi always output the native video resolution, right?
    This way we could make use of the generally better TV-internal scaling.
    Maybe just a box to click like "Output native video resolution (use TV upscaling) = on/off".

    Right now it is already possible to run Kodi in 1080p and still output 2160p natively... This should be possible for the other resolutions as well?
    What do you think kzsaq?

    Edited once, last by jd17 (January 30, 2017 at 12:10 PM).

  • I do not see any difference in upscaling between Jarvis and Krypton on my S905 devices. I have a lot of SD and 720p content, all displays are 1080p.

    Can you upload a short sample video that highlights the problem?

  • I'm sorry if you misread my response in a condescending manner, those were not my intentions whatsoever. I'll assume it's when I wrote "to explain it in what I would hope is a sound and logical manner for you", which I could see how it would be easy to misinterpret. Really, it was more or less a long winded way of saying "I hope I make sense" and was not intended to challenge or mock your level of knowledge.

    I've reloaded my SD card with Krypton to test and compare with my internal Jarvis build, and I truly see no difference between the two.

    When hardware acceleration is enabled, all scaling is offloaded to the GPU to process. My understanding after some research is that the s905x Mali-450 GPU is only capable of bilinear scaling in the first place. To enable anything other than that or nearest neighbor options, you'd have to disable hardware acceleration in Kodi settings. Are you sure that in Jarvis you didn't perhaps enable "Post-processing" in the video settings menu only accessible during playback, or maybe disable hardware acceleration to try one of the other software renderers that would then show up? Enabling "post-processing" essentially adds a blurring/smoothing effect on top of the scaling that would perhaps explain why you perceived an improvement in quality. Try enabling it in Krypton and see if it helps.

    As for the suggested solution/workaround, it's been a long standing feature request for Kodi dating back to 2009 and still getting +1's as recent as two months ago. Page 13 seems to show that a fix of this nature was actually attempted and even tested in several RPI dev builds, but was unstable, buggy, and abandoned. It may be possible to work the feature in, but it doesn't sound like it'll work all that well.


  • I do not see any difference in upscaling between Jarvis and Krypton on my S905 devices. I have a lot of SD and 720p content, all displays are 1080p.

    Can you upload a short sample video that highlights the problem?

    Thank you for checking...
    Maybe S905 devices behave differently?

    There is really no point in uploading a sample...
    I see the bad upscaling in all SD or 720p content, it is not limited to only a few cases.

    I think a screenshot would help most - can I somehow take a screenshot in Kodi that shows the already upscaled image?
    [hr]


    I'm sorry if you misread my response in a condescending manner, those were not my intentions whatsoever. I'll assume it's when I wrote "to explain it in what I would hope is a sound and logical manner for you", which I could see how it would be easy to misinterpret. Really, it was more or less a long winded way of saying "I hope I make sense" and was not intended to challenge or mock your level of knowledge.

    Don't worry about it. :)

    Quote


    I've reloaded my SD card with Krypton to test and compare with my internal Jarvis build, and I truly see no difference between the two.

    Is your device a S905 or S905X?
    And is there any chance, that my M8S II behaves differently than other S905X?

    Quote


    When hardware acceleration is enabled, all scaling is offloaded to the GPU to process. My understanding after some research is that the s905x Mali-450 GPU is only capable of bilinear scaling in the first place. To enable anything other than that or nearest neighbor options, you'd have to disable hardware acceleration in Kodi settings. Are you sure that in Jarvis you didn't perhaps enable "Post-processing" in the video settings menu only accessible during playback, or maybe disable hardware acceleration to try one of the other software renderers that would then show up? Enabling "post-processing" essentially adds a blurring/smoothing effect on top of the scaling that would perhaps explain why you perceived an improvement in quality. Try enabling it in Krypton and see if it helps.

    Do S905 chips have the same Mali-450 GPU?

    It is possible, that the hardware upscaling method is only Bilinear.
    What I see in Krypton however is so much worse than Bilinear scaling.
    I tested both hardware acceleration on and off in both Jarvis and Krypton.
    When hardware acceleration is off, I can choose between Bilinear and Nearest Neighbor when in the video - in Jarvis and Krypton.
    When hardware acceleration is on, there is no choice - but Jarvis looks fine and Krypton looks awful.

    I never enabled post-processing in any testing situation.

    Quote


    As for the suggested solution/workaround, it's been a long standing feature request for Kodi dating back to 2009 and still getting +1's as recent as two months ago. Page 13 seems to show that a fix of this nature was actually attempted and even tested in several RPI dev builds, but was unstable, buggy, and abandoned. It may be possible to work the feature in, but it doesn't sound like it'll work all that well.

    That's sad. :(

    Edited once, last by jd17 (January 31, 2017 at 7:11 AM).

  • jd17 Can you please try the following before playing a video:

    Code
    echo rm default > /sys/class/vfm/map
    echo add default decoder ppmgr deinterlace amlvideo amvideo > /sys/class/vfm/map
    chmod 444 /sys/class/vfm/map
  • Please login over SSH and execute these commands (root is the only user). After this do not reboot - open your test videos and tell us if they're Jarvis-good or still the same.

  • this command seems to improve PQ

    Quote


    echo 1 > /sys/module/di/parameters/bypass_all

    but then i get no de-interlacing on livetv so livetv looks bad..

    jd17 does this command fix pq issues on this test #4723768 for you? i.e. is it like Jarvis now?

  • Thank you Gendo. :)

    This does the trick, PQ is on the same level as Jarvis since I entered this command.

    99% of my content is Progressive so this is a great solution for me...
    However I assume that I might be a minority in that regard...? ;)

    I hope this helps kszaq to tackle the root cause?

  • A better solution: echo 1 > /sys/module/di/parameters/bypass_prog

    This flag was set in Jarvis but I set it back to 0 because for some reason this was needed to make VC-1 playback work properly...