You are not logged in.

#1 2023-06-26 06:18:12

drishal
Member
Registered: 2020-10-25
Posts: 18

firefox/chromium video lag

For some reason Firefox and Chromium start lagging and dropping frames every few seconds after a little while of playing videos. I am currently on Hyprland and can verify that both firefox and chromium are running on native wayland with xprop. With firefox I have enabled vaapi as suggested in the arch wiki with enabling webrender with     gfx.webrender.all = true  and media.ffmpeg.vaapi.enabled = true in about:config (interestingly if I did not enable the vaapi flag, in about:support I saw that hardware video decoding was disabled due to gfxinfo). I can verify that vaapi is working in firefox by watching `/sys/kernel/debug/dri/0/amdgpu_pm_info` and seeing VCN: enabled while watching a video. With chromium, I have an even more interesting issue, currently I have the following flags:

--enable-gpu-rasterization
--enable-gpu-compositing
--enable-oop-rasterization
--enable-native-gpu-memory-buffers
--enable-zero-copy
--ignore-gpu-blocklist
--use-vulkan
--enable-oop-rasterization
--enable-drdc
--enable-features=VaapiVideoDecoder,VaapiVideoEncoder,VaapiVideoDecodeLinuxGL,vulkan,VaapiIgnoreDriverChecks,drdc
--disable-features=UseChromeOSDirectVideoDecoder

but then on checking inspect element under media I can see that hardware decoding is false and its using vpxvideodecoder even though chrome://gpu shows hardware decoding

Canvas: Hardware accelerated
Canvas out-of-process rasterization: Enabled
Direct Rendering Display Compositor: Disabled
Compositing: Hardware accelerated
Multiple Raster Threads: Enabled
OpenGL: Enabled
Rasterization: Hardware accelerated on all pages
Raw Draw: Enabled
Video Decode: Hardware accelerated
Video Encode: Hardware accelerated
Vulkan: Enabled
WebGL: Hardware accelerated
WebGL2: Hardware accelerated
WebGPU: Disabled

However I still get strange lagging/framedrops  even in chrome specially if I increase the speeds

even more interesting is that if I use mpv <video_url> it can play 1440p60fps videos without any issues with vaapi, but its just the browsers (both firefox and chrome) which begin lagging after a little while on playing video and also cause atleast 4-5 times higher cpu use compared to mpv with the same video (btw on 4k videos firefox just hangs and stutters, which is even more interesting, but windows can handle 4k60fps HDR videos just fine, tested with a backup ssd I have that had windows installed in it to rule out hardware issues)

can someone please help me solve this hanging/lagging issues?

Specs: ThinkPad P14s gen 1 AMD, ryzen 7 4750u with 32gb ram

Offline

#2 2023-07-24 10:40:11

birdie-github
Member
From: Artem S. Tashkinov
Registered: 2021-10-09
Posts: 14
Website

Re: firefox/chromium video lag

I'm not using Wayland but here under X11 Google Chrome disables HW accelerated video decoding if Vulkan is enabled.

I'm not sure why people enable all possible experimental features without first checking whether they are beneficial at all.

For running Chrome I have the only option enabled: "--disable-features=UseChromeOSDirectVideoDecoder". That's it.

Anyhow, check your chrome://gpu/ and find "Video Acceleration Information" - if HW video decoding is enabled it will show:

Decoding
Decode h264 baseline 16x16 to 4096x4096 pixels
Decode h264 main     16x16 to 4096x4096 pixels
Decode h264 high     16x16 to 4096x4096 pixels
Decode vp9 profile0  16x16 to 8192x4352 pixels

Probably Chromium is a whole different beast, so please dismiss my comment.

Last edited by birdie-github (2023-07-24 10:47:51)

Offline

Board footer

Powered by FluxBB