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

Add back VA-API support #33

Closed
TeslaBargain opened this issue Sep 24, 2019 · 9 comments
Closed

Add back VA-API support #33

TeslaBargain opened this issue Sep 24, 2019 · 9 comments

Comments

@TeslaBargain
Copy link

According to a comment in the AUR for ungoogled-chromium this PKBUILD formerly included vaapi-fix.patch but it has been dropped for unknown reasons?

Please bring back support for HW acceleration, because it really makes no sense to miss out on that very important feature and only feeds the need for more than one ungoogled-chromium build when we could have an all-in-one AUR package instead.

@ghost
Copy link

ghost commented Sep 24, 2019

lookslike it will be back when PR #32 lands: https://github.com/ungoogled-software/ungoogled-chromium-archlinux/pull/32/files#diff-14e5dc0abf7e8a4b1863c02864ca744d

actually I don't know if whoever maintains that repo will bring it back, they seem to be using this:

# CHANGES MADE for ungoogled-chromium:
# - exposed all *-webrtc-hw-* feature flags for Linux
description: build with hardware accelerated (vaapi) video support
author: Akarshan Biswas <akarshan.biswas@gmail.com>
origin: https://src.fedoraproject.org/rpms/chromium/raw/master/f/enable-vaapi.patch

--- a/chrome/browser/about_flags.cc
+++ b/chrome/browser/about_flags.cc
@@ -1187,10 +1187,10 @@ const FeatureEntry kFeatureEntries[] = {
      flag_descriptions::kUiPartialSwapDescription, kOsAll,
      SINGLE_DISABLE_VALUE_TYPE(switches::kUIDisablePartialSwap)},
     {"disable-webrtc-hw-decoding", flag_descriptions::kWebrtcHwDecodingName,
-     flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS,
+     flag_descriptions::kWebrtcHwDecodingDescription, kOsAndroid | kOsCrOS | kOsLinux,
      SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWDecoding)},
     {"disable-webrtc-hw-encoding", flag_descriptions::kWebrtcHwEncodingName,
-     flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS,
+     flag_descriptions::kWebrtcHwEncodingDescription, kOsAndroid | kOsCrOS | kOsLinux,
      SINGLE_DISABLE_VALUE_TYPE(switches::kDisableWebRtcHWEncoding)},
 #if !defined(OS_ANDROID)
     {"enable-reader-mode", flag_descriptions::kEnableReaderModeName,
@@ -1199,11 +1199,11 @@ const FeatureEntry kFeatureEntries[] = {
 #endif  // !defined(OS_ANDROID)
     {"enable-webrtc-hw-h264-encoding",
      flag_descriptions::kWebrtcHwH264EncodingName,
-     flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS,
+     flag_descriptions::kWebrtcHwH264EncodingDescription, kOsAndroid | kOsCrOS | kOsLinux,
      FEATURE_VALUE_TYPE(features::kWebRtcHWH264Encoding)},
     {"enable-webrtc-hw-vp8-encoding",
      flag_descriptions::kWebrtcHwVP8EncodingName,
-     flag_descriptions::kWebrtcHwVP8EncodingDescription, kOsAndroid | kOsCrOS,
+     flag_descriptions::kWebrtcHwVP8EncodingDescription, kOsAndroid | kOsCrOS | kOsLinux,
      FEATURE_VALUE_TYPE(features::kWebRtcHWVP8Encoding)},
 #if defined(WEBRTC_USE_PIPEWIRE)
     {"enable-webrtc-pipewire-capturer",
@@ -1517,7 +1517,7 @@ const FeatureEntry kFeatureEntries[] = {
         "disable-accelerated-video-decode",
         flag_descriptions::kAcceleratedVideoDecodeName,
         flag_descriptions::kAcceleratedVideoDecodeDescription,
-        kOsMac | kOsWin | kOsCrOS | kOsAndroid,
+        kOsMac | kOsWin | kOsCrOS | kOsAndroid | kOsLinux,
         SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedVideoDecode),
     },
     {"enable-history-favicons-google-server-query",
@@ -1953,7 +1953,7 @@ const FeatureEntry kFeatureEntries[] = {
 #if defined(OS_CHROMEOS)
     {"disable-accelerated-mjpeg-decode",
      flag_descriptions::kAcceleratedMjpegDecodeName,
-     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS,
+     flag_descriptions::kAcceleratedMjpegDecodeDescription, kOsCrOS | kOsLinux,
      SINGLE_DISABLE_VALUE_TYPE(switches::kDisableAcceleratedMjpegDecode)},
 #endif  // OS_CHROMEOS
     {"system-keyboard-lock", flag_descriptions::kSystemKeyboardLockName,
--- a/chrome/browser/flag_descriptions.cc
+++ b/chrome/browser/flag_descriptions.cc
@@ -2770,15 +2770,20 @@ const char kMacSystemMediaPermissionsInf
 
 #endif
 
-// Chrome OS -------------------------------------------------------------------
+// Chrome OS Linux-------------------------------------------------------------------
 
-#if defined(OS_CHROMEOS)
+#if defined(OS_CHROMEOS) || (defined(OS_LINUX) && !defined(OS_ANDROID))
 
 const char kAcceleratedMjpegDecodeName[] =
     "Hardware-accelerated mjpeg decode for captured frame";
 const char kAcceleratedMjpegDecodeDescription[] =
     "Enable hardware-accelerated mjpeg decode for captured frame where "
     "available.";
+#endif
+
+// Chrome OS --------------------------------------------------
+
+#if defined(OS_CHROMEOS)
 
 const char kAppServiceAshName[] = "App Service Ash";
 const char kAppServiceAshDescription[] =
--- a/gpu/config/software_rendering_list.json
+++ b/gpu/config/software_rendering_list.json
@@ -370,11 +370,12 @@
     },
     {
       "id": 48,
-      "description": "Accelerated video decode is unavailable on Linux",
+      "description": "Accelerated VA-API video decode is not supported on NVIDIA platforms",
       "cr_bugs": [137247],
       "os": {
         "type": "linux"
       },
+      "vendor_id": "0x10de",
       "features": [
         "accelerated_video_decode"
       ]

in 77.0.3865.90-1 https://aur.archlinux.org/cgit/aur.git/commit/?h=ungoogled-chromium&id=e2508ea3bca2ab7fb22a0a47b7d3a9831d409faf

@wchen342
Copy link
Collaborator

I checked the PKGBUILD for 77.0.3865.120-1 in seppia's package and vaapi.patch is there, so I guess this is solved for now?

@TeslaBargain
Copy link
Author

Can someone confirm that HW video acceleration is working with the build from seppia's package?

I'm currently using the binary package made by @jstkdng.

@Scrumplex
Copy link

Scrumplex commented Oct 19, 2019

Can someone confirm that HW video acceleration is working with the build from seppia's package?

I'm currently using the binary package made by @jstkdng

When playing a YouTube video on X11. The CPU usage is very low for chromium (around 4%).

chrome://gpu:

Data exported | 2019-10-19T11:05:05.013Z
-- | --
Chrome version | Chrome/77.0.3865.120
Operating system | Linux 5.3.7-arch1-1-ARCH
Software rendering list URL | https://chromium.9oo91esource.qjz9zk/chromium/src/+/416d6d8013e9adb6dd33b0c12e7614ff403d1a94/gpu/config/software_rendering_list.json
Driver bug list URL | https://chromium.9oo91esource.qjz9zk/chromium/src/+/416d6d8013e9adb6dd33b0c12e7614ff403d1a94/gpu/config/gpu_driver_bug_list.json
ANGLE commit id | unknown hash
2D graphics backend | Skia/77 a10014304cba4f24b7af17191f59490faa8aee77
Command Line | /usr/lib/chromium/chromium --flag-switches-begin --enable-features=WebUIDarkMode,CheckerImaging,MarkHttpAs,ScrollAnchorSerialization,brotli-encoding --force-dark-mode --enable-quic --enable-tcp-fastopen -–enable-gpu-rasterization --force-gpu-rasterization --enable-native-gpu-memory-buffers --enable-oop-rasterization --ignore-gpu-blacklist --use-skia-deferred-display-list --enable-surfaces-for-videos -–enable-zero-copy --enable-fast-unload --save-page-as-mhtml --enable-smooth-scrolling --site-per-process --enable-http-form-warning --enable-tab-audio-muting --history-entry-requires-user-gesture --enable-scroll-anchoring --flag-switches-end --flag-switches-begin --enable-experimental-web-platform-features --flag-switches-end --file-url-path-alias=/gen=/usr/lib/chromium/gen

@Master0ne
Copy link

Master0ne commented Oct 20, 2019

@Scrumplex that data is not really telling anything. I guess this is what it is supposed to look like when going to chrome://gpu:

hardware_accelerated

@jstkdng
Copy link
Member

jstkdng commented Oct 20, 2019

actually, better info would be the decoder you get when playing a video.

  1. play a video
  2. go to chrome://media-internals
  3. Collapse the list and look at the video decoder, if it says mojo video decoder then its all good. If you get ffmpegvideodecoder then hw accel is broken.

Edit: of course, other decoders could appear, like dav1d, you have to research if that decoder supports hardware acceleration

@TeslaBargain
Copy link
Author

@jstkdng, here chrome://media-internals shows dav1d so I guess it should be working correctly (with your ungoogled-chromium build), having Intel Graphics HD 620 properly set up.

@jstkdng
Copy link
Member

jstkdng commented Oct 23, 2019

@TeslaBargain you should be all good then.

@jstkdng
Copy link
Member

jstkdng commented May 16, 2020

#79 should have fixed this issue. Reopen if it still isn't working.

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