Conversation

Here is Megapixels 2 built on the Xiaomi Scorpio running on the libmegapixels config from my last blog post. Still broken oled panel though :p

1
1
0

The output, no autofocus, awb and AE and color calibration though :P

2
0
0

@martijnbraam What about hardware debayering and color correction? I almost managed to get that to work on msm8917 with some kernel hacks but got stuck at writing a libcamera driver, so it would be nice if libmegapixels made this simpler.

The main difference in userspace is that this requires selecting the PIX video capture device instead of RDI and that the capture format may differ from the main pipeline format. Some features might also require ISP-specific userspace code.

1
0
0

@affe_null libmegapixels should be ablet o deal with the PIX thing and format conversions in the ISP.

libmegapixels only handles pipeline setup basically. Megapixels implements the GPU debayer to actually make something usable about the data. Color correction is handled by having a sane color pipeline in Megapixels itself and DCP files that define the color data for the sensor.

0
0
0
@martijnbraam Hi! If you want autofocus, AE, and AWb take a look at millipixels application. It is fork of your megapixels (thanks a lot!), but it has that stuff (+ hacky video recording). A _lot_ of improvement is possible, but basics are there.

I even have patches to libcamera to do AE. Unfortunately they are hacky and merging tuff to libcamera is not easy.
1
0
0

@pavel I've been using your code as reference for my AE and AWB code. AE works great at least but the AWB just runs through the set of presets in the millipixels code. My current experiments have issues with being both slow and oscillating so I need to do some more fancy things there I guess.

I'm also now getting the balance data after the color calibration matrix but sensor gains are applied before it so it's a bit of a mess

1
0
1

@pavel I've not gotten to AF yet because millipixels just shells out to i2cset to change focus parameters in the hardware and I'm not planning on adding that hack to megapixels.

2
0
1
@martijnbraam Aha, so you are aware of that work, good. I'm currently busy with some work and BangleJS smartwatch, but hope to get back to that. This really needs to be done in libcamera.
0
0
0
@martijnbraam Yep, i2cset in millipixels .... is not a way to go. I believe I was not the one to do that particular hack. There's ton of work everywhere around the cameras :-(. BTW word of warning, the AF is actually the hard part, because it is time-critical, the rest should be easy in comparison.
1
0
0

@pavel I think that's there from the manual focus implementation.

I've not looked too much in AF yet but your millipixels code for it looks deceptively simple. I assume it mostly takes a lot of tweaking to get it stable

1
0
0
@martijnbraam Basic AF is really not that hard. Doing it well, debugging it under all conditions and optimizing it for focus speed would make it way more interesting.
0
0
0