pinebook pro tools - 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: pinebook pro tools (/showthread.php?tid=10190) |
RE: pinebook pro tools - mjhammel - 08-31-2020 I've been following this thread for a short while - thanks for the really great information! I've been tasked with getting the VPU working on a rk3399-based board with a custom distro. For user space I think I understand what's required and where to get it. For the kernel I'm a little confused on what's required. It seems 5.8 is the place to start. That seems somewhat stable at this point, at least for some codecs. Do I need both the hantro and rkvdec drivers or is the hantro sufficient? We need h264, mp4 and mjpeg decoding and mjpeg encoding at a minimum. I may be required to backport to 5.4 but I can't tell if that would be harder than forward porting our tweaks of 5.4 instead. I've started following the linux-media mailing list for updates. I just need some help on where the best place to start is. Any pointers would be greatly appreciated. Thanks! RE: pinebook pro tools - xmixahlx - 08-31-2020 you could do everything with hantro as it also has h264 support, however rkvdec supports h264 also and is favored. you should be able to review the linux and ffmpeg scripts, files under /resources/, and kwiboo's repositories for linux-rockchip and ffmpeg. see how these are addressed by libreelec - kwiboo prepares patches for matching repositories, and the linuxtv-rkvdec linux-rockchip branch is additional WIP, but usually stable. if possible, i would rebase your project on 5.8. i will be rebasing the hwaccel patches for 5.9 soon. i added ADDPATCH and KERNELCONFIG variables to the linux script, so you may be able to use the script with your own patch and kernel for your project. this approach can actually work for any rockchip hardware with some effort, snd i will soon be expanding for rockpro64. RE: pinebook pro tools - mjhammel - 09-02-2020 (08-31-2020, 11:16 AM)xmixahlx Wrote: you could do everything with hantro as it also has h264 support, however rkvdec supports h264 also and is favored. Thanks for the tips. I decided it was easier to forward port our 5.4 changes to 5.8.5. I spent yesterday doing that (mostly dts and some network mods) and the node boots fine with both the hantro and rkvdec drivers. I ran some v4l2 commands and it looks far better than the original 4.4 stuff I had. Next I'll take a look at your ffmpeg script(s) and kwiboo's ffmpeg repo. My goal is to show ffmpeg doing hwaccel'd encoding and decoding, though I'm not quite sure the best way to do that yet. I guess I could try a file conversion from h.264 to ... something else? ... and back. I also need to test motion jpeg encoding somehow. I don't have video input on the device (at least not yet). And I don't have a display working yet either (we do on 4.4 - it's dsi, not hdmi - but I haven't ported that forward yet). Any additional suggestions are appreciated - and again: thanks for your work and help on this! RE: pinebook pro tools - mjhammel - 09-02-2020 (08-31-2020, 11:16 AM)xmixahlx Wrote: you could do everything with hantro as it also has h264 support, however rkvdec supports h264 also and is favored. One more question: why is the rkvdec driver favored? Is the hantro driver still dependent on MPP? RE: pinebook pro tools - jh76 - 09-14-2020 upgrade system before read this thread my current kernel version 5.8.6 how to downgrade kernel version? or you packaged will update soon? RE: pinebook pro tools - xmixahlx - 09-19-2020 iirc rkvdec supports greater resolution decode than hantro for h264. kwiboo wrote support for h264 on hantro, but then dropped in favor of rkvdec. still using 5.8. no rush on 5.9. i have other projects in the works and those should be discuswed here soon. ffmpeg uses drm hwaccel. kodi is the most supported software bevayse that is what libreelec uses as frontend. you can process via cli also. see the "mainline hwaccel" thread for more details. RE: pinebook pro tools - spikerguy - 11-27-2020 (09-19-2020, 10:11 AM)xmixahlx Wrote: iirc rkvdec supports greater resolution decode than hantro for h264. kwiboo wrote support for h264 on hantro, but then dropped in favor of rkvdec.Hello @xmixahlx I have finally got back to trying vpu support for Manjaro. I patched the following packages
Quote:Quote:v4l2-ctl --list-devices Quote:dmesg | grep hantro Quote:dmesg | grep rk3399-vpu Quote:ffplay -decoders | grep v4l2 Quote:ffmpeg -re -hwaccel drm -i bbb_1080-30_3M_x265_main_8b_lv51.mkv -f null - I am not sure what else is needed. It still takes alot of cpu when playing via ffplay as mpv is not patched and as v4l2_request is not detected then no point of patching mpv, for kodi I might have to do a fresh pkgbuild for gbm with patched ffmpeg. Any advice? RE: pinebook pro tools - xmixahlx - 12-06-2020 there is/was a bug where v4l2-request was not being properly detected, so solutions depending on detection (vlc, mpv) were also not working. however, ffmpeg directly using drm hwaccel and kodi were/are working. although not ideal, i simply switch into kodi from sway when wanting to watch something. i need to get back in sync to the current kernel and kwiboo patches. i'm still using 5.8 and have been detached from development for ~2 months. hoping to receive a rockpro64 in the mail shortly to help jumpstart this and a few other projects in the works. RE: pinebook pro tools - mjhammel - 03-08-2021 (12-06-2020, 01:16 PM)xmixahlx Wrote: there is/was a bug where v4l2-request was not being properly detected, so solutions depending on detection (vlc, mpv) were also not working. however, ffmpeg directly using drm hwaccel and kodi were/are working. although not ideal, i simply switch into kodi from sway when wanting to watch something.Any updates on this? I don't think I'm seeing hw accel with the 5.10.17 kernel, at least not based on CPU load when I start my tests. My software setup is as follows: Quote:1. kernel 5.10.17, no patches All patches are from pbp-tools. Does anyone know if all/any of these patches are still needed? My test script: https://www.graphics-muse.org/archives/source/vputest.sh vainfo: vainfo --display drm --device /dev/videoX vainfo.log (Size: 1.55 KB / Downloads: 312) Decode to NULL (-f NULL -): ffmpeg -hwaccel drm -vaapi_device /dev/dri/renderD128 -an -i big_buck_bunny_480p_H264_AAC_25fps_1800K_short.MP4 -map 0:0 -threads 8 -aspect 16:9 -y -f mp4 decodeVideos.mk vpu.log (Size: 6.24 KB / Downloads: 318) RE: pinebook pro tools - mjhammel - 03-12-2021 I've fixed some bugs in my test script that now show vainfo correctly. The updated script is vputests.sh, as in this example. |---------------------------------------------------- ++++ /dev/video0: |---------------------------------------------------- LIBVA_DRIVER_NAME=v4l2_request vainfo --display drm --device /dev/video0 libva info: VA-API version 1.11.0 libva info: User environment variable requested driver 'v4l2_request' libva info: Trying to open /usr/lib/dri/v4l2_request_drv_video.so libva info: Found init function __vaDriverInit_1_11 libva info: va_openDriver() returns 0 vainfo: VA-API version: 1.11 (libva 2.11.0.pre1) vainfo: Driver version: v4l2-request vainfo: Supported profile and entrypoints VAProfileH264Main : VAEntrypointVLD VAProfileH264High : VAEntrypointVLD VAProfileH264ConstrainedBaseline: VAEntrypointVLD VAProfileH264MultiviewHigh : VAEntrypointVLD VAProfileH264StereoHigh : VAEntrypointVLD VAProfileHEVCMain : VAEntrypointVLD I also ported the kernel patch to 5.10.17. Before and after the patch I have only seen what appears to be HW accelleration with mpeg2video files. H264 doesn't not appear to be getting accelerated based on CPU uage. The patch has been posted to the pbp site. I've also created my own sample files using OpenShot to save in H264, mpeg2video and mpeg4 formats (I'm not trying VP9 because its not one of our use cases) as 720p 25fps 1280x720 videos in MP4 and AVI containers. The videos are longer than most of the samples I've been using to give me a chance to watch CPU usage over time. That's how I'm testing if HW accel is apparently working. With mpeg2video I'm seeing about 7% CPU usage. With the others it varies from about 50% to 80% cpu usage. I tried kwiboo's ffmpeg but there was no difference in the tests. At this point I'm convinced that only mpeg2video are HW accelerated with the upstreamed hantro/rkvdec drivers plus the patches available here to both the kernel and user space utilities for VAAPI support. |