Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] UI items, subtitles causes playing video to glitch weirdly #9065

Closed
XxAcielxX opened this issue Jul 7, 2024 · 14 comments
Closed

[BUG] UI items, subtitles causes playing video to glitch weirdly #9065

XxAcielxX opened this issue Jul 7, 2024 · 14 comments

Comments

@XxAcielxX
Copy link

XxAcielxX commented Jul 7, 2024

Describe the bug

When playing videos with ff-h264-drm_prime (HW) or ff-vp9-drm_prime (HW) Decorder, it causes the video to glitch weirdly (UI items like changing volume, mute/unmute, Video Info, etc). Even the Subtitle causes this issue as well.

Videos played locally, over the network, or YouTube Addon, all are affected.

The issue does not occur with ff-hevc-drm_prime (HW) Decorder.

It is happening on a fresh test install too. Here is a video example https://youtu.be/IRxyoZ4qt_w

How to reproduce

Steps to reproduce the behavior:

  1. Play any video with h264/VP9 Codecs
  2. Mute/unmute, disable/enable subtitles, open video info
  3. Observe the glitch

Information

  • LibreELEC Version: 12.0.0
  • Hardware Platform: NanoPC-T4 (RK3399)

Debug Log

Bug happens randomly, hard to get debug log

@NetDwarf
Copy link
Contributor

NetDwarf commented Aug 27, 2024

Can confirm on other devices as well with Allwinner and RockChip SoCs.

Problem description

  • triggered by moving menu elements or multiple overlay menus or subtitles, basically anything overlaying
  • i.e. triggered by opening control menu (OK/Enter) -> settings
  • the video frames play out of order and often also redraw half-way (tearing)
  • happens on all hardware-accelerated videos

Information

Example 1

  • LibreELEC Version: 12.0-nightly-20240802-cbf0545
  • Hardware Platform: Rock64 (RK3328)

Example 2

  • LibreELEC Version: 12.0.0 (stable)
  • Hardware Platform: QPlus (Allwinner H6)

I also tested various versions and this has been an issue since quite a while, but I thought it'd be fixed in stable.

Counter Example

  • LibreELEC Version: 12.0.0 (stable)
  • Hardware Platform: Odroid C2 (Amlogic S905)

This has various other problems, but not the flickering issue on overlay.

@NetDwarf
Copy link
Contributor

Maybe more interesting is another counter example I just found:

Counter Example

  • LibreELEC 12.0-nightly-20231018-ada1505
  • Hardware Platform: Rock64 (RK3328)

So it worked on 20231018 (kernel 6.5), but doesn't on 20240802 (kernel 6.6).

@XxAcielxX
Copy link
Author

I thought I was the only with this issue, but it affects many devices.

@XxAcielxX
Copy link
Author

Upgraded to LE 12.0.1 (stable), and I'm still noticing the issue happening.

@knaerzche
Copy link
Contributor

knaerzche commented Aug 30, 2024

This has nothing to do with the kernel version, it's yet another issue of xbmc/xbmc#23921 (mostly because frames (-rates) of gui/video layer are out of sync). See also xbmc/xbmc#25588 (comment)
@heitbaum best add https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/RPi/patches/kodi/000-temp-revert-fences.patch for RK and AW as well.

@NetDwarf
Copy link
Contributor

NetDwarf commented Sep 4, 2024

This has nothing to do with the kernel version, it's yet another issue of xbmc/xbmc#23921 (mostly because frames (-rates) of gui/video layer are out of sync). See also xbmc/xbmc#25588 (comment) @heitbaum best add https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/RPi/patches/kodi/000-temp-revert-fences.patch for RK and AW as well.

Compiled a LibreELEC image with your patches and it works; no tearing. I'm honestly impressed.

Test Setup

  1. used LibreELEC 12.0.1 as base (the tag 12.0.1)
  2. added linux (Rockchip RK3328): pinctrl fix #9256 (to make it bootable)
  3. copied the suggested patch over to the Rockchip folder
  4. compiled

More precisely I compiled the bootable version first and then added your suggested patch to make sure I had a booting baseline.

Allwinner also needs this patch

Just as a small reminder.

@NetDwarf
Copy link
Contributor

NetDwarf commented Sep 7, 2024

Not to make a hurry, but I am not sure about the conventions here. Am I supposed to make the PR? I am also a bit hesitant because of the authorship because this is basically @knaerzche's fix 😅

Or should I just wait? (also fine, just want to cover all bases)

@chewitt
Copy link
Member

chewitt commented Sep 7, 2024

@NetDwarf .. @knaerzche or @heitbaum won't complain if someone saves them the effort of sending a pull request. Feel free to send the change suggested.

@NetDwarf
Copy link
Contributor

NetDwarf commented Sep 9, 2024

The issue is pretty much fixed by #9277 . I realized too late that the first/linked PR was only for LE13 and not LE12. Given that the issue at hand is in LE12, I would close it for now. It could potentially be reopened if there is no fix provided for LE13.

@hbiyik
Copy link

hbiyik commented Sep 9, 2024

Sorry to interrupt, but the fix proposed is completely disabling Async rendering,
xbmc/xbmc#25588 here i provided a fix to prevent Async rendering messing up the rendering path in case of an unexpected drm commit, if this commit also fixes this issue, would it make sense to still include async rendering the fix xbmc/xbmc#25588, async rendering is really a good feature to improve performance overall.

On the other hand, the fix can be tested in wider install base like LE.

@knaerzche
Copy link
Contributor

knaerzche commented Sep 9, 2024

Sorry to interrupt, but the fix proposed is completely disabling Async rendering,

Sure, because it doesn't work as expected.

xbmc/xbmc#25588 here i provided a fix to prevent Async rendering messing up the rendering path in case of an

I checked this already, but it doesn't help with this issue here. Just from a wild guess, it looks like the (gui) frames are in an incorrect order and that's nothing you are addressing in this PR.

@hbiyik
Copy link

hbiyik commented Sep 9, 2024

@knaerzche ah ok, thanks for the clarifcation, i guess i misinterpreted the case here.

@NetDwarf
Copy link
Contributor

NetDwarf commented Sep 11, 2024

@XxAcielxX can you test LE12-nightly for NanoPC-T4?

If it fixes the flicker/tearing issue for you, this could be closed.

PS.: To be a bit more verbose. It was a mistake by me to PR the fix to master. I realized too late that it wouldn't fix LE12 and posted the same fix to LE12 subsequently. The latter has been merged and the former might never been merged, depending if a better fix is possible. This however means that the problem is fixed in LE12 test builds (but not LE13 ones) and most likely in 12.0.2 🤞

@XxAcielxX
Copy link
Author

@NetDwarf

Sorry for late response as I was testing it. Now I can confirm that patch https://github.com/LibreELEC/LibreELEC.tv/blob/master/projects/RPi/patches/kodi/000-temp-revert-fences.patch fixes my issue. So I'll close this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants