Raspberry Camera V1.3 no works with the new Stack

apparently the problem is that mjpegstreamer is running.. so the camera is "busy"

[0:00:49.884971959] [1026] INFO Camera camera.cpp:840 Pipeline handler in use by another process
ERROR: *** failed to acquire camera /base/soc/i2c0mux/i2c@1/ov5647@36 ***

Question now is: how to disable mjpegstreamer?

Where can I deactivate this?

This service is not running.

take a look at the log /var/log/webcamd.log

This log file does not exist

Did you upgrade an older version or use the image with the new stack and restore the settings from a backup file?

If so you may be better off just creating a new installation from the Raspberry Pi Imager using the new stack and not restoring your backup file.

In my case it's an old installation (more then 2 years) upgraded all the times to latest version ..
It did work until 2 days ago..
see here Raspberry PI3A Camera stopped working - Get Help / Webcams - OctoPrint Community Forum

Any help on how to have it working again without reinstalling everything?
Which are the steps to setup just the webcam (raspicam)?
Thanks in advance

If you are not using the "new camera stack" OctoPi image, then you have a different problem/situation from the OP. mjpg streamer & webcamd are not in use in the new streaming stack. Please don't hijack their post to ask for help on yours.

Sorry Charlie.. I was asking help because, even if the situation may seems different (it's not a fresh installation) the error reported in this post is EXACTLY the same of my error.. so I assume it is the same issue (maybe I am wrong)..
What is the "new stack"?

I used the new clean image. No backup. Is freh installed.

How exactly is the new stack configured? Do I need both files in /boot/camera-streamer ? How are these configured? I see option='--xxxxx "aaa 123"' or option=--xxxxx "...... without ' it is poorly described. A working example config would be better. What you have to pay attention to is whether the /boot/ config. txt needs to be changed... etc. I have now reinstalled and don't want to go through the work of redoing everything again. Or is it Bullseye's fault that it doesn't work. There must be a reason why this pi camera v1.3 just doesn't work.

Hello i have the same problem with the new stack it works perfect with the old one

Hello @Dennis_Voss !

Then please also attach your systeminfo bundle to your next post.

Addressing @Tkaus's original post first:

  • Based on your systeminfo bundle, it appears that your camera is being correctly recognised and camera-streamer is running. However, there is the below message:

    Sep 22 02:24:37 octoprint sh[727]: [0:00:25.656052542] [835] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
    Sep 22 02:24:37 octoprint sh[727]: [0:00:25.656086135] [835] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
    Sep 22 02:24:37 octoprint sh[727]: [0:00:25.656118271] [835] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
    

    There is then attempts to stream, but the stream goes stale. Camera-streamer has a known bug that it can't properly recover from a stream going stale (which happens if it is not accessed within a certain time somehow), this is why the new stack is not the default yet. It produces the mentioned "server error" if you try and open the stream in your browser (outside OctoPrint). Known issue.

  • The only solution seen so far has been to restart the streamer. You can do this with the command sudo camera-streamer-control restart. It is not a guaranteed fix however. I will also note that it seems more common to find this issue with the Pi Cam V1, anecdotally.

  • For a camera connected to the CSI port on the Pi, you use the libcamera.conf file in /boot/camera-streamer. This is setup out of the box so it should "just work", without configuration. Configuration should be if you wish to change the resolution/fps etc. Obviously this is not always the case.

  • For a camera connected to the USB ports, any other *.conf files are used. The default one is designed to work with any camera that's connected to the USB ports, and you can customise. They are both intended "working example configs".

Thanks for the great details within this thread. I think I am seeing the same issue as the OP, unfortunately restarting the camera-streamer-control service did not seem to help for me.

I have a Pi 3B w/ a Camera v1.3. It has been running with the old stack for a couple of years, but I wanted to update to the new stack and possibly switch to a Pi Camera v3 or ArduCam I have lying around.

For my new camera stack install I created a fresh image and restored settings from a backup.

Upon boot I see the camera LED flash a few times, but then remains off and my stream seems down. Attempts to connect to the URLs seem to be rejected or return a Server Error.

Running libcamera-hello (after stopping camera-streamer service) indicates a similar frontend timeout error - bummer.

> pi@octopi:~ $ libcamera-hello
> Preview window unavailable
> [0:11:33.116823005] [1406] INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
> [0:11:33.188698209] [1407] INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/ov5647@36 to Unicam device /dev/media0 and ISP device /dev/media1
> [0:11:33.188812220] [1407] INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
> [0:11:33.190147167] [1406] INFO Camera camera.cpp:1033 configuring streams: (0) 1296x972-YUV420
> [0:11:33.191039355] [1407] INFO RPI vc4.cpp:565 Sensor: /base/soc/i2c0mux/i2c@1/ov5647@36 - Selected sensor format: 1296x972-SGBRG10_1X10 - Selected unicam format: 1296x972-pGAA
> [0:11:34.309576866] [1407] WARN V4L2 v4l2_videodevice.cpp:2007 /dev/video0[12:cap]: Dequeue timer of 1000000.00us has expired!
> [0:11:34.309786137] [1407] ERROR RPI pipeline_base.cpp:1333 Camera frontend has timed out!
> [0:11:34.309862908] [1407] ERROR RPI pipeline_base.cpp:1334 Please check that your camera sensor connector is attached securely.
> [0:11:34.309939106] [1407] ERROR RPI pipeline_base.cpp:1335 Alternatively, try another cable and/or sensor.
> ERROR: Device timeout detected, attempting a restart!!!

I stumbled onto this thread which seemed loosely related - but it seems to indicate a specific issue with the Pi 5. (When using the OV5647 model camera on Raspberry Pi 5B, an error is reported. - Raspberry Pi Forums)

Maybe I'll get really curious and plug in my ArduCam 16MP autofocus to see if it works.

Here's an attempt at my logs if interested...
octoprint-systeminfo-20240213210551.zip (59.0 KB)

I tested to restart the camera-streamer-control and it didn't resolve my problem. I have tested to disable camera auto detect dtoverlay in config.txt and add it manually but it didn't help.
octoprint-systeminfo-20240214105537.zip (25.3 KB)

I think that the raspberry camera v1.3 with 5M is not supported by libcamera.

I think that repo is more specifically camera-streamer than libcamera itself... so I'm not sure it's indicative to why libcamera tools from the terminal provide the same errors (frontend timeout) while not running the camera-streamer service.

A brief further glance makes it look like those (your link to githib) service files are example configs (not necessarily the fully supported list) and that the service config on my Pi is /etc/systemd/system/camera-streamer-libcamera.service.

I'm new to this effort, however, so could be wholly wrong :slight_smile:

I've tried everything I've read in the last 3 days without success.

I'm starting to wonder if the Pi 3B (with latest camera stack / kernel) has some issue with the old 5MP camera/sensor. As with many issues, online searching shows all kinds hints or similar problems - many of which maybe totally unrelated or wrong.

I'll see what I can experiment with when I get a chance - I have an Arducam 16MP AF camera lying around and also a Pi Zero W and Pi Zero 2 I may be able to swap around to see if any combinations work. Maybe I can pick up a cam v3 to try too (eventually using the Arducam or a new v3 was sort of my aim in trying this new camera stack anyway).

A few links I've found interesting when looking into this:

I've noted increasing the timeout value (seen in top link above) seems to make the timeout error go away but the camera still fails to function.

i tried running crowsnest and mainsail and couldn't get the camera to work on bookworm so installed everything on buster and then it worked when i changed the dtoverlay manually so can it be that something is missing in the newer versions?