Closed ktorimaru closed 2 years ago
Hi, the "PixelArraySize" error is normally a result of not updating libcamera, for example here. Could you try updating as described there and let us know what happens? Thanks!
Ran these:
sudo apt install -y python3-libcamera
pip3 install picamera2 --upgrade
They reported that everything is current.
Running cam = Picamera2()
failed the same way.
I've had this error in the past when I had inadvertently installed two versions/copies of libcamera. I think one was under /lib/python3/dist-packages/libcamera and one under /usr/lib/python3/dist-packages/libcamera. sudo apt install was finding the newer one, python the older one. Disclaimer: Linux is not my first language.
Yes, I think something like this is likely. I don't know if starting from a fresh image is an option for you, otherwise maybe try find / -name libcamera.so |& grep -v denied
to see how many versions might be lurking on your system?
This was one of the issues I hit when I was using the Arducam build of libcamera. Just an indication of the version in use being out of sync with the latest build, one way or another, as mentioned.
Oddly enough,
find / -name libcamera.so |& grep -v denied
yields nothing.
On my system the file is called _libcamera.cpython-39-arm-linux-gnueabihf.so and is in the /usr/lib/python3/dist-packages/libcamera/ folder. At least I think that's the file, again Linux not my first language. When I run: sudo find / -name *libcamera*.so |& grep -v denied I get that file and two other files that match the pattern but don't look interesting.
Hi, thanks for the various responses.
Can you say what OS you are using and whether you're using Arducam supplied versions of libcamera?
I have just finally upgraded picamera2 on my RPi4 system and am getting complaints when trying to instantiate about the Sycc color class not being defined. This is a recent change in libcamera for which you updated picamera2 to keep in sync. But the package installed version of libcamera on Raspberry Pi OS is the 2022 July 7 build 3700, which does not have these changes (and there are probably other incompatibilities, not sure if the PixelArraySize is one of them).
Trying to build libcamera now and figure out how to properly point to it. But just know that the posted instructions for keeping libcamera and picamera2 up to date are not currently functional/compatible.
Hi, yes I'm very sorry about this. We're just right in the throes of updating all the packages and getting ready to build a new set of Raspberry Pi OS images. On this occasion libcamera has changed (the JPEG colour space has been renamed to sYCC, which is the cause of all the trouble), and Picamera2 is updated but the python3-libcamera package isn't.
For now I would downgrade yourself back to Picamera 0.3.2 which should be fine. Very soon things though be back to normal, and in fact even better because there'll be a single apt package which will update everything.
Hi, yes I'm very sorry about this. We're just right in the throes of updating all the packages and getting ready to build a new set of Raspberry Pi OS images. On this occasion libcamera has changed (the JPEG colour space has been renamed to sYCC, which is the cause of all the trouble), and Picamera2 is updated but the python3-libcamera package isn't.
For now I would downgrade yourself back to Picamera 0.3.2 which should be fine. Very soon things though be back to normal, and in fact even better because there'll be a single apt package which will update everything.
A single apt package - meaning libcamera with its python bindings and picamera2 living under one happy roof? What a wonderful world that will be to live in.
Apparently the default build config of libcamera doesn't include the python bindings, so my first run at doing this didn't get me there. Rather than continue down that rabbit hole, I will take your advice about the minor downgrade until all the apt stuff is lined up.
Thanks again.
Hi again, I think things are all sorted out now and there are updated libcamera apt packages that will work with Picamera2 version 0.3.3 (indeed earlier versions won't work any more). Also, as I indicated, you can simply do the following
sudo apt install -y python3-picamera2
and that should fetch everything you need.
I found that the above pulled in several dependencies but was not until I did a separate apt upgrade that the libcamera stuff refreshed (to an Aug 31 build). In any case, it looks like everything is back to functional out of the box. Curious if this solves the OP's issue.
Thanks for the confirmation on that. There might be a way of forcing apt to update dependencies too when updating the main package, we can investigate that one!
Just wondering if there's anything else to do on this issue, or if I can consider closing it in a few days time? Please post back if there are any updates. Thanks!
I ended up starting from scratch.
This seems very similar to: https://github.com/raspberrypi/picamera2/issues/166
This is what is happening: pi@raspberrypi:~ $ python3 Python 3.9.2 (default, Feb 28 2021, 17:03:44) [GCC 10.2.1 20210110] on linux Type "help", "copyright", "credits" or "license" for more information.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File "", line 1, in
File "/home/pi/picamera2/picamera2/picamera2.py", line 81, in init
raise RuntimeError("Camera init sequence did not complete.")
RuntimeError: Camera init sequence did not complete.
Note: libcamera-hello is working. The version is v0.0.0+3700-f30ad033
Prior to updating everything was working great.