You are not logged in.

#1 2024-03-17 16:17:59

Demokrittor
Member
Registered: 2016-07-25
Posts: 11

Video acceleration on Wayland with dedicated graphics

Hi :-)

I've recently switched from a Lenovo E550 (no dedicated graphics) to a Toshiba Satellite L50 (i5-4210U / AMD Radeon R7 M260).
Aside my compile times exploding, video playback puts this new laptop under a lot more stress.
The DE is Sway (-> Wayland).

The problem appears to be a lack of hardware acceleration for video decoding.
According to the Wiki, cards that are "Radeon HD 2000 and newer" should support H264 with VA-API and VDPAU.
HD 2000 (2007) is a lot older than R7 (2014) so I'm expecting see it supported but it doesn't look that way when checking vainfo and vdpauinfo.

$ vainfo --display drm --device /dev/dri/card0
Trying display: drm
Xlib:  extension "DRI2" missing on display ":0".
vainfo: VA-API version: 1.21 (libva 2.20.1)
vainfo: Driver version: Mesa Gallium driver 24.0.3-arch1.1 for AMD Radeon R7 M260 (radeonsi, iceland, LLVM 17.0.6, DRM 3.57, 6.7.8-arch1-1)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
$ DRI_PRIME=1 VDPAU_DRIVER=radeonsi vdpauinfo 
display: :0   screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0

..

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                           0 1048576 16384 16384
MPEG2_SIMPLE                    3 1048576 16384 16384
MPEG2_MAIN                      3 1048576 16384 16384
H264_BASELINE                  --- not supported ---
H264_MAIN                      --- not supported ---
H264_HIGH                      --- not supported ---
..
# only more unsupported

Interestingly, vainfo won't work like this:
(Is it trying to use radeonsi with the Intel CPU?)

$ DRI_PRIME=1 LIBVA_DRIVER_NAME=radeonsi vainfo 
Trying display: wayland
crocus: driver missing
libva error: /usr/lib/dri/radeonsi_drv_video.so init failed
vaInitialize failed with error code 2 (resource allocation failed),exit

The CPU supports acceleration to some degree but it also turns the fan volume up to a maximum when playing a simple YT video:

$ vainfo 
Trying display: wayland
vainfo: VA-API version: 1.21 (libva 2.20.1)
vainfo: Driver version: Intel i965 driver for Intel(R) Haswell Mobile - 2.4.1
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264MultiviewHigh      :	VAEntrypointEncSlice
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointEncSlice
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD

I assume that I have all necessary packages installed since both vainfo and vdpauinfo detect the card.
Am I doing it wrong or is there just no support?

kind regards!

Offline

#2 2024-03-18 11:17:52

Lone_Wolf
Administrator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 12,903

Re: Video acceleration on Wayland with dedicated graphics

Try unsetting $DISPLAY as described at https://wiki.archlinux.org/title/Hardwa … nit_failed

Also keep in mind that copying from dedicated card to the output buffer of the integrated card usually means rendering videos on the dedicated card worsens performance.

Last edited by Lone_Wolf (2024-03-18 11:21:03)


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.

clean chroot building not flexible enough ?
Try clean chroot manager by graysky

Offline

Board footer

Powered by FluxBB