[libcamera-devel] How to activate AGC control in libcamera, or set the GAIN/EXPOSURE parameter by v4l2 command.

David Plowman david.plowman at raspberrypi.com
Tue Sep 29 09:03:26 CEST 2020


Hello again

Thanks to everyone for trying to sort this out! Let me try and explain
what I've understood so far.

1. AGC and AEC are not separate in the AGC/AEC algorithm that runs on
the Pi under libcamera.

2. When qcam saves a jpeg it does *not* record exposure time and
analogue gain in the exif data (I've checked this since I last
posted).

3. However, when you save a DNG file ("qcam -s role=viewfinder -s
role=stillraw") you should find both in the exif data. It doesn't
actually record analogue gain directly, I think it multiplies it by
100 and saves it as the "ISO".

4. I can't explain why you're not finding the saved jpeg files. The
default folder is I think ~/Pictures, but I don't know why you don't
see a file.

5. The log you've posted just above looks fine, though I think it is
stopping before you click to save the jpeg file?

6. Given that you are able to save DNG files, can you share the
exposure time and ISO values from the exif data for images captured in
both bright and dark conditions? This would tell us what the AGC is
doing.

7. Testing with the old Raspberry Pi "raspi-cam" apps doesn't really
show anything. It's a completely different stack and the control
algorithms are all different.

Thanks, and sorry that this all seems to be so confusing!

Best regards
David

On Tue, 29 Sep 2020 at 01:41, <tetsuya.nomura at soho-enterprise.com> wrote:
>
> Dear Laurent-san
>
> I don't see the error message.
>
> Here is the message log.
> ---
> pi at raspberrypi:~/libcamera/build/src/qcam $ qcam
> qt5ct: using qt5ct plugin
> [1:02:58.663793968] [1179]  INFO Camera camera_manager.cpp:287 libcamera v0.0.0+1805-f999ee85
> [1:02:58.837343652] [1179]  INFO Camera camera.cpp:797 configuring streams: (0) 800x600-BGR888
> [1:02:58.838269394] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 3280x2464 fmt BG10 Score: 2592.49 (best 2592.49)
> [1:02:58.838444061] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 1920x1080 fmt BG10 Score: 2066.67 (best 2066.67)
> [1:02:58.838541969] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 1640x1232 fmt BG10 Score: 1874.49 (best 1874.49)
> [1:02:58.838635765] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 640x480 fmt BG10 Score: 2060 (best 1874.49)
> [1:02:58.838741525] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 3280x2464 fmt BA81 Score: 3592.49 (best 1874.49)
> [1:02:58.838833525] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 1920x1080 fmt BA81 Score: 3066.67 (best 1874.49)
> [1:02:58.838924155] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 1640x1232 fmt BA81 Score: 2874.49 (best 1874.49)
> [1:02:58.839013414] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 640x480 fmt BA81 Score: 3060 (best 1874.49)
> [1:02:58.839107303] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 3280x2464 fmt pBAA Score: 2092.49 (best 1874.49)
> [1:02:58.839198377] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 1920x1080 fmt pBAA Score: 1566.67 (best 1566.67)
> [1:02:58.839310914] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 1640x1232 fmt pBAA Score: 1374.49 (best 1374.49)
> [1:02:58.839454229] [1181]  INFO RPI raspberrypi.cpp:116 Mode: 640x480 fmt pBAA Score: 1560 (best 1374.49)
> [1:02:58.839612156] [1181]  INFO RPI raspberrypi.cpp:496 Sensor: /base/soc/i2c0mux/i2c at 1/imx219 at 10 - Selected mode: 1640x1232-pBAA
> [1:02:58.957246497] [1181]  INFO RPI_S_W staggered_ctrl.cpp:36 Init ctrl 0x00980911 with delay 2
> [1:02:58.957479609] [1181]  INFO RPI_S_W staggered_ctrl.cpp:36 Init ctrl 0x009e0903 with delay 1
> Zero-copy enabled
> [1:02:58.993835570] [1181]  INFO RPISTREAM rpi_stream.cpp:120 No buffers available for ISP Output0
> [1:02:58.993962033] [1181]  INFO RPISTREAM rpi_stream.cpp:120 No buffers available for ISP Output0
> [1:02:59.100047413] [1181]  INFO RPI raspberrypi.cpp:1397 Dropping frame at the request of the IPA (5 left)
> [1:02:59.147212816] [1181]  INFO RPI raspberrypi.cpp:1397 Dropping frame at the request of the IPA (4 left)
> [1:02:59.164827176] [1181]  INFO RPI raspberrypi.cpp:1397 Dropping frame at the request of the IPA (3 left)
> [1:02:59.199072801] [1181]  INFO RPI raspberrypi.cpp:1397 Dropping frame at the request of the IPA (2 left)
> libpng warning: iCCP: known incorrect sRGB profile
> [1:02:59.229348050] [1181]  INFO RPI raspberrypi.cpp:1397 Dropping frame at the request of the IPA (1 left)
> [1:02:59.262649340] [1181]  INFO RPI raspberrypi.cpp:1397 Dropping frame at the request of the IPA (0 left)
> seq: 000006 bytesused: 1440000 timestamp: 3779256059000 fps: 0.00
> seq: 000007 bytesused: 1440000 timestamp: 3779289386000 fps: 30.01
> seq: 000008 bytesused: 1440000 timestamp: 3779322716000 fps: 30.00
> seq: 000009 bytesused: 1440000 timestamp: 3779356040000 fps: 30.01
> seq: 000010 bytesused: 1440000 timestamp: 3779389368000 fps: 30.00
> seq: 000011 bytesused: 1440000 timestamp: 3779422699000 fps: 30.00
>
> ---
>
> Best Regards,
>
> NOMURA
>
> -----Original Message-----
> From: Laurent Pinchart <laurent.pinchart at ideasonboard.com>
> Sent: Tuesday, September 29, 2020 9:20 AM
> To: tetsuya.nomura at soho-enterprise.com
> Cc: 'David Plowman' <david.plowman at raspberrypi.com>; 'Kieran Bingham' <kieran.bingham at ideasonboard.com>; libcamera-devel at lists.libcamera.org
> Subject: Re: [libcamera-devel] How to activate AGC control in libcamera, or set the GAIN/EXPOSURE parameter by v4l2 command.
>
> Hello Nomura-san,
>
> On Tue, Sep 29, 2020 at 08:55:28AM +0900, tetsuya.nomura at soho-enterprise.com wrote:
> > Dear Laurent-san
> >
> > Thank you for your advice.
> >
> > I've tried the "Save As" button, specify the file name, and saved, but I cannot find it there.
>
> I'm surprised. If you run qcam in a console, does it print an error message when it fails to save ?
>
> > On the other hand, I could store the raw data starting with " qcam -s role=viewfinder -s role=stillraw".
>
> --
> Regards,
>
> Laurent Pinchart
>


More information about the libcamera-devel mailing list