[libcamera-devel] PinePhone needs S_FRAME_INTERVAL

Pavel Machek pavel at ucw.cz
Tue Jul 5 00:15:49 CEST 2022


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.

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: 181 bytes
Desc: Digital signature
URL: <https://lists.libcamera.org/pipermail/libcamera-devel/attachments/20220705/dc3d6791/attachment.sig>


More information about the libcamera-devel mailing list