[SOLVED] VLC 3.0.3 Can't play video using VAAPI (VA-API) on Intel UHD Graphics 630

Report Bugs, Issues and non- package Requests
Post Reply
Message
Author
igo
Posts: 13
Joined: Mon Dec 31, 2018 7:17 pm

[SOLVED] VLC 3.0.3 Can't play video using VAAPI (VA-API) on Intel UHD Graphics 630

#1 Post by igo »

VLC can't use VAAPI for GPU accelerated. In the same hardware Manjaro use about 2% of CPU (10% of one core) to play a 4K UHD video, but, MX Linux 18 use 10% of CPU (100% of one core).

The problem can be related with messages:
  • vaapi_drm generic error: vaInitialize: unknown libva error;
    main generic debug: no hw decoder modules matched; and
    glconv_vaapi_x11 gl error: vaInitialize: unknown libva error.
The command "vainfo" show "VA-API version 1.3.0", but VLC debug show "VA-API version 0.39.4".

More informations of messages and hardware bellow.

Code: Select all

$ uname -a
Linux mx 4.19.0-1-amd64 #1 SMP Debian 4.19.5-2~mx17+1 (2018-12-12) x86_64 GNU/Linux

Code: Select all

$ vlc -vvvv video.mkv
...
[00007f08e0001060] main vout display debug: VoutDisplayEvent 'resize' 3840x1608
[00007f08e0001ce0] main gl debug: looking for opengl module matching "any": 3 candidates

[00007f08e0001ce0] egl_x11 gl debug: EGL version 1.4 (DRI2) by Mesa Project
[00007f08e0001ce0] egl_x11 gl debug:  extensions: EGL_ANDROID_blob_cache EGL_ANDROID_native_fence_sync EGL_CHROMIUM_sync_control EGL_EXT_create_context_robustness EGL_EXT_image_dma_buf_import EGL_EXT_image_dma_buf_import_modifiers EGL_IMG_context_priority EGL_KHR_config_attribs EGL_KHR_create_context EGL_KHR_create_context_no_error EGL_KHR_fence_sync EGL_KHR_get_all_proc_addresses EGL_KHR_gl_colorspace EGL_KHR_gl_renderbuffer_image EGL_KHR_gl_texture_2D_image EGL_KHR_gl_texture_3D_image EGL_KHR_gl_texture_cubemap_image EGL_KHR_image EGL_KHR_image_base EGL_KHR_image_pixmap EGL_KHR_no_config_context EGL_KHR_reusable_sync EGL_KHR_surfaceless_context EGL_EXT_pixel_format_float EGL_KHR_wait_sync EGL_MESA_configless_context EGL_MESA_drm_image EGL_MESA_image_dma_buf_export EGL_NOK_swap_region EGL_NOK_texture_from_pixmap EGL_NV_post_sub_buffer EGL_WL_bind_wayland_display 
[00007f08e0001ce0] main gl debug: using opengl module "egl_x11"
[00007f08ec334b00] main window debug: resized to 3840x1608
[00007f08e0001060] main vout display debug: VoutDisplayEvent 'resize' 3840x1608
[000055ea5733fd80] qt interface debug: Logical video size: 2561x1072

[00007f08e05e54e0] main generic debug: looking for glconv module matching "any": 4 candidates
[00007f08ec334b00] main window debug: resized to 3840x1608
[00007f08e0001060] main vout display debug: VoutDisplayEvent 'resize' 3840x1608
[00007f08ec334b00] main window debug: resized to 3840x1608
[00007f08e0001060] main vout display debug: VoutDisplayEvent 'resize' 3840x1608

libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1
[00007f08e0001ce0] glconv_vaapi_x11 gl error: vaInitialize: unknown libva error

libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1
[00007f08e0001ce0] glconv_vaapi_drm gl error: vaInitialize: unknown libva error

libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1
[00007f08e0001ce0] glconv_vaapi_drm gl error: vaInitialize: unknown libva error

[00007f08e05e54e0] main generic debug: no glconv modules matched
[00007f08e0001ce0] gl gl warning: VLC needs to be built with support for libplacebo in order to display wide gamut or HDR signals correctly.

[00007f08e0001ce0] gl gl debug: 
=== Fragment shader for fourcc: P010, colorspace: 3 ===
#version 120
uniform sampler2D Texture0;
varying vec2 TexCoord0;
uniform sampler2D Texture1;
varying vec2 TexCoord1;
uniform vec4 Coefficients[4];
uniform vec4 FillColor;
void main(void) {
 float val;vec4 colors;
 colors = texture2D(Texture0, TexCoord0);
 val = colors.r;
 vec4 color0 = vec4(val, val, val, 1);
 colors = texture2D(Texture1, TexCoord1);
 val = colors.r;
 vec4 color1 = vec4(val, val, val, 1);
 val = colors.g;
 vec4 color2 = vec4(val, val, val, 1);
 vec4 result = (color0 * Coefficients[0]) + Coefficients[3];
 result = (color1 * Coefficients[1]) + result;
 result = (color2 * Coefficients[2]) + result;
 gl_FragColor = result * FillColor;
}
...

Code: Select all

$ vainfo 
libva info: VA-API version 1.3.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_3
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.3 (libva 2.3.0)
vainfo: Driver version: Intel i965 driver for Intel(R) Coffee Lake - 2.2.0
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :	VAEntrypointVLD
      VAProfileMPEG2Simple            :	VAEntrypointEncSlice
      VAProfileMPEG2Main              :	VAEntrypointVLD
      VAProfileMPEG2Main              :	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSlice
      VAProfileH264ConstrainedBaseline:	VAEntrypointEncSliceLP
      VAProfileH264Main               :	VAEntrypointVLD
      VAProfileH264Main               :	VAEntrypointEncSlice
      VAProfileH264Main               :	VAEntrypointEncSliceLP
      VAProfileH264High               :	VAEntrypointVLD
      VAProfileH264High               :	VAEntrypointEncSlice
      VAProfileH264High               :	VAEntrypointEncSliceLP
      VAProfileH264MultiviewHigh      :	VAEntrypointVLD
      VAProfileH264StereoHigh         :	VAEntrypointVLD
      VAProfileVC1Simple              :	VAEntrypointVLD
      VAProfileVC1Main                :	VAEntrypointVLD
      VAProfileVC1Advanced            :	VAEntrypointVLD
      VAProfileNone                   :	VAEntrypointVideoProc
      VAProfileJPEGBaseline           :	VAEntrypointVLD
      VAProfileJPEGBaseline           :	VAEntrypointEncPicture
      VAProfileVP8Version0_3          :	VAEntrypointVLD
      VAProfileHEVCMain               :	VAEntrypointVLD
      VAProfileHEVCMain10             :	VAEntrypointVLD
      VAProfileVP9Profile0            :	VAEntrypointVLD
      VAProfileVP9Profile2            :	VAEntrypointVLD

Code: Select all

$ hwinfo --gfx
23: PCI 02.0: 0300 VGA compatible controller (VGA)              
  [Created at pci.378]
  Unique ID: _Znp.5L+R308A3P8
  SysFS ID: /devices/pci0000:00/0000:00:02.0
  SysFS BusID: 0000:00:02.0
  Hardware Class: graphics card
  Device Name: "Onboard - Video"
  Model: "Intel VGA compatible controller"
  Vendor: pci 0x8086 "Intel Corporation"
  Device: pci 0x3e9b 
  SubVendor: pci 0x1028 "Dell"
  SubDevice: pci 0x086f 
  Driver: "i915"
  Driver Modules: "i915"
  Memory Range: 0xa2000000-0xa2ffffff (rw,non-prefetchable)
  Memory Range: 0x80000000-0x8fffffff (ro,non-prefetchable)
  I/O Ports: 0x4000-0x403f (rw)
  Memory Range: 0x000c0000-0x000dffff (rw,non-prefetchable,disabled)
  IRQ: 125 (212475 events)
  Module Alias: "pci:v00008086d00003E9Bsv00001028sd0000086Fbc03sc00i00"
  Driver Info #0:
    Driver Status: i915 is active
    Driver Activation Cmd: "modprobe i915"
  Config Status: cfg=new, avail=yes, need=no, active=unknown

Primary display adapter: #23

Code: Select all

$ lsmod |grep i915
i915                 1732608  3
i2c_algo_bit           16384  1 i915
drm_kms_helper        204800  1 i915
drm                   487424  4 drm_kms_helper,i915
video                  45056  3 dell_wmi,dell_laptop,i915

Code: Select all

$ glxinfo | grep version
server glx version string: 1.4
client glx version string: 1.4
GLX version: 1.4
    Max core profile version: 4.5
    Max compat profile version: 3.0
    Max GLES1 profile version: 1.1
    Max GLES[23] profile version: 3.2
OpenGL core profile version string: 4.5 (Core Profile) Mesa 18.2.6
OpenGL core profile shading language version string: 4.50
OpenGL version string: 3.0 Mesa 18.2.6
OpenGL shading language version string: 1.30
OpenGL ES profile version string: OpenGL ES 3.2 Mesa 18.2.6
OpenGL ES profile shading language version string: OpenGL ES GLSL ES 3.20

Code: Select all

$ glxinfo | grep render
direct rendering: Yes
    GLX_MESA_multithread_makecurrent, GLX_MESA_query_renderer, 
    GLX_MESA_query_renderer, GLX_MESA_swap_control, GLX_OML_swap_method, 
Extended renderer info (GLX_MESA_query_renderer):
OpenGL renderer string: Mesa DRI Intel(R) UHD Graphics 630 (Coffeelake 3x8 GT2) 
    GL_ARB_conditional_render_inverted, GL_ARB_conservative_depth, 
    GL_NV_conditional_render, GL_NV_depth_clamp, GL_NV_packed_depth_stencil, 
    GL_ARB_compute_shader, GL_ARB_conditional_render_inverted, 
    GL_MESA_window_pos, GL_NV_blend_square, GL_NV_conditional_render, 
    GL_OES_element_index_uint, GL_OES_fbo_render_mipmap, 
Last edited by igo on Mon Jan 14, 2019 10:08 pm, edited 1 time in total.

User avatar
Stevo
Developer
Posts: 12774
Joined: Fri Dec 15, 2006 8:07 pm

Re: VLC 3.0.3 Can't play video using VAAPI (VA-API) on Intel UHD Graphics 630

#2 Post by Stevo »

Try upgrading to VLC 3.0.5 in the test repo--that one's built against the MX libva-dev instead of the older one in Stretch, which doesn't have any support for the UHD 630 (Coffee Lake).
However, the one video player I can get to work reliably with va-api on my UHD-630 is QMPlay2, though I also think I had mpv working at one time. It should work with the qmplay2 in main if you go into the Playback Settings and put the FFmpeg-vaapi decoder at the top of the list in the lower right. The qmplay2 in testing offers more codec support, such as AV1 (no va-api with that codec, though).

User avatar
Stevo
Developer
Posts: 12774
Joined: Fri Dec 15, 2006 8:07 pm

Re: VLC 3.0.3 Can't play video using VAAPI (VA-API) on Intel UHD Graphics 630

#3 Post by Stevo »

VLC 3.0.5 does say it's working, but it still uses much more CPU than QMPlay2--both with video sharpening enabled. Let's see about turning off the sharpening.

Code: Select all

vlc Elysium_trailer_1-4K-HDTN\(4ksamples.com\).mp4 
VLC media player 3.0.5 Vetinari (revision 3.0.5-1-0-g653c0c1ca8)
[000055e77bfe11a0] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
Could not resolve property : linearGradient4837
Could not resolve property : linearGradient4837
Could not resolve property : linearGradient4837
libva info: VA-API version 1.3.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_3
libva info: va_openDriver() returns 0
[00007fc748d64500] avcodec decoder: Using Intel i965 driver for Intel(R) Coffee Lake - 2.2.0 for hardware decoding
Yes, turning off VLC's sharpening drastically reduces CPU use to that of QMPlay2-just a few %. Apparently, QMPlay2 can do it without increasing CPU use...This is with VLC's hardware decoding set to Automatic.

igo
Posts: 13
Joined: Mon Dec 31, 2018 7:17 pm

Re: VLC 3.0.3 Can't play video using VAAPI (VA-API) on Intel UHD Graphics 630

#4 Post by igo »

Thanks Stevo.

VLC 3.0.5 from test repo solved the problem. The MX Package Installer make it easy. Now, the usage for one core is 10% instead 100%.
QMPlay2 and SMPlayer use 100% of one core, I install "libvdpau-va-gl1" needed, configure for use FFMPEG VA-API Decoder, upgradeFFMPEG from Test Repo, but not solved for this players. This players prefers VDPAU, even if I select the FFMPEG VA-API Decoder. QMPlay2 don't have verbose/debug mode?

Code: Select all

...
libva info: VA-API version 1.3.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_1_3
libva info: va_openDriver() returns 0
Opening video filter: [ass auto=1]
[vo] query(Planar YV12) -> 3
Couldn't open video filter 'ass'.
ASS: cannot add video filter
...
VO: [vdpau] 3840x1608 => 3840x1608 Planar YV12 
VO: Description: VDPAU with X11
VO: Author: Rajib Mahapatra <rmahapatra@nvidia.com> and others
[vdpau] Updating CSC matrix for BT.601
....

User avatar
Stevo
Developer
Posts: 12774
Joined: Fri Dec 15, 2006 8:07 pm

Re: VLC 3.0.3 Can't play video using VAAPI (VA-API) on Intel UHD Graphics 630

#5 Post by Stevo »

Apparently QMPlay2 only displays errors if something goes wrong, like if it's was compiled against the Stretch libva-dev and ffmpeg, then we try to use va-api in MX (which I have mistakingly done all too often, that's why it's a mx17+2 version).
Hardware acceleration important information:

VDPAU uses only its own video output, so OpenGL features and CPU filters won't work.
CUVID, DXVA2 and VA-API uses OpenGL2 video output, so OpenGL features are available, but CPU filters won't work.
DXVA2 requires "WGL_NV_DX_interop" extension and currently it doesn't support hue, saturation adjustment and video deinterlacing.
VDPAU, VA-API and CUVID has its own deinterlacing filters. Their settings are available in "Settings->Video filters".
CUVID requires FFmpeg 3.1 or higher for H264 and HEVC support (requirement during compilation)!
H.264 lossless movies (CRF 0 or QP 0) might not be properly decoded via VDPAU and VA-API.
VideoToolBox doesn't support OpenGL high quality video scaling yet.
VideoToolBox doesn't support deinterlacing.
This is my QMPlay2 "playback settings" tht has va-api working:

Image

In video filters, I too have vdapu and va-api listed in that order in the bottom right-hand corner for video acceleration.

SMPlayer can only get va-api using mpv as the backend, so I think you'll need to get mpv from our test repo, too, and get va-api working with that alone first before setting SMPlayer to use it with va-api.

igo
Posts: 13
Joined: Mon Dec 31, 2018 7:17 pm

Re: VLC 3.0.3 Can't play video using VAAPI (VA-API) on Intel UHD Graphics 630

#6 Post by igo »

In my Linux MX 18, SMPlayer and QMPlay2 did not work with hardware decoding via VAAPI. The fix in the Test repository for VLC should be similar to that needed to fix SMPlayer and QMPlay2.

I installed several libraries, but it did not solve:

Code: Select all

apt install libav-tools libavcodec-dev libavutil-dev libswresample-dev libavcodec-dev libavutil-dev libswresample-dev libavcodec-extra libavcodec-extra57 libavcodec-extra libavcodec-extra57 libavfilter-dev libavformat-dev libavresample-dev libpostproc-dev libswscale-dev libavfilter-dev libavformat-dev libavresample-dev libpostproc-dev libswscale-dev libavfilter-extra libaec0 libavfilter-extra6 libhdf5-100 liblept5 libnetcdf11 libsz2 libtesseract-data libtesseract3  libaec0 libavfilter-extra libavfilter-extra6 libhdf5-100 liblept5 libnetcdf11 libsz2 libaec0 libavfilter-extra libavfilter-extra6 libhdf5-100 liblept5 libnetcdf11 libsz2 libtesseract-data libtesseract3 libva-egl1 libva-glx1 libva-glx2 libvdpau-va-gl1 mesa-vdpau-drivers

Below is an excerpt from the SMPlayer log that is probably related to the problem.
>> SMPlayer Log in MX Linux

Code: Select all

...
[vd] Opening video decoder hevc
[vd] Probing 'vaapi'...
[vo/opengl] Loading hwdec driver 'vaapi-egl'
[vo/opengl/vaapi-egl] Trying to open a x11 VA display...
libva info: VA-API version 0.39.4
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so has no function __vaDriverInit_0_32
libva info: va_openDriver() returns -1
[vo/opengl] Loading failed.
[vd] VO does not support requested hardware decoder, or loading it failed.
[vd] Using software decoding.
...
>> SMPLayer Log in Manjaro

Code: Select all

...
[vo/gpu] Loading hwdec driver 'vaapi-egl'
[vo/gpu/vaapi-egl] Trying to open a x11 VA display...
[vo/gpu/vaapi-egl/vaapi] Initialized VAAPI: version 1.3
[vo/gpu/vaapi-egl] using VAAPI EGL interop
[vo/gpu/vaapi-egl/vaapi] libva: vaExportSurfaceHandle: fourcc 48323234 is not supported for export as separate planes.
[vo/gpu/vaapi-egl] vaAcquireSurfaceHandle() failed (invalid VASurfaceID)
[vo/gpu/vaapi-egl] Supported formats:
[vo/gpu/vaapi-egl] yuv420p
[vo/gpu/vaapi-egl] yuv420p
[vo/gpu/vaapi-egl] nv12
[vo/gpu/vaapi-egl] rgb0
[vo/gpu/vaapi-egl] bgr0
[vo/gpu/vaapi-egl] p010
[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 'vdpau-glx'
[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] Trying hardware decoding via hevc-vaapi.
[vd] Selected codec: hevc (HEVC (High Efficiency Video Coding))
[vf] User filter list:
[vf] (empty)
[ad] Codec list:
[ad] ac3 - ATSC A/52A (AC-3)
[ad] ac3_fixed (ac3) - ATSC A/52A (AC-3)
[ad] Opening decoder ac3
[ad] Requesting 1 threads for decoding.
[ad] Selected codec: ac3 (ATSC A/52A (AC-3))
[af] User filter list:
[af] (empty)
Starting playback...
[mkv] queuing seek to 597.000000
hr-seek, skipping to 597.000000
[mkv] execute seek (to 597.000000 flags 32)
[mkv] seek done
[af] [in] 48000Hz 5.1(side) 6ch floatp
[af] [userspeed] 48000Hz 5.1(side) 6ch floatp
[af] [userspeed] (disabled)
[af] [convert] 48000Hz 5.1(side) 6ch floatp
[vd] Pixel formats supported by decoder: vaapi_vld cuda yuv420p10le
[vd] Codec profile: Main 10 (0x2)
[vd] Requesting pixfmt 'vaapi_vld' from decoder.
[vd] Using hardware decoding (vaapi).
[vd] Decoder format: 3840x1608 vaapi[p010] bt.2020-ncl/bt.2020/pq/limited/auto SP=10.000000 CL=unknown (auto 0.000000/0.000000/0.000000)
...

User avatar
Stevo
Developer
Posts: 12774
Joined: Fri Dec 15, 2006 8:07 pm

Re: VLC 3.0.3 Can't play video using VAAPI (VA-API) on Intel UHD Graphics 630

#7 Post by Stevo »

Yeah, I'm going to have to look into this some more. I don't think you need any vdpau packages for Intel hardware, though!

Post Reply

Return to “Bugs and Non-Package Requests Forum”