RESOLVED FIXED 261892
[GStreamer][MSE] video playback uses GstVA, except on YouTube
https://bugs.webkit.org/show_bug.cgi?id=261892
Summary [GStreamer][MSE] video playback uses GstVA, except on YouTube
Johannes Penßel
Reported 2023-09-21 10:48:35 PDT
Created attachment 467816 [details] "GST_DEBUG=va*:6 epiphany": log of YT playback WebKitGTK 2.42.0 happily plays VAAPI-accelerated video on any website in any HW-supported format, except on YouTube (tested with vp9 and av1). Tested with GNOME Web and Surf, on GNOME 45 in wayland and X11 sessions. If I remove the libraries for the GStreamer av1/vpx software decoders, playback on YT stops working altogether. For reference, this testcase: https://tools.woolyss.com/html5-audio-video-tester/?u=woolyss.com/f/spring-vp9-vorbis.webm works flawlessly. (verified via intel_gpu_top) Epiphany 44.0 (installed via flatpak) is not affected, but Epiphany.Devel 45.0 is. Firefox 117.0 works. environment: GST_PLUGIN_FEATURE_RANK=vaav1dec:MAX,vah264dec:MAX,vah265dec:MAX,vampeg2dec:MAX,vavp8dec:MAX,vavp9dec:MAX,vacompositor:MAX,vadeinterlace:MAX,vajpegdec:MAX,vapostproc:MAX,vah264lpenc:MAX,vah265lpenc:MAX other software: GStreamer 1.22.6 Mesa 23.2-rc3 libva-1.19 intel-media-driver-23.3.4
Attachments
"GST_DEBUG=va*:6 epiphany": log of YT playback (54.39 KB, text/x-log)
2023-09-21 10:48 PDT, Johannes Penßel
no flags
playback of vp9 content on YT with GST_DEBUG=3,va*:6,webkit*:6 (563.89 KB, text/x-log)
2023-09-25 11:56 PDT, Johannes Penßel
no flags
playback of vp9 content from a different source GST_DEBUG=3,va*:6,webkit*:6 (570.84 KB, text/x-log)
2023-09-25 12:09 PDT, Johannes Penßel
no flags
log with GST_PLUGIN_FEATURE_RANK+=pipewiresink:0 (565.68 KB, text/x-log)
2023-09-27 04:16 PDT, Johannes Penßel
no flags
log with GST_PLUGIN_FEATURE_RANK+=pulsesink:0 (559.41 KB, text/x-log)
2023-09-27 07:39 PDT, Johannes Penßel
no flags
Philippe Normand
Comment 1 2023-09-22 14:13:54 PDT
GST_DEBUG=3,va*:6,webkit*:6 log please :)
Johannes Penßel
Comment 2 2023-09-25 11:56:08 PDT
Created attachment 467848 [details] playback of vp9 content on YT with GST_DEBUG=3,va*:6,webkit*:6 With GST_DEBUG=3,va*:6,webkit*:6, the following errors are being logged: 0:00:02.157503867 2 0x55adb427d610 ERROR default gstpipewirecore.c:91:make_core: (null) 0:00:02.158037939 2 0x55adb427d610 ERROR pipewire gstpipewiredeviceprovider.c:625:gst_pipewire_device_provider_start:<pipewiredeviceprovider0> Failed to connect 0:00:02.307123798 2 0x55adb427d610 ERROR GST_BUS gstbus.c:945:gst_bus_add_watch_full_unlocked:<bus95> Tried to add new watch while one was already there I'm on pipewire 0.3.80 and alsa 1.2.10.
Johannes Penßel
Comment 3 2023-09-25 12:09:33 PDT
Created attachment 467849 [details] playback of vp9 content from a different source GST_DEBUG=3,va*:6,webkit*:6 For reference, this is a log captured while playing vp9 video from a different website. (with working HW accel)
Philippe Normand
Comment 4 2023-09-27 03:23:36 PDT
Are the pipewire errors always and consistently happening when attempting to play YT videos?
Johannes Penßel
Comment 5 2023-09-27 03:39:47 PDT
Yes, they're happening 100% predictably. Same goes for the flatpak version of GNOME Web 45.
Philippe Normand
Comment 6 2023-09-27 03:52:45 PDT
I guess you don't have PulseAudio and you're using PipeWire directly? If so, can you add this to GST_PLUGIN_FEATURE_RANK? pipewiresink:0
Johannes Penßel
Comment 7 2023-09-27 04:16:22 PDT
Created attachment 467893 [details] log with GST_PLUGIN_FEATURE_RANK+=pipewiresink:0 I use pipewire-pulse instead of pulseaudio-daemon, but libpulse is still present on my system. Is that what you mean? Sorry for the confusion. Seems like the same pipewire errors are still popping up with GST_PLUGIN_FEATURE_RANK+=pipewiresink:0, unfortunately.
Philippe Normand
Comment 8 2023-09-27 06:40:13 PDT
and with pulsesink:0 ? Should fallback to alsasink if you have that.
Johannes Penßel
Comment 9 2023-09-27 07:39:08 PDT
Created attachment 467899 [details] log with GST_PLUGIN_FEATURE_RANK+=pulsesink:0 After replacing pipewire's soundserver with pulseaudio-daemon and disabling pipewire gstreamer support, I've finally managed to hit a different error message: 0:00:02.445350936 2 0x55e9c218f610 ERROR alsa gstalsadeviceprovider.c:57:add_device:<alsadeviceprovider0> Could not open device hw:0,0 for inspection! No visible change in behavior otherwise though. hw:0,0 is just my normal soundcard, which I've had zero issues with so far: card 0: PCH [HDA Intel PCH], device 0: ALC256 Analog [ALC256 Analog] Subdevices: 1/1 Subdevice #0: subdevice #0
Philippe Normand
Comment 10 2023-10-07 07:37:30 PDT
I can reproduce this issue here. I think it's a GStreamer bug... For YT vp9 streams, decodebin3 doesn't parse the stream and attempts feed that to a compatible decoder, but vavp9dec requires a parsed stream, so it's not selected.
Philippe Normand
Comment 11 2023-10-07 07:39:12 PDT
Can you try this workaround, downrank every vp9 decoder excepted the va one... GST_PLUGIN_FEATURE_RANK=vp9dec:0,avdec_vp9:0
Philippe Normand
Comment 12 2023-10-07 07:39:52 PDT
(In reply to Philippe Normand from comment #11) > Can you try this workaround, downrank every vp9 decoder excepted the va > one... > > GST_PLUGIN_FEATURE_RANK=vp9dec:0,avdec_vp9:0 That should force decodebin3 to add a parsebin and then vavp9dec should be plugged...
Johannes Penßel
Comment 14 2023-10-07 08:39:05 PDT
(In reply to Philippe Normand from comment #12) > (In reply to Philippe Normand from comment #11) > > Can you try this workaround, downrank every vp9 decoder excepted the va > > one... > > > > GST_PLUGIN_FEATURE_RANK=vp9dec:0,avdec_vp9:0 > > That should force decodebin3 to add a parsebin and then vavp9dec should be > plugged... That works! Dammit, I thought I had discovered an actual WebKit bug for once... Anyways, thank you very much for your help!
Philippe Normand
Comment 15 2023-10-08 01:09:18 PDT
We shouldn't disable urisourcebin:parse-streams for MSE...
Philippe Normand
Comment 16 2023-10-08 01:14:07 PDT
EWS
Comment 17 2023-10-09 01:54:44 PDT
Committed 269068@main (d14f07282a9d): <https://commits.webkit.org/269068@main> Reviewed commits have been landed. Closing PR #18825 and removing active labels.
Radar WebKit Bug Importer
Comment 18 2023-10-09 01:55:16 PDT
Note You need to log in before you can comment on or make changes to this bug.