LibreELEC.tv icon indicating copy to clipboard operation
LibreELEC.tv copied to clipboard

[BUG][Allwinner] Green screen when playing dvds (pine64-lts)

Open enen92 opened this issue 2 years ago • 4 comments

Describe the bug

Not sure if this is a known issue, feel free to close if duplicated (I didn't find any related). While looking into https://github.com/xbmc/xbmc/issues/21670 in my pine64-lts (latest master) I've found out the dvd under test resulted in a green screen on the kodi side. Log below:

https://paste.kodi.tv/ebeqigubar.kodi

Same file plays fine with Allow hardware acceleration with DRM PRIME disabled. Since the reason was to debug the linked issue, I updated the kodi revision to latest master and dropped some patches which I would have otherwise to rebase. Surprised to check the file played just fine by dropping https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/Allwinner/patches/kodi/0002-WIP-DRMPRIME-deinterlace-filter.patch while still keeping the aforementioned setting enabled.

To Reproduce

Steps to reproduce the behavior:

  1. Just play any dvd (or iso) in pine64-lts or similar devices.

Informations

  • LE Version: devel-20220711221910-f682eb5 11.0
  • Hardware Platform: pine64-lts

Log file

https://paste.kodi.tv/ebeqigubar.kodi

enen92 avatar Jul 11 '22 22:07 enen92

I tested two different DVDs with pine64-plus, which should be similar to your board. It worked with both. Did you build your own image or did you take nightly image? Can you try today nightly?

jernejsk avatar Jul 12 '22 20:07 jernejsk

Yeah it happens with any build (also affects latest nightly). Maybe this small .vob will help reproduce? VTS_01_6.zip

enen92 avatar Jul 13 '22 10:07 enen92

It still works with nightly-20220713-5ce4da1: http://jernej.libreelec.tv/tmp/VID_20220713_205927.mp4 Not sure what to check next.

jernejsk avatar Jul 13 '22 19:07 jernejsk

I guess I might try to debug it further later on and check if I can adapt the patch to check exactly what breaks it - thanks for the effort

enen92 avatar Jul 15 '22 08:07 enen92

@enen92 does this still occur with the latest LE12 nightlies?

heitbaum avatar Oct 16 '23 12:10 heitbaum

@heitbaum yes still happens with LE12 nightlies. Even worse, now I cannot play any video at all (black screen)

enen92 avatar Oct 16 '23 16:10 enen92

log file: https://paste.kodi.tv/bedesaleza

enen92 avatar Oct 16 '23 16:10 enen92

Actually if I use EGL instead of direct to plane I now get video, but the green screen is still present when playing the DVD or my tv channels: https://paste.kodi.tv/ugoxupeluq

enen92 avatar Oct 16 '23 17:10 enen92

I guess introduced DRM plane rendering issue when I worked on 10-bit output support for H6. I'll fix that. However, as mentioned at the beginning of the thread, this is most likely issue with deinterlace driver. You disabled it and then it worked fine, according to the report. Note that I also noticed something similar on other SoCs, but it went away with new builds, so I can't really test now.

@enen92 Can you confirm that disabling deinterlacing still helps? If so, I'll go through vendor driver again to see if I missed anything.

jernejsk avatar Oct 16 '23 17:10 jernejsk

DRM plane rendering is fixed with #8221

jernejsk avatar Oct 16 '23 19:10 jernejsk

It's not completed, original issue probably still persist

jernejsk avatar Oct 16 '23 19:10 jernejsk

I guess introduced DRM plane rendering issue when I worked on 10-bit output support for H6. I'll fix that. However, as mentioned at the beginning of the thread, this is most likely issue with deinterlace driver. You disabled it and then it worked fine, according to the report. Note that I also noticed something similar on other SoCs, but it went away with new builds, so I can't really test now.

@enen92 Can you confirm that disabling deinterlacing still helps? If so, I'll go through vendor driver again to see if I missed anything.

Interesting stuff, after toggling deinterlace off it started to play fine (well slow as hell but I guess that's the hw limitation)...

Then, I changed again to direct to plane and now all the files that exhibited this behaviour (green screen) started to play just fine (even with deinterlace on/half or off). Log (with deinterlace on): https://paste.kodi.tv/usujubodar

Guess the toggle persisted some state or register...I think I'll give a go to tomorrow nightly (fresh install) and redo the same experiments since now I cannot get a green screen anymore (even after a reboot).

enen92 avatar Oct 16 '23 19:10 enen92

Can you put this patch into projects/Allwinner/patches/linux and see if it works? I know driver code is enabling deinterlace core in wrong order, so this might influence behaviour later.

jernejsk avatar Oct 16 '23 19:10 jernejsk

@jernejsk I tested today's nightly and I and I can confirm the "direct to plane" option is now working fine. Green screen still occurs unless the interlacer is disabled. Regarding your patch test request I currently don't have the environment to build libreelec set up so it will take me a while... Do you guys have the necessary infra to generate testbuilds on demand? Can you generate some testbuild to the pine-lts including the patch?

enen92 avatar Oct 17 '23 08:10 enen92

Recovered my development environment and managed to compile libreleec with the linked patch, unfortunately it didn't help, I still get a green screen with deinterlace on. However in one of the tests (building master without the patch) I managed to have videos playing correctly even with deinterlace on - unfortunately I only managed to do it once. So I guess this is really some timing issue in the driver.

enen92 avatar Oct 17 '23 12:10 enen92

I found another discrepancy with vendor driver. Coefficients should be set always, after module is enabled. So this would be logical explanation why it doesn't work first time. Please test http://ix.io/4JfB

jernejsk avatar Oct 17 '23 19:10 jernejsk

@jernejsk that's it :) All working great now with the linked patch. Thanks a lot for looking into it

enen92 avatar Oct 17 '23 21:10 enen92