V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
Distributions
Ubuntu
Fedora
CentOS
中文资源站
网易开源镜像站
wbd31
V2EX  ›  Linux

debian 11 cinnamon 双屏很卡,而且 chrome/firefox-esr 播放视频无法硬解

  •  
  •   wbd31 · 2022-01-04 21:42:27 +08:00 · 1967 次点击
    这是一个创建于 835 天前的主题,其中的信息可能已经有所发展或是发生改变。

    cpui5-10400 核显 uhd630 感觉这个现象不太正常。

    双屏 4k@30Hz 显示设置里 user interface scaleDouble(Hi-DPI)

    两个屏幕分别开两个 chrome 窗口就能感觉到卡

    如果播放视频的话,intel-cpu-top 查看占用一直 90% 以上

    而且视频画面有明显的闪烁感觉

    浏览器版本 chrome-stable Version 96.0.4664.110 (Official Build) (64-bit)

    Graphics Feature Status
    Canvas: Hardware accelerated
    Canvas out-of-process rasterization: Disabled
    Compositing: Hardware accelerated
    Multiple Raster Threads: Enabled
    Out-of-process Rasterization: Disabled
    OpenGL: Enabled
    Rasterization: Software only. Hardware acceleration disabled
    Raw Draw: Disabled
    Skia Renderer: Enabled
    Video Decode: Software only. Hardware acceleration disabled
    Vulkan: Disabled
    WebGL: Hardware accelerated
    WebGL2: Hardware accelerated
    

    查看 media 使用的 VideoDecoder 也是 FFmpegVideoDecoder

    96 版本的 chrome-stable 好像也没有 updated_guide_on_how_to_get_hardware_acceleration/ 这篇文章里说的 Hardware-accelerated video decodeflags

    λ xrandr -q
    
    
    Screen 0: minimum 320 x 200, current 6000 x 3840, maximum 16384 x 16384
    DP-1 connected primary 3840x2160+2160+0 (normal left inverted right x axis y axis) 522mm x 294mm
       3840x2160     60.00 +  30.00* 
       2560x1440     59.95  
       1920x1080     60.00    60.00    50.00    59.94  
       1920x1080i    60.00    50.00    59.94  
       1680x1050     59.95  
       1600x900      60.00  
       1280x1024     75.02    60.02  
       1440x900      59.89  
       1152x864      75.00  
       1280x720      60.00    50.00    59.94  
       1024x768      75.03    60.00  
       832x624       74.55  
       800x600       75.00    60.32  
       720x576       50.00  
       720x480       60.00    59.94  
       640x480       75.00    72.81    66.67    60.00    59.94  
       720x400       70.08  
    HDMI-1 disconnected (normal left inverted right x axis y axis)
    HDMI-2 connected 2160x3840+0+0 left (normal left inverted right x axis y axis) 344mm x 194mm
       3840x2160     30.00*   25.00    24.00    29.97    23.98  
       2560x1440     59.95  
       1920x1080    120.00   100.00   119.88    60.00    60.00    50.00    59.94    30.00    25.00    24.00    29.97    23.98  
       1920x1080i    60.00    50.00    59.94  
       1600x1200     60.00  
       1680x1050     59.88  
       1400x1050     59.95  
       1280x1024     75.02    60.02  
       1440x900      59.90  
       1280x960      60.00  
       1152x864      75.00  
       1280x720      60.00    50.00    59.94  
       1024x768      75.03    70.07    60.00  
       832x624       74.55  
       800x600       72.19    75.00    60.32    56.25  
       720x576       50.00  
       720x576i      50.00  
       720x480       60.00    59.94  
       720x480i      60.00    59.94  
       640x480       75.00    72.81    66.67    60.00    59.94  
       720x400       70.08  
    
    λ vainfo
    libva info: VA-API version 1.10.0
    libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
    libva info: Found init function __vaDriverInit_1_10
    libva info: va_openDriver() returns 0
    vainfo: VA-API version: 1.10 (libva 2.10.0)
    vainfo: Driver version: Intel iHD driver for Intel(R) Gen Graphics - 21.1.1 ()
    vainfo: Supported profile and entrypoints
          VAProfileMPEG2Simple            :	VAEntrypointVLD
          VAProfileMPEG2Main              :	VAEntrypointVLD
          VAProfileH264Main               :	VAEntrypointVLD
          VAProfileH264Main               :	VAEntrypointEncSliceLP
          VAProfileH264High               :	VAEntrypointVLD
          VAProfileH264High               :	VAEntrypointEncSliceLP
          VAProfileJPEGBaseline           :	VAEntrypointVLD
          VAProfileJPEGBaseline           :	VAEntrypointEncPicture
          VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
          VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
          VAProfileVP8Version0_3          :	VAEntrypointVLD
          VAProfileHEVCMain               :	VAEntrypointVLD
          VAProfileHEVCMain10             :	VAEntrypointVLD
          VAProfileVP9Profile0            :	VAEntrypointVLD
          VAProfileVP9Profile2            :	VAEntrypointVLD
    
    5 条回复    2022-01-06 22:32:12 +08:00
    harwck
        1
    harwck  
       2022-01-05 18:12:02 +08:00
    我是 Ubuntu ,X11 ,UHD620 。debian 装过一次好象是 Wayland 。所以可能有差别
    Chrome 94 以上好像默认 Use ozone 所以 Hardware Decode 不了,我的 Chrome 定在 94.0.4606.81 一直都可以硬解
    Chrome 的话:
    Override software rendering list enabled
    Zero-copy rasterizer enabled
    GPU rasterization enabled
    Use ozone disabled
    应该可以了。

    但不建议用 Chrome ,Firefox 同样可以硬解而且占用资源看起来比 Chrome 低的。Firefox 的话 about:config
    media.ffmpeg.vaapi.enabled = true
    media.rdd-process.enabled = false
    media.av1.enabled = false
    就可以了。
    intel_gpu_top 的话光 Render/3D 占用高不是硬解,下面的 Video 或者 VideoEnhance 要有占用才是硬解。
    harwck
        2
    harwck  
       2022-01-05 18:13:53 +08:00
    而且你的 libva 和 iHD 都有点老了,建议自己 Compile 一个
    wbd31
        3
    wbd31  
    OP
       2022-01-05 22:10:26 +08:00
    @harwck not work..

    chrome 没有找到 `Use ozone` 的选项,命令行运行报了个 error

    λ google-chrome --disable-features=UseOzonePlatform
    libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
    [39874:39874:0105/220427.373184:ERROR:sandbox_linux.cc(376)] InitializeSandbox() called with multiple threads in process gpu-process.
    [39833:39906:0105/220429.817923:ERROR:chrome_browser_main_extra_parts_metrics.cc(226)] crbug.com/1216328: Checking Bluetooth availability started. Please report if there is no report that this ends.

    但是发现关掉 `Settings -> System -> Use hardware acceleration when available` 之后播放视频 gpu 占用正常了很多,youtube 4k 占用 40% 上下


    我这边 firefox 还需要开启 `gfx.x11-egl.force-enabled=true` 和 `gfx.webrender.all=true` 才能硬解 (看 Video/0 这一项有数值了),但是开启这个 gpu 的 Render/3D/0 占用一直在 90% 上下。。
    harwck
        4
    harwck  
       2022-01-06 06:13:19 +08:00
    @wbd31

    https://wiki.archlinux.org/title/chromium
    这是我的 flags 。你的 use-gl 可能跟我的不一样,还有 Chrome 要降级到 94 ,以前亲测 94 以上 Ozone 无法 disable
    还有看你的 Chrome 输出是 i965 被 init 了,.profile 或者 bashrc 里 export LIBVA_DRIVER_NAME=iHD ,i965 好像不能在 Chrome 用来 Hardware Decode ,

    google-chrome-stable --use-gl=desktop --enable-features=VaapiVideoDecoder --enable-gpu-rasterization --enable-zero-copy --ignore-gpu-blocklist --disable-features=UseOzonePlatform

    至于 Firefox 可能是你接了两个 4k30 带不动了?我是一个 4k60 没这个问题。
    wbd31
        5
    wbd31  
    OP
       2022-01-06 22:32:12 +08:00
    @harwck 好的 谢谢。最近太忙了,先不研究了。
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   5667 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 01:52 · PVG 09:52 · LAX 18:52 · JFK 21:52
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.