mainline kernel hardware acceleration - Printable Version +- PINE64 (https://forum.pine64.org) +-- Forum: Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=111) +--- Forum: Linux on Pinebook Pro (https://forum.pine64.org/forumdisplay.php?fid=114) +--- Thread: mainline kernel hardware acceleration (/showthread.php?tid=9171) |
RE: mainline kernel hardware acceleration - xmixahlx - 05-31-2020 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. the kernel i am testing now, working well is: next20200529 pinebookpro patch: https://pastebin.com/YK4LXeyv LibreElec 1000 patch v4l2 patch: https://pastebin.com/gaQSZQ6B drm patch: https://pastebin.com/b1BWZ8Cg plus: ffmpeg 4.2.3 with v4l2-request-hwaccel-4.2.2-rkvdec patch: https://pastebin.com/uF5kpABD kodi-git libva-v4l2-request_master + pulls 29+30 libva_master + pulls 332+340 (for libva 332 delete the 5th chunk, version bump, or apply against libva 2.6.0) general responsiveness is actually significantly better than 5.7-rc7 (!?), and my nvme drive is also much better handled. interesting. also, i would recommend compiling hantro and rkvdec into the kernel, not modules, so that they are detected in the same order consistently. RE: mainline kernel hardware acceleration - termac - 06-01-2020 Thank You again for Your help @xmixahlx ! Hardware decoding is now working nicely, following the steps You outlined above. Using ffmpeg and null output: Code: > ffmpeg -hwaccel drm -i bbb_sunflower_1080p_60fps_normal.mp4 -f null - 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: Code: $> ~/mpv-build/mpv/build/mpv --hwdec=drm --vo=gpu --gpu-context=drm bbb_sunflower_1080p_60fps_normal.mp4 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! RE: mainline kernel hardware acceleration - xmixahlx - 06-01-2020 i think mpv hwaccel is currently broken due to v4l2request not being detected. (ffmpeg -decoders | grep v4l) for quick test monitor top and use: "ffmpeg -re --hwaccel drm -i inputfile -f null -" for hwaccel playback use kodi-git. see my other thread. i am also using jellyfin-kodi. works great playing files from my htpc/server. 5.7 is released so i will update patches soon. RE: mainline kernel hardware acceleration - termac - 06-01-2020 (06-01-2020, 09:19 AM)xmixahlx Wrote: i think mpv hwaccel is currently broken due to v4l2request not being detected. (ffmpeg -decoders | grep v4l) Code: $> ffmpeg -decoders | grep v4l 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. RE: mainline kernel hardware acceleration - spikerguy - 06-01-2020 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 Keep up the good work. RE: mainline kernel hardware acceleration - xmixahlx - 06-01-2020 (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 @spikerguy @tsys 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. https://patchwork.kernel.org/project/linux-media/list/?submitter=182393 https://github.com/Kwiboo/linux-rockchip https://github.com/Kwiboo/LibreELEC.tv/tree/rk-5.7/projects/Rockchip/patches/linux/default 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). ffmpeg-v4l2-request: https://github.com/Kwiboo/FFmpeg/tree/v4l2-request-hwaccel-4.2.2 ffmpeg-v4l2-request-rockchip: https://github.com/Kwiboo/FFmpeg/tree/v4l2-request-hwaccel-4.2.2-rkvdec (have these conflict. rkvdec is experimental for rockchip, the other is stable for both rockchip and allwinner, but less featureful on rockchip.) 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. RE: mainline kernel hardware acceleration - termac - 06-03-2020 Thanks for the patches and kernel config @xmixahlx ! Trying to build gives me an error regarding firmware: Code: make KERNELRELEASE=5.7.0-pbp-custom ARCH=arm64 KBUILD_BUILD_VERSION=1 -f ./Makefile 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? RE: mainline kernel hardware acceleration - xmixahlx - 06-03-2020 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. RE: mainline kernel hardware acceleration - termac - 06-03-2020 Installing firmware-misc-nonfree did the trick. Thanks again! RE: mainline kernel hardware acceleration - xmixahlx - 06-07-2020 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. |