LINUX.ORG.RU

AMDGPU и аппаратное ускорение видео в Gentoo

 , , , ,


0

1

Ноутбук lenovo 110-15ACL

$ uname -a
Linux localhost 4.19.27-gentoo-r1nny11 #11 SMP Sun Jun 16 11:34:23 MSK 2019 x86_64 AMD A4-7210 APU with AMD Radeon R3 Graphics AuthenticAMD GNU/Linux

$ lspci -k
00:01.0 VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Mullins [Radeon R3 Graphics] (rev 45)
	Subsystem: Lenovo Mullins [Radeon R3 Graphics]
	Kernel driver in use: amdgpu
	Kernel modules: radeon, amdgpu
01:00.0 Display controller: Advanced Micro Devices, Inc. [AMD/ATI] Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520] (rev 83)
	Subsystem: Lenovo Sun XT [Radeon HD 8670A/8670M/8690M / R5 M330 / M430 / R7 M520]
	Kernel driver in use: amdgpu
	Kernel modules: radeon, amdgpu

$  vdpauinfo 
display: :0   screen: 0
API version: 1
Information string: G3DVL VDPAU Driver Shared Library version 1.0

Video surface:

name   width height types
-------------------------------------------
420    16384 16384  NV12 YV12 
422    16384 16384  UYVY YUYV 
444    16384 16384  Y8U8V8A8 V8U8Y8A8 

Decoder capabilities:

name                        level macbs width height
----------------------------------------------------
MPEG1                          --- not supported ---
MPEG2_SIMPLE                    3  9216  2048  1152
MPEG2_MAIN                      3  9216  2048  1152
H264_BASELINE                  41  9216  2048  1152
H264_MAIN                      41  9216  2048  1152
H264_HIGH                      41  9216  2048  1152
VC1_SIMPLE                      1  9216  2048  1152
VC1_MAIN                        2  9216  2048  1152
VC1_ADVANCED                    4  9216  2048  1152
MPEG4_PART2_SP                  3  9216  2048  1152
MPEG4_PART2_ASP                 5  9216  2048  1152
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       0  9216  2048  1152
H264_EXTENDED                  --- not supported ---
H264_PROGRESSIVE_HIGH          --- not supported ---
H264_CONSTRAINED_HIGH          --- not supported ---
H264_HIGH_444_PREDICTIVE       --- 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 ---

Output surface:

name              width height nat types
----------------------------------------------------
B8G8R8A8         16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A8I8 I8A8 
R8G8B8A8         16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A8I8 I8A8 
R10G10B10A2      16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A8I8 I8A8 
B10G10R10A2      16384 16384    y  NV12 YV12 UYVY YUYV Y8U8V8A8 V8U8Y8A8 A8I8 I8A8 

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             y
DEINTERLACE_TEMPORAL_SPATIAL     -
INVERSE_TELECINE                 -
NOISE_REDUCTION                  y
SHARPNESS                        y
LUMA_KEY                         y
HIGH QUALITY SCALING - L1        y
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              y        48     2048
VIDEO_SURFACE_HEIGHT             y        48     1152
CHROMA_TYPE                      y  
LAYERS                           y         0        4

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

$ vainfo 
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/va/drivers/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.39 (libva 1.7.3)
vainfo: Driver version: Mesa Gallium driver 18.3.6 for AMD MULLINS (DRM 3.27.0, 4.19.27-gentoo-r1nny11, LLVM 7.1.0)
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileNone                   :	VAEntrypointVideoProc

$ mpv "Patlabor 1.mp4" --hwdec=auto
Playing: Patlabor 1.mp4
 (+) Video --vid=1 (*) (h264 720x480 24.000fps)
 (+) Audio --aid=1 --alang=und (*) (aac 2ch 44100Hz)
AO: [pulse] 44100Hz stereo 2ch float
Using hardware decoding (vdpau).
VO: [opengl] 720x480 vdpau[yuv420p]
AV: 00:00:00 / 01:38:43 (0%) A-V:  0.219 Dropped: 1

Audio/Video desynchronisation detected! Possible reasons include too slow
hardware, temporary CPU spikes, broken drivers, and broken files. Audio
position will not match to the video (see A-V status field).

AV: 00:00:00 / 01:38:43 (0%) A-V:  2.153 Dropped: 12

$ DRI_PRIME=1 mpv "Patlabor 1.mp4" --hwdec=auto
Playing: Patlabor 1.mp4
 (+) Video --vid=1 (*) (h264 720x480 24.000fps)
 (+) Audio --aid=1 --alang=und (*) (aac 2ch 44100Hz)
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib64/va/drivers/radeonsi_drv_video.so
libva info: Found init function __vaDriverInit_0_39
libva info: va_openDriver() returns 0
[vo/opengl/vaapi-egl] vaDeriveImage(): invalid VAImageFormat
[vo/opengl/vaapi-egl] vaDeriveImage(): invalid VAImageFormat
[vo/opengl/vaapi-egl] vaDeriveImage(): invalid VAImageFormat
AO: [pulse] 44100Hz stereo 2ch float
[ffmpeg/video] h264: Failed setup for format vdpau: hwaccel initialisation returned error.
VO: [opengl] 720x480 yuv420p
AV: 00:00:01 / 01:38:43 (0%) A-V:  0.000

Нет изображения. С другими hwdec либо также нет изображения, либо нет аппаратного ускорения. В vlc аналогично. Собственно вопрос: как сделать ускорение?



Последнее исправление: Pasha__kun (всего исправлений: 2)

Ответ на: комментарий от Meyer

Бинарный блоб, ты хотел сказать.

anonymous
()
Ответ на: комментарий от Meyer

Да, без него совсем видеодрайвер не работал

Pasha__kun
() автор топика

Patlabor 1.mp4"

Аппаратно воспроизводятся файлы, кодированные по канону. Если та м какой нибудь reframe=20 в ключах кодирования то не будет аппаратно декодировать.

anonymous
()
Ответ на: комментарий от anonymous

Бред. У меня под сотню разных видео в разных форматах и из разных источников. И аппаратное ускорение не заработало ни разу.

$ mediainfo "Patlabor 1.mp4"
General
Complete name                            : Patlabor 1.mp4
Format                                   : MPEG-4
Format profile                           : Base Media
Codec ID                                 : isom (isom/iso2/avc1/mp41)
File size                                : 549 MiB
Duration                                 : 1 h 38 min
Overall bit rate mode                    : Variable
Overall bit rate                         : 778 kb/s
Encoded date                             : UTC 1970-01-01 00:00:00
Tagged date                              : UTC 1970-01-01 00:00:00
Writing application                      : Lavf52.40.0

Video
ID                                       : 1
Format                                   : AVC
Format/Info                              : Advanced Video Codec
Format profile                           : High@L3
Format settings                          : CABAC / 3 Ref Frames
Format settings, CABAC                   : Yes
Format settings, ReFrames                : 3 frames
Codec ID                                 : avc1
Codec ID/Info                            : Advanced Video Coding
Duration                                 : 1 h 38 min
Bit rate                                 : 670 kb/s
Width                                    : 720 pixels
Height                                   : 480 pixels
Display aspect ratio                     : 3:2
Frame rate mode                          : Variable
Frame rate                               : 24.000 FPS
Minimum frame rate                       : 12.500 FPS
Maximum frame rate                       : 25.000 FPS
Original frame rate                      : 25.000 FPS
Color space                              : YUV
Chroma subsampling                       : 4:2:0
Bit depth                                : 8 bits
Scan type                                : Progressive
Bits/(Pixel*Frame)                       : 0.081
Stream size                              : 455 MiB (83%)
Writing library                          : x264 core 79
Encoding settings                        : cabac=1 / ref=3 / deblock=1:0:0 / analyse=0x3:0x113 / me=hex / subme=7 / psy=1 / psy_rd=1.0:0.0 / mixed_ref=1 / me_range=16 / chroma_me=1 / trellis=1 / 8x8dct=1 / cqm=0 / deadzone=21,11 / chroma_qp_offset=-2 / threads=24 / nr=0 / decimate=1 / mbaff=0 / constrained_intra=0 / bframes=3 / b_pyramid=0 / b_adapt=1 / b_bias=0 / direct=1 / wpredb=32 / wpredp=2 / keyint=250 / keyint_min=25 / scenecut=40 / rc_lookahead=40 / rc=abr / mbtree=1 / bitrate=670 / ratetol=6.0 / qcomp=0.60 / qpmin=10 / qpmax=51 / qpstep=4 / ip_ratio=1.41 / aq=1:1.00
Encoded date                             : UTC 1970-01-01 00:00:00
Tagged date                              : UTC 1970-01-01 00:00:00
Codec configuration box                  : avcC

Pasha__kun
() автор топика
Ответ на: комментарий от anonymous

Видел такие проблемы только на телевизоре, кодек видеокарты всё жрёт нормально.

anonymous
()

Сейчас проверил, mp4 не работают, webm и wmv - работают. Возможно, проблема действительно в файлах

Pasha__kun
() автор топика
Ответ на: комментарий от Mike_RM
[cplayer] Command line options: '-v' '--gpu-context=x11egl' '--gpu-hwdec-interop=vaapi-egl' '--hwdec=vaapi' 'Patlabor 1.mp4'
[cplayer] mpv 0.27.2 (C) 2000-2017 mpv/MPlayer/mplayer2 projects
[cplayer]  built on UNKNOWN
[cplayer] ffmpeg library versions:
[cplayer]    libavutil       56.22.100
[cplayer]    libavcodec      58.35.100
[cplayer]    libavformat     58.20.100
[cplayer]    libswscale      5.3.100
[cplayer]    libavfilter     7.40.101
[cplayer]    libswresample   3.3.100
[cplayer] ffmpeg version: 4.1.3
[cplayer] 
[cplayer] Configuration: /var/tmp/portage/media-video/mpv-0.27.2/work/mpv-0.27.2/waf --prefix=/usr --libdir=/usr/lib64 --confdir=/etc/mpv --docdir=/usr/share/doc/mpv-0.27.2 --htmldir=/usr/share/doc/mpv-0.27.2/html --disable-libmpv-shared --disable-libmpv-static --disable-static-build --disable-optimize --disable-debug-build --enable-html-build --disable-pdf-build --enable-cplugins --disable-zsh-comp --disable-test --disable-android --enable-iconv --disable-libsmbclient --enable-lua --lua=luajit --disable-javascript --enable-libass --enable-libass-osd --enable-zlib --enable-encoding --disable-libbluray --enable-dvdread --enable-dvdnav --enable-cdda --enable-uchardet --disable-rubberband --enable-lcms2 --disable-vapoursynth --disable-vapoursynth-lazy --enable-libarchive --enable-libavdevice --disable-sdl2 --disable-sdl1 --disable-oss-audio --disable-rsound --disable-sndio --enable-pulse --disable-jack --enable-openal --disable-opensles --enable-alsa --disable-coreaudio --disable-cocoa --enable-drm --enable-gbm --disable-wayland --enable-x11 --enable-xv --disable-gl-cocoa --enable-gl-x11 --enable-egl-x11 --enable-egl-drm --disable-gl-wayland --enable-vdpau --enable-vdpau-gl-x11 --enable-vaapi --enable-vaapi-x11 --disable-vaapi-wayland --enable-vaapi-drm --disable-caca --enable-jpeg --disable-rpi --disable-plain-gl --disable-mali-fbdev --enable-vaapi-hwaccel --enable-vdpau-hwaccel --disable-cuda-hwaccel --disable-tv --disable-tv-v4l2 --disable-libv4l2 --disable-audio-input --disable-dvbin --disable-apple-remote --enable-vaapi-glx --enable-vaapi-x-egl --disable-build-date configure
[cplayer] List of enabled features: alsa asm atomics avutil-content-light-level avutil-icc-profile avutil-imgcpy-uc avutil-spherical cdda cplayer cplugins drm dvdnav dvdread dvdread-common egl-drm egl-helpers egl-x11 encoding fchmod gbm gbm.h gl gl-x11 glibc-thread-name glob glob-posix gnuc iconv is_ffmpeg jpeg lcms2 libarchive libass libass-osd libav libavcodec libavdevice libdl libm librt linux-fstatfs lua luajit nanosleep openal posix posix-or-mingw posix-spawn pthreads pulse shm stdatomic termios uchardet vaapi vaapi-drm vaapi-egl vaapi-glx vaapi-hwaccel vaapi-x-egl vaapi-x11 vdpau vdpau-gl-x11 vdpau-hwaccel vt.h x11 xv zlib
[global] config path: '' -> '/home/neko/.config/mpv'
[global] config path: 'encoding-profiles.conf' -/-> '/home/neko/.config/mpv/encoding-profiles.conf'
[global] config path: 'encoding-profiles.conf' -/-> '/home/neko/.mpv/encoding-profiles.conf'
[global] config path: 'encoding-profiles.conf' -> '/etc/mpv/encoding-profiles.conf'
[cplayer] Reading config file /etc/mpv/encoding-profiles.conf
[global] config path: 'mpv.conf' -/-> '/home/neko/.config/mpv/mpv.conf'
[global] config path: 'config' -/-> '/home/neko/.config/mpv/config'
[global] config path: 'mpv.conf' -/-> '/home/neko/.mpv/mpv.conf'
[global] config path: 'config' -/-> '/home/neko/.mpv/config'
[global] config path: 'mpv.conf' -/-> '/etc/mpv/mpv.conf'
[global] config path: 'config' -/-> '/etc/mpv/config'
[cplayer] Setting option 'v' = '' (flags = 8)
[cplayer] Error parsing option gpu-context (option not found)
[cplayer] Setting commandline option --gpu-context=x11egl failed.
[cplayer] 
[cplayer] Exiting... (Fatal error)
Pasha__kun
() автор топика
Ответ на: комментарий от Pasha__kun

Поторопился. Webm и некоторые wmv просто аппаратно не декодируются (видимо как-раз из-за формата). Они открываются нормально. А некоторые wmv, все mp4 и почти все mkv пытаются декодитоваться аппаратно и показывают черный экран.

Pasha__kun
() автор топика
Ответ на: комментарий от Pasha__kun

У меня RX480 и аппаратное декодирование я осилил только через vaapi и egl. EGL специально не доставлял. Вот что из пакетов стоит:

$ apt list --installed | grep egl

WARNING: apt does not have a stable CLI interface. Use with caution in scripts.

libegl-mesa0/disco,now 19.2~git1906190730.5743a3~oibaf~d amd64 [установлен, автоматически]
libegl1-mesa/disco,now 19.2~git1906190730.5743a3~oibaf~d amd64 [установлен, автоматически]
libegl1/disco,now 1.1.1-0ubuntu1 amd64 [установлен, автоматически]
libgegl-0.4-0/disco,now 0.4.14-1 amd64 [установлен, автоматически]
libgegl-common/disco,disco,now 0.4.14-1 all [установлен, автоматически]
libwayland-egl1/disco,now 1.16.0-1ubuntu2 amd64 [установлен, автоматически]
libwayland-egl1/disco,now 1.16.0-1ubuntu2 i386 [установлен, автоматически]

Mike_RM
()
Последнее исправление: Mike_RM (всего исправлений: 1)
Ответ на: комментарий от Mike_RM

У меня libva собрана без egl (по умолчанию), попробую пересобрать.

Pasha__kun
() автор топика

linux-firmware собери и включи в ядре поддержку AMDGPU/ATI RADEON

illialoo99
()

Я видел на ЛОРе, как у кого-то на AMD не ускорялось видео, ему подсказали какую правку внести в конфиги, и всё заработало. А найти не могу

ZenitharChampion ★★★★★
()
Ответ на: комментарий от ZenitharChampion

Нет, там ТС дождался новой версии и его АМД раскрыл потенциал. Предлагаю местному ТСу немного подождать, через пару версий все заработает само «изкаробке».

anonymous
()
Вы не можете добавлять комментарии в эту тему. Тема перемещена в архив.