64MP libcamera-vid mjpeg full resolution : Not enough buffers provided by V4L2VideoDevice

I need to use the 64MP camera to capture mjpeg pictures. I have a IMX519 and this feature works great.
It woks on the 64MP but only at 16MP resolution. If I up it to the maximum I get the message below. In short it is the “ERROR: *** failed to allocate capture buffers ***” error.

I Have a 4 GB pi 4B and I’ve switched off desktop. Has it simply run out of memory. Would an 8GB pi work? Could anyone test it? Hopefully there is a simple work around otherwise the purchase has been wasted.

Thanks in advance

libcamera-vid -t 500 --width 9152 --height 6944 --codec mjpeg -o test%05d.jpeg --segment 1
rm: cannot remove ‘test*.jpeg’: No such file or directory
WARNING: consider inline headers with ‘pause’/split/segment/circular
Preview window unavailable
[2:19:17.431690372] [1748] INFO Camera camera_manager.cpp:293 libcamera v0.0.0+3572-e13ccdd5
[2:19:17.435043287] [1750] WARN CameraSensorProperties camera_sensor_properties.cpp:163 No static properties available for ‘arducam_64mp’
[2:19:17.435086268] [1750] WARN CameraSensorProperties camera_sensor_properties.cpp:165 Please consider updating the camera sensor properties database
[2:19:17.435594912] [1750] ERROR CameraSensor camera_sensor.cpp:591 ‘arducam_64mp 10-001a’: Camera sensor does not support test pattern modes.
[2:19:17.457758695] [1750] WARN RPI raspberrypi.cpp:1263 Mismatch between Unicam and CamHelper for embedded data usage!
[2:19:17.458371115] [1750] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0
[2:19:17.458673668] [1750] INFO RPI raspberrypi.cpp:1386 Registered camera /base/soc/i2c0mux/i2c@1/arducam_64mp@1a to Unicam device /dev/media3 and ISP device /dev/media0
[2:19:17.459374439] [1748] INFO Camera camera.cpp:1029 configuring streams: (0) 9152x6944-YUV420
[2:19:17.459843158] [1750] INFO RPI raspberrypi.cpp:764 Sensor: /base/soc/i2c0mux/i2c@1/arducam_64mp@1a - Selected sensor format: 9152x6944-SBGGR10_1X10 - Selected unicam format: 9152x6944-pBAA
[2:19:17.649313259] [1750] ERROR V4L2 v4l2_videodevice.cpp:1218 /dev/video14[16:cap]: Not enough buffers provided by V4L2VideoDevice
ERROR: *** failed to allocate capture buffers ***
pi@raspberrypi4n:~/pics $

hi, @bmike

You can refer to the following links to solve the problem of “failed to allocate capture buffers”.

Hi,

Yes I have followed the instructions. I’ve done the install several times to check.

All other features I’ve tested work.

Could you just confirm if the command given works for you on Pi 4 4GB Pi with latest OS. If so, at least I know it’s my config.

libcamera-vid -t 500 --width 9152 --height 6944 --codec mjpeg -o test%05d.jpeg --segment 1

Didn’t supply this last time:

pi@raspberrypi4n:~/pics $ uname -a
Linux raspberrypi4n 5.15.32-v7l+ #1538 SMP Thu Mar 31 19:39:41 BST 2022 armv7l GNU/Linux
cat /etc/os-release
PRETTY_NAME=“Raspbian GNU/Linux 11 (bullseye)”
NAME=“Raspbian GNU/Linux”
VERSION_ID=“11”
VERSION=“11 (bullseye)”
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
pi@raspberrypi4n:~/pics $

tail of config.txt

[cm4]

Enable host mode on the 2711 built-in XHCI USB controller.

This line should be removed if the legacy DWC2 controller is required

(e.g. for USB device mode) or if USB support is not required.

otg_mode=1

[pi4]
arm_boost=1

[all]
dtoverlay=arducam_64mp
dtoverlay=arducam_64mp,cam0
dtoverlay=vc4-kms-v3d,cma-512

1 Like

And this

i@raspberrypi4n:~/pics $ cat /proc/meminfo
MemTotal: 3930664 kB
MemFree: 3287028 kB
MemAvailable: 3586180 kB
Buffers: 31084 kB
Cached: 409680 kB
SwapCached: 0 kB
Active: 93756 kB
Inactive: 422924 kB
Active(anon): 1004 kB
Inactive(anon): 111004 kB
Active(file): 92752 kB
Inactive(file): 311920 kB
Unevictable: 31212 kB
Mlocked: 16 kB
HighTotal: 3264512 kB
HighFree: 2732128 kB
LowTotal: 666152 kB
LowFree: 554900 kB
SwapTotal: 102396 kB
SwapFree: 102396 kB
Dirty: 0 kB
Writeback: 0 kB
AnonPages: 107168 kB
Mapped: 129828 kB
Shmem: 36092 kB
KReclaimable: 27308 kB
Slab: 47160 kB
SReclaimable: 27308 kB
SUnreclaim: 19852 kB
KernelStack: 1904 kB
PageTables: 4580 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
WritebackTmp: 0 kB
CommitLimit: 2067728 kB
Committed_AS: 1015640 kB
VmallocTotal: 245760 kB
VmallocUsed: 5968 kB
VmallocChunk: 0 kB
Percpu: 448 kB
CmaTotal: 524288 kB
CmaFree: 495716 kB
pi@raspberrypi4n:~/pics $

hi, @bmike

At present, we have not seen any problems. There is no problem with the test on the PI4 4GB.

If you have a 8GB version of PI4 in your hand, you can test it.

I don’t have an 8GB pi to hand and can’t get one due to chip shortages. Also I need to know it will work and if you say it works on an 4GB I need to know what I’m doing wrong. I followed the instructions using a brand new image.

hi, @bmike

Can you send me all the commands you executed?

libcamera-vid -t 500 --width 9152 --height 6944 --codec mjpeg -o test%05d.jpeg --segment 1

Just this one

1 Like

If you meant what command did I use to install the drivers etc then I followed the instructions in arducam_64mp_pi_camera_manual.pdf

  1. wget -O install_pivariety_pkgs.sh https://github.com/ArduCAM/Arducam-Pivariety-V4L2-Driver/releases/download/install_script/install_pivariety_pkgs.sh
  2. chmod +x install_pivariety_pkgs.sh
  3. ./install_pivariety_pkgs.sh -p libcamera_dev
  4. ./install_pivariety_pkgs.sh -p libcamera_apps
  5. ./install_pivariety_pkgs.sh -p 64mp_pi_hawk_eye_kernel_driver

Amended /boot/config.txt as given.

I’m sure its simply running out of memory. How many buffers does it use in this mode?

hi, @bmike

Sorry, I don’t know why you keep getting this error.

We tested it several times on the 4GB version of the pi4 and it worked fine every time.

Does your system have other processes consuming resources. I suggest you try again with a re-flashed Raspberry Pi image.

I had a similar issue and what fixed it for me was, in /boot/config.txt

Instead of writing dtoverlay=vc4-kms-v3d,cma-512 underneath [all], I put it underneath [pi4]

So it becomes:

[pi4]
arm_boost=1
dtoverlay=vc4-kms-v3d,cma-512

2 Likes

Thanks, I’m sure I’ve tried this but I’ll try it again. Not sure why it would make a difference.

I would try to debug it but I can’t get the source code for libcamera to work with the 64MP although I can get it to work with imx519. I’ve even used an image from this forum for OctoPi and this also showed the same error.

Tried this but no luck. Could someone upload an image where it works then I can try this and compare the difference to my build. Note model 4B 4GB
pi@raspberrypi4n:~ $ cat /proc/device-tree/model
Raspberry Pi 4 Model B Rev 1.4

Simply execute this command
libcamera-vid -t 500 --width 9152 --height 6944 --codec mjpeg -o test%05d.jpeg --segment 1

1 Like

Hi, @bmike

The maximum resolution of 64MP cannot be run at preview.

Libcamera-Still has limited to a maximum of 16MP during preview, and switches to 64MP resolution when saving the image.

Libcamera-Vid does not do this limit, so you will report this error when you run with a maximum resolution. The resolution it previews is the resolution of the saving image you set.

1 Like

Ok, can I just confirm what you are saying. libcamera-vid extracts it pictures using a preview stream (which I assume uses a lot of buffer space) and so does not support the maximum size supported by the 64mp camera on the pi.

Is this a limitiation of the pi 4GB or does it apply to the 8gb version as well? Is there anyway round this restriction? i.e. some future update by you. If not then I feel this should be made clear as I seem to have wasted my money. Sinlge stills are not what I’m after and severly limit the use of this camera. As it can’t support the Hi res video mode either it then real limits its use on the pi. Taking a single still takes over 1 second so the 3 frames per second indicated can not be achived on th pi.

Hi, @bmike

There is no problem with our camera and can output 64MP images.

However, due to the memory problem of Raspberry Pi, this makes it impossible to preview the 64MP image and can only obtain 64MP images by saving.

Through technical methods, the preview 16MP image maintains the field of view of 64MP images.

1 Like

Just thought I would add this update as I’ve found a solution/work around. You can reduce the number of buffers required by specifiying --buffer-count. A value of 2 for the highest resolution or 3 for 8000x6000 works. Performance then becomes an issue but at least it works.

1 Like