Bug 197752 - [GStreamer] Consider blacklisting gstreamer-vaapi
Summary: [GStreamer] Consider blacklisting gstreamer-vaapi
Status: RESOLVED WONTFIX
Alias: None
Product: WebKit
Classification: Unclassified
Component: Media (show other bugs)
Version: WebKit Nightly Build
Hardware: PC Linux
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-05-09 12:29 PDT by Michael Catanzaro
Modified: 2023-03-23 11:22 PDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Michael Catanzaro 2019-05-09 12:29:29 PDT
After removing gstreamer-vaapi from the GNOME runtime, I noticed:

 (a) Video corruption issues reported at https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/100 are fixed
 (b) Dramatically improved scrolling performance and web process responsiveness on pages with certain videos
 (c) Dramatic reduction in web process hangs on pages with certain videos

I'm pretty sure gstreamer-vaapi is responsible for souring a large number of users on WebKit. It makes our web engine perform really bad. The quality difference after disabling it is really huge.

I suggest we disable use of gstreamer-vaapi at the WebKit level, to immediately ensure a quality user experience until we are able to investigate and resolve (b) and (c).
Comment 1 Philippe Normand 2019-05-10 00:59:44 PDT
There are 2 independent options:

- Blacklist AMDGPU in gst-vaapi, until its maintenance is increased and the issues are fixed
- Víctor suggested to add a web-setting to disable hw-accelerated playback in WebKit, which also makes sense.
Comment 2 Víctor M. Jáquez L. 2019-05-10 03:51:42 PDT
(In reply to Philippe Normand from comment #1)
> There are 2 independent options:
> 
> - Blacklist AMDGPU in gst-vaapi, until its maintenance is increased and the
> issues are fixed

https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/merge_requests/72

> - Víctor suggested to add a web-setting to disable hw-accelerated playback
> in WebKit, which also makes sense.

o/
Comment 3 Michael Catanzaro 2019-05-10 07:42:54 PDT
(In reply to Philippe Normand from comment #1)
> - Blacklist AMDGPU in gst-vaapi, until its maintenance is increased and the
> issues are fixed

Are Intel users not experiencing these problems? If so, OK, of course. Presuming that patch in gstreamer-vaapi!72 is going to actually land soon.

> - Víctor suggested to add a web-setting to disable hw-accelerated playback
> in WebKit, which also makes sense.

I mean, we could. But if it's off by default, nobody will ever turn it on. And if it's on by default, then it would become another setting that just needs to be disabled to make WebKit work, like accelerated compositing mode. For Epiphany, I would disable it unconditionally and then Intel users won't have -vaapi either.
Comment 4 Philippe Normand 2019-05-14 13:05:26 PDT
*** Bug 197872 has been marked as a duplicate of this bug. ***
Comment 5 Michael Catanzaro 2019-05-15 10:10:00 PDT
(In reply to Michael Catanzaro from comment #0)
> After removing gstreamer-vaapi from the GNOME runtime, I noticed:
> 
>  (a) Video corruption issues reported at
> https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/100 are fixed
>  (b) Dramatically improved scrolling performance and web process
> responsiveness on pages with certain videos
>  (c) Dramatic reduction in web process hangs on pages with certain videos

(a) should be fixed now (in mesa), but I don't know about (b) and (c).
Comment 6 Philippe Normand 2019-05-15 10:14:12 PDT
Do we have detailed and reproducible bug reports for the remaining issues?
Comment 7 Michael Catanzaro 2019-05-15 10:40:55 PDT
Nope.
Comment 8 Michael Catanzaro 2019-05-15 12:18:49 PDT
What we could do is: once we get a freedesktop-sdk update containing the new mesa, do a test build with gst-vaapi restored. Then we can decide if we need to report more bugs and rollback (likely) or not.
Comment 9 Lionir 2019-05-15 13:18:17 PDT
(In reply to Michael Catanzaro from comment #8)
> What we could do is: once we get a freedesktop-sdk update containing the new
> mesa, do a test build with gst-vaapi restored. Then we can decide if we need
> to report more bugs and rollback (likely) or not.

I'd love to help test this build.
Comment 10 Michael Catanzaro 2019-05-15 15:52:35 PDT
Great, then we'll have three data points (you, me, Philippe). More testing is better here.

It's going to be some time before the new mesa reaches freedesktop-sdk though, and GNOME is often delayed in updating freedesktop-sdk if there are regressions. So now we wait.
Comment 11 Michael Catanzaro 2019-06-16 06:21:01 PDT
Status update: freedesktop-sdk has adopted Phil's patch from https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/merge_requests/72 and I've re-added gstreamer-vaapi to the GNOME runtime for testing. If it works for me, then we'll keep gstreamer-vaapi in the runtime for now.

That !72 should really urgently be applied upstream.
Comment 12 Michael Catanzaro 2019-06-24 11:46:03 PDT
(In reply to Michael Catanzaro from comment #11)
> If it works for me, then we'll keep gstreamer-vaapi in the runtime for now.

Yeah, all good here.

> That !72 should really urgently be applied upstream.

Since this merge request still has not been accepted upstream, I really think it's time to proceed here. Leaving WebKit broken for tons of users isn't cool. I don't know how to blacklist GStreamer elements, but surely it's possible?

I don't think this would be needed if !72 were merged, but it doesn't seem likely to happen?
Comment 13 Philippe Normand 2019-06-24 12:36:53 PDT
No. We can't blacklist vaapi unconditionally. It seems to work fine on Intel GPUs so I would rather NOT penalise Intel users for the well-being of AMD users...
Comment 14 Michael Catanzaro 2019-06-24 13:31:44 PDT
Then could you push harder to land your !72 merge request, please? Because that really works based on my testing, and should eliminate all complaints.

Otherwise, the choice is between performance and correctness. I'd much rather all users receive non-accelerated video that works rather than broken video.
Comment 15 Michael Catanzaro 2019-07-05 08:31:51 PDT
Update on this, trying to keep a bunch of parallel bugs in sync. freedesktop-sdk stopped using !72 and instead just disabled the gallium vaapi driver. This might have been a mistake, though: now we are getting complaints from non-gstreamer users of vaapi. Turns out everyone agrees that gallium driver is fine and gstreamer-vaapi is to blame for misusing it. That bug is https://gitlab.freedesktop.org/gstreamer/gstreamer-vaapi/issues/137.

And !72 has still not yet been merged.

This is just such a mess, and what's worse, it causes me to lose confidence in GStreamer itself as a dependency. It seems too easy to break WebKit by installing a bad GStreamer plugin. :/
Comment 16 Víctor M. Jáquez L. 2020-05-04 02:02:35 PDT
In the last gstreamer hackfest I added a flag in playbin to block hardware-based decoders: https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/485

With it we could add a setting to disable hardware accelerated decoders, if the user meet issues in their setup.
Comment 17 Michael Catanzaro 2020-05-04 07:23:27 PDT
That might be good to do.

Regardless, you solved this issue last year when you merged gstreamer-vaapi!72. I haven't had a problem since then, and I haven't heard complaints from users since then either. So I don't think we need to keep this particular bug open anymore.
Comment 18 Michael Catanzaro 2023-03-23 11:22:53 PDT
This actually did eventually land in bug #240664