[libcamera-devel] libcamera on pinephone
Laurent Pinchart
laurent.pinchart at ideasonboard.com
Wed Jun 22 10:52:51 CEST 2022
Hi Pawel,
On Wed, Jun 22, 2022 at 10:37:34AM +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.
>
> Ok, thanks for hints. I indeed hacked the sources. I believe I need to
> select SBGGR8 for final capture and SBGGR8_1X8 as data format inside
> the pipeline. Can I do that with -s option?
You can specify `-s pixelformat=SBGGR8` and libcamera should configure
the pipeline automatically, using SBGGR8_1X8 for the sensor output.
> > > 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`).
>
> Thanks, it works okay using gles. I don't think I can capture still
> images; I should have TIFF available.
I'm not sure we've tried capturing still images when the camera output
is set to Bayer. I half recall Jean-Michel mentioning recently this was
broken.
> > Another simpler option is to use YUYV (assuming it's supported), with
> > `-s pixelformat=YUYV`.
>
> That one does not work for some reason.
>
> Would something like this make sense? I do not see other obvious place
> to tell if TIFF was detected.
The meson configuration log will tell you if libtiff was detected, but
showing the information in the help text is actually a good idea I
think, as it makes it easy to find out what a particular binary
supports.
> diff --git a/src/qcam/main.cpp b/src/qcam/main.cpp
> index d3f01a85..1884b2ed 100644
> --- a/src/qcam/main.cpp
> +++ b/src/qcam/main.cpp
> @@ -45,8 +45,14 @@ OptionsParser::Options parseOptions(int argc, char *argv[])
> "Print verbose log messages", "verbose");
>
> OptionsParser::Options options = parser.parse(argc, argv);
> - if (options.isSet(OptHelp))
> + if (options.isSet(OptHelp)) {
> parser.usage();
> +#ifdef HAVE_TIFF
> + qInfo() << "TIFF/DNG support available.";
> +#else
> + qInfo() << "TIFF/DNG support NOT available, taking still images not possible";
> +#endif
> + }
>
> return options;
> }
--
Regards,
Laurent Pinchart
More information about the libcamera-devel
mailing list