flathub / org.chromium.Chromium

https://flathub.org/apps/details/org.chromium.Chromium
43 stars 25 forks source link

Patch: Add a VAAPI flag Ozone Wayland Patch #326

Open EliasOfWaffle opened 11 months ago

EliasOfWaffle commented 11 months ago

from https://aur.archlinux.org/cgit/aur.git/plain/0001-vaapi-flag-ozone-wayland.patch?h=chromium-wayland-vaapi credits to zhmars Arch Linux Chromium Wayland vaapi package maintainer

flathubbot commented 11 months ago

Started test build 72080

flathubbot commented 11 months ago

Build 72080 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/54735/org.chromium.Chromium.flatpakref
refi64 commented 11 months ago

This is significantly simpler than the last variant which makes it a lot more manageable, is it confirmed to still work?

EliasOfWaffle commented 11 months ago

This is significantly simpler than the last variant which makes it a lot more manageable, is it confirmed to still work?

is necessary for test in a new intel gpu cards, for some reason i965 looks broken in Wayland VAAPI but in Intel media drivers it can be work, in the same way that lastest try is working. i think that i965 can be a libva problem or a specific driver problem, sadly i965 vaapi driver is for older cards. i will try to convice my friend to test in the recent intel processor that use intel media driver

EliasOfWaffle commented 11 months ago

but in i965 the decoding capabilities is recognized when is using this patch with Wayland Ozone Flag. but have a error on initialze memory pool that same error the lastest patch have with i965, but in the lastest patch the IHD driver is working, is necessary for i convince a someone in a group for test in iHD. i965 looks broken

retrixe commented 11 months ago

AMD Mesa, nvidia-vaapi-driver and i965 are all broken with VaapiVideoDecoder afaik, only Intel media driver is tested by the Chromium team and Intel devs to work at the moment

There is a patch here to get AMD and perhaps NVIDIA/i965(?) working https://gist.github.com/thubble/235806c4c64b159653de879173d24d9f unfortunately this patch is for Vulkan, not OpenGL, and Ozone Wayland doesn't support Vulkan yet, so this benefits X11/Xwayland users only

I just tried this patch and it works correctly on my laptop with Intel 11th gen (i.e. Intel media driver) specifying --enable-features=VaapiVideoDecodeLinuxGL and using Wayland Ozone platform in chrome://flags

EliasOfWaffle commented 11 months ago

i965 is broken with VaapiVideoDecoder in general afaik (I don't have my old laptop which used i965 anymore), AMD Mesa and nvidia-vaapi-driver don't work with it either (discussion here: https://gist.github.com/thubble/235806c4c64b159653de879173d24d9f unfortunately this patch is for Vulkan not OpenGL, and Ozone Wayland doesn't support Vulkan), only the Intel media driver is confirmed to work at the moment

I just tried this patch and it works correctly on my laptop with Intel 11th gen (i.e. Intel media driver) specifying --enable-features=VaapiVideoDecodeLinuxGL and using Wayland Ozone platform in chrome://flags

thanks for the test

kryptobolt07 commented 2 months ago

AMD Mesa, nvidia-vaapi-driver and i965 are all broken with VaapiVideoDecoder afaik, only Intel media driver is tested by the Chromium team and Intel devs to work at the moment

There is a patch here to get AMD and perhaps NVIDIA/i965(?) working https://gist.github.com/thubble/235806c4c64b159653de879173d24d9f unfortunately this patch is for Vulkan, not OpenGL, and Ozone Wayland doesn't support Vulkan yet, so this benefits X11/Xwayland users only

I just tried this patch and it works correctly on my laptop with Intel 11th gen (i.e. Intel media driver) specifying --enable-features=VaapiVideoDecodeLinuxGL and using Wayland Ozone platform in chrome://flags

was it broken all along or did it break in the recent years??

I tested this on Intel Haswell and it works great for H264 videos. Just a quick note, Vulkan needs to be DISABLED on this specific platform, otherwise it will only show a white box instead of the decoded video, since Vulkan support is incomplete on Haswell. Maybe we can either have a workaround for it or at least a warning?

Originally posted by @BrozzSama in https://github.com/flathub/org.chromium.Chromium/issues/35#issuecomment-756022267 The above comment implies that it broke in recent times.

Aslo @BuonHobo suggested a cause for VAAPI not working with i965 in https://github.com/flathub/org.chromium.Chromium/issues/266#issuecomment-1879750412_

Apparently it's not enough to get it working on AMD GPUs, they also should merge this mesa patch https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165

Maybe this explains why does not work now: https://chromium-review.googlesource.com/c/chromium/src/+/3646633

— Reply to this email directly, view it on GitHub https://github.com/flathub/org.chromium.Chromium/issues/266#issuecomment-1879730974, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOJZ5HBO6PVNL5M4YPVLLOTYNFVNHAVCNFSM6AAAAAAT6JJ6JKVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQNZZG4ZTAOJXGQ . You are receiving this because you commented.Message ID: <flathub/org. @.***>

Originally posted by @BuonHobo in https://github.com/flathub/org.chromium.Chromium/issues/266#issuecomment-1879750412

retrixe commented 2 months ago

There were two codepaths:

VaapiVideoDecoder requires either:

To my knowledge, there is no way to get old Intel (i965/libva-intel) to work with VaapiVideoDecoder, and the old Intel media driver is not seeing any updates at the moment. Chrome would have to workaround and I don't know if someone has filed a bug for that or if they ever plan to. The older VDAVideoDecoder meanwhile is no longer available.

kryptobolt07 commented 2 months ago

VDAVideoDecoder

Thanks,do you have any source for this information though,i wasn't able to find one. I just wasted days trying to get H264 working on my Haswell processor.

There were two codepaths:

  • VDAVideoDecoder: Old one, slower, removed from Chrome, used to work with AMD and Intel (old & new)
  • VaapiVideoDecoder: New one, faster, works only with Intel (5th gen+) or AMD (for AMD, you need Mesa 24.1 and --enable-features=VaapiIgnoreDriverChecks)

VaapiVideoDecoder requires either:

  • Vulkan/VulkanFromANGLE/DefaultANGLEVulkan flags to be enabled (if running Chrome via Xwayland/X11), OR
  • --enable-features=VaapiVideoDecodeLinuxGL (doesn't work on AMD, adds an extra copy hurting performance)

To my knowledge, there is no way to get old Intel (i965/libva-intel) to work with VaapiVideoDecoder, and the old Intel media driver is not seeing any updates at the moment. Chrome would have to workaround and I don't know if someone has filed a bug for that or if they ever plan to. The older VDAVideoDecoder meanwhile is no longer available.

Do you mean removed from "chromium" as well? Anyways thanks for the information,do you have any source for this information though,i wasn't able to find one. I just wasted days trying to get H264 hardware decoding working on my Haswell processor. On a sidenote firefox still seems to support older hardware,though it doesn't properly utilize it.

retrixe commented 2 months ago

Yeah, removed from Chromium

I couldn't point you to a single source, but removal of VDAVideoDecoder has been discussed on the bug tracker several times e.g. https://issues.chromium.org/issues/40898058 and https://issues.chromium.org/issues/40192819 (incl the fact it's broken for the older Haswell i965 driver)

AMD support was fixed here https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165 and info on the flags is here https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md

kryptobolt07 commented 2 months ago

Yeah, removed from Chromium

I couldn't point you to a single source, but removal of VDAVideoDecoder has been discussed on the bug tracker several times e.g. https://issues.chromium.org/issues/40898058 and https://issues.chromium.org/issues/40192819 (incl the fact it's broken for the older Haswell i965 driver)

AMD support was fixed here https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26165 and info on the flags is here https://chromium.googlesource.com/chromium/src/+/refs/heads/main/docs/gpu/vaapi.md

Thanks alot.

AlexStorm1313 commented 2 weeks ago

Build 72080 successful To test this build, install it from the testing repository:

flatpak install --user https://dl.flathub.org/build-repo/54735/org.chromium.Chromium.flatpakref

Is there a way to test this build. Currently this returns a 404. Also is this PR still active? Since all external issues are fixed are there any other blockers except the current merge conflicts?

retrixe commented 2 weeks ago

This pull request is obsolete as the original patch has been incorporated into chromium several months ago

BuonHobo commented 2 weeks ago

In my case (flatpak chromium, amd gpu, fedora silverblue) I got vaapi decoding and encoding to work in chromium with these flags.

--enable-features=VaapiVideoDecoder,VaapiIgnoreDriverChecks,Vulkan,DefaultANGLEVulkan,VaapiVideoEncoder,VulkanFromANGLE

Unfortunately it doesn't work natively on wayland and HEVC is listed in chrome://gpu but HEVC videos don't seem to work.

Does anybody know what issues to follow in order to track the state of VAAPI support on chromium/wayland/amd?

retrixe commented 2 weeks ago
  1. Native Wayland works with Vulkan,VulkanFromANGLE,DefaultANGLEVulkan starting with Chrome 129.0.6632.0 (currently in beta as of posting this comment), note that this breaks VA-API encoding functionality for some reason though (at least, on Intel graphics)
  2. HEVC is unfortunately broken with AMD graphics (only working on Intel), the issue has been noted here https://issues.chromium.org/issues/40883357 but I don't believe anyone is working on rectifying it
  3. Another tiny thing of note is that VaapiVideoDecoder isn't needed since it's enabled by default
BuonHobo commented 2 weeks ago
  1. Native Wayland works with Vulkan,VulkanFromANGLE,DefaultANGLEVulkan starting with Chrome 129.0.6632.0 (currently in beta as of posting this comment), note that this breaks VA-API encoding functionality for some reason though (at least, on Intel graphics)
  2. HEVC is unfortunately broken with AMD graphics (only working on Intel), the issue has been noted here https://issues.chromium.org/issues/40883357 but I don't believe anyone is working on rectifying it
  3. Another tiny thing of note is that VaapiVideoDecoder isn't needed since it's enabled by default

I installed chromium 129 and mesa 24.2 (from rpmfusion) in a toolbox and i could get VAAPI to work, both encoding and decoding. The only remaining issue is HEVC10 not working, but apparently there's no tracker for that?

BuonHobo commented 2 weeks ago

https://issues.chromium.org/issues/349428388 https://chromium-review.googlesource.com/c/chromium/src/+/5647049

retrixe commented 2 weeks ago

Like I said, HEVC 10-bit works on Intel and not AMD, I don't know if anyone is working on the AMD case since the patch was submitted by an Intel engineer

BuonHobo commented 2 weeks ago

The second link I sent (https://chromium-review.googlesource.com/c/chromium/src/+/5647049) shows that a workaround was merged but I'm not sure when it's gonna be available

retrixe commented 2 weeks ago

It's been shipping since Chrome 128 and like I said, the workaround only works on Intel graphics, not AMD systems (https://issues.chromium.org/issues/40883357#comment31 as linked earlier)

BuonHobo commented 2 weeks ago

Oh, I'm sorry, you're right. I had missed the part where you said it was an Intel engineer