mainline kernel hardware acceleration
#14
(05-16-2020, 06:40 PM)xmixahlx Wrote: vainfo will display a single media decoder module, and it defaults to /dev/video0 or whatever you have set as LIBVA_V4L2_REQUEST_VIDEO_PATH (see first few posts). since rk3399 has two (hantro and rkvdec) you need to select them with vainfo separately. with mpeg2 you are seeing hantro. check devices with v4l2-ctl --list-devices. check each device with v4l2-ctl -d /dev/video# --all.
...

Thanks for pointing that out. I only checked video0 and video1. With LIBVA_V4L2_REQUEST_VIDEO_PATH=/dev/video4 I get:

Code:
$>vainfo
libva info: VA-API version 1.8.0
libva info: User environment variable requested driver 'v4l2_request'
libva info: Trying to open /usr/lib/aarch64-linux-gnu/dri/v4l2_request_drv_video.so
libva info: Found init function __vaDriverInit_1_8
libva info: va_openDriver() returns 0
vainfo: VA-API version: 1.8 (libva 2.7.0)
vainfo: Driver version: v4l2-request
vainfo: Supported profile and entrypoints
     VAProfileH264Main               : VAEntrypointVLD
     VAProfileH264High               : VAEntrypointVLD
     VAProfileH264ConstrainedBaseline: VAEntrypointVLD
     VAProfileH264MultiviewHigh      : VAEntrypointVLD
     VAProfileH264StereoHigh         : VAEntrypointVLD

Code:
$>v4l2-ctl -d /dev/video4 --all
Driver Info:
Driver name      : rkvdec
Card type        : rkvdec
Bus info         : platform:rkvdec
Driver version   : 5.7.0
Capabilities     : 0x84204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Device Capabilities
Device Caps      : 0x04204000
Video Memory-to-Memory Multiplanar
Streaming
Extended Pix Format
Media Driver Info:
Driver name      : rkvdec
Model            : rkvdec
Serial           :
Bus info         : platform:rkvdec
Media version    : 5.7.0
Hardware revision: 0x00000000 (0)
Driver version   : 5.7.0
Interface Info:
ID               : 0x0300000c
Type             : V4L Video
Entity Info:
ID               : 0x00000001 (1)
Name             : rkvdec-source
Function         : V4L2 I/O
Pad 0x01000002   : 0: Source
 Link 0x02000008: to remote pad 0x1000004 of entity 'rkvdec-proc': Data, Enabled, Immutable
Priority: 2
Format Video Capture Multiplanar:
Width/Height      : 48/48
Pixel Format      : 'NV12' (Y/CbCr 4:2:0)
Field             : None
Number of planes  : 1
Flags             :
Colorspace        : Rec. 709
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization      : Default
Plane 0           :
  Bytes per Line : 48
  Size Image     : 4608
Format Video Output Multiplanar:
Width/Height      : 48/48
Pixel Format      : 'S264' (H.264 Parsed Slice Data)
Field             : None
Number of planes  : 1
Flags             :
Colorspace        : Rec. 709
Transfer Function : Default
YCbCr/HSV Encoding: Default
Quantization      : Default
Plane 0           :
  Bytes per Line : 0
  Size Image     : 4608

Codec Controls

                   vp9_profile 0x00990b00 (menu)   : min=0 max=0 default=0 value=0
0: 0
   h264_sequence_parameter_set 0x00990ce8 (unknown): type=110 flags=has-payload
    h264_picture_parameter_set 0x00990ce9 (unknown): type=111 flags=has-payload
           h264_scaling_matrix 0x00990cea (unknown): type=112 flags=has-payload
         h264_slice_parameters 0x00990ceb (unknown): type=113 flags=has-payload
        h264_decode_parameters 0x00990cec (unknown): type=114 flags=has-payload
              h264_decode_mode 0x00990ced (menu)   : min=1 max=1 default=1 value=1
1: Frame-Based
               h264_start_code 0x00990cee (menu)   : min=1 max=1 default=1 value=1
1: Annex B Start Code
           vp9_frame_context_0 0x009918a0 (unknown): type=400 flags=has-payload
           vp9_frame_context_1 0x009918a1 (unknown): type=400 flags=has-payload
           vp9_frame_context_2 0x009918a2 (unknown): type=400 flags=has-payload
           vp9_frame_context_3 0x009918a3 (unknown): type=400 flags=has-payload
   vp9_frame_decode_parameters 0x009918a4 (unknown): type=404 flags=has-payload

To me that seems like from the driver and v4l2 side everything is in place. I tried playing video with mpv (unpatched) and the --hwdec options "vaapi" and "v4l2m2m-copy". In the first case I get no error, but the playback drops quite alot of frames and in the second case I get the error
Code:
[ffmpeg/video] h264_v4l2m2m: Could not find a valid device
[ffmpeg/video] h264_v4l2m2m: can't configure decoder
Could not open codec.

So maybe I am just missing a patched ffmpeg now. I will give that a try next.
If that does not work out, I will try the exact patches You listed, as currently I have gotten here using the patches mentioned in the quote from the other thread. Thank You for looking into it!

(05-16-2020, 06:40 PM)xmixahlx Wrote: pbp linux 5.7-rc5 hwaccel patch sequence:
tsys 5.7.0-rc2 branch
5.7.0-rc3 incremental patch
5.7.0-rc4 incremental patch
5.7.0-rc5 incremental patch
LibreElec 002, 0012, 0013, 0021, 0022, 1000 patches
Kwiboo hevc patch


Messages In This Thread
RE: mainline kernel hardware acceleration - by termac - 05-17-2020, 04:38 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to mainline kernel on daniel thompson's debian installer? hellojack 14 7,027 09-07-2023, 09:38 PM
Last Post: Der Geist der Maschine
  kernel module that supports usb-c hdmi alexandre 16 14,138 05-14-2023, 09:58 PM
Last Post: rathofkhan3
  Manjaro update broke hardware video acceleration with mpv myself600 2 1,261 01-25-2023, 09:12 AM
Last Post: myself600
Question Debian (Vanilla) no output on display after Kernel update (6.0.8-1) as365n4 1 1,200 12-09-2022, 12:43 PM
Last Post: as365n4
  bootloader menu to pick a kernel - what is the current situation in in early 2022? maxtothemax 4 3,025 02-05-2022, 03:04 PM
Last Post: maxtothemax
  Kernel panics solostian 17 13,743 01-26-2022, 08:08 AM
Last Post: TRS-80
  Kernel 5.17 will improve VP9 support? jiyong 1 2,051 01-16-2022, 08:26 PM
Last Post: xmixahlx
  red/green power led not working with kernel 5.14 alchemist 4 3,671 11-04-2021, 04:09 AM
Last Post: alchemist
  Very slow glamor 2D acceleration hjalfi 3 3,959 09-06-2021, 12:54 PM
Last Post: jbrock
  Sound stuttering on Manjaro gnome after latest kernel upgrade? pjsf 0 1,740 07-13-2021, 10:37 PM
Last Post: pjsf

Forum Jump:


Users browsing this thread: 1 Guest(s)