[libcamera-devel] libcamera on Librem 5, phase detection auto focus

Kieran Bingham kieran.bingham at ideasonboard.com
Mon Nov 21 14:09:05 CET 2022


Hi Pavel,

Quoting Pavel Machek via libcamera-devel (2022-11-21 11:32:30)
> Hi!
> 
> I'm playing with camera on Librem 5. So far I added af/ae/awb support
> to millipixels done completely in software, but I guess libcamera
> would be more suitable place for it. If you have some hints/example
> where to look at, it would be nice.

The area you are looking at is essentially doing the role of a software
based ISP processor. It would be a component that a pipeline handler
could choose to instantiate, to support any algorithms that use the data
you produce. It can be difficult to produce 'generic' data that any IPA
(where the algorithms would reside) could consume, so I think it would
end up with a paired 'software ISP' and corresponding implementation in
an IPA...

But how that would fit in the libcamera design would need further
consideration ... falling back to software ISP ... should really be
avoided ... but perhaps there's benefits for early bring up - or simply
being able to manage a simple way of getting AWB/AE for raw streams,
without an ISP (as we have on the RKISP1), so I think it has some value.

Ideally - we shouldn't rely on the CPU where possible though, and that's
why several people have been looking at a GPU/OpenGL based option. I
could imagine a software fallback would be a part of that pairing of
SoftwareISP component.

> So far I'm working with contrast detection, but samsung chip should
> support phase detection auto focus, too. So far I hacked
> drivers/media/i2c/s5k3l6xx.ko not to filter out those bits and took
> photos (and looked at them in darktable), but I don't see any obvious
> "defects" indicating presense of focus data. Do you have any pointers
> to more information by chance?

I think that requires support from the sensor vendor.

> I took deliberately defocused photo to make "defects" easier to see. I
> guess I should take another one with less gain to keep other noise
> down. Any ideas how to locate those bits?

If it's just the gain - there's usually a dedicated control for analogue
gain.

 
> Best regards,
>                                                                 Pavel
> 
> -- 
> People of Russia, stop Putin before his war on Ukraine escalates.


More information about the libcamera-devel mailing list