Skip to content

Add intel-vaapi-driver 2.3.0.pre1 and update NASM, Yasm, FFmpeg, xine-lib, and VLC #970

Merged
merged 22 commits into from
Dec 7, 2018

Conversation

pmenzel
Copy link
Collaborator

@pmenzel pmenzel commented Dec 5, 2018

This driver is needed to get the Chromium browser working with VA-API.

This patch contains all the changes necessary to use VA-API along with
vaapi-driver to run all media use cases supported with hardware acceleration.

libva needs to be updated too.

Install with the commands below.

$ sudo bee update libva libva-utils yasm nasm ffmpeg xine-lib
$ sudo bee install intel-vaapi-driver

The project moved to GitHub, and releases are only published there.
Update the source URL accordingly.

The change-log is available [online][1].

[1]: https://github.com/intel/libva/blob/master/NEWS
@pmenzel
Copy link
Collaborator Author

pmenzel commented Dec 5, 2018

The packages below need to be rebuilt.

$ sousage.pl libva.so.1

# '/usr/lib/libva.so.1' dependencies:
# ---------------------------------------------------------------------------------------------
  /usr/bin/avcenc                                      libva-utils-1.8.2-0.x86_64
  /usr/bin/h264encode                                  libva-utils-1.8.2-0.x86_64
  /usr/bin/jpegenc                                     libva-utils-1.8.2-0.x86_64
  /usr/bin/loadjpeg                                    libva-utils-1.8.2-0.x86_64
  /usr/bin/mpeg2vaenc                                  libva-utils-1.8.2-0.x86_64
  /usr/bin/mpeg2vldemo                                 libva-utils-1.8.2-0.x86_64
  /usr/bin/putsurface                                  libva-utils-1.8.2-0.x86_64
  /usr/bin/putsurface_wayland                          libva-utils-1.8.2-0.x86_64
  /usr/bin/vainfo                                      libva-utils-1.8.2-0.x86_64
  /usr/lib/libavcodec.so.57                            ffmpeg-3.3.4-0.x86_64
  /usr/lib/libavcodec.so.57.89.100                     ffmpeg-3.3.4-0.x86_64
  /usr/lib/libavfilter.so.6                            ffmpeg-3.3.4-0.x86_64
  /usr/lib/libavfilter.so.6.82.100                     ffmpeg-3.3.4-0.x86_64
  /usr/lib/libavutil.so.55                             ffmpeg-3.3.4-0.x86_64
  /usr/lib/libavutil.so.55.58.100                      ffmpeg-3.3.4-0.x86_64
  /usr/lib/libva-drm.so.1                              libva-1.8.2-0.x86_64
  /usr/lib/libva-drm.so.1.4000.0                       libva-1.8.2-0.x86_64
  /usr/lib/libva-egl.so.1.4000.0                       libva-1.8.2-0.x86_64
  /usr/lib/libva-glx.so.1                              libva-1.8.2-0.x86_64
  /usr/lib/libva-glx.so.1.4000.0                       libva-1.8.2-0.x86_64
  /usr/lib/libva-tpi.so.1.4000.0                       libva-1.8.2-0.x86_64
  /usr/lib/libva-wayland.so.1                          libva-1.8.2-0.x86_64
  /usr/lib/libva-wayland.so.1.4000.0                   libva-1.8.2-0.x86_64
  /usr/lib/libva-x11.so.1                              libva-1.8.2-0.x86_64
  /usr/lib/libva-x11.so.1.4000.0                       libva-1.8.2-0.x86_64
  /usr/lib/xine/plugins/2.5/xineplug_vo_out_vaapi.so   xine-lib-1.2.6-1.x86_64

[Description][0]:

> VA-API (Video Acceleration API) user mode driver for Intel GEN
> Graphics family
>
> VA-API is an open-source library and API specification, which provides
> access to graphics hardware acceleration capabilities for video
> processing. It consists of a main library and driver-specific
> acceleration backends for each supported hardware vendor.
>
> The current video driver backend provides a bridge to the GEN GPUs
> through the packaging of buffers and commands to be sent to the i915
> driver for exercising both hardware and shader functionality for video
> decode, encode, and processing.

[1]: https://github.com/intel/intel-vaapi-driver
@thomas
Copy link
Collaborator

thomas commented Dec 6, 2018

I guess it will install a libva.so.2. And to save the hassle of removing/updating the other ffmpeg deps down the road, I'll opt for a compat package. As for avidemux, and incase no compat package is made available (see pkg, the reason for the last update of libva) a working binary could be simply achieved by placing the lib in the package.

The release is from August 2014, and the [change-log][1] is below.

> Changes from 1.2.0 to 1.3.0:
>
> *   Add AMD TBM instructions.
> *   Add HSW TSX instructions.
> *   Fix “pmulhrw”, “vphaddudq”, and “vpbroadcastq” instructions.
> *   Add Intel SHA, ADX, RDSEED, and SMAP instructions.
> *   Use a larger hash table size in NASM macro handling.
> *   Add support for x32 ABI (called “elfx32”).
> *   Add support for “function” decorator in win32/win64 object files.
> *   In Mach-O, only warn on repeated flags if the new flags are
>     different.

FFmpeg failed to build with NASM, I wanted to try Yasm, but in the end
it worked fine with a newer NASM. Add the update anyway. But NASM seems
to be under more active development.

[1]: https://yasm.tortall.net/releases/Release1.3.0.html
Rebuild against libav 2.0.3.
Released on November 7th, 2018.

The change-log is available [online][1].

This update fixes build errors like below in FFmpeg 3.4.5.

    libavfilter/x86/avf_showcqt.asm:183: error: invalid combination of opcode and operands
    libavfilter/x86/avf_showcqt.asm:183: error: invalid combination of opcode and operands
    CC      libavformat/adp.o
    CC      libavformat/ads.o
    CC      libavformat/adtsenc.o
    CC      libavformat/adxdec.o
    libavfilter/x86/avf_showcqt.asm:187: error: invalid combination of opcode and operands
    libavfilter/x86/avf_showcqt.asm:187: error: invalid combination of opcode and operands

[1]: https://www.nasm.us/pub/nasm/releasebuilds/2.14/doc/nasmdoc.txt
@pmenzel
Copy link
Collaborator Author

pmenzel commented Dec 6, 2018

I updated NASM and rebuilt xine-lib and FFmpeg (only updating the patch levels, so they should be compatible). Could you test avidemux please?

@pmenzel pmenzel changed the title Add intel-vaapi-driver 2.3.0.pre1 Add intel-vaapi-driver 2.3.0.pre1 and update NASM, Yasm, FFmpeg and xine-lib Dec 6, 2018
@pmenzel
Copy link
Collaborator Author

pmenzel commented Dec 6, 2018

Ignore my request, avidemux needs libva directly, and not indirectly over FFmpeg. My bad.

avidemux3_qt5: error while loading shared libraries: libva.so.1: cannot open shared object file: No such file or directory

I’d like to avoid a compatibility package, and maybe avidemux can be rebuild too?

@thomas
Copy link
Collaborator

thomas commented Dec 6, 2018

Avidemux seems to build/work with with libva-2xy, so I think libva-1xy can safely be dropped.

[kreitler@k-2so:/dev/shm/pkg/avidemux-2.7.1-1/bin]
#ldd avidemux3_qt5 | grep libva
        libva.so.2 => /usr/lib/libva.so.2 (0x00007fb33b20a000)
        libva-x11.so.2 => /usr/lib/libva-x11.so.2 (0x00007fb33b004000)
        libva-drm.so.2 => /usr/lib/libva-drm.so.2 (0x00007fb33a7de000)

@pmenzel
Copy link
Collaborator Author

pmenzel commented Dec 6, 2018

Cool, thank you for testing. Will you update/rebuild the Avidemux?

@thomas
Copy link
Collaborator

thomas commented Dec 6, 2018

Yepp, after the dist. 'guess there are not so many avidemux users around.

This adds the function `__vaDriverInit_1_3` to the drivers.

Tested on *keineahnung* (Intel) and *inbetweenmove* (AMDGPU).
Currently, only VDPAU is supported. But we want VA-API to be supported
as well.

    checking libavutil/avutil.h usability... yes
    checking libavutil/avutil.h presence... yes
    checking for libavutil/avutil.h... yes
    checking for LIBVA... yes
    checking for LIBVA_DRM... yes
    checking for LIBVA_X11... yes
    checking for LIBVA_WL... yes
    checking libavcodec/vaapi.h usability... yes
    checking libavcodec/vaapi.h presence... yes
    checking for libavcodec/vaapi.h... yes
    configure: VA API acceleration activated

Playing a movie, the VA-API is automatically used.

    libva info: VA-API version 1.3.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_1_3
    libva info: va_openDriver() returns 0

Increment revision to 1.
@pmenzel pmenzel force-pushed the add-intel-vaapi-driver-2.3.0-pre1 branch from 6e002ad to bbd0392 Compare December 6, 2018 17:10
@pmenzel pmenzel changed the title Add intel-vaapi-driver 2.3.0.pre1 and update NASM, Yasm, FFmpeg and xine-lib Add intel-vaapi-driver 2.3.0.pre1 and update NASM, Yasm, FFmpeg, xine-lib, and VLC Dec 7, 2018
@pmenzel pmenzel merged commit 9d301b9 into master Dec 7, 2018
@pmenzel pmenzel deleted the add-intel-vaapi-driver-2.3.0-pre1 branch October 19, 2021 13:15
Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants