05-31-2020, 11:22 AM (This post was last modified: 05-31-2020, 04:35 PM by xmixahlx.)
linuxtv wip against media_tree master from linuxtv.org
drm next against next20200501 from kernel.org
ffmpeg v4l2 rkvdec against official 4.2.2
i made patchsets against next20200529 preparing for 5.7 to be released. (and prob slight changes afterwards). i was to share them when i get to my pbp (on phone now).
you are right that the patches didn't apply cleanly. i made several changes.
Thank You again for Your help @xmixahlx ! Hardware decoding is now working nicely, following the steps You outlined above. Using ffmpeg and null output:
So I am already half way there. Now I only need to get video rendering working properly, because the output with mpv is still dropping frames. I did rebuild against patched ffmpeg, but running mpv with drm option for decoding and video output gives me errors and mpv does not play the video:
(+) Video --vid=1 (*) (h264 1920x1080 60.000fps)
(+) Audio --aid=1 (*) (mp3 2ch 48000Hz)
Audio --aid=2 (*) (ac3 6ch 48000Hz)
File tags:
Artist: Blender Foundation 2008, Janus Bager Kristensen 2013
Comment: Creative Commons Attribution 3.0 - http://bbb3d.renderfarming.net
Composer: Sacha Goedegebure
Genre: Animation
Title: Big Buck Bunny, Sunflower version
[vo/gpu] VT_GETMODE failed: Inappropriate ioctl for device
[vo/gpu/opengl] Failed to set up VT switcher. Terminal switching will be unavailable.
[vo/gpu] Failed to commit ModeSetting atomic request (-13)
[vo/gpu/opengl] Failed to set CRTC for connector 49: Permission denied
[vo/gpu] Failed initializing any suitable GPU context!
Error opening/initializing the selected video_out (--vo) device.
Video: no video
Exiting... (Errors when loading file)
Leaving off the "--gpu-context=drm" option will allow the file to play, but as I said output is dropping frames.
Do You happen to know what the issue here is? From Your posts I gather, You do not use mpv Yourself, but maybe You have come across something... In any case thank You very much again, this is already way better, than what I had working before!
Edit: Isn't that the expected output? I see now all the *_v4l2request are missing. Sorry!
The ffmpeg comand you suggested uses ~75% of one core and decodes at 60 fps for a 1080p/60fps file. So I guess it works in principal. Will have to test kodi next than.
06-01-2020, 05:34 PM (This post was last modified: 06-02-2020, 01:35 AM by xmixahlx.)
(06-01-2020, 09:24 AM)termac Wrote: The ffmpeg comand you suggested uses ~75% of one core and decodes at 60 fps for a 1080p/60fps file. So I guess it works in principal. Will have to test kodi next than.
for a better example of the kodi-gbm+drm+gles experience, use: "ffmpeg -re --hwaccel drm -hwaccel_output_format drm_prime -i inputfile -f null -"
you can also add pixel format with "-pix_fmt bgra" and output to framebuffer with "-f fbdev /dev/fb0"
(06-01-2020, 02:31 PM)spikerguy Wrote: Hi @xmixahlx
I would like to know where did you get these patches from ?
Is there any plan to upstream these?
I understand we need v4l2 in ffmpeg but isn't the drm already available in 5.7 ?
I would love to test it too and build, package it for manjaro
the drm is available in 5.7, but it is patched for upstream + WIP features. the v4l2 api is in constant flux. kwiboo upstreams some patches, and what's still WIP is included in libreelec. their build system pulls in patches and builds packages from source, which makes adapting their patches from their git repo easier than cherry picking patches from LKML (!!!).
in more detail: after a major release he updates his repo branches and gets ready to package for libreelec, then he makes a PR on the libreelec main git. when merged he deletes his branch.
you can generally make his patches yourself by diffing each branch to their base. (that's what i do between his major releases.)
a few additional WIP things are not included in the official patches. you can get those via the branch diffs.
for packaging, you would also want to include ffmpeg-v4l2-request. (the diff against official 4.2.2 is above and applies to 4.2.3, also), and kodi-git built with gbm+gles (see my other thread).
libva and libva-v4l2-request are somewhat broken at the moment and can be skipped for packaging right now.
edit: i attached my patches, config, and patchseries script (delete .log). you can see several of these made it into libreelec 5.7 branch with similar naming.
Anyone got an idea if the file '/lib/firmware/rockchip/dptx.bin' is really needed (it is not present in my earlier kernel build trees) or what to do here?
i build this into the kernel, but you can remove by deleting that line in the config. it is installed manually by danielt's installer, and included in debian's firmware-misc-nonfree package.
confirmed that the youtube kodi plugin working well with hwaccel (tested up to 1080p). h264 works great. vp9 has occasional artifacts. recommend using Adaptive H264 in MPEG DASH settings.
kodi-git thread updated and added inputstream.adaptive-git script for use with youtube-kodi-addon, etc.