[libcamera-devel] PinePhone needs S_FRAME_INTERVAL
Jacopo Mondi
jacopo at jmondi.org
Tue Jul 5 09:17:44 CEST 2022
Hi Pavel,
On Tue, Jul 05, 2022 at 12:15:49AM +0200, Pavel Machek via libcamera-devel wrote:
> Hi!
>
> It looks I solved another mystery: Top resolution was not available,
> and depending on order of commands, sometimes 1280x720 was not
> available, either.
>
> So I took a look into megapixels, and mystery solved -- libcamera is
> not setting frame intervals at all.
>
> AFAICT that needs to happen. PinePhone needs lower fps for top
> resolution, but an use high fps for lower resolutions...
>
> This is obviosly a hack, but we need something like that.
>
Can I ask a stupid question ? Is the sun6i a parallel or CSI-2
receiver ? If you're using my ov5640 branch (patches will land
upstream in 5.20) the need to set frame_interval to work around a
driver deficiency is now only for parallel setups. CSI-2 platforms have
been switched to use VBLANK to control the frame rate.
For reference:
https://git.sr.ht/~jmondi_/linux/tree/jmondi/media-master/ov5640-v7
> Best regards,
> Pavel
>
> commit 66616c78007c08fcd3fde66888c2210a392b184e
> Author: Pavel Machek <pavel at ucw.cz>
> Date: Mon Jul 4 23:54:22 2022 +0200
>
> S_FRAME_INTERVAL is needed, or things don't work.
>
> index fba90e20..0ee6ac30 100644
> --- a/src/libcamera/v4l2_subdevice.cpp
> +++ b/src/libcamera/v4l2_subdevice.cpp
> @@ -452,6 +452,21 @@ int V4L2Subdevice::setFormat(unsigned int pad, V4L2SubdeviceFormat *format,
> Whence whence)
> {
> struct v4l2_subdev_format subdevFmt = {};
> +
> + {
> + struct v4l2_subdev_frame_interval interval = {};
> + interval.pad = 0;
> + interval.interval.numerator = 1;
> + interval.interval.denominator = 10;
> + if (int ret = ioctl(VIDIOC_SUBDEV_S_FRAME_INTERVAL,
> + &interval) == -1) {
> + LOG(V4L2, Error)
> + << "Unable to set frame interval on pad " << pad
> + << ": " << strerror(-ret);
> + return ret;
> + }
> +
> + }
> subdevFmt.which = whence == ActiveFormat ? V4L2_SUBDEV_FORMAT_ACTIVE
> : V4L2_SUBDEV_FORMAT_TRY;
> subdevFmt.pad = pad;
>
> --
> People of Russia, stop Putin before his war on Ukraine escalates.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20220705/e5e6143d/attachment.sig>
More information about the libcamera-devel
mailing list