You are not logged in.

#1 2017-06-10 17:03:59

tomaso
Member
Registered: 2017-06-10
Posts: 5

[SOLVED] Hardware decoding in mpv failing

I'm having problems enabling hardware decoding in mpv. I want to use va-api as the decoder. When trying to play a video I get the following error

mpv: intel_driver.c:112: intel_driver_init: Assertion `VA_CHECK_DRM_AUTH_TYPE(ctx, VA_DRM_AUTH_DRI1) || VA_CHECK_DRM_AUTH_TYPE(ctx, VA_DRM_AUTH_DRI2) || VA_CHECK_DRM_AUTH_TYPE(ctx, VA_DRM_AUTH_CUSTOM)' failed.
Aborted (core dumped)

and

libva info: va_getDriverName() returns -1

Output of vainfo:

libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: User requested driver 'i965'
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: Intel i965 driver for Intel(R) Kabylake - 1.8.2
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
      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
      VAProfileHEVCMain               :    VAEntrypointEncSlice
      VAProfileHEVCMain10             :    VAEntrypointVLD
      VAProfileHEVCMain10             :    VAEntrypointEncSlice
      VAProfileVP9Profile0            :    VAEntrypointVLD
      VAProfileVP9Profile0            :    VAEntrypointEncSlice
      VAProfileVP9Profile2            :    VAEntrypointVLD

I've set the environment variables

LIBVA_DRIVER_NAME=i965
VDPAU_DRIVER=va_gl

My machine is the late 2016 dell xps 13 with i5 kaby lake.

Last edited by tomaso (2017-06-11 09:34:47)

Offline

#2 2017-06-10 17:23:29

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] Hardware decoding in mpv failing

Post your mpv.conf

Offline

#3 2017-06-10 17:29:30

tomaso
Member
Registered: 2017-06-10
Posts: 5

Re: [SOLVED] Hardware decoding in mpv failing

mpv configuration file:

profile=opengl-hq
hwdec=vaapi

I have the same problem also with vlc. So probably not mpv specific.

Offline

#4 2017-06-10 17:41:22

x33a
Forum Fellow
Registered: 2009-08-15
Posts: 4,587

Re: [SOLVED] Hardware decoding in mpv failing

Try getting rid of both the variables.

Offline

#5 2017-06-10 17:52:06

tomaso
Member
Registered: 2017-06-10
Posts: 5

Re: [SOLVED] Hardware decoding in mpv failing

Then I get

[vaapi] libva: va_getDriverName() failed with unknown libva error,driver_name=(null)
VO does not support requested hardware decoder, or loading it failed.

but vainfo still works

libva info: VA-API version 0.40.0
libva info: va_getDriverName() returns 0
libva info: Trying to open /usr/lib/dri/i965_drv_video.so
libva info: Found init function __vaDriverInit_0_40
libva info: va_openDriver() returns 0
vainfo: VA-API version: 0.40 (libva )
vainfo: Driver version: Intel i965 driver for Intel(R) Kabylake - 1.8.2
vainfo: Supported profile and entrypoints
      VAProfileMPEG2Simple            :    VAEntrypointVLD
      VAProfileMPEG2Simple            :    VAEntrypointEncSlice
      VAProfileMPEG2Main              :    VAEntrypointVLD
      VAProfileMPEG2Main              :    VAEntrypointEncSlice

Offline

#6 2017-06-11 09:15:10

tomaso
Member
Registered: 2017-06-10
Posts: 5

Re: [SOLVED] Hardware decoding in mpv failing

Seems to be an issue with wayland, under X everything works fine.

Offline

#7 2017-06-11 09:26:16

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [SOLVED] Hardware decoding in mpv failing

mpv --opengl-backend=wayland

The above should do the trick. You now need to explicitly request the wayland backend, otherwise xwayland will be used and hardware decoding doesn't work with that.

Offline

#8 2017-06-11 09:33:03

tomaso
Member
Registered: 2017-06-10
Posts: 5

Re: [SOLVED] Hardware decoding in mpv failing

Just figured it out as well. Works perfectly now. Thanks!

Offline

#9 2017-06-12 00:25:38

mrlamud
Member
Registered: 2014-09-27
Posts: 104

Re: [SOLVED] Hardware decoding in mpv failing

"hwdec=vaapi-copy"  works for me in Wayland , hardware-decoding is also working.

Offline

#10 2017-06-12 04:13:45

Gusar
Member
Registered: 2009-08-25
Posts: 3,605

Re: [SOLVED] Hardware decoding in mpv failing

mrlamud wrote:

"hwdec=vaapi-copy"  works for me in Wayland

Yeah, but this copies decoded frames back to system memory, only to then send them again to the GPU for display. Unless you have a *very* good reason why you need copy-back, the copying is just needless waste of resources.

Offline

Board footer

Powered by FluxBB