Closed rubenvb closed 4 years ago
I have also spotted a difference between my kernel's h264-ctrls.h and the one added in the patches. Replacing it with the one from my kernel build makes the build fail on undefined V4L2_PIX_FMT_H264_SLICE_RAW
. So I removed the _RAW
to match this kernel change:
https://lkml.org/lkml/2019/8/12/965
This seems a cosmetic change at this level in any case.
Hmm, are you using a 5.6.2 kernel ?
Anyway, most of my tests were done using mpv compiled against FFMPEG. Do you have multiple versions of FFMPEG installed on your system ? In that case, could you paste the output of
ldd $(which ffmpeg)
I'm used to execute mpv like this :
./mpv --vo=gpu --gpu-context=drm --hwdec=drm video_file.mkv -v --msg-level=ffmpeg=trace
Then I quit the player as soon as possible and look at the logs.
The player is launched in console mode (chvt 1), since it uses the DRM output directly.
I reckon that testing the driver is kind of a pain, and its developers seem to be oblivious to this (or maybe they have something right now... I don't know who's currently actively developing the client part actually).
Yes, linux 5.6.2 with hopefully the correct v4l2 patches applied. I thought that would give me the least headache when applying these bleeding-edge patches, and at least the kernel wasn't all that hard to get build, seemingly correctly providing the new rkvdev
device which at least spits back some strings containing h264.
Here's the ldd ./ffmpeg
I built and tried and failed:
$ ldd ./ffmpeg
linux-vdso.so.1 (0x0000ffff9e7b8000)
libXv.so.1 => /usr/lib/libXv.so.1 (0x0000ffff9cfe3000)
libX11.so.6 => /usr/lib/libX11.so.6 (0x0000ffff9ce8f000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x0000ffff9ce6b000)
libm.so.6 => /usr/lib/libm.so.6 (0x0000ffff9cdbf000)
libdrm.so.2 => /usr/lib/libdrm.so.2 (0x0000ffff9cd9b000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x0000ffff9cd62000)
libxcb-shm.so.0 => /usr/lib/libxcb-shm.so.0 (0x0000ffff9cd4e000)
libxcb-shape.so.0 => /usr/lib/libxcb-shape.so.0 (0x0000ffff9cd3a000)
libxcb-xfixes.so.0 => /usr/lib/libxcb-xfixes.so.0 (0x0000ffff9cd21000)
libasound.so.2 => /usr/lib/libasound.so.2 (0x0000ffff9cc2b000)
libSDL2-2.0.so.0 => /usr/lib/libSDL2-2.0.so.0 (0x0000ffff9cabd000)
libsndio.so.7.0 => /usr/lib/libsndio.so.7.0 (0x0000ffff9ca9a000)
libva.so.2 => /usr/lib/libva.so.2 (0x0000ffff9ca62000)
libbz2.so.1.0 => /usr/lib/libbz2.so.1.0 (0x0000ffff9ca41000)
libz.so.1 => /usr/lib/libz.so.1 (0x0000ffff9ca1a000)
liblzma.so.5 => /usr/lib/liblzma.so.5 (0x0000ffff9c9e4000)
libudev.so.1 => /usr/lib/libudev.so.1 (0x0000ffff9c99e000)
libva-drm.so.2 => /usr/lib/libva-drm.so.2 (0x0000ffff9c98b000)
libva-x11.so.2 => /usr/lib/libva-x11.so.2 (0x0000ffff9c975000)
libvdpau.so.1 => /usr/lib/libvdpau.so.1 (0x0000ffff9c961000)
libpthread.so.0 => /usr/lib/libpthread.so.0 (0x0000ffff9c931000)
libc.so.6 => /usr/lib/libc.so.6 (0x0000ffff9c7c4000)
/lib/ld-linux-aarch64.so.1 => /usr/lib/ld-linux-aarch64.so.1 (0x0000ffff9e78a000)
libdl.so.2 => /usr/lib/libdl.so.2 (0x0000ffff9c7b0000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x0000ffff9c79c000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x0000ffff9c786000)
librt.so.1 => /usr/lib/librt.so.1 (0x0000ffff9c76e000)
libbsd.so.0 => /usr/lib/libbsd.so.0 (0x0000ffff9c747000)
libXfixes.so.3 => /usr/lib/libXfixes.so.3 (0x0000ffff9c731000)
The output of v4l2-compliance
is also quite good:
Compliance test for rkvdec device /dev/video1:
Driver Info:
Driver name : rkvdec
Card type : rkvdec
Bus info : platform:rkvdec
Driver version : 5.6.2
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.6.2
Hardware revision: 0x00000000 (0)
Driver version : 5.6.2
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
Required ioctls:
test MC information (see 'Media Driver Info' above): OK
test VIDIOC_QUERYCAP: OK
Allow for multiple opens:
test second /dev/video1 open: OK
test VIDIOC_QUERYCAP: OK
test VIDIOC_G/S_PRIORITY: OK
test for unlimited opens: OK
Debug ioctls:
test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
test VIDIOC_LOG_STATUS: OK (Not Supported)
Input ioctls:
test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
test VIDIOC_ENUMAUDIO: OK (Not Supported)
test VIDIOC_G/S/ENUMINPUT: OK (Not Supported)
test VIDIOC_G/S_AUDIO: OK (Not Supported)
Inputs: 0 Audio Inputs: 0 Tuners: 0
Output ioctls:
test VIDIOC_G/S_MODULATOR: OK (Not Supported)
test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
test VIDIOC_ENUMAUDOUT: OK (Not Supported)
test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
test VIDIOC_G/S_AUDOUT: OK (Not Supported)
Outputs: 0 Audio Outputs: 0 Modulators: 0
Input/Output configuration ioctls:
test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
test VIDIOC_G/S_EDID: OK (Not Supported)
Control ioctls:
test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
test VIDIOC_QUERYCTRL: OK
test VIDIOC_G/S_CTRL: OK
test VIDIOC_G/S/TRY_EXT_CTRLS: OK
test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
Standard Controls: 8 Private Controls: 0
Format ioctls:
test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
test VIDIOC_G/S_PARM: OK (Not Supported)
test VIDIOC_G_FBUF: OK (Not Supported)
test VIDIOC_G_FMT: OK
test VIDIOC_TRY_FMT: OK
test VIDIOC_S_FMT: OK
test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
test Cropping: OK (Not Supported)
test Composing: OK (Not Supported)
test Scaling: OK
Codec ioctls:
test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
test VIDIOC_G_ENC_INDEX: OK (Not Supported)
test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)
Buffer ioctls:
test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
test VIDIOC_EXPBUF: OK
test Requests: OK
Total for rkvdec device /dev/video1: 45, Succeeded: 45, Failed: 0, Warnings: 0
I have noticed the /dev/video{0,1,2} devices I have (rockchip-rga
: seemingly only scaling/rotation/... and JPEG, hantro-vpu
: seemingly only MPEG2, and the new rkvdec
: should hopefully provide h264 decoding) aren't assigned the same number each boot.
I'll try to build a replacement system ffmpeg package so I can't get confused anymore between my local builds and system libraries. But I also built a static ffmpeg just to avoid this kind of mixing, same result. ./ffmpeg -hwaccels
also does not print the v4l2_request
hwaccel even though configure
output listed it.
FYI I'm running ArchLinuxARM, hence the recent kernel (I took their linux-aarch64-5.6-rc package as a basis for my kernel). They also have a great distcc cross-compile setup so things happen a bit faster than usual.
The issue title doesn't really correspond to what we're discussing though, sorry for that.
Hmm, could you try to compile "mpv" against this version of FFMPEG libraries ?
Also :
find / -name "ffmpeg"
do you get only one result ?mv /dev/video0{,.bak} && mv /dev/video{1,0}
), does it work better ?I haven't checked on ffmpeg -hwaccels
work, but maybe the patches don't add the right hooks to display themselves in the list.
Ok, I tried recompiling a version of FFMPEG with v4l2 request API enabled, but the same thing happened...
-hwaccels
don't return v4l2_request
but don't return xvmc
too, so that might be a red herring... I guess that it's going to end with some horrendous printf
debugging to understand which functions are called, and why the v4l2 request API is not used...
I'll open a new thread for this.
I'm trying to get V4L2_request support built into ffmpeg for testing on my rk3399 NanoPi M4. My last attempt to get something failed when your script failed to apply patches to current FFmpeg master.
End goal is to have a Kodi build that uses v4l2 (request api as I think that's the only thing being worked on upstream for rk3399). Below is the backstory of what I've tried. I have some kernel patches applied, namely these here: https://github.com/rubenvb/PKGBUILDs/commit/26c17bfded37daf8d0676e61e571920ae92c721e
If I run
v4l2-ctl --all
I get promising output from my patched kernel build:I have succesfully build FFmpeg (4.0.4, Kodi Leia version) with the LibreElec patches from here: https://github.com/LibreELEC/LibreELEC.tv/tree/libreelec-9.2/packages/multimedia/ffmpeg/patches/v4l2-request-api
But I don't know how to actually use the v4l2 request hwaccel.
ffmpeg -hwaccels
only listswhich seems to contradict the inital output from FFmpeg's configure:
I don't know what I can try next, so I made this issue as you at least seem to know what you're doing :). It might just be that the kernel patches I found are insufficient, I already contacted the author about the completeness of these patches but he hasn't responded yet.
Thanks for any help you may be able to provide.