sipeed / sipeed/MaixPy

[MaixCAM2] read_raw() returns an empty buffer (and segfaults on the second call)

Open
#204 4 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
850
Forks
128
Avg merge
1m
Merged PRs (30d)
2

Description

Just a heads-up rather than an urgent report — I was trying out raw Bayer capture
on MaixCAM2 and it doesn't seem to work as the API suggests. Not blocking anything
on my side, but you probably want to know.

Environment

MaixCAM2 (2K variant), MaixPy 4.12.5, Ubuntu 22.04 / Linux 4.19.125 aarch64.
This is the latest image available for MaixCAM2 as far as I can tell — v4.12.5
looks like it was a MaixCAM-only release.

What happens

from maix import camera

c = camera.Camera(raw=True)
c.skip_frames(30)
raw = c.read_raw()

Metadata comes back correct — 1280x720, FMT_RGGB10, 1,152,000 bytes
(1.25 B/px, stride 1600, consistent with MIPI RAW10).

But the buffer is empty: 100% zeros, only 4 unique values across 1.15 MB,
mean/std = 0.00 / 0.15.

An RGB frame taken at the same moment is perfectly fine (std 74.3, 256 unique
values), so the sensor itself is clearly producing data.

Separately, asking for a second frame in the same process segfaults:

frame 0: 1152000 B
Segmentation fault (core dumped)

Calling read() before read_raw() triggers it too.

Things I tried

  • gc.collect() / del between calls — still segfaults
  • format=FMT_RGGB10 in the constructor — "Format not support"
  • explicit resolution — "RGB888 must not exceed 1920x1080"
  • stopping launcher first — no change
  • restarting the process for each frame — no crash, 8 frames captured, but every
    buffer still empty

That last one suggests the empty buffer and the crash are two separate things.

Question

The docs mention RAW output mainly in the astrophotography / long-exposure context.
Is the raw path only wired up for that mode on MaixCAM2? If it needs a particular
setup, that'd be worth a note in the docs — camera.Camera(raw=True) + read_raw()
reads like it should just work.

Happy to test anything if it's useful.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with camera.Camera(raw=True), skip_frames(30), read_raw(), and a second frame on the stated MaixCAM2 environment. Compare the raw-buffer behavior with RGB capture and determine whether the documented raw path supports this mode; done means the behavior is fixed or the required setup and limitation are clearly documented.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
embedded-iot
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.