Jump to content

schunckt

Members
  • Posts

    37
  • Joined

  • Last visited

Everything posted by schunckt

  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
  16. Great! I'll give it a try, likely next weekend. Thilo
  17. @going "Maybe it's a hardware limitation?" this can't be true because highest resolution works with the "original" friendlyCore 4.14 image/kernel. @Gunjan Gupta im quite sure 2592x1944 worked in Armbian_21.08.1_Nanopiduo2_focal_current_5.10.60 but i can retry using the prepared SD card (I hope this still is there 🙂) About 6.1: I don't mind if it only works on the latest 6.4x series, I'm fine staying there and proceed with other development like hwaccell and other stuff, like spi display retest and the like. FYI using the "friendly" I already was able to capture and playback on fbi / spi display, other i2c sensors are working, ola DMX output works, .net6 works with swagger UI ... Goal is have this all working in latest armbian plus hwaccel (if possible) btw. if you really find the root cause in 6.1 don't hesitate to share the source code of the problematic area. I'm curious... Thanks! Thilo
  18. @going it seems the higest resolution 2592x1944 fails because of this: [ 593.498632] cma: cma_alloc: reserved: alloc failed, req-size: 1846 pages, ret: -16 [ 593.498684] sun6i-csi 1cb0000.camera: dma alloc of size 7561216 failed already increased cma to 256M but doesnt help. Anyway. Will proceed next with the encoder/decoder and fullhd 1920x1080 (works), that's more important for me. Thilo
  19. Did further play around with ffmpeg and v4l pipeline. This now WORKS also 6.4.8-sunxi (Armbian_23.08.0-trunk_Nanopiduo2_jammy_edge_6.4.8_minimal build from 07-Aug) v4l2-ctl --device /dev/video1 --set-fmt-video=width=1280,height=720,pixelformat=YUYV media-ctl --device /dev/media1 --set-v4l2 '"ov5640 2-003c":0[fmt:YUYV8_2X8/1280x720]' ffmpeg -i /dev/video1 -q 10 -pix_fmt yuv420p -video_size 1280x720 -r 5 -listen 1 -f avi http://192.168.179.55:8080/stream VLC http://192.168.179.55:8080/stream ffmpeg is version 4.4.2-0ubuntu0.22.04.1 This means, there was a problem "behind the scenes" in 6.1x which is now fixed. Other parameters which did work in the past and now failing might be a side effect of internal improvments. I'll figure out anyway because this kernel now also contains the cedrus video engine and I want to use that for encoding and decoding. So from my point of view the issue is solved. @going the highest resolution 2592x1944 did work in friendlycore xenial 4.14 so the driver WAS able to do so. Don't know yet if something is now broken - but as said above need to play around anyways. Thanks @all! Thilo
  20. Progress still on nanopiduo2 6.4.8-sunxi Meaniwhile i tried ustreamer which now WORKS at least with 640x480 like so: v4l2-ctl --device /dev/video1 --set-fmt-video=width=640,height=480,pixelformat=YUYV media-ctl --device /dev/media1 --set-v4l2 '"ov5640 2-003c":0[fmt:YUYV8_2X8/640x480]' ./ustreamer -d /dev/video1 --host 192.168.179.55 -r 640x480 and VLC plays http://192.168.179.55:8080/stream will now go ahead trying ffmpeg and will test ustreamer on 6.1.x (But I'd prefer using latest build anyway!) Thanks! Thilo
  21. Did build 'edge' have now Linux nanopiduo2 6.4.8-sunxi #1 SMP Thu Aug 3 08:26:15 UTC 2023 armv7l armv7l armv7l GNU/Linux No more crashes 😀 but now no video🙄. mjpg_streamer says "cant enable video" dmesg shows sun6i-csi 1cb0000.camera: invalid input/output format combination tried sveral params which did work in the past, no luck as yet. Will do further testing later on. v4l2-ctl -d /dev/video1 --all Driver Info: Driver name : sun6i-csi Card type : sun6i-csi-capture Bus info : platform:1cb0000.camera Driver version : 6.4.8 Capabilities : 0xa4200001 Video Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x24200001 Video Capture Streaming Extended Pix Format Media Driver Info: Driver name : sun6i-csi Model : Allwinner A31 CSI Device Serial : Bus info : platform:1cb0000.camera Media version : 6.4.8 Hardware revision: 0x00000000 (0) Driver version : 6.4.8 Interface Info: ID : 0x0300000e Type : V4L Video Entity Info: ID : 0x0000000c (12) Name : sun6i-csi-capture Function : V4L2 I/O Pad 0x0100000d : 0: Sink, Must Connect Link 0x02000010: from remote pad 0x1000003 of entity 'sun6i-csi-bridge' (Video Interface Bridge): Data, Enabled, Immutable Priority: 2 Video input : 0 (sun6i-csi-capture: ok) Format Video Capture: Width/Height : 640/480 Pixel Format : 'YUYV' (YUYV 4:2:2) Field : None Bytes per Line : 1280 Size Image : 614400 Colorspace : sRGB Transfer Function : Default (maps to sRGB) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Limited Range) Flags : looks good but that "sun6i-csi-bridge" seems to be different!?! also i have spi-spidev overlay enabled but there is no /dev/spi* Maybe I made something wrong when building the image!?!? ov5640 load shows root@nanopiduo2:~# dmesg | grep ov5640 [ 8.767826] ov5640 2-003c: supply DOVDD not found, using dummy regulator [ 8.768164] ov5640 2-003c: supply AVDD not found, using dummy regulator [ 8.768320] ov5640 2-003c: supply DVDD not found, using dummy regulator [ 8.775980] ov5640 2-003c: Consider updating driver ov5640 to match on endpoints The last line is new i think. Need to figure out what that means... Thilo
  22. I've a armbian VM build environment ready, did build once successfully but I'm not experienced in linux. Is there an easy way to find and integrate the changes mentioned above? Then I could give it a try, maybe just the code to be pasted into the respecitve files... Thilo
  23. Update: after boot simple v4l2-ctl -d /dev/video1 --all also causes the crash. Output ends here in the middle: Driver Info: Driver name : sun6i-csi Card type : sun6i-csi Bus info : platform:1cb0000.camera Driver version : 6.1.34 Capabilities : 0x84200001 Video Capture Streaming Extended Pix Format Device Capabilities Device Caps : 0x04200001 Video Capture Streaming Extended Pix Format Media Driver Info: Driver name : sun6i-csi Model : Allwinner A31 CSI Device Serial : Bus info : platform:1cb0000.camera Media version : 6.1.34 Hardware revision: 0x00000000 (0) Driver version : 6.1.34 Interface Info: ID : 0x03000003 Type : V4L Video Entity Info: ID : 0x00000001 (1) Name : sun6i-csi Function : V4L2 I/O Pad 0x01000002 : 0: Sink, Must Connect Link 0x02000007: from remote pad 0x1000006 of entity 'ov5640 2-003c' (Camera Sensor): Data, Enabled Priority: 2 Video input : 0 (Camera: ok) Format Video Capture: Width/Height : 1280/720 Pixel Format : 'BA81' (8-bit Bayer BGBG/GRGR) Field : None Bytes per Line : 1280 Size Image : 921600 Colorspace : sRGB Transfer Function : Default (maps to sRGB) YCbCr/HSV Encoding: Default (maps to ITU-R 601) Quantization : Default (maps to Full Range) Flags : Thilo
  24. Did you ever solve this? Maybe try this: media-ctl --device /dev/media1 --set-v4l2 '"ov5640 1-003c":0[fmt:UYVY8_2X8/1920x1080]' note the _2X8 (I found this while searching for latest DT overlay) T.
  25. Just FYI i did update/upgrade recently and just NOW again but the result is the same. Will test latest image just in case. Thanks! Thilo
×
×
  • Create New...

Important Information

Terms of Use - Privacy Policy - Guidelines