Jump to content

Sash0k

Members
  • Posts

    5
  • Joined

  • Last visited

Posts posted by Sash0k

  1. Hello. Thanks to you post, i've started VPU acceleration in H3 (OrangePI PC). For your SBC seems it will be the same.

     

    On 5/29/2020 at 10:09 PM, divis1969 said:

    I have reverted the following commits:

     

    Seems, it will be better to upgrade backend headers, than downgrade kernel

     

    On 5/29/2020 at 10:09 PM, divis1969 said:

    [AVHWFramesContext @ 0xae54cfe0] Failed to destroy surface 0x400000b: 6 (invalid VASurfaceID).

     

    Try this patch: https://github.com/bootlin/libva-v4l2-request/pull/30/files

     

    Details:

    https://forum.armbian.com/topic/11184-hardware-graphicvideo-acceleration-in-h3-mainline/?do=findComment&comment=105564

  2. Finally got it! No kernel modifications needed, only v4l2-request.


    Key notes:

    • Use bootlin code, latest master (not release-2019.03 tag)
    • I merged just one small patch from https://github.com/bootlin/libva-v4l2-request/pull/30/files (seems, it's unecessary)
    • Download kernel sources with corresponding version. For my armbian is: https://cdn.kernel.org/pub/linux/kernel/v5.x/linux-5.4.45.tar.xz
    • Extract 2 files from kernel/include/media mpeg2-ctrls.h and h264-ctrls.h and replace ones in v4l2-request
    • Replace V4L2_PIX_FMT_H264_SLICE_RAW to V4L2_PIX_FMT_H264_SLICE in v4l2-request source code
    • Compile and install (instruction is as 2 posts above)
    • Don't forget to set VLC as in https://linux-sunxi.org/Sunxi-Cedrus
      Spoiler

      Tools > Preferences > Input / Codecs > Codecs > Hardware-accelerated decoding > VA-API video decoder

      Tools > Preferences > Video > Display > Output > X11 video output (XCB)

     

    Tested with VLC, usable with issues:

    • Artifacts in some videos h264 720p and higher, for example: https://imgur.com/nYFArT4 (360/480 works fine)
    • Scaling (fullscreen, resizing) not works, slowdown with message
      [a310cb88] main filter error: Failed to create video converter
    • Minor issues in console output on playback (see bold)
      Spoiler

      $ vlc 3-big_buck_bunny_480p_H264_AAC_25fps_1800K.MP4
      VLC media player 3.0.9.2 Vetinari (revision 3.0.9.2-0-gd4c1aefe4d)
      [02287b98] main libvlc: Running vlc with the default interface. Use 'cvlc' to use vlc without interface.
      libEGL warning: DRI2: failed to authenticate
      libva info: VA-API version 1.7.0
      libva info: User environment variable requested driver 'v4l2_request'
      libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so
      libva info: Found init function __vaDriverInit_1_7
      libva info: va_openDriver() returns 0
      [a272d350] avcodec decoder: Using v4l2-request for hardware decoding
      [a3018b98] blend blend error: no matching alpha blending routine (chroma: YUVA -> VAOP)
      [a3018b98] main blend error: blending YUVA to VAOP failed

     

    Thanks to: @jernej for this post:

     

  3. 4 hours ago, Dreyk said:

    @Sash0k, it looks interesting.
    What about the real video playback in video players (like mpv, vlc, etc...)?

     

    Unfortunately, no success.

     

    First, mainline bootlin backend is outdated, h264 broken. It has some pull requests, that not merged.

    Tryng to recompile Philipp Zabel's version, and merge his work for h264

    Spoiler

    $ git clone https://github.com/pH5/libva-v4l2-request.git
    $ cd libva-v4l2-request
    $ git merge origin/h264
    $ ./autogen.sh
    $ make
    $ sudo make install

     

     

    This version works with artifacts in VLC:

    U24j7fV.png

     

  4. Trying to add VA-API into actual Armbian Focal (Linux orangepipc 5.4.45-sunxi #20.05.4)

     

    Install instruction

    Spoiler

    $ sudo apt-get install libtool pkg-config vainfo libva2 libva-x11-2 libva-drm2 libva-utils libva-dev libdrm-dev

    $ git clone https://github.com/bootlin/libva-v4l2-request

    $ cd libva-v4l2-request

    $ ./autogen.sh

    $ make

    $ sudo make install

     

    Next, export driver:

    $ export LIBVA_DRIVER_NAME=v4l2_request

    and check it with vainfo tool. Have an error:

    $ vainfo 
    libva info: VA-API version 1.7.0
    libva info: User environment variable requested driver 'v4l2_request'
    libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so
    libva info: va_openDriver() returns -1
    vaInitialize failed with error code -1 (unknown libva error),exit

     

    To fix, add symbolic link to installed driver:

    $ sudo ln -s /usr/lib/dri/v4l2_request_drv_video.so /usr/lib/arm-linux-gnueabihf/dri/

     

    And seems everything is ok

    $ vainfo 
    libva info: VA-API version 1.7.0
    libva info: User environment variable requested driver 'v4l2_request'
    libva info: Trying to open /usr/lib/arm-linux-gnueabihf/dri/v4l2_request_drv_video.so
    libva info: Found init function __vaDriverInit_1_7
    libva info: va_openDriver() returns 0
    vainfo: VA-API version: 1.7 (libva 2.6.0)
    vainfo: Driver version: v4l2-request
    vainfo: Supported profile and entrypoints
          VAProfileMPEG2Simple            :	VAEntrypointVLD
          VAProfileMPEG2Main              :	VAEntrypointVLD
          VAProfileH264Main               :	VAEntrypointVLD
          VAProfileH264High               :	VAEntrypointVLD
          VAProfileH264ConstrainedBaseline:	VAEntrypointVLD
          VAProfileH264MultiviewHigh      :	VAEntrypointVLD
          VAProfileH264StereoHigh         :	VAEntrypointVLD
          VAProfileHEVCMain               :	VAEntrypointVLD

     

×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines