ArduCAM / Arducam-Pivariety-V4L2-Driver

This driver is used for Arducam mipi camera with Pivariety board
39 stars 22 forks source link

16MP IMX519 *** failed to allocate capture buffers *** #14

Closed tomtom215 closed 2 years ago

tomtom215 commented 2 years ago

Device: Raspberry Pi Zero 2 Kernel: 5.10.92-v7+ Installation Guide Followed: https://arducam.com/downloads/arducam-imx519-start-guide.pdf RPI-Config GPU Memory: 256 MB Glamor GPU: Enabled

Command Ran: libcamera-still -n -o test1.jpg --viewfinder-width 1920 --viewfinder-height 1080

Error Output:

[0:01:40.930401837] [631] INFO Camera camera_manager.cpp:293 libcamera v0.0.0 [0:01:40.960385949] [632] WARN CameraSensorProperties camera_sensor_properties.cpp:141 No static properties available for 'imx519' [0:01:40.960481157] [632] WARN CameraSensorProperties camera_sensor_properties.cpp:143 Please consider updating the camera sensor properties database [0:01:40.960551574] [632] ERROR CameraSensor camera_sensor.cpp:551 'imx519 10-001a': Camera sensor does not support test pattern modes. [0:01:41.017282344] [632] WARN RPI raspberrypi.cpp:1233 Mismatch between Unicam and CamHelper for embedded data usage! [0:01:41.018255523] [632] ERROR DelayedControls delayed_controls.cpp:87 Delay request for control id 0x009a090a but control is not exposed by device /dev/v4l-subdev0 [0:01:41.018946097] [632] INFO RPI raspberrypi.cpp:1356 Registered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media3 and ISP device /dev/media0 [0:01:41.020119485] [631] INFO Camera camera.cpp:1028 configuring streams: (0) 1920x1080-YUV420 [0:01:41.020761152] [632] INFO RPI raspberrypi.cpp:751 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 1920x1080-SRGGB10_1X10 - Selected unicam format: 1920x1080-pRAA [0:01:41.059942829] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: Saturation = 1.000000 [0:01:41.060158090] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: Contrast = 1.000000 [0:01:41.060223871] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: Brightness = 0.000000 [0:01:41.060284497] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: AwbMode = 0 [0:01:41.060345382] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: Sharpness = 1.000000 [0:01:41.060517726] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: ExposureValue = 0.000000 [0:01:41.060665591] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: AeExposureMode = 0 [0:01:41.060795018] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: FrameDurationLimits = [ 33333, 33333 ] [0:01:41.060957206] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: AeMeteringMode = 0 [0:01:41.061082362] [637] INFO IPARPI raspberrypi.cpp:666 Request ctrl: NoiseReductionMode = 3 [0:01:46.295273858] [631] INFO Camera camera.cpp:1028 configuring streams: (0) 4656x3496-YUV420 (1) 4656x3496-SRGGB10_CSI2P [0:01:46.296042453] [632] INFO RPI raspberrypi.cpp:751 Sensor: /base/soc/i2c0mux/i2c@1/imx519@1a - Selected sensor format: 4656x3496-SRGGB10_1X10 - Selected unicam format: 4656x3496-pRAA [0:01:46.351230171] [632] ERROR V4L2 v4l2_videodevice.cpp:1179 /dev/video0[12:cap]: Unable to request 1 buffers: Cannot allocate memory ERROR: failed to allocate capture buffers

kbingham commented 2 years ago

You might want to reduce the memory you've given to the GPU. When you use the libcamera apps, they use memory from the CPU - not the GPU, so if you give too much memory to the GPU - you limit the capabiltiies for allocating camera buffers.

cortmen commented 2 years ago

hi, /boot/config.txt

[all] dtparam=act_led_trigger=default-on gpu_mem=76 camera_auto_detect=1 dtoverlay=vc4-fkms-v3d

dtoverlay=imx477

libcamera is working (but no preview under X) by enable dtoverlay=vc4-fkms-v3d also the old dtoverlay=vc4-kms-v3d you can run libcamera under /bin/bash

also look at
https://forums.raspberrypi.com/viewtopic.php?t=323547&sid=094938929d9e0143916c5a1cf11c3c6f

tomtom215 commented 2 years ago

hi, /boot/config.txt

[all] dtparam=act_led_trigger=default-on gpu_mem=76 camera_auto_detect=1 dtoverlay=vc4-fkms-v3d #dtoverlay=imx477

libcamera is working by enable dtoverlay=vc4-fkms-v3d also the old dtoverlay=vc4-kms-v3d

Thanks @cortmen, that seemed to do the trick.

@kbingham I tried your suggestion first and lowered GPU memory to 16MB but still received the same error

For anyone running on Bullseye, all I need to do is edit my /boot/config.txt to uncomment the line # Enable DRM VC4 V3D driver dtoverlay=vc4-kms-v3d

Then I rebooted and ran this command successfully for the first time: libcamera-still -n -o test1.jpg --viewfinder-width 1920 --viewfinder-height 1080