#Mainsail OS Pi Cam Failed To Start Camera

1 messages · Page 1 of 1 (latest)

muted maple
#

I have a fresh Mainsail OS install with a Pi Cam Module 2 and 3 (tested individually). The camera is recognized but libcamera-hello returns an error (below). The cam module 2 works on another Pi (with older Pi OS) and the 3 is brand new. Any suggestions on what else I can check?

$ libcamera-hello
Preview window unavailable
[1:29:28.640775310] [3592] INFO Camera camera_manager.cpp:297 libcamera v0.0.5+83-bde9b04f
[1:29:28.679785488] [3593] WARN RPI vc4.cpp:383 Mismatch between Unicam and CamHelper for embedded data usage!
[1:29:28.680707491] [3593] INFO RPI vc4.cpp:437 Registered camera /base/soc/i2c0mux/i2c@1/imx219@10 to Unicam device /dev/media2 and ISP device /dev/media1
[1:29:28.680772360] [3593] INFO RPI pipeline_base.cpp:1101 Using configuration file '/usr/share/libcamera/pipeline/rpi/vc4/rpi_apps.yaml'
[1:29:28.681792138] [3592] INFO Camera camera.cpp:1033 configuring streams: (0) 1640x1232-YUV420
[1:29:28.682372646] [3593] INFO RPI vc4.cpp:565 Sensor: /base/soc/i2c0mux/i2c@1/imx219@10 - Selected sensor format: 1640x1232-SBGGR10_1X10 - Selected unicam format: 1640x1232-pBAA
[1:29:29.757985797] [3593] ERROR V4L2 v4l2_videodevice.cpp:1906 /dev/video0[12:cap]: Failed to start streaming: Input/output error
ERROR: *** failed to start camera ***

$ libcamera-hello --list-cameras
Available cameras

0 : imx219 [3280x2464] (/base/soc/i2c0mux/i2c@1/imx219@10)
Modes: 'SRGGB10_CSI2P' : 640x480 [103.33 fps - (1000, 752)/1280x960 crop]
1640x1232 [41.85 fps - (0, 0)/3280x2464 crop]
1920x1080 [47.57 fps - (680, 692)/1920x1080 crop]
3280x2464 [21.19 fps - (0, 0)/3280x2464 crop]
'SRGGB8' : 640x480 [103.33 fps - (1000, 752)/1280x960 crop]
1640x1232 [41.85 fps - (0, 0)/3280x2464 crop]
1920x1080 [47.57 fps - (680, 692)/1920x1080 crop]
3280x2464 [21.19 fps - (0, 0)/3280x2464 crop]

muted maple
#

I also found this in dmesg:
camera-streamer: page allocation failure: order:10, mode:0xcc1(GFP_KERNEL|GFP_DMA), nodemask=(null),cpuset=/,mems_allowed=0

torn zephyr
#

Did you rename your username?

#

Oh wait, that will only make problems with crowsnest on MainsailOS

#

Send your /boot/config.txt and make sure your packages are all up to date with sudo apt update && sudo apt upgrade

muted maple
#

Yes, I've made sure to apt update/upgrade. Here's my config.txt

torn zephyr
muted maple
#

Yes, I am. Ok, I'll read through that!

#

ok, that doc mentions that rolling back to legacy camera stack doesn't support camera module 3. Is there a way to get this to work with the 3 and klipperscreen? I have a camera 2 module I can use but I was hoping to be able to use the autofocus on the 3

torn zephyr
#

We don't have found a solution for this yet...

#

This is some kind of kernel problem and we cannot do anything about this

muted maple
#

ok, understood

#

I'll swap out the camera 3 and try again

muted maple
#

Ok, swapping out the camera and rolling back to legacy camera stack did worked for me. I'm still curious why I didn't have to do this on my other printer with the same Pi 4 (different Pi camera) and running Klipperscreen, but I'm thrilled to be past this issue for now.

torn zephyr
#

Then we are in the same boat. You are one of a few people that got klipperscreen and libcamera working. You can try with a fresh installation, that sometimes solve the problem. But this whole libcamera and klipperscreen thing is just annoying

#

I don't own a klipperscreen myself, so I couldn't do testing myself yet, but I already gave some support on this topic and there are a lot of weird things going on sometimes

muted maple
#

heh, I would buy a btt screen for someone to figure it out 🙂

#

I really appreciate your help getting this working as it is now

#

can I ask a question about the resolution here or should that be a separate post?

torn zephyr
#

Just ask it here

muted maple
#

my camera supports up to 1920x1080 resolution but when I choose that its cropped and very zoomed in crowsnest. when I drop down to 1280x962 its zoomed out as expected. Do I have something set wrong to cause that?

torn zephyr
# muted maple heh, I would buy a btt screen for someone to figure it out 🙂

Getting a btt screen wouldn't be the problem 😉
It's more like I don't want to put that much effort in something that is different for every single screen. Those screens behave all differently and this would just solve the problem for the BTT screens, or maybe worse, only for one BTT screen.
If you want to try around a bit, here are some notes, I made up until now about this topic:

Source: https://forums.raspberrypi.com/viewtopic.php?t=350936
Fix: https://github.com/raspberrypi/linux/pull/5476
Another Fix: https://github.com/raspberrypi/linux/pull/5479

Since kernel 6.1.29 maybe fixed
Manual fix: sudo rpi-update pulls/5476
Better: sudo rpi-update pulls/5479
Doesn't work with all klipperscreens!!!

Some /boot/config.txt settings: https://github.com/ayufan/camera-streamer/issues/21

dtoverlay=vc4-kms-v3d,cma-256
dtoverlay=vc4-kms-dsi-7inch
dtoverlay=imx219

Those fixes are a big maybe.

torn zephyr
muted maple
#

ahhh... got it. so 1440 x 1080 is what I should be using

torn zephyr
#

Yes

#

But it might be stil zoomed. I didn't test that much

muted maple
#

I just tried it and it works great. Thanks again!

torn zephyr
#

Then please close this post. If you can find something out about the klipperscreen, feel free to ping me somewhere or write me in dm 😄