[libcamera-devel,v3,0/4] libcamera: rkisp1: Fix generateConfiguration
mbox series

Message ID 20230307114804.42291-1-jacopo.mondi@ideasonboard.com
Headers show
Series
  • libcamera: rkisp1: Fix generateConfiguration
Related show

Message

Jacopo Mondi March 7, 2023, 11:48 a.m. UTC
The series started with bug 180:
https://bugs.libcamera.org/show_bug.cgi?id=180

which reports how using the self-path for generating a configuration
for a single stream results in only StreamFormats up to 1920x1920
to be produced.

I have then noticed how the current implementation of
RkISP1Path::generateConfiguration() could produce unusual sizes, such as
1920x1432 in case the sensor's resolution is larger than the maximum supported
1920x1920 output.

Finally, if StillCapture is requested, make sure it is assigned to the main
path in RkISP1::generateConfiguration() to make sure it can produce images
in full resolution.

Tested on Pinephone Pro with imx258 camera.

Updated branch jmondi/pinephonepro-af on
https://git.libcamera.org/libcamera/jmondi/libcamera.git

v2->v3:
- Add review tags
- Improve 3/4 as suggested by Paul

v1->v2:
- Enumerate StreamFormats for all the available size and not limited to the
  current output size. This allows to enumerate higher resolutions even if the
  desired role has a smaller resolution.

  In example:
  gst-launch-1.0 libcamerasrc camera-name="/base/i2c\@ff110000/camera\@1a" ! 'video/x-raw,format=NV12,width=4208,height=3120' ! glimagesink

  which used to fail now works correctly

- Enumerate all the RAW sizes the sensor can produce but only if the requested
  role is StreamRole::Raw


Jacopo Mondi (4):
  libcamera: rkisp1: Generate config using main path
  libcamera: rkisp1: Assign sizes to roles
  libcamera: rkisp1: Reserve main path for StillCapture
  libcamera: rkisp1: Fix enumeration of RAW formats

 src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 30 ++++++++++++-------
 src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 29 +++++++++++++++---
 src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  1 +
 3 files changed, 46 insertions(+), 14 deletions(-)

--
2.39.0

Comments

Daniel Semkowicz March 17, 2023, 7:09 a.m. UTC | #1
On Tue, Mar 7, 2023 at 12:48 PM Jacopo Mondi via libcamera-devel
<libcamera-devel@lists.libcamera.org> wrote:
>
> The series started with bug 180:
> https://bugs.libcamera.org/show_bug.cgi?id=180
>
> which reports how using the self-path for generating a configuration
> for a single stream results in only StreamFormats up to 1920x1920
> to be produced.
>
> I have then noticed how the current implementation of
> RkISP1Path::generateConfiguration() could produce unusual sizes, such as
> 1920x1432 in case the sensor's resolution is larger than the maximum supported
> 1920x1920 output.
>
> Finally, if StillCapture is requested, make sure it is assigned to the main
> path in RkISP1::generateConfiguration() to make sure it can produce images
> in full resolution.
>
> Tested on Pinephone Pro with imx258 camera.
>
> Updated branch jmondi/pinephonepro-af on
> https://git.libcamera.org/libcamera/jmondi/libcamera.git
>
> v2->v3:
> - Add review tags
> - Improve 3/4 as suggested by Paul
>
> v1->v2:
> - Enumerate StreamFormats for all the available size and not limited to the
>   current output size. This allows to enumerate higher resolutions even if the
>   desired role has a smaller resolution.
>
>   In example:
>   gst-launch-1.0 libcamerasrc camera-name="/base/i2c\@ff110000/camera\@1a" ! 'video/x-raw,format=NV12,width=4208,height=3120' ! glimagesink
>
>   which used to fail now works correctly
>
> - Enumerate all the RAW sizes the sensor can produce but only if the requested
>   role is StreamRole::Raw
>
>
> Jacopo Mondi (4):
>   libcamera: rkisp1: Generate config using main path
>   libcamera: rkisp1: Assign sizes to roles
>   libcamera: rkisp1: Reserve main path for StillCapture
>   libcamera: rkisp1: Fix enumeration of RAW formats
>
>  src/libcamera/pipeline/rkisp1/rkisp1.cpp      | 30 ++++++++++++-------
>  src/libcamera/pipeline/rkisp1/rkisp1_path.cpp | 29 +++++++++++++++---
>  src/libcamera/pipeline/rkisp1/rkisp1_path.h   |  1 +
>  3 files changed, 46 insertions(+), 14 deletions(-)
>
> --
> 2.39.0
>

Hi Jacopo,

Thank you very much for this fix!

I tested your patches with RK3399 + OV5675 and it worked correctly.
I was able to capture streams with the full sensor resolution.

Best regards
Daniel Semkowicz