Jump to content

schunckt

Members
  • Posts

    37
  • Joined

  • Last visited

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

  1. Hi! i already tried this without luck. Based on the version ffmpeg showed it installed the right one. I also did uninstall previous ffmpeg and verified its really gone. I still suspect there is something wrong specific for the duo2. Could you please take a look what exact version ffmpeg does show? T.
  2. Hi! @jwalds did yo mange to make hw decoding work with cedrus? (Note: you initially wrote cedar_ve, that's a different driver) I'm fighting with a nanopi duo2. If it works at your end I'd like to know your setup kernel version armbianEnv.txt whatelse has been installed, how could you please provide your dts / dto ? T.
  3. Hi again! Quick update after i wrote that below. I found something very promising here https://codesandbox.io/p/github/NathanJohnNJ/BananaPi-Camcorder/master This is a different approach. Behind the scenes the cedar_ve driver gets used which also supports encoding accel. I think I'll give it a try but that may take some time ... (btw. this is where some confusion exists, at several places - there are two drivers: cedrus aka. sunxi-cedrus and cedar_ve) -------------------------------------------------------------------------------- Im not using X11, i am using direct frambebuffer. But i'm quite sure the output is not the root cause as output to null also doesnt work So for testing there is no need for SPI LCD ffmpeg -hwaccel drm -i Big_Buck_Bunny_720_10s_10MB.mp4 -f null - @robertoj Maybe you can test this above and watch the framerate. if that achieves the 30fps run again with trace ffmpeg -v trace -hwaccel drm -i Big_Buck_Bunny_720_10s_10MB.mp4 -f null - and provide me the console output? also tested again mpv just with the input file and debug output (but this time not the specific v4l request thread) mpv Big_Buck_Bunny_720_10s_10MB.mp4 --msg-level=vd=v,vo=v,vo/gpu/vaapi-egl=trace ... ... [vd] No hardware decoding requested. [vd] Using software decoding. [vd] Detected 4 logical cores. [vd] Requesting 5 threads for decoding. [vd] Selected codec: h264 (H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10) [vd] DR failed - disabling. [vd] Using software decoding. [vd] Decoder format: 1280x720 yuv420p auto/auto/auto/auto/auto CL=mpeg2/4/h264 of course tested different parmeters but mpv always falls back to soft. mpv Big_Buck_Bunny_720_10s_10MB.mp4 --msg-level=vd=v,vo=v,vo/gpu/vaapi-egl=trace --no-config --hwdec=yes [vd] Trying hardware decoding via h264_v4l2m2m-v4l2m2m-copy. [vd] Using underlying hw-decoder 'h264_v4l2m2m' [ffmpeg/video] h264_v4l2m2m: Could not find a valid device [ffmpeg/video] h264_v4l2m2m: can't configure decoder Could not open codec.
  4. Hi! With latest edge 6.15.4 the board boots fine, shutdown also clean and complete but on reboot it does not again start up. Need to powercycle😒 I gets stuck et end of shutdown. Same for latest bookworm image (I think it's 6.12x). Earlier ones did work. => Any other board also affected? => Is for reboot the watchdog involved? T.
  5. Hi and thanks! Tested now but no luck. Compiled edge 6.15.4 Linux nanopiduo2 6.15.4-edge-sunxi #1 SMP Fri Jun 27 10:13:43 UTC 2025 armv7l GNU/Linux now i get Device creation failed: -14. [h264 @ 0x11f9b40] No device available for decoder: device type drm needed for codec h264. Stream mapping: Stream #0:0 -> #0:0 (h264 (native) -> wrapped_avframe (native)) Device setup failed for decoder on input stream #0:0 : Bad address [AVIOContext @ 0x11ac030] Statistics: 498846 bytes read, 0 seeks command as follows: ffmpeg -v trace -re -hwaccel drm -i Big_Buck_Bunny_720_10s_10MB.mp4 -f null - also tried fbdev output but same result. ffmpeg version is still ffmpeg -v ffmpeg version 5.1.7-0+deb12u1 Copyright (c) 2000-2025 the FFmpeg developers built with gcc 12 (Debian 12.2.0-14+deb12u1) configuration: --prefix=/usr --extra-version=0+deb12u1 --toolchain=hardened --libdir=/usr/lib/arm-linux-gnueabihf --incdir=/usr/include/arm-linux-gnueabihf --arch=arm --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared libavutil 57. 28.100 / 57. 28.100 libavcodec 59. 37.100 / 59. 37.100 libavformat 59. 27.100 / 59. 27.100 libavdevice 59. 7.100 / 59. 7.100 libavfilter 8. 44.100 / 8. 44.100 libswscale 6. 7.100 / 6. 7.100 libswresample 4. 7.100 / 4. 7.100 libpostproc 56. 6.100 / 56. 6.100 Unfortunately there are countless forks of ffmpeg. I used the one from here https://forum.armbian.com/topic/32449-repository-for-v4l2request-hardware-video-decoding-rockchip-allwinner/ As of now I haven't found anything about a current kernel and ffmpeg working on any H3, only stuff back in 2019 and/or kernel 4.x 🙂 I also tried several extraargs=cma=### up to 256M but all same error. I really woud love to get some more tech background on "how stuff works" which may help me troubleshoot. => Can we enable debug output from the cedrus driver? How? => Can we enable debug output from thev4l2 layer? How? => Which libraries are involved, eg. v4l2request, other v4l2* which may need additional install/update? => Do in need v4l2-util / v4l2-ctl to configure some stuff? If yes, what exactly? (Remember, Its currently for file playback. I know about for cam capture) => Could the v4l2loopback help? => Can anybody confirm it really works on H3 maybe on an OrangePi board? If yes I can pull the Opi device tree and compare for possible differences. T.
  6. Hi there! Made some further research. It seems I was wrong assuming hw GPU/VPU is used. The reduced CPU load is more likely a result of the lower fps when using -hwaccel drm (aka v4l2request) and the v4l2 layer falls back to soft decoding. I also tried now mpv but just with null output (as it can't fbdev) and captured the debug trace like so mpv Big_Buck_Bunny_720_10s_10MB.mp4 -vo=null --msg-level=all=trace [vd] Codec list: [vd] h264 - H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [vd] h264_v4l2m2m (h264) - V4L2 mem2mem H.264 decoder wrapper [vd] Opening decoder h264 [vd] Looking at hwdec h264-drm... [vd] Could not create device. [vd] No hardware decoding available for this codec. [vd] Using software decoding. no hw accel used! I also captured a ffmpeg trace. ffmpeg -v trace -re -hwaccel drm -i Big_Buck_Bunny_720_10s_10MB.mp4 -f null - Maybe its in fact a duo2 only device tree related? Could someone try the same on any other H3 and provide thr results? If it really works with hwaccel and the org. 30fps I would like to have the trace logs, ideally the ffmpg* or both. lsmod | grep ced sunxi_cedrus 40960 0 v4l2_mem2mem 16384 1 sunxi_cedrus videobuf2_dma_contig 16384 1 sunxi_cedrus videobuf2_v4l2 16384 2 sunxi_cedrus,v4l2_mem2mem videobuf2_common 45056 5 sunxi_cedrus,videobuf2_dma_contig,videobuf2_memops,v4l2_mem2mem,videobuf2_v4l2 videodev 188416 3 sunxi_cedrus,v4l2_mem2mem,videobuf2_v4l2 mc 36864 5 sunxi_cedrus,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2 *ffmpeg has been installed from below as the compiled 8x throws errors with -hwaccel. # Install the precompiled # ffmpeg version 5.1.6-0+deb12u1 Copyright (c) 2000-2024 the FFmpeg developers # built with gcc 12 (Debian 12.2.0-14) # https://forum.armbian.com/topic/32449-repository-for-v4l2request-hardware-video-decoding-rockchip-allwinner/ # As root, no sudo # APT REPOSITORY SETUP wget http://apt.undo.it:7242/apt.undo.it.asc -O /etc/apt/trusted.gpg.d/apt.undo.it.asc . /etc/os-release && echo "deb http://apt.undo.it:7242 $VERSION_CODENAME main" | sudo tee /etc/apt/sources.list.d/apt.undo.it.list echo -e "Package: *\nPin: release o=apt.undo.it\nPin-Priority: 600" | sudo tee /etc/apt/preferences.d/apt-undo-it # We only install ffmpeg. mpv doesn't work anyway with framebuffer # INSTALL FFMPEG AND MPV PACKAGES apt install ffmpeg
  7. @Ryzer There is no "ffmpeg -hwaccel drm-copy" option. Looks like this is mpv only, which - as said - doen't work with framebuffer. glxgears also can't work because i have no OpenGL. But in general that's a good hint. I'll create some small videos with different resolutions and compressions and measure the fps. Maybe that helps to nail down the issue. btw. I've not yet tested VLC. Need to figure out if this is a ffmpeg issue or something else inside the kernel, i.e. v4l2request related ... @robertoj Trying another image doesn't make much sense for me for several other reasons. T.
  8. Thanks for your feedback. But as I wrote, it looks like hw accel works in general when checking the much lower CPU load vs. the fps. CPU 4x100% => ~10fps HW 1x20% => ~6fps Thats why I think the VPU really gets used but not optimal. btw. I did not yet get mpv to work with frambebuffer. T.
  9. No, I did not compile this time. I used the downloaded image (need to double check exactly which one). Before trying this path (have to update my build env first😀) I'd try to get a better understanding about the root cause of the slowness. I think next I'll play around with mpv instead of ffmpeg. I'd prefer ffmpeg for other reasons, but testing mpv is worth to spend some time. T.
  10. @robertoj right, that worked for me as well But the remaining issue is the slowness. Meanwhile I also tested ffmpeg unscaled and no rgb conversion to /dev/null outputt but still slow. Maybe there is some pre/postprocessing done which cloud be tuned further. If i remember right there are some v4l2* features which may impact the processing but I'm not sure if this was camera capture related. Another idea: It seems the VPU clock source is configurable (inside DT) maybe that's not quite right? T.
  11. Great, thanks for the links! Meanwhile it works partially. The DT tweaking was not needed. I made a mistake by specifying the armbian extraargs. I added a second line to armbianEnv.txt but realized all args must be one line. I had to increase cma=256M (Yes, really, tested all lower values). Then it works, BUT ... Fun fact, will further investigate: Decoding with "-hwaccel drm" results in lower fps (about 6..8) whereas software decoder goes up to 10 😀 Decoding has been verified with htop. CPU only => 4 cores 100%. hwaccel one core about 20% which is likely th e yuv to rgb and scaling. Maybe this is still an issue caused by DT, at least when reading https://gregdavill.com/posts/allwinner-s3-videoencoders/ It specifies memory-region = <&cma_pool>; which is missing in my decompiled DT, also the referenced reserved-memory section. Maybe that's not needed if it's coded inside the driver or specified elswhere. T.
  12. Hi all! On NanoPi Duo2 I'm trying to use the builtin video hw processor. ffmpeg already works with -hwaccel v4l2request but throws errors: Press [q] to stop, [?] for help [h264 @ 0x11645f0] Using V4L2 media driver cedrus (6.12.35) for S264 [V4L2RequestContext @ 0xae5f0db0] Failed to create buffer of type 1: Cannot allocate memory (12) [h264 @ 0x11645f0] Failed setup for format drm_prime: hwaccel initialisation returned error. dmesg [ 8906.864389] cma: __cma_alloc: reserved: alloc failed, req-size: 3038 pages, ret: -12 [ 8906.872255] cma: number of available pages: 42@86+128@384+34@3550+34@6622+34@9694+34@12766+34@15838+34@18910+34@21982+1570@25054=> 1978 free of 26624 total pages [ 8906.886783] cedrus 1c0e000.video-codec: dma alloc of size 12443648 failed root@nanopiduo2:~# I already did play around with armbianEnv tweaking extraargs cma but no success. I found a link talking about VPU device tree dma limitations https://git.sec.in.tum.de/croemheld/linux/-/blob/v5.1-rc5/Documentation/devicetree/bindings/media/cedrus.txt I already decompiled the DT and verified there are is no such "reserved-memory" section. Is this the root cause? Maybe someone can provide some hints or ideas confirming that I'm on the right track? If yes I'd give it a try adjusting the DT. T.
  13. Hi guys, Since I'm out of GPIOs I would like to reuse the Debug UART0 RX/TX in "release" if no serial module is attached. I'm using a nanopi Duo2 but that question applies to the general strategy. The NanoPi UART0 RX can be used as PA5, PWM output. I did already play successfully with overlay files for other purposes so I know a little how that works. Can I create a overlay with shared usage, and depending on the loaded module (tty*) the RS232 is operating, or when this is stopped i can use the PWM out? Is this "Shared overlay" in general the right approach? If yes could someone point me to some hints how to craft such a sharing overlay? Sure I need to figure out in general how to setup PWM but thats a different story i think. Thilo
  14. Hi all! I may need some pointers. I'm using a 2.4" LCD at spi1 which works as /dev/fb0 on armbian bookworm (6.1.63) Meanwhile I've learned frambuffer is deprecated and to be replaced by drm., but ... - I could not find enough details to understand the drm architecture in general - there is a linux/drivers/gpu/drm/tiny/ili9341.c how is that used at all? - How to use drm in armbian? For my case any acceleration is not necessary (and likely not possible even if the H3 has Mali Hardware) but I want to avoid further changes if /fbX is really gone. btw. I want to add touch with shared SPI soon, work in progress. Of course that should also work then later on with drm - I'm thinking of any possible conflicts inside the Device Tree which then may need further tweaking. It's all nice but sooooooo time consuming... T.
  15. I can confirm 6.1.47 now works! One caveat: Highest resolution 2592x1944 still has the cma/dma memory error like 6.4.x. But as of now I don't mind. I'll focus next on the harware encoding and other hardware resting, Thilo
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines