mpv doesn't automatically use hw acceleration

Created on 16 Oct 2017  路  4Comments  路  Source: mpv-player/mpv

Hey.

I've got a new notebook and on the old one (which used to have some Intel HD Graphics as well, just a much older chipset), mpv automatically used hw acceleration .

It doesn't one the new one, though it seems to be available and working:

$ vainfo 
libva info: VA-API version 0.40.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_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.3
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
# grep -i "dri2\|vdpau" /var/log/Xorg.0.log
[    30.068] (II) glamor: EGL version 1.4 (DRI2):
[    30.238] (II) modeset(0): [DRI2] Setup complete
[    30.238] (II) modeset(0): [DRI2]   DRI driver: i965
[    30.238] (II) modeset(0): [DRI2]   VDPAU driver: i965
[    30.245] (II) GLX: Initialized DRI2 GL provider for screen 0

If I manually tell it to use vaapi it seems to work, with the mpv process using much less CPU power.

$ mpv foo.mp4 
Playing: foo.mp4
 (+) Video --vid=1 (*) (h264 720x304 23.976fps)
 (+) Audio --aid=1 --alang=und (*) (aac 2ch 44100Hz)
AO: [pulse] 44100Hz stereo 2ch float
VO: [opengl] 720x304 => 724x304 yuv420p
AV: 00:00:01 / 02:15:46 (0%) A-V:  0.000


Exiting... (Quit)

calestyo@heisenberg:~$ mpv --hwdec=vaapi foo.mp4
Playing: foo.mp4
 (+) Video --vid=1 (*) (h264 720x304 23.976fps)
 (+) Audio --aid=1 --alang=und (*) (aac 2ch 44100Hz)
AO: [pulse] 44100Hz stereo 2ch float
Using hardware decoding (vaapi).
VO: [opengl] 720x304 => 724x304 vaapi[nv12]
AV: 00:00:04 / 02:15:46 (0%) A-V:  0.000


Exiting... (Quit)

Any ideas?
Thanks,
Chris.

question

Most helpful comment

Everything is buggy. The question is whether it's sufficiently not buggy. Since hwdec pulls in even more potentially fragile code than swdec, there's of course the chance that more bugs get triggered than with swdec. This and the fact that swdec issues are easier to reproduce is why we prefer swdec.

Why are you not banned from this issue tracker anyway, and does anyone know how to do it?

All 4 comments

Intended behaviour. You likely had hwdec=auto set on your old notebook, or used a really old version.

hwdec is buggy and can reduce quality. Often times, it doesn't even save power. Unless you absolutely need it for performance reasons, it shouldn't be used. The manual states this too.

hwdec is not buggy, but occasionally can cause problems. Usually the CPU is powerful enough to decode it, so it's disabled by default. You can change the default by editing the config file.

hwdec is not buggy

mpv's interfacing with the different hwdecs probably isn't, but the implementations of those decoders on the vendor side of things can be from what I've gathered, e.g. people having problems with HEVC and Cuda. Did not mean to offend.

Everything is buggy. The question is whether it's sufficiently not buggy. Since hwdec pulls in even more potentially fragile code than swdec, there's of course the chance that more bugs get triggered than with swdec. This and the fact that swdec issues are easier to reproduce is why we prefer swdec.

Why are you not banned from this issue tracker anyway, and does anyone know how to do it?

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xanadupark picture xanadupark  路  3Comments

beew picture beew  路  3Comments

laichiaheng picture laichiaheng  路  3Comments

lightonflux picture lightonflux  路  4Comments

Edenharder picture Edenharder  路  4Comments