Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Hi everyone,

I'm experiencing an issue with Picamera2 on my Raspberry Pi CM5. The same code works perfectly on my CM4, but on the CM5 board, the call to capture_metadata() appears to block my code. As a result, the variables that depend on its return value are never initialized correctly and no frames are being received.

Below is the snippet of code causing the problem:

if self.current_size is None:
    self.current_size = list(self.picam2.capture_metadata()['ScalerCrop'][2:])
    self.scaler_crop = self.zoom_offset + self.current_size

I have verified the following:

The camera is configured and recording properly before this call.
The hardware (CM5) and the library work correctly in isolation – for example, running the metadata.py example from the Picamera2 library prints the metadata as expected.
I even set up a different test project with a Flask server that uses the same capture_metadata() call, and it works fine on CM5.

Environment Details

Operating System:

PRETTY_NAME="Debian GNU/Linux 12 (bookworm)"
NAME="Debian GNU/Linux"
VERSION_ID="12"
VERSION="12 (bookworm)"
VERSION_CODENAME=bookworm
ID=debian

Picamera2 Version:

0.3.24

Libcamera Version:

libcamera build: v0.4.0+53-29156679

Additional Context

  • The problematic code is executed in the Picam2Streamer class when initializing self.current_size from the metadata.
  • On CM4, everything works as expected.
  • Since other test projects using Flask and similar metadata calls work fine on the CM5, it doesn’t appear to be a hardware or library bug.
  • I suspect there may be differences in how the CM5 (with its newer hardware) handles the metadata call compared to the CM4.

My Question

  • Has anyone experienced similar issues on the CM5? Is there a known difference between the CM4 and CM5 regarding the capture_metadata() call that might cause it to block? Any insights or workarounds to ensure that the metadata is captured correctly and that the dependent variables are properly initialized would be greatly appreciated.

Thanks in advance for your help!

You must be logged in to vote

Replies: 1 comment

Comment options

Hi, I'm assuming this is the same question as on the camera forum, where I've answered. Thanks!

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.