Arducam64MP cam and new camera stack, INOP

Camera model

Arducam 64MP camera with autofocus

What is the problem?

Can't get it to work in Octopi with new camera stack. Don't know if it is possible with this camera. Have not seen any recent threads that say it can be done without resorting to Arducam's repackaged Octopi.

What did you already try to solve it?

Made sure i2c was on using raspi-config. Followed instructions to add enabling of both i2c's in /boot/config.txt.

#ArduCamFocus
dtparam=i2c_vc=on
dtparam=i2c_arm=on

Checked octopi can use a normal raspberry pi camera - it works.

A reboot with the new camera shows:
$ libcamera-hello -list cameras says "No cameras available". vcgencmd get_camera output: supported=1 detected=0, libcamera interfaces=0. Which is discouraging.

Edit: I did not install ArduCAMs "updated drivers". Was not sure if required in 2024. dtoverlay=vc4-kms-v3d right now, not dtoverlay=vc4-kms-v3d,cm=512 as Arducam recommends. Wasn't sure if it would boot with this option without Arducam drivers.

Have you tried running in safe mode?

No

Did running in safe mode solve the problem?

Didn't try yet

Systeminfo Bundle

You can download this in OctoPrint's System Information dialog ... no bundle, no support!)

octoprint-systeminfo-20240125135539.zip (31.3 KB)

Additional information about your setup

OctoPrint version, OctoPi version, printer, firmware, browser, operating system, ... as much data as possible

1.9.3 OctoPrint, Build 2023.10.09.154319, based on OctoPi 1.0.0, running on Raspberry Pi 4 Model B Rev 1.5. 8GB RAM, 1 TB SSD, Prusa MK4, Safari, MacOS Sonoma 14.2.1, 36GB RAM, 1TB NVME, M3 Max

If I use the download scripts from Arducam, will Octopi continue to work? Or do I have to use the Arducam "Octopi" image? I suppose this is a fools errand, but somehow I'd like to be able to use the AF of the new camera.

Do you have a link to a guide or something from Arducam on how to setup this camera? I am not familiar, but reading a setup guide/script might enable us to apply the necessary parts to the new camera stack.

As a side note,

When using libcamera, detected=1 will never occur. Detected is the old stack, libcamera interfaces is the new stack, so that should show 1 & libcamera-hello will produce an output when it works. Don't chase detected=1, and if that shows up it probably means the legacy stack is enabled which breaks the new streaming stack.

Here is the link. How to use arducam_64mp & arducam_64mp FAQ - Raspberry Pi Cameras - Arducam Camera Support Forum

Not sure why it sees the old stack unless it is because I did an apt update / upgrade to the octopi-newstack software. If that screws it up, I'm not sure I even want to run the new stack - I need to be able to keep my system, even a pi secure.

Hmm, raspistill exists, maybe the stack did get overwritten. Drat.

$ raspistill -v
mmal: Cannot read camera info, keeping the defaults for OV5647

"raspistill" Camera App (commit )

Camera Name OV5647
Width 2592, Height 1944, filename (null)
Using camera 0, sensor mode 0

GPS output Disabled

Quality 85, Raw no
Thumbnail enabled Yes, width 64, height 48, quality 35
Time delay 5000, Timelapse 0
Link to latest frame enabled  no
Full resolution preview No
Capture method : Single capture

Preview Yes, Full screen Yes
Preview window 0,0,1024,768
Opacity 255
Sharpness 0, Contrast 0, Brightness 50
Saturation 0, ISO 0, Video Stabilisation No, Exposure compensation 0
Exposure Mode 'auto', AWB Mode 'auto', Image Effect 'none'
Flicker Avoid Mode 'off'
Metering Mode 'average', Colour Effect Enabled No with U = 128, V = 128
Rotation 0, hflip No, vflip No
ROI x 0.000000, y 0.000000, w 1.000000 h 1.000000
mmal: mmal_vc_component_create: failed to create component 'vc.ril.camera' (1:ENOMEM)
mmal: mmal_component_create_core: could not create component 'vc.ril.camera' (1)
mmal: Failed to create camera component
mmal: main: Failed to create camera component
mmal: Camera is not detected. Please check carefully the camera module is installed correctly

The OV5647 was the old camera.

So is it possible to maintain this new camera stack "distro" with software updates? If so, how?

It's "easy enough" to reflash, but it would be useful to know how to maintain this libcamera stack version. Any guidance on this? Or is this download really, really experimental?

I said it doesn't see a camera connected to the old stack, as it shows detected=0 on there. But it also shows libcamera interfaces=0 which means there is no camera on the new stack.

With the new stack enabled, detected=0 remains but it will never switch to 1 when you connect a camera.

I was warning you not to chase detected=1, as that's not what you want to happen.

It doesn't look like raspistill works, so the legacy stack is probably not enabled. It will exist, because the RPi foundation still ships both with Bullseye distros (as far as I remember) because of the breaking changes they wanted to allow people to use both. So don't chase it not 'existing' either as a sign it's not enabled.


To answer the questions on updates, it should be fine to use sudo apt update and sudo apt upgrade, and you will even get updates to the camera-stack scripts as that's one of the new features of this image (old-style 'webcamd' required reflashing for updates to the scripts).

I haven't yet had a chance to look at the Arducam stuff yet, and I don't have a similar camera - I'm kind of hoping someone else who's done it before might come along and share their knowledge :wink:

Thanks Charlie, I was seeing if I could keep on going, rather than reflash. So I will try that. Worse comes to worse, back to the old image. I will try the Arducam scripts next.

I thought I had messed things up, so that is why I asked. Lot's to learn on this.

Reading through the earlier linked Arducam guide, particularly the below post:

My take on each step is detailed here:

  • You will have to use the install_pivariety_pkgs.sh script to get the driver for this camera. I don't think it will work out of the box.
  • You will not need to install libcamera-apps or libcamera-dev, these already exist.
  • I think you most likely will need to edit config.txt as described to get the right graphics driver running.

The rest of the guide is to do with testing the camera. I would reboot, run libcamera-hello --list-cameras again to see if the camera is listed, and see if camera-streamer runs. You can get the logs from the systeminfo bundle easily.

After installing the stuff on the link above, I can see the camera, and can capture a picture. I had previously installed Camera Streamer Control, but it claims that camera-streamer is not installed now. So no pictures in OctoPrint yet. But I did get to see the 5000x6000 pixel image that was captured and it was pretty good, although rotated. Won't use that for streaming, that would be horribly slow. The cam can output at 1920x1080 at 60 Hz. It can also autofocus, I believe.

Now some kind of camera-streamer needs to be installed, and apparently I need to edit the service. There is a raspi variant binary to use. What needs to be done to the service remains to be seen.

I don't understand. I thought the point of me downloading the new camera stack was it had camera-streamer in it? I need to install one now? If I have no usb cams, should I remove the usb-default.conf?

Here's my current system bundle. I did start camera-streamer, with $ sudo systemctl start camera-streamer it didn't seem to emit any messages if it started or not.
octoprint-systeminfo-20240206172435.zip (36.3 KB)

$ systemctl is-active camera-streamer.service
active

But $ camera-streamer results in -bash: camera-streamer: command not found

Fooey. Installing camera-streamer has broken my system.

$ PACKAGE=camera-streamer-$(test -e /etc/default/raspberrypi-kernel && echo raspi || echo generic)_0.2.8.$(. /etc/os-release; echo $VERSION_CODENAME)_$(dpkg --print-architecture).deb
wget "https://github.com/ayufan/camera-streamer/releases/download/v0.2.8/$PACKAGE"
sudo apt install "$PWD/$PACKAGE"
--2024-02-06 20:51:46--  https://github.com/ayufan/camera-streamer/releases/download/v0.2.8/camera-streamer-raspi_0.2.8.bullseye_armhf.deb
Resolving github.com (github.com)... 140.82.112.3
Connecting to github.com (github.com)|140.82.112.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://objects.githubusercontent.com/github-production-release-asset-2e65be/477898191/cd614374-61c9-4b3d-8f57-0996c4113c97?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240207%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240207T015147Z&X-Amz-Expires=300&X-Amz-Signature=c9d7325342deaee6996f946c3f0ebbc22b7173ee58d78d0f4463c93bec6e34c5&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=477898191&response-content-disposition=attachment%3B%20filename%3Dcamera-streamer-raspi_0.2.8.bullseye_armhf.deb&response-content-type=application%2Foctet-stream [following]
--2024-02-06 20:51:47--  https://objects.githubusercontent.com/github-production-release-asset-2e65be/477898191/cd614374-61c9-4b3d-8f57-0996c4113c97?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAVCODYLSA53PQK4ZA%2F20240207%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20240207T015147Z&X-Amz-Expires=300&X-Amz-Signature=c9d7325342deaee6996f946c3f0ebbc22b7173ee58d78d0f4463c93bec6e34c5&X-Amz-SignedHeaders=host&actor_id=0&key_id=0&repo_id=477898191&response-content-disposition=attachment%3B%20filename%3Dcamera-streamer-raspi_0.2.8.bullseye_armhf.deb&response-content-type=application%2Foctet-stream
Resolving objects.githubusercontent.com (objects.githubusercontent.com)... 185.199.110.133, 185.199.108.133, 185.199.111.133, ...
Connecting to objects.githubusercontent.com (objects.githubusercontent.com)|185.199.110.133|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 11211104 (11M) [application/octet-stream]
Saving to: ‘camera-streamer-raspi_0.2.8.bullseye_armhf.deb’

camera-streamer-ras 100%[===================>]  10.69M  10.7MB/s    in 1.0s    

2024-02-06 20:51:48 (10.7 MB/s) - ‘camera-streamer-raspi_0.2.8.bullseye_armhf.deb’ saved [11211104/11211104]

[sudo] password for pi: 
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
Note, selecting 'camera-streamer-raspi' instead of '/home/pi/camera-streamer-raspi_0.2.8.bullseye_armhf.deb'
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 camera-streamer-raspi : Depends: libcamera0 (= 0~git20230720+bde9b04f-1) but 0~git20230724+ad9428b4-1 is to be installed
E: Unable to correct problems, you have held broken packages.

Drat. Broke everything. Is there a way to fix this, or do I need to start all over again?

Can someone tell me the right order to do this?

  1. Install new camera stack from down load
  2. Install x% of ArduCam stuff - definitely the kernel for the camera
    Seems that installing all of the Arducam suggested stuff breaks things
  3. Shouldn't need to install camera-streamer-raspi, or should I?

The ayufan camera-streamer seems to have an ArduCam 64mp service, what else is needed?

Issue is the camera-streamer depends on libcamera 0~git20230720+bde9b04f-1 but my version of libcamera0:armhf is 0~git20230724+ad9428b4-1. (Probably from the ArduCam stuff.) It also seems that libcamera-dev is not compatible.

I tried downgrading libcamera0, but ran into trouble since libcamera-dev wasn't downgraded and apt put on the brakes. I'm not skilled in the art of persuading apt to do my bidding.

Can someone help me here? @Charlie_Powell ? Somewhat stuck.

The "new camera stack" already comes bundled with camera-streamer, this is not something that you have to setup yourself.

However, it seems that you have managed to remove camera-streamer - according to the bundle it does not exist anymore. The Arducam drivers have nothing to do with the streaming application, that install process does not do any uninstalling of anything else.

When you made the below post:

camera-streamer was successfully running with your camera according to the systeminfo bundle there. So since then, it has been uninstalled.

Hmm, I took no overt action to uninstall anything. I only can conclude camera-streamer was affected by the full ArduCam install. That did install their version of libcamera and libcamera-dev
From: How to use arducam_64mp & arducam_64mp FAQ - Raspberry Pi Cameras - Arducam Camera Support Forum

libcamera-dev and libcamera-apps Installation

./install_pivariety_pkgs.sh -p libcamera_dev
./install_pivariety_pkgs.sh -p libcamera_apps

Guess I shouldn't have done that? Only their kernel driver, which was the step before? Seems in the script they download the latest, which is later than what ayufan camera-streamer uses...

It seems I did not exactly follow your advise. Missed that.

You will not need to install libcamera-apps or libcamera-dev, these already exist.

Ok, starting all over again...

Fresh install. Only installed the kernel driver. Updated config.txt. Camera-streamer is present. Unfortunately

$ libcamera-hello --list-cameras
No cameras available!

So seem to be in a catch 22. Doesn't work in Octoprint if I completely follow the Arducam instructions, but I can capture a picture. Problem with version conflict between camera-streamer package and ArduCam stuff. Installing ArduCam libcamera and friends wipes out ayufun's camera-streamer.

If I only install ArduCam 64mp kernel driver, camera-streamer is intact. Video devices show. Arducam kernel is installed, "Device found Arducam 64MP" from $ dmesg | grep -E "arducam".

dtparam=i2c_arm=on
dtparam=i2c_vc=on
dtoverlay=arducam-64mp
dtoverlay=vc4-kms-v3d,cma-512
max_framebuffers=2

Not sure what to do next. Seem to be going around in circles. Latest system bundle.
octoprint-systeminfo-20240207123124.zip (31.6 KB)

Journalctl shows

Feb 07 12:14:50 octorpi4 systemd[1]: Starting camera-streamer...
Feb 07 12:14:50 octorpi4 camera-streamer-control[613]: Running start for camera-streamer-libcamera.service...
Feb 07 12:14:50 octorpi4 camera-streamer-control[613]: ... done.
Feb 07 12:14:50 octorpi4 camera-streamer-control[613]: Adding path unit for autolaunch of camera-streamer-usb@default
Feb 07 12:14:51 octorpi4 camera-streamer-control[613]: Running start for camera-streamer-usb-default.path...
Feb 07 12:14:51 octorpi4 camera-streamer-control[613]: ... done.
Feb 07 12:14:51 octorpi4 systemd[1]: Finished camera-streamer.

More searching. Found this: Solution On OctoPrint - Arducam Wiki But it seems it is starting from an old image of OctoPrint/Pi and then there are a series of steps (which don't seem too bad) to get to the end. I have no idea if this image is maintainable. Just doesn't really feel like a good idea to start from there.

Dunno, seems that the main issue is Arducam's drivers are not compatible with existing OctoPrint/Pi stuff. Unless someone helps here, I have to reluctantly hang up the towel, since it is so far away from my current abilities.

Currently, the title is still apt, ArduCam64mp is INOP with the existing "new camera stack" image. If it isn't, please drop a few clues here, or even a recipe. There's still some desire to have this work, but don't know what to do.

1 Like

Output of libcamera-hello

$ libcamera-hello
Preview window unavailable
[0:49:53.878202955] [10276]  INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
[0:49:53.915968257] [10277]  WARN CameraSensorProperties camera_sensor_properties.cpp:261 No static properties available for 'arducam_64mp'
[0:49:53.916014774] [10277]  WARN CameraSensorProperties camera_sensor_properties.cpp:263 Please consider updating the camera sensor properties database
[0:49:53.926000089] [10277] ERROR IPAProxy ipa_proxy.cpp:149 Configuration file 'arducam_64mp.json' not found for IPA module 'rpi/vc4'
[0:49:53.926104012] [10277] ERROR IPARPI ipa_base.cpp:117 Could not create camera helper for arducam_64mp
[0:49:53.926133437] [10277] ERROR RPI pipeline_base.cpp:818 Failed to load a suitable IPA library
[0:49:53.926156140] [10277] ERROR RPI vc4.cpp:219 Failed to register camera arducam_64mp 10-001a: -22
ERROR: *** no cameras available ***

libcamera-hello does work if I install Arducam libcamera and friends, but that breaks Octoprint.