You are not logged in.
Thanks for the other patch, it applied without problems. However, still no dice neither on vivaldi nor chromium. Tried both wayland and x11 KDE sessions. On a random 1440p video it still says
"Cannot select VaapiVideoDecoder for video decoding"
"Selected VpxVideoDecoder for video decoding, config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [2560,1440], visible rect: [0,0,2560,1440], natural size: [2560,1440], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
And I think I know why: with patched mesa-git vainfo says:
Trying display: wayland
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 24.0.0-devel for AMD Radeon Graphics (radeonsi, gfx1103_r1, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
vainfo: Supported profile and entrypoints
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
Which is interesting, because with the unpatched version of mesa it says:
Trying display: wayland
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 23.2.1-arch1.2 for AMD Radeon Graphics (gfx1103_r1, LLVM 16.0.6, DRM 3.54, 6.6.2-arch1-1)
vainfo: Supported profile and entrypoints
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileAV1Profile0 : VAEntrypointVLD
VAProfileAV1Profile0 : VAEntrypointEncSlice
VAProfileNone : VAEntrypointVideoProc
Note how the VP9 profiles are missing with the patched mesa-git. Am I missing some compilation flags?
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
i had to change the PKGBUILD and make the video codec flag be
-D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec \
and now it works fine in chromium on my amdgpu ... the only thing left is to get this working on wayland too
Offline
Thanks for the heads up about it not working on wayland, no sense in trying it out then... Kind of stuck with wayland since I need separate dpi settings for my two monitors...
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
The patch from Hmann is working well, but there is a problem with Kernels up to 6.0. On Kernel 5.15 everything works fine, but from the beginning:
I have an Radeon 6700 XT and when HW-Accereration is activated and up to Kernel 6.x sometimes the Desktop freeze when watching videos (e.g. Twitch) and then the screens goes black and stays black. The only way to get back to Desktop is to restart the PC.
That bug does't happen on Kernel 5.15 and it started with Kernel 6.0 and goes up to Kernel 6.6. It doen't matter on which way HW-Acceleration was installed. There are some more users with that bug and it maybe could be a problem with buffering, but i don't know too much about it. It's just an idea about what i have read about it.
And as far i know, it's not a Chrome or Chromium bug, because it happens in Firefox and mpv-Player too only when HW-Accerleration is activated.
Last edited by theDude1848 (2023-11-27 05:33:25)
Offline
Thanks for the heads up about it not working on wayland, no sense in trying it out then... Kind of stuck with wayland since I need separate dpi settings for my two monitors...
well it works fine under xwayland... if you start it with the flags mentioned in the patch - it will start with xwayland anyway.
Offline
00:00:04.965 info "VideoDecoderPipeline |decoder_| Initialize() successful"
00:00:04.965 kIsVideoDecryptingDemuxerStream false
00:00:04.965 kVideoDecoderName "VaapiVideoDecoder"
00:00:04.965 kIsPlatformVideoDecoder true
00:00:04.965 info "Selected VaapiVideoDecoder for video decoding, config: codec: vp9, profile: vp9 profile0, level: not available, alpha_mode: is_opaque, coded size: [2560,1440], visible rect: [0,0,2560,1440], natural size: [2560,1440], has extra data: false, encryption scheme: Unencrypted, rotation: 0°, flipped: 0, color space: {primaries:BT709, transfer:BT709, matrix:BT709, range:LIMITED}"
00:00:04.966 pipeline_state "kPlaying"
00:00:04.983 error "VideoDecoderPipeline Frame converter returns null frame."
00:00:04.983 error "VideoDecoderPipeline Frame converter returns null frame."
00:00:04.983 error "VideoDecoderPipeline Frame converter returns null frame."
00:00:04.983 warning "video decoder fallback after initial decode error."
00:00:04.984 kIsVideoDecryptingDemuxerStream false
00:00:04.984 kVideoDecoderName "VpxVideoDecoder"
I think I'll just get back to it whenever it decides to start working without jumping through thousands loops.
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
i had to change the PKGBUILD and make the video codec flag be
-D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec \
and now it works fine in chromium on my amdgpu ... the only thing left is to get this working on wayland too
Hi , can you explain exactly how did you do it ?
Offline
Thank you so much @hmann, the patch is working perfectly.
Offline
Works now on uhd620 after i disabled vulkan which was enabled by default(latest chrome 119)... Mine chrome-flags.conf
--ignore-gpu-blocklist
--enable-gpu-rasterization
--enable-zero-copy
--enable-features=VaapiVideoDecodeLinuxGL
--disable-features=Vulkan
Offline
gyordanov wrote:i had to change the PKGBUILD and make the video codec flag be
-D video-codecs=vc1dec,h264dec,h264enc,h265dec,h265enc,av1dec,av1enc,vp9dec \
and now it works fine in chromium on my amdgpu ... the only thing left is to get this working on wayland too
Hi , can you explain exactly how did you do it ?
oh just edit the PKGBUILD file and change the codec flags, if you follow the steps just do it after the makepkg -so step i think.
Offline
I'm on an old i5 3337U with gpu intel HD4000, gnome on xorg. I already managed to get vaapi working with firefox, vlc, mpv but not with chromium. I've tried a lot of different combinations of flags. even set environment variable to LIBVA_DRI3_DISABLE=1 but no success yet. any help?
Offline
https://chromium-review.googlesource.co … /+/4938496
Already merged to main. Hopefully this will land in 119 to make VAAPI actually work natively on Wayland.
edit: landed in 120.0.6066.0. need to wait a bit longer
No VAAPI for me on wayland with these flags (chromium 120.0.6099.62-2) [UHD Graphics 730]:
--enable-features=VaapiVideoDecodeLinuxGL
--ozone-platform-hint=auto
Offline
You don't need any other patches for Chromium 119. These flags are all you need for hardware video decoding:
--use-gl=angle --use-angle=vulkan --enable-accelerated-video-decode --enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport,UseMultiPlaneFormatForHardwareVideo
I tried these steps with patched mesa and still can't get VAAPI to function with Chromium 119.0.6045.199.
I don't know if that might be the issue but I'm running chrome in virtual display using Xpra:
xpra start-desktop :99
export DISPLAY=":99"
chromium --use-gl=angle --use-angle=vulkan --enable-accelerated-video-decode --enable-features=Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,VaapiIgnoreDriverChecks,VaapiVideoDecoder,PlatformHEVCDecoderSupport,UseMultiPlaneFormatForHardwareVideo
I get these errors in chromium log:
libva error: vaGetDriverNames() failed with unknown libva error
vulkan: No DRI3 support detected - required for presentation
Note: you can probably enable DRI3 in your Xorg config
[8505:8505:1206/195831.220901:ERROR:skia_output_device_vulkan.cc(302)] Failed to initialize vulkan surface.
chrome://gpu report:
* Canvas: Hardware accelerated
* Canvas out-of-process rasterization: Disabled
* Direct Rendering Display Compositor: Disabled
* Compositing: Hardware accelerated
* Multiple Raster Threads: Enabled
* OpenGL: Enabled
* Rasterization: Hardware accelerated
* Raw Draw: Disabled
* Skia Graphite: Disabled
* Video Decode: Hardware accelerated
* Video Encode: Software only. Hardware acceleration disabled
* Vulkan: Enabled
* WebGL: Hardware accelerated
* WebGL2: Hardware accelerated
* WebGPU: Disabled
chrome://media-internals shows FFmpegVideoDecoder is used when playing h264 video.
vainfo report:
Trying display: wayland
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Trying display: x11
error: can't connect to X server!
Trying display: drm
vainfo: VA-API version: 1.20 (libva 2.20.0)
vainfo: Driver version: Mesa Gallium driver 24.0.0-devel for AMD Radeon Graphics (radeonsi, raphael_mendocino, LLVM 16.0.6, DRM 3.54, 6.6.3-arch1-1)
vainfo: Supported profile and entrypoints
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileAV1Profile0 : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
When I try vainfo with virtual display I get this error:
Trying display: wayland
error: XDG_RUNTIME_DIR is invalid or not set in the environment.
Trying display: x11
libva error: vaGetDriverNames() failed with unknown libva error
vaInitialize failed with error code -1 (unknown libva error),exit
CPU used is AMD Ryzen 9 7950X3D.
Does anyone have idea what could be the issue?
Thanks!
Offline
The issue is AMD. HW acceleration is broken on it for both Firefox and Chromium.
Offline
The issue is AMD. HW acceleration is broken on it for both Firefox and Chromium.
Well, it works for me, 6750xt on firefox wayland, both av1 and vp9 hw decodings work as intended...
Offline
It depends on which gen AMD chip you have. The 760M in my Phoenix is still a mess, broken hwdec aside. Rendering artifacts here and there, random freezing etc. There are quite some issues open on the mesa tracker with multiple fixes in the pipeline, so it's (hopefully) only a matter of time.
Last edited by Soukyuu (2023-12-08 08:13:11)
[ Arch x86_64 | linux | Framework 13 | AMD Ryzen™ 5 7640U | 32GB RAM | KDE Plasma Wayland ]
Offline
Well, it works for me, 6750xt on firefox wayland, both av1 and vp9 hw decodings work as intended...
With upstream mesa? Share your flags, please.
Last edited by digitalone (2023-12-10 09:19:58)
Offline
Bzzz_56 wrote:Well, it works for me, 6750xt on firefox wayland, both av1 and vp9 hw decodings work as intended...
With upstream mesa? Share your flags, please.
Just mesa from extra, I didn't make it work on chromium with native wayland (by compiling mesa-git with the patch provided by @hmann, vaapi hw decode works for avc, vp9, hevc and av1 formats on chromium xwayland, while the browser is then locked to 60fps on my monitor); for firefox, I just toggled the media.ffmpeg.vaapi.enabled option in about:config (with the environment variable MOZ_ENABLE_WAYLAND=1)
Last edited by Bzzz_56 (2023-12-10 10:39:24)
Offline
Patch working good Debian 12, Chrome 120.0.6099.71 on ryzen 5 4500u
Video Acceleration Information
==============================
Decoding :
Decode h264 baseline : 64x64 to 4096x4096 pixels
Decode h264 main : 64x64 to 4096x4096 pixels
Decode h264 high : 64x64 to 4096x4096 pixels
Decode vp9 profile0 : 64x64 to 8192x4352 pixels
Decode vp9 profile2 : 64x64 to 8192x4352 pixels
Decode hevc main : 64x64 to 8192x4352 pixels
Decode hevc main 10 : 64x64 to 8192x4352 pixels
Decode hevc main still-picture: 64x64 to 8192x4352 pixels
Offline
Still doesn't work for me on AMD Ryzen 7 7840U with 780M Graphics. Using mesa-1:23.2.1-2 from extra. X11. Tried both Chromium 120.0.6099.109 and Brave 120.0.6099.115.
Using no flags in Chromium, no patch.
HW acceleration works fine in mpv
Last edited by Ventil1 (2023-12-14 06:42:57)
Offline
Hi. Patch works for decoding, but it seems that I'm having troubles with vulkan. My setup is Thinkpad Z16 with integrated cards (Rembrandt [Radeon 680M] - most used) and dedicated card (Navi 24 [Radeon RX 6400/6500 XT/6500M] - almost never used).
After applying patch I can see following decoders:
Decode h264 baseline : 64x64 to 4096x4096 pixels
Decode h264 main : 64x64 to 4096x4096 pixels
Decode h264 high : 64x64 to 4096x4096 pixels
Decode vp9 profile0 : 64x64 to 8192x4352 pixels
Decode vp9 profile2 : 64x64 to 8192x4352 pixels
Decode hevc main : 64x64 to 8192x4352 pixels
Decode hevc main 10 : 64x64 to 8192x4352 pixels
Decode hevc main still-picture: 64x64 to 8192x4352 pixels
But vainfo for integrated card is:
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib64/va/drivers/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.1)
vainfo: Driver version: Mesa Gallium driver 23.3.1 for AMD Radeon Graphics (radeonsi, rembrandt, LLVM 17.0.6, DRM 3.54, 6.6.7-gentoo)
vainfo: Supported profile and entrypoints
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264ConstrainedBaseline: VAEntrypointEncSlice
VAProfileH264Main : VAEntrypointVLD
VAProfileH264Main : VAEntrypointEncSlice
VAProfileH264High : VAEntrypointVLD
VAProfileH264High : VAEntrypointEncSlice
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointEncSlice
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointEncSlice
VAProfileJPEGBaseline : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileAV1Profile0 : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
and for dedicated card is:
Trying display: wayland
Trying display: x11
libva info: VA-API version 1.20.0
libva info: Trying to open /usr/lib64/va/drivers/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_1_20
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.20 (libva 2.20.1)
vainfo: Driver version: Mesa Gallium driver 23.3.1 for AMD Radeon RX 6500 (radeonsi, navi24, LLVM 17.0.6, DRM 3.54, 6.6.7-gentoo)
vainfo: Supported profile and entrypoints
VAProfileH264ConstrainedBaseline: VAEntrypointVLD
VAProfileH264Main : VAEntrypointVLD
VAProfileH264High : VAEntrypointVLD
VAProfileHEVCMain : VAEntrypointVLD
VAProfileHEVCMain10 : VAEntrypointVLD
VAProfileVP9Profile0 : VAEntrypointVLD
VAProfileVP9Profile2 : VAEntrypointVLD
VAProfileNone : VAEntrypointVideoProc
Also in chromium gpu data I can see:
GPU0 : VENDOR= 0x1002, DEVICE=0x1681, DRIVER_VENDOR=AMD, DRIVER_VERSION=23.3.1 *ACTIVE*
GPU1 : VENDOR= 0x1002, DEVICE=0x743f
GL_RENDERER : ANGLE (AMD, Vulkan 1.3.267 (AMD Radeon RX 6500 (RADV NAVI24) (0x0000743F)), radv-23.3.1)
It seems that as soon as angle vulkan is used, chromium takes decoder information from dedicated card only while working on integrated card. And no encoders found as a result. Any suggestions ?
Offline
It seems that as soon as angle vulkan is used, chromium takes decoder information from dedicated card only while working on integrated card. And no encoders found as a result. Any suggestions ?
Which flags are you using? Maybe something is wrong with them. I don't have a dedicaded GPU but I have a Radeon 680M as well and these flags work fine for me :
--enable-features=Vulkan,DefaultANGLEVulkan,VulkanFromANGLE,VaapiVideoDecoder,VaapiIgnoreDriverChecks,UseMultiPlaneFormatForHardwareVideo
Offline
All flags I'm using:
--ignore-gpu-blocklist
--canvas-msaa-sample-count=2
--enable-accelerated-2d-canvas
--enable-checker-imaging
--enable-experimental-canvas-features
--enable-fast-unload
--enable-gpu-compositing
--enable-gpu-rasterization
--enable-gpu-memory-buffers
--enable-oop-rasterization
--enable-raw-draw
--enable-tcp-fastopen
--enable-webgl-image-chromium
--enable-zero-copy
--force-display-list-2d-canvas
--force-gpu-rasterization
--javascript-harmony
--ui-enable-zero-copy
--use-skia-deferred-display-list
--use-skia-renderer
--use-vulkan
--v8-cache-options=code
--v8-cache-strategies-for-cache-storage=aggressive
--enable-accelerated-video
--enable-accelerated-video-decode
--enable-accelerated-video-encode
--enable-accelerated-vpx-decode=3
--enable-accelerated-mjpeg-decode
--enable-vp9-kSVC-decode-acceleration
--use-gl=angle
--use-angle=vulkan
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiIgnoreDriverChecks,CanvasOopRasterization,Vulkan,VulkanFromANGLE,DefaultANGLEVulkan,PlatformHEVCDecoderSupport,UseChromeOSDirectVideoDecoder,UseMultiPlaneFormatForHardwareVideo
If I remove:
--use-angle=vulkan
and chnage features to:
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiIgnoreDriverChecks,CanvasOopRasterization,Vulkan,PlatformHEVCDecoderSupport,UseChromeOSDirectVideoDecoder,UseMultiPlaneFormatForHardwareVideo
I will see that GL_RENDERER points to integrated gpu (GPU0), but hw video decoding is not working anymore (same for video encoding).
Offline
It seems that GL_RENDERER tells truth - chromium is using dedicated GPU with such options
Offline
Is there a way to enable acceleration on older than Broadwell Intel GPUs?
As far as I understand, they disabled VDAVideoDecoder, which worked with the libva-intel-driver package and left VaapiVideoDecoder, which works with the intel-media-driver one. Is this correct?
Where did you find this out? I've been using a laptop with a Haswell processor (the one used on Acer C720 specifically) trying to get VA-API on Chromium and your post is the only one so far that suggested it was impossible. Video acceleration seems to work on Firefox after checking intel_gpu_top I'm not sure if this is true.
Offline