Solved Very high CPU usage during video play.

I have FrankenPad with T480 board and no nvidia chip, only intel but i have very high CPU usage during Youtube plays ( firefox, chromium,qutebrowser) and sometimes it gets so bad my laptop crashes or have brain-freeze for a moment
OS - FreeBSD 14.2 RELEASE
Is this how supposed to be or i can do some adjustments ?
Snippet of rc.conf:
Code:
microcode_update_enable="YES"
kld_list="i915kms acpi_video fusefs"
powerd_flags="-a hiadaptive -b adaptive"
performance_cx_lowest="Cmax"
economy_cx_lowest="Cmax"
 
At first glance that looks correct. But having i915kms in kld_list is not a guarantee it's actually being loaded and used. Can you see the module with kldstat and see it gets used in /var/log/Xorg.0.log?
 
At first glance that looks correct. But having i915kms in kld_list is not a guarantee it's actually being loaded and used. Can you see the module with kldstat and see it gets used in /var/log/Xorg.0.log?
if i search i915 in Xorg log - not found.
kldstat:
Code:
  kldstat
Id Refs Address                Size Name
 1  182 0xffffffff80200000  1f3c6c0 kernel
 2    1 0xffffffff8213d000     45c0 snd_driver.ko
 3    2 0xffffffff82142000    1b388 snd_uaudio.ko
 4    2 0xffffffff8215e000     72c0 snd_vibes.ko
 5    2 0xffffffff82166000     5c10 snd_via82c686.ko
 6    2 0xffffffff8216c000     5cc0 snd_t4dwave.ko
 7    4 0xffffffff82172000     3238 snd_spicds.ko
 8    2 0xffffffff82176000     7650 snd_solo.ko
 9    2 0xffffffff8217e000    12298 snd_neomagic.ko
10    2 0xffffffff82191000     c048 snd_maestro3.ko
11    2 0xffffffff8219e000     a2e0 snd_hdspe.ko
12    2 0xffffffff821a9000     4808 snd_fm801.ko
13    2 0xffffffff821ae000     8cf8 snd_envy24ht.ko
14    2 0xffffffff821b7000     a078 snd_envy24.ko
15    2 0xffffffff821c2000     5ca8 snd_cs4281.ko
16    2 0xffffffff821c8000     7c98 snd_atiixp.ko
17    2 0xffffffff821d0000     61d0 snd_als4000.ko
18    1 0xffffffff821d8000   5da658 zfs.ko
19    1 0xffffffff827b3000     77d8 cryptodev.ko
20    1 0xffffffff827bb000     8618 acpi_ibm.ko
21    1 0xffffffff827c4000    1c5e8 geom_eli.ko
22    1 0xffffffff83e20000   1e2228 i915kms.ko
23    2 0xffffffff84003000    87090 drm.ko
24    1 0xffffffff8408b000     22b8 iic.ko
25    2 0xffffffff8408e000     4120 linuxkpi_video.ko
26    3 0xffffffff84093000     7350 dmabuf.ko
27    3 0xffffffff8409b000     3378 lindebugfs.ko
28    1 0xffffffff8409f000     c338 ttm.ko
29    1 0xffffffff840ac000     4388 acpi_video.ko
30    1 0xffffffff840b1000    12e18 fusefs.ko
31    1 0xffffffff840c4000     3390 acpi_wmi.ko
32    1 0xffffffff840c8000     4250 ichsmb.ko
33    1 0xffffffff840cd000     2178 smbus.ko
34    1 0xffffffff840d0000    95260 if_iwlwifi.ko
35    1 0xffffffff84166000     6020 ig4.ko
36    1 0xffffffff8416d000     2110 pchtherm.ko
37    1 0xffffffff84170000    30a80 linux.ko
38    4 0xffffffff841a1000     c2a8 linux_common.ko
39    1 0xffffffff841ae000    2de10 linux64.ko
40    1 0xffffffff841dc000     2278 pty.ko
41    1 0xffffffff841df000     3560 fdescfs.ko
42    1 0xffffffff841e3000     73c0 linprocfs.ko
43    1 0xffffffff841eb000     440c linsysfs.ko
44    1 0xffffffff841f0000     2240 cpuctl.ko
45    1 0xffffffff841f3000     3360 uhid.ko
46    1 0xffffffff841f7000     4364 ums.ko
47    1 0xffffffff841fc000     2260 pflog.ko
48    1 0xffffffff841ff000    4f538 pf.ko
49    1 0xffffffff8424f000     2a68 mac_ntpd.ko
50    1 0xffffffff84252000     20c0 acpi_call.ko
What's the output of `xvinfo`?
xvinfo
Code:
 xvinfo
X-Video Extension version 2.2
screen #0
  Adaptor #0: "GLAMOR Textured Video"
    number of ports: 16
    port base: 197
    operations supported: PutImage
    supported visuals:
      depth 24, visualID 0x21
    number of attributes: 5
      "XV_BRIGHTNESS" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_CONTRAST" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_SATURATION" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_HUE" (range -1000 to 1000)
              client settable attribute
              client gettable attribute (current value is 0)
      "XV_COLORSPACE" (range 0 to 1)
              client settable attribute
              client gettable attribute (current value is 0)
    maximum XvImage size: 8192 x 8192
    Number of image formats: 3
      id: 0x32315659 (YV12)
        guid: 59563132-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)
      id: 0x30323449 (I420)
        guid: 49343230-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 3
        type: YUV (planar)
      id: 0x3231564e (NV12)
        guid: 4e563132-0000-0010-8000-00aa00389b71
        bits per pixel: 12
        number of planes: 2
        type: YUV (planar)
 
Xorg log got this error
Code:
[    34.577] (II) LoadModule: "intel"
[    34.578] (WW) Warning, couldn't open module intel
[    34.578] (EE) Failed to load module "intel" (module does not exist, 0)
Maybe i have to create 20-intel.conf ?
 
It will use the modesetting(4) driver. If not it falls back on scfb(4).

It's looking for x11-drivers/xf86-video-intel, but you shouldn't need that, so the "error" is fine.
Code:
[    34.578] (II) LoadModule: "modesetting"
[    34.578] (II) Loading /usr/local/lib/xorg/modules/drivers/modesetting_drv.so
[    34.580] (II) Module modesetting: vendor="X.Org Foundation"
[    34.580]     compiled for 1.21.1.18, module version = 1.21.1
[    34.580]     Module class: X.Org Video Driver
[    34.580]     ABI class: X.Org Video Driver, version 25.2
[    34.580] (II) LoadModule: "scfb"
[    34.580] (II) Loading /usr/local/lib/xorg/modules/drivers/scfb_drv.so
[    34.581] (II) Module scfb: vendor="X.Org Foundation"
[    34.581]     compiled for 1.21.1.13, module version = 0.0.5
[    34.581]     ABI class: X.Org Video Driver, version 25.2
[    34.581] (II) LoadModule: "vesa"
[    34.581] (II) Loading /usr/local/lib/xorg/modules/drivers/vesa_drv.so
[    34.581] (II) Module vesa: vendor="X.Org Foundation"
[    34.581]     compiled for 1.21.1.13, module version = 2.5.0
[    34.581]     Module class: X.Org Video Driver
[    34.581]     ABI class: X.Org Video Driver, version 25.2
[    34.581] (II) modesetting: Driver for Modesetting Kernel Drivers: kms
[    34.581] (II) scfb: driver for wsdisplay framebuffer: scfb
[    34.581] (II) VESA: driver for VESA chipsets: vesa
[    34.582] (--) Using syscons driver with X support (version 2.0)
[    34.582] (--) using VT number 9

[    34.617] (II) modeset(0): using drv /dev/dri/card0
[    34.617] (WW) Falling back to old probe method for scfb
[    34.617] scfb trace: probe start
[    34.617] scfb trace: probe done
[    34.617] (WW) VGA arbiter: cannot open kernel arbiter, no multi-card support
[    34.618] (II) modeset(0): Creating default Display subsection in Screen section
    "Default Screen Section" for depth/fbbpp 24/32
[    34.618] (==) modeset(0): Depth 24, (==) framebuffer bpp 32
[    34.618] (==) modeset(0): RGB weight 888
[    34.618] (==) modeset(0): Default visual is TrueColor
[    34.618] (II) Loading sub module "glamoregl"
[    34.618] (II) LoadModule: "glamoregl"
[    34.618] (II) Loading /usr/local/lib/xorg/modules/libglamoregl.so
[    34.641] (II) Module glamoregl: vendor="X.Org Foundation"
[    34.641]     compiled for 1.21.1.18, module version = 1.0.1
[    34.641]     ABI class: X.Org ANSI C Emulation, version 0.4
 
Don't use xf86-video-intel driver. Use drm driver and install libva-intel, libvdpau-va-gl then check the hardware capabilities using vdpauinfo

I think your UHD 620 doesn't support hardware decoding for Youtube and that's why you are seeing high cpu usage.

here's what works on my old laptop.
archivers/7-zip
www/chromium
graphics/drm-510-kmod
graphics/drm_info
multimedia/gstreamer1-libav
multimedia/gstreamer1-plugins-core
multimedia/gstreamer1-plugins-msdk
audio/gstreamer1-plugins-pulse
multimedia/gstreamer1-plugins-svt-av1
multimedia/gstreamer1-vaapi
multimedia/libgav1
editors/libreoffice
multimedia/libva-glx
multimedia/libva-intel-driver
multimedia/libva-utils
multimedia/libvdpau-va-gl
x11/lightdm
x11/lightdm-gtk-greeter
x11/lightdm-gtk-greeter-settings
misc/mc
graphics/mesa-demos
multimedia/mplayer
multimedia/mpv
ports-mgmt/pkg
archivers/thunar-archive-plugin
archivers/unzip
multimedia/vdpauinfo
audio/virtual_oss
audio/virtual_oss_ctl
x11-fonts/webfonts
archivers/xarchiver
x11-wm/xfce4
x11/xfce4-taskmanager
x11/xorg
audio/xfce4-mixer
benchmarks/glmark2
multimedia/gnome-mplayer
 
Don't use xf86-video-intel driver. Use drm driver and install libva-intel, libvdpau-va-gl then check the hardware capabilities using vdpauinfo

I think your UHD 620 doesn't support hardware decoding for Youtube and that's why you are seeing high cpu usage.

here's what works on my old laptop.
archivers/7-zip
www/chromium
graphics/drm-510-kmod
graphics/drm_info
multimedia/gstreamer1-libav
multimedia/gstreamer1-plugins-core
multimedia/gstreamer1-plugins-msdk
audio/gstreamer1-plugins-pulse
multimedia/gstreamer1-plugins-svt-av1
multimedia/gstreamer1-vaapi
multimedia/libgav1
editors/libreoffice
multimedia/libva-glx
multimedia/libva-intel-driver
multimedia/libva-utils
multimedia/libvdpau-va-gl
x11/lightdm
x11/lightdm-gtk-greeter
x11/lightdm-gtk-greeter-settings
misc/mc
graphics/mesa-demos
multimedia/mplayer
multimedia/mpv
ports-mgmt/pkg
archivers/thunar-archive-plugin
archivers/unzip
multimedia/vdpauinfo
audio/virtual_oss
audio/virtual_oss_ctl
x11-fonts/webfonts
archivers/xarchiver
x11-wm/xfce4
x11/xfce4-taskmanager
x11/xorg
audio/xfce4-mixer
benchmarks/glmark2
multimedia/gnome-mplayer
I dont use xf86-video-intell

vdpau
Code:
vdpauinfo
display: :0   screen: 0
libva info: VA-API version 1.22.0
libva info: Trying to open /usr/local/lib/dri/iHD_drv_video.so
libva info: va_openDriver() returns -1
libva info: Trying to open /usr/local/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_22
libva info: va_openDriver() returns 0
API version: 1
Information string: OpenGL/VAAPI backend for VDPAU

Video surface:

name   width height types
-------------------------------------------
420     4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16
422     4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16
444     4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16
420_16  4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16
422_16  4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16
444_16  4096  4096  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 NV24 YV24 P010 P016 Y_U_V_444_16

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                   --- not supported ---
MPEG2_MAIN                     --- not supported ---
H264_BASELINE                  51 16384  2048  2048
H264_MAIN                      51 16384  2048  2048
H264_HIGH                      51 16384  2048  2048
VC1_SIMPLE                     --- not supported ---
VC1_MAIN                       --- not supported ---
VC1_ADVANCED                   --- not supported ---
MPEG4_PART2_SP                 --- not supported ---
MPEG4_PART2_ASP                --- not supported ---
DIVX4_QMOBILE                  --- not supported ---
DIVX4_MOBILE                   --- not supported ---
DIVX4_HOME_THEATER             --- not supported ---
DIVX4_HD_1080P                 --- not supported ---
DIVX5_QMOBILE                  --- not supported ---
DIVX5_MOBILE                   --- not supported ---
DIVX5_HOME_THEATER             --- not supported ---
DIVX5_HD_1080P                 --- not supported ---
H264_CONSTRAINED_BASELINE      51 16384  2048  2048
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- not supported ---
VP9_PROFILE_0                  --- not supported ---
VP9_PROFILE_1                  --- not supported ---
VP9_PROFILE_2                  --- not supported ---
VP9_PROFILE_3                  --- not supported ---
HEVC_MAIN                      --- not supported ---
HEVC_MAIN_10                   --- not supported ---
HEVC_MAIN_STILL                --- not supported ---
HEVC_MAIN_12                   --- not supported ---
HEVC_MAIN_444                  --- not supported ---
HEVC_MAIN_444_10               --- not supported ---
HEVC_MAIN_444_12               --- not supported ---
AV1_MAIN                       --- not supported ---
AV1_HIGH                       --- not supported ---
AV1_PROFESSIONAL               --- not supported ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8         16384 16384    -
R8G8B8A8         16384 16384    -
R10G10B10A2      16384 16384    -
B10G10R10A2      16384 16384    -
A8               16384 16384    -

Bitmap surface:

name              width height
------------------------------
B8G8R8A8         16384 16384
R8G8B8A8         16384 16384
R10G10B10A2      16384 16384
B10G10R10A2      16384 16384
A8               16384 16384

Video mixer:

feature name                    sup
------------------------------------
DEINTERLACE_TEMPORAL             -
DEINTERLACE_TEMPORAL_SPATIAL     -
INVERSE_TELECINE                 -
NOISE_REDUCTION                  -
SHARPNESS                        -
LUMA_KEY                         -
HIGH QUALITY SCALING - L1        -
HIGH QUALITY SCALING - L2        -
HIGH QUALITY SCALING - L3        -
HIGH QUALITY SCALING - L4        -
HIGH QUALITY SCALING - L5        -
HIGH QUALITY SCALING - L6        -
HIGH QUALITY SCALING - L7        -
HIGH QUALITY SCALING - L8        -
HIGH QUALITY SCALING - L9        -

parameter name                  sup      min      max
-----------------------------------------------------
VIDEO_SURFACE_WIDTH              -
VIDEO_SURFACE_HEIGHT             -
CHROMA_TYPE                      -
LAYERS                           -

attribute name                  sup      min      max
-----------------------------------------------------
BACKGROUND_COLOR                 -
CSC_MATRIX                       -
NOISE_REDUCTION_LEVEL            -
SHARPNESS_LEVEL                  -
LUMA_KEY_MIN_LUMA                -
LUMA_KEY_MAX_LUMA                -


libvdpau-va-gl: Device::Resource::~Resource(): caught exception
Terminating due to uncaught exception 0x49f0f13560 of type std::__1::system_error
zsh: abort (core dumped)  vdpauinfo
 
I found this. Now it makes 0 sense for me at all.
But isnt youtube uses H264 ?
 

Attachments

  • uhd620.png
    uhd620.png
    102.3 KB · Views: 172
  • uhd620-1.png
    uhd620-1.png
    130 KB · Views: 157
most of the videos are using av1 and vp9 some old clips are in avc (h.264). You can right click on the video and check the statistics to see the codec.
 
Your CPU is more than capable to play anything. What is your CPU usage during the play of the Youtube?
25-35 and jumps to 40+ and 100% constantly, specially if i do other stuff. its like a heart beat and during multitasking its pain.
 
Back
Top