Hi everyone. I’ve got an Arducam B0371 (Sony IMX519 16MP with autofocus) hooked up to a Raspberry Pi 3B v1.2 running OctoPi. OS is Raspbian GNU/Linux 11 (bullseye), kernel Linux octopi 6.1.21-v7+ #1642 SMP Mon Apr 3 17:20:52 BST 2023 armv7l, libcamera v0.0.0+4367-ad9428b4. I followed the Arducam native camera quick start guide and the OctoPrint setup guide. The camera gets detected by the Pi, but every time I try to capture it fails. It has never worked since I got it. Has anyone seen this before?
Welcome. Can you run libcamera-hello and libcamera-still -t 5000 and paste the full output? That should show where it’s dying. Also, can you confirm you’ve done the software install from the wiki and run apt update/upgrade?
Sure. libcamera-still -t 5000 also fails, and libcamera-hello gives this:
Preview window unavailable
[0:38:22.271604728] [7543] INFO Camera camera_manager.cpp:297 libcamera v0.0.0+4367-ad9428b4
[0:38:22.370256397] [7552] INFO RPI vc4.cpp:444 Registered camera /base/soc/i2c0mux/i2c@1/imx519@1a to Unicam device /dev/media0 and ISP device /dev/media2
[0:38:22.370365616] [7552] INFO RPI pipeline_base.cpp:1101 Using configuration file ‘/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml’
[0:38:22.371670666] [7543] INFO Camera camera.cpp:1033 configuring streams: (0) 2328x1748-YUV420
[0:38:22.372130926] [7552] ERROR V4L2 v4l2_videodevice.cpp:1047 /dev/video0[13:cap]: Unable to set format: Device or resource busy
ERROR: *** failed to configure streams ***
Yes, I installed everything per the Arducam wiki, searched their forums for similar problems, and ran sudo apt-get update / sudo apt-get upgrade (plus a couple of typos like sudo get-update / sudo get-upgrade). Still nothing.
That ‘Device or resource busy’ on /dev/video0 is a big clue. Can you post the camera/unicam lines from dmesg after a fresh boot, and the camera-related lines from your /boot/config.txt?
Here you go.
dmesg:
[ 11.444775] imx519 10-001a: Device found is imx519
[ 11.445336] imx519 10-001a: Consider updating driver imx519 to match on endpoints
[ 12.479386] unicam 3f801000.csi: Wrong width or height 640x480 (remote pad set to 4656x3496)
[ 12.479529] unicam 3f801000.csi: Failed to start media pipeline: -22
config.txt relevant settings:
camera_auto_detect=0
dtoverlay=vc4-kms-v3d
dtoverlay=imx519
start_x=1
gpu_mem=128
dtparam=i2c_vc=on
dtparam=i2c_arm=on
Thanks. So the sensor is detected fine (imx519@1a registers), but stream configuration fails because /dev/video0 reports busy, and Unicam complains about a 640x480 vs 4656x3496 size mismatch. The fact that something is already claiming the camera resource is suspicious, but I want to rule things out properly first. Can you generate the Arducam camera bug report so I can see the full picture?
I’ve sent you the bug report tool and the exact steps via private message. Short version: reboot your device first, then run the tool and it will produce an arducam-bug-report.txt file in the current directory. Please send that file back to me via PM.
Done. I rebooted, ran the tool, and it generated arducam-bug-report.txt. I’ve sent the file over to you through private message.
Thanks, I went through the report. The camera resource is being held by another process - that’s what’s causing the ‘Device or resource busy’ error when libcamera tries to configure /dev/video0. My money is on the OctoPrint webcam stream grabbing the camera. Check OctoPrint’s webcam settings and stop whatever process is using the camera, then try libcamera-still -t 5000 again. Once that process is out of the way, the stream should configure without the busy error.