[libcamera-devel] libcamera on pinephone

Laurent Pinchart laurent.pinchart at ideasonboard.com
Wed Jun 22 00:10:17 CEST 2022


Hi Pawel,

On Tue, Jun 21, 2022 at 11:57:14PM +0200, Pavel Machek wrote:
> Hi!
> 
> > > Could you print the length of all planes and see how they look like in
> > > memory ? Also note that the two planes have the same fd so they
> > > seem to be contiguous in memory if I'm not mistaken ?
> 
> That may be above my skill level (sorry).
> 
> > We really need data offset support for V4L2 buffer planes in the V4L2
> > API :-S See http://lore.kernel.org/linux-media/20200804192939.2251988-3-helen.koike@collabora.com/
> 
> But I understood enough to realize that I420 is problematic, switched
> to 1280x720-BA810x31384142 and now I have... something ;-).

How did you switch to that format ? The `cam -I` output below lists
SBGGR8 only, which surprises me as I thought both sensors of the
Pinephone had an internal ISP, and supported outputting YUV.

If you've hacked sources somewhere to disable other formats, that
shouldn't be needed. The `-s pixelformat=...` argument to cam lets you
pick a pixel format on the command line.

> I do have some captured files. It does _not_ end in success. I'd like
> to see what I'm getting, and I guess viewfinder would be useful.
> 
> Dependency SDL2 found: YES 2.0.22 (cached)
> Dependency SDL2_image found: YES 2.0.5 (cached)
> Run-time dependency qt5 (modules: Core, Gui, Widgets) found: NO (tried pkgconfig)
> 
> README.rst does not mention sdl. I believe it should?
> 
> for cam: [optional]
>         libevent-dev
> 
> mobian at mobian:~/g/libcamera$ LIBCAMERA_LOG_FILE=/tmp/camera.log LIBCAMERA_LOG_LEVELS=*:DEBUG build/src/cam/c\
> am -c 1 -I --capture=50  -S
> Using camera /base/i2c-csi/rear-camera at 4c as cam0
> 0: 1280x720-SBGGR8
>  * Pixelformat: SBGGR8 (1280x720)-(1280x720)/(+1,+1)
>   - 1280x720
> Unsupported pixel format SBGGR8
> Failed to configure frame sink
> Failed to start camera session
> mobian at mobian:~/g/libcamera$ 
> 
> Hmm. Is SDL not able to display SBGGR8? Is there anything else I can
> try before trying to play with gstreamer?

SDL doesn't support Bayer formats, no. We would need to apply a software
conversion first.

One option, if you can install Qt on the Pinephone, is to use qcam
instead. It supports debayering (when using the GLES backend, see `qcam
-h`).

Another simpler option is to use YUYV (assuming it's supported), with
`-s pixelformat=YUYV`.

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list