intel / libva

Libva is an implementation for VA-API (Video Acceleration API)
http://intel.github.io/libva/
Other
650 stars 299 forks source link

Corrupted VA-API playback via mpv/vlc with i965 driver on Cherryview (Gen8) #626

Open iegubkin opened 2 years ago

iegubkin commented 2 years ago

Hello, Using a fully updated new Arch install, playback of videos suffer from extensive blockiness/pixelation. This occurs using either mpv or vlc with VA-API hardware acceleration enabled. It affects both h264 and h265 videos. Disabling hardware acceleration eliminates the problem (but makes h265 HD videos not playable because of the weak processor). Perhaps of note, the corrupted playback of hardware accelerated videos does not crash or produce error messages with mpv. The machine in question has a Celeron N3160 (HD Graphics 400). Another Arch user is also reporting the issue and claims accelerated playback had previously worked correctly. Please let me know if I need to provide any other information or should post this report somewhere else.

vainfo

vainfo: VA-API version: 1.15 (libva 2.15.0)
vainfo: Driver version: Intel i965 driver for Intel(R) CherryView - 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
      VAProfileJPEGBaseline           : VAEntrypointEncPicture
      VAProfileVP8Version0_3          : VAEntrypointVLD
      VAProfileVP8Version0_3          : VAEntrypointEncSlice
      VAProfileHEVCMain               :         VAEntrypointVLD

cat /proc/cpuinfo

processor   : 3
vendor_id   : GenuineIntel
cpu family  : 6
model       : 76
model name  : Intel(R) Celeron(R) CPU  N3160  @ 1.60GHz
stepping    : 4
microcode   : 0x411

lsgpu

card0                    Intel Cherryview (Gen8)           drm:/dev/dri/card0
└─renderD128                                               drm:/dev/dri/renderD128

mpv --msg-level=vd=v,vo=v,vo/gpu/vaapi-egl=trace

mpv --msg-level=vd=v,vo=v,vo/gpu/vaapi-egl=trace --hidpi-window-scale=no "video/Big Buck Bunny.mp4" 
 (+) Video --vid=1 (*) (h264 1280x720 24.000fps)
[vo/gpu] Probing for best GPU context.
[vo/gpu/opengl] Initializing GPU context 'wayland'
[vo/gpu/opengl] Initializing GPU context 'x11egl'
[vo/gpu/x11] X11 opening display: :0
[vo/gpu/x11] Display 0 (eDP1): [0, 0, 1920, 1080] @ 60.031418 FPS
[vo/gpu/x11] Current display FPS: 60.031418
[vo/gpu/opengl] EGL_VERSION=1.5
[vo/gpu/opengl] EGL_VENDOR=Mesa Project
[vo/gpu/opengl] EGL_CLIENT_APIS=OpenGL OpenGL_ES 
[vo/gpu/opengl] Trying to create Desktop OpenGL context.
[vo/gpu/opengl] Choosing visual EGL config 0xa, visual ID 0x20
[vo/gpu/opengl] GL_VERSION='4.6 (Core Profile) Mesa 22.1.7'
[vo/gpu/opengl] Detected desktop OpenGL 4.6.
[vo/gpu/opengl] GL_VENDOR='Intel'
[vo/gpu/opengl] GL_RENDERER='Mesa Intel(R) HD Graphics 400 (BSW)'
[vo/gpu/opengl] GL_SHADING_LANGUAGE_VERSION='4.60'
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu] Assuming 60.031418 FPS for display sync.
[vd] Container reported FPS: 24.000000
[vd] Codec list:
[vd]     h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10
[vd]     h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper
[vd]     h264_qsv (h264) - H264 video (Intel Quick Sync Video acceleration)
[vd]     h264_cuvid (h264) - Nvidia CUVID H264 decoder
[vd] Opening decoder h264
[vd] Looking at hwdec h264-nvdec...
[vo/gpu] Loading hwdec driver 'vaapi-egl'
[vo/gpu/vaapi-egl] using VAAPI EGL interop
[vo/gpu/vaapi-egl] Trying to open a x11 VA display...
[vo/gpu/vaapi-egl/vaapi] libva: VA-API version 1.15.0
[vo/gpu/vaapi-egl/vaapi] libva: Trying to open /usr/lib/dri/iHD_drv_video.so
[vo/gpu/vaapi-egl/vaapi] libva: va_openDriver() returns -1
[vo/gpu/vaapi-egl/vaapi] libva: Trying to open /usr/lib/dri/i965_drv_video.so
[vo/gpu/vaapi-egl/vaapi] libva: Found init function __vaDriverInit_1_13
[vo/gpu/vaapi-egl/vaapi] libva: va_openDriver() returns 0
[vo/gpu/vaapi-egl/vaapi] Initialized VAAPI: version 1.15
[vo/gpu/vaapi-egl] Going to probe surface formats (may log bogus errors)...
[vo/gpu/vaapi-egl/vaapi] libva: vaExportSurfaceHandle: fourcc 48323234 is not supported for export as separate planes.
[vo/gpu/vaapi-egl] vaExportSurfaceHandle() failed (invalid VASurfaceID)
[vo/gpu/vaapi-egl/vaapi] libva: vaExportSurfaceHandle: fourcc 50313134 is not supported for export as separate planes.
[vo/gpu/vaapi-egl] vaExportSurfaceHandle() failed (invalid VASurfaceID)
[vo/gpu/vaapi-egl/vaapi] libva: vaExportSurfaceHandle: fourcc 48323234 is not supported for export as separate planes.
[vo/gpu/vaapi-egl] vaExportSurfaceHandle() failed (invalid VASurfaceID)
[vo/gpu/vaapi-egl/vaapi] libva: vaExportSurfaceHandle: fourcc 56323234 is not supported for export as separate planes.
[vo/gpu/vaapi-egl] vaExportSurfaceHandle() failed (invalid VASurfaceID)
[vo/gpu/vaapi-egl/vaapi] libva: vaExportSurfaceHandle: fourcc 50343434 is not supported for export as separate planes.
[vo/gpu/vaapi-egl] vaExportSurfaceHandle() failed (invalid VASurfaceID)
[vo/gpu/vaapi-egl/vaapi] libva: vaExportSurfaceHandle: fourcc 48323234 is not supported for export as separate planes.
[vo/gpu/vaapi-egl] vaExportSurfaceHandle() failed (invalid VASurfaceID)
[vo/gpu/vaapi-egl] Supported formats:
[vo/gpu/vaapi-egl]  nv12
[vo/gpu/vaapi-egl]  yuv420p
[vo/gpu/vaapi-egl]  rgba
[vo/gpu/vaapi-egl]  rgb0
[vo/gpu/vaapi-egl]  bgra
[vo/gpu/vaapi-egl]  bgr0
[vo/gpu/vaapi-egl]  gray
[vo/gpu/vaapi-egl] Done probing surface formats.
[vo/gpu] Loading hwdec driver 'cuda-nvdec'
Cannot load libcuda.so.1
[vo/gpu/cuda-nvdec] Failed to load CUDA symbols
[vo/gpu] Loading failed.
[vo/gpu] Loading hwdec driver 'drmprime-drm'
[vo/gpu/drmprime-drm] Failed to retrieve DRM fd from native display.
[vo/gpu] Loading failed.
[vd] Could not create device.
[vd] Looking at hwdec h264-vaapi...
[vd] Trying hardware decoding via h264-vaapi.
[vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10)
[vd] Pixel formats supported by decoder: vdpau cuda vaapi yuv420p
[vd] Codec profile: Main (0x4d)
[vd] Requesting pixfmt 'vaapi' from decoder.
Using hardware decoding (vaapi).
[vd] Decoder format: 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/auto CL=mpeg2/4/h264
VO: [gpu] 1280x720 vaapi[nv12]
[vo/gpu] reconfig to 1280x720 vaapi[nv12] bt.709/bt.709/bt.1886/limited/display SP=1.000000 CL=mpeg2/4/h264
[vo/gpu/x11] not waiting for MapNotify
[vo/gpu] Resize: 1280x720
[vo/gpu] Window size: 1280x720 (Borders: l=0 t=0 r=0 b=0)
[vo/gpu] Video source: 1280x720 (1:1)
[vo/gpu] Video display: (0, 0) 1280x720 -> (0, 0) 1280x720
[vo/gpu] Video scale: 1.000000/1.000000
[vo/gpu] OSD borders: l=0 t=0 r=0 b=0
[vo/gpu] Video borders: l=0 t=0 r=0 b=0
[vo/gpu] Reported display depth: 8
[vo/gpu] Testing FBO format rgba16f
[vo/gpu] Using FBO format rgba16f.
[vo/gpu] No advanced processing required. Enabling dumb mode.
[vo/gpu/x11] Disabling screensaver.
V: 00:00:04 / 00:09:56 (1%)

Exiting... (Quit)
[vo/gpu/x11] Enabling screensaver.

ffmpeg

ffmpeg version n5.1.1 Copyright (c) 2000-2022 the FFmpeg developers
  built with gcc 12.2.0 (GCC)
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      57. 28.100 / 57. 28.100
  libavcodec     59. 37.100 / 59. 37.100
  libavformat    59. 27.100 / 59. 27.100
  libavdevice    59.  7.100 / 59.  7.100
  libavfilter     8. 44.100 /  8. 44.100
  libswscale      6.  7.100 /  6.  7.100
  libswresample   4.  7.100 /  4.  7.100
  libpostproc    56.  6.100 / 56.  6.100

mpv

mpv 0.34.1-dirty Copyright © 2000-2021 mpv/MPlayer/mplayer2 projects
 built on UNKNOWN
FFmpeg library versions:
   libavutil       57.17.100 (runtime 57.28.100)
   libavcodec      59.18.100 (runtime 59.37.100)
   libavformat     59.16.100 (runtime 59.27.100)
   libswscale      6.4.100 (runtime 6.7.100)
   libavfilter     8.24.100 (runtime 8.44.100)
   libswresample   4.3.100 (runtime 4.7.100)
FFmpeg version: n5.1.1
iegubkin commented 2 years ago

Apparently related to: upgrade from 5.18 to 5.19 kernel breaks interlaced video playback #551

Pending patch: drm/i915: Set correct domains values at _i915_vma_move_to_active

See: FS#75641 - [linux] Video decode artifacts on Intel Atom (Cherry Trail) platform

evelikov commented 2 years ago

This tracker is for the API frontend library, not driver specific issues.

So this is better suited at https://github.com/intel/intel-vaapi-driver or the respective kernel tracker - as you rightfully linked.

mirh commented 8 months ago

This was eventually fixed that week, isn't it?