[libcamera-devel,0/3] libcamera: Add sensor timestamp support
mbox series

Message ID 20210407160644.58326-1-jacopo@jmondi.org
Headers show
Series
  • libcamera: Add sensor timestamp support
Related show

Message

Jacopo Mondi April 7, 2021, 4:06 p.m. UTC
Hello,
   we have an issue with reporting sensor timestamps correctly to android.

We currently use one of the buffers timestamps, which fails some CTS tests that
verify that the reported SENSOR_TIMESTAMP is in the frame duration range
reported as static metadata
Ie. android.hardware.camera2.cts.CaptureRequestTest#testNoiseReductionModeControl
when run in FULL mode.

This series de-stages the SensorTimestamp control we had defined as draft
control and populates it in the IPU3 pipeline handler with the timestamp
of the CIO2 raw buffer. It then reports it to Android.

Paul: I didn't manage to reproduce the error on you in-development CTS patches
so I can't say this series fixes the test. But I've manually collected the
reported duration and run them through a little script and verified they all
fall in the expected range. Could you test your failing test with this series
on top ?

Thanks
  j

Jacopo Mondi (3):
  libcamera: controls: Destage 'SensorTimestamp'
  libcamera: ipu3: Report sensor timestamp
  android: camera_device: Use controls::SensorTimestamp

 src/android/camera_device.cpp        | 33 +++++++++++++++++-----------
 src/android/camera_device.h          |  3 +--
 src/libcamera/control_ids.yaml       | 21 ++++++++++++------
 src/libcamera/pipeline/ipu3/ipu3.cpp |  9 ++++++++
 4 files changed, 44 insertions(+), 22 deletions(-)

--
2.31.1

Comments

Paul Elder April 22, 2021, 9:53 a.m. UTC | #1
Hi Jacopo,

On Wed, Apr 07, 2021 at 06:06:41PM +0200, Jacopo Mondi wrote:
> Hello,
>    we have an issue with reporting sensor timestamps correctly to android.
> 
> We currently use one of the buffers timestamps, which fails some CTS tests that
> verify that the reported SENSOR_TIMESTAMP is in the frame duration range
> reported as static metadata
> Ie. android.hardware.camera2.cts.CaptureRequestTest#testNoiseReductionModeControl
> when run in FULL mode.
> 
> This series de-stages the SensorTimestamp control we had defined as draft
> control and populates it in the IPU3 pipeline handler with the timestamp
> of the CIO2 raw buffer. It then reports it to Android.
> 
> Paul: I didn't manage to reproduce the error on you in-development CTS patches
> so I can't say this series fixes the test. But I've manually collected the
> reported duration and run them through a little script and verified they all
> fall in the expected range. Could you test your failing test with this series
> on top ?

It practically fixes the issue, thanks! As mentioned before, there's
just one single frame that's still too fast, but other than that I think
it's fine.

Tested-by: Paul Elder <paul.elder@ideasonboard.com>

> 
> Thanks
>   j
> 
> Jacopo Mondi (3):
>   libcamera: controls: Destage 'SensorTimestamp'
>   libcamera: ipu3: Report sensor timestamp
>   android: camera_device: Use controls::SensorTimestamp
> 
>  src/android/camera_device.cpp        | 33 +++++++++++++++++-----------
>  src/android/camera_device.h          |  3 +--
>  src/libcamera/control_ids.yaml       | 21 ++++++++++++------
>  src/libcamera/pipeline/ipu3/ipu3.cpp |  9 ++++++++
>  4 files changed, 44 insertions(+), 22 deletions(-)
> 
> --
> 2.31.1
>
Jacopo Mondi April 22, 2021, 12:44 p.m. UTC | #2
Hi Paul,

On Thu, Apr 22, 2021 at 06:53:34PM +0900, paul.elder@ideasonboard.com wrote:
> Hi Jacopo,
>
> On Wed, Apr 07, 2021 at 06:06:41PM +0200, Jacopo Mondi wrote:
> > Hello,
> >    we have an issue with reporting sensor timestamps correctly to android.
> >
> > We currently use one of the buffers timestamps, which fails some CTS tests that
> > verify that the reported SENSOR_TIMESTAMP is in the frame duration range
> > reported as static metadata
> > Ie. android.hardware.camera2.cts.CaptureRequestTest#testNoiseReductionModeControl
> > when run in FULL mode.
> >
> > This series de-stages the SensorTimestamp control we had defined as draft
> > control and populates it in the IPU3 pipeline handler with the timestamp
> > of the CIO2 raw buffer. It then reports it to Android.
> >
> > Paul: I didn't manage to reproduce the error on you in-development CTS patches
> > so I can't say this series fixes the test. But I've manually collected the
> > reported duration and run them through a little script and verified they all
> > fall in the expected range. Could you test your failing test with this series
> > on top ?
>
> It practically fixes the issue, thanks! As mentioned before, there's
> just one single frame that's still too fast, but other than that I think
> it's fine.
>
> Tested-by: Paul Elder <paul.elder@ideasonboard.com>
>

Thanks, be aware that v3 is out :)

> >
> > Thanks
> >   j
> >
> > Jacopo Mondi (3):
> >   libcamera: controls: Destage 'SensorTimestamp'
> >   libcamera: ipu3: Report sensor timestamp
> >   android: camera_device: Use controls::SensorTimestamp
> >
> >  src/android/camera_device.cpp        | 33 +++++++++++++++++-----------
> >  src/android/camera_device.h          |  3 +--
> >  src/libcamera/control_ids.yaml       | 21 ++++++++++++------
> >  src/libcamera/pipeline/ipu3/ipu3.cpp |  9 ++++++++
> >  4 files changed, 44 insertions(+), 22 deletions(-)
> >
> > --
> > 2.31.1
> >