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

Laurent Pinchart laurent.pinchart at ideasonboard.com
Mon Nov 23 11:19:52 CET 2020


Hi David,

On Sun, Nov 22, 2020 at 03:10:59PM +0000, David Plowman wrote:
> Hello Nomura-san
> 
> Yes, I have had some similar errors in recent weeks, I'm not too sure
> why. There seems to be a new Python package required ("ply") and
> sometimes I've found myself having to delete the build directory under
> libcamera entirely and start over. Anyway, I've double-checked that
> the following instructions work, starting from a clean Raspberry Pi OS
> installation.
> 
> First update the Pi's software as usual:
> 
> sudo apt update
> sudo apt upgrade
> sudo rpi-update
> 
> and then reboot it. Next install all the prerequisites for libcamera:
> 
> sudo apt install libboost-dev
> sudo apt install libgnutls28-dev openssl libtiff5-dev
> sudo apt install meson
> sudo apt install qtbase5-dev libqt5core5a libqt5gui5 libqt5widgets5
> sudo pip3 install pyyaml ply

You can also install the native python3-yaml and python3-ply packages.
In the not too distant future we'll also require python3-jinja2.

> Note the new "ply" Python package. Finally download and build libcamera:
> 
> git clone git://linuxtv.org/libcamera.git
> cd libcamera
> meson build
> ninja -C build
> 
> That all seemed to work for me. You may have read that we're (very
> soon, I hope!) introducing libcamera-based versions of our
> raspistill/raspivid applications and once those are available I'll be
> doing an update to all our related documentation.
> 
> On Sun, 22 Nov 2020 at 08:39, <tetsuya.nomura at soho-enterprise.com> wrote:
> >
> > Dear David-san.
> >
> > I retried the updating according to the instruction shown below URL.
> > https://www.raspberrypi.org/documentation/linux/software/libcamera/README.md
> >
> > And when executing "meson build", the error occurred as attached log-file.
> >
> > We tried to recover the missing files but not succeeded in.
> > (I did under clean-installed environment but failed.)
> >
> > It would be great if you help us the problem above.
> >
> > Thank you very much for your help in advance.
> >
> > Best Regards,
> >
> > NOMURA
> >
> > ================================
> >   Tetsuya NOMURA
> > ================================
> >  Soho Enterprise Ltd.
> >  4-11-26 Gent BLDG 2F, Asahi-cho, Atsugi-shi,
> >  Kanagawa, Japan  243-0014
> >  URL: https://soho-enterprise.com
> >  Mail: tetsuya.nomura at soho-enterprise.com
> >  Phone: +81-90-1839-1135
> > ================================
> >
> > -----Original Message-----
> > From: David Plowman <david.plowman at raspberrypi.com>
> > Sent: Friday, November 20, 2020 6:48 PM
> > To: tetsuya.nomura at soho-enterprise.com
> > Cc: Naushir Patuck <naush at raspberrypi.com>; libcamera devel <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.
> >
> > Dear Nomura-san
> >
> > Thanks for your message. Obviously if the build problems persist please post details of the error and we'll try to help.
> >
> > As regards the image orientation, the CameraConfiguration class has a field named "transform" which you can set before validating/configuring it, for example:
> >
> > cameraConfig.transform = Transform::VFlip;
> >
> > Please refer to libcamera/include/libcamera/transform.h for all the possible values, but note that the Pi implementation does not support transforms that involve a transpose operation (so only Identity, HFlip, VFlip and HVFlip are allowed).
> >
> > I don't believe qcam has any way to set this from the command line, so you'd have to edit source code. At Raspberry Pi we're still intending to release libcamera-based versions of raspistill/raspicam which will have command line options to configure the transform, hopefully this won't be too much longer now!
> >
> > Best regards
> > David
> >
> > On Fri, 20 Nov 2020 at 07:04, <tetsuya.nomura at soho-enterprise.com> wrote:
> > >
> > > Dear David-san
> > >
> > >
> > >
> > > We have tried rpi-update.
> > >
> > > We had the build error then.
> > >
> > > Do you have any idea for this problem?
> > >
> > > Anyway we’ll try clean install.
> > >
> > >
> > >
> > > By the way, we’d like to change the image orientation.
> > >
> > > I think v4l2 command support vertical/horizontal flip by changing the register of 0x172[1:0] .
> > >
> > > How can we apply this function when using qcam?
> > >
> > >
> > >
> > > I appreciate your kind advice in advance.
> > >
> > >
> > >
> > > Best Regards,
> > >
> > >
> > >
> > > NOMURA
> > >
> > >
> > >
> > >
> > >
> > >
> > >
> > > From: tetsuya.nomura at soho-enterprise.com
> > > <tetsuya.nomura at soho-enterprise.com>
> > > Sent: Sunday, November 8, 2020 8:55 AM
> > > To: 'David Plowman' <david.plowman at raspberrypi.com>
> > > Cc: 'Naushir Patuck' <naush at raspberrypi.com>; 'libcamera devel'
> > > <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.
> > >
> > >
> > >
> > > Dear David-san
> > >
> > >
> > >
> > > Thank you for the notification of fixing memory leak issue.
> > >
> > > I’ll try it soon.
> > >
> > >
> > >
> > > Best Regards,
> > >
> > >
> > >
> > > NOMURA
> > >
> > >
> > >
> > > From: David Plowman <david.plowman at raspberrypi.com>
> > > Sent: Saturday, November 7, 2020 12:23 AM
> > > To: tetsuya.nomura at soho-enterprise.com
> > > Cc: Naushir Patuck <naush at raspberrypi.com>; libcamera devel
> > > <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.
> > >
> > >
> > >
> > > Hi everyone
> > >
> > >
> > >
> > > This is just to let you know that doing "sudo rpi-update" should now update your kernel with a fix for this memory leak.
> > >
> > >
> > >
> > > Best regards
> > >
> > > David
> > >
> > >
> > >
> > > On Sat, 10 Oct 2020 at 10:16, David Plowman <david.plowman at raspberrypi.com> wrote:
> > >
> > > Hello Nomura-san
> > >
> > > Thanks for sending that log. At least it seems to be showing the same
> > > thing that Naush saw, so hopefully there is only a single problem.
> > >
> > > You had previously mentioned the following two git commits:
> > >
> > > libcamera: c3548a333f86d31213ca9f2ccc3faf743b246743
> > > rpi-update: f794477c7c48061a720d6b9331d27f8d0300009c
> > >
> > > Can you perhaps confirm whether this version of the software, with the
> > > above commits at the top of the tree, did show the memory problem or
> > > did not show it?
> > >
> > > Best regards
> > > David
> > >
> > > On Sat, 10 Oct 2020 at 02:16, <tetsuya.nomura at soho-enterprise.com> wrote:
> > > >
> > > > Dear David-san and Naush-san
> > > >
> > > > We have another dmesg log as attached.
> > > >
> > > > Best Regards,
> > > >
> > > > NOMURA
> > > > -----Original Message-----
> > > > From: tetsuya.nomura at soho-enterprise.com
> > > > <tetsuya.nomura at soho-enterprise.com>
> > > > Sent: Saturday, October 10, 2020 8:20 AM
> > > > To: 'Naushir Patuck' <naush at raspberrypi.com>; 'David Plowman'
> > > > <david.plowman at raspberrypi.com>
> > > > Cc: 'libcamera-devel at lists.libcamera.org'
> > > > <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.
> > > >
> > > > Dear David-san and Naush-san
> > > >
> > > > And after login again and run the qcam, it stopped after a few minutes and see the login window.
> > > > But this time I could not login.(no dmseg was got after this
> > > > symptom)
> > > >
> > > > While second trial of qcam the response speed for the click became very slow.
> > > > Image display speed kept 30.0fps.
> > > >
> > > > For an additional report.
> > > >
> > > > Best Regards,
> > > >
> > > > NOMURA
> > > > -----Original Message-----
> > > > From: tetsuya.nomura at soho-enterprise.com
> > > > <tetsuya.nomura at soho-enterprise.com>
> > > > Sent: Saturday, October 10, 2020 8:08 AM
> > > > To: 'Naushir Patuck' <naush at raspberrypi.com>; 'David Plowman'
> > > > <david.plowman at raspberrypi.com>
> > > > Cc: 'libcamera-devel at lists.libcamera.org'
> > > > <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.
> > > >
> > > > Dear David-san Naush-san
> > > >
> > > > I got reproduce the symptom and got the dmseg as attached.
> > > >
> > > > It would be great if it will be your help to solve the issue.
> > > >
> > > > Best Regards,
> > > >
> > > > NOMURA
> > > >
> > > > -----Original Message-----
> > > > From: Naushir Patuck <naush at raspberrypi.com>
> > > > Sent: Thursday, October 8, 2020 5:19 PM
> > > > To: tetsuya.nomura at soho-enterprise.com
> > > > Cc: David Plowman <david.plowman at raspberrypi.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.
> > > >
> > > > Hi all,
> > > >
> > > > I did try a long running test, and interestingly, mine did also fail at around the 15hour mark (approx 1540000 frames).  My qcam process (running under gdb) was just terminated at that point.  However, no reboot occurred.  Looking at the dmesg logs, it seems that the Out of Memory killer terminated the task.  This suggests that there is maybe a memory leak lurking somewhere in either libcamera core or the Raspberry Pi ipa/pipeline handler.
> > > >
> > > > Nomura-san, could you send us the output of dmesg when you run into this failure again, just to check if we are seeing the same thing?
> > > >
> > > > Thanks,
> > > > Naush
> > > >
> > > > On Thu, 8 Oct 2020 at 07:48, <tetsuya.nomura at soho-enterprise.com> wrote:
> > > > >
> > > > > Dear David-san
> > > > >
> > > > > We took a log to catch when (how long time after application start) reboot occurs.
> > > > > The logs says around 1100minuite, maybe the raspi got rebooted, no other log.
> > > > >
> > > > > And the older version and the combination, this phenomena never happened.
> > > > >
> > > > > libcamera: c3548a333f86d31213ca9f2ccc3faf743b246743
> > > > > rpi-update: f794477c7c48061a720d6b9331d27f8d0300009c
> > > > > (We are using the latest one for both.)
> > > > >
> > > > > Best Regards,
> > > > >
> > > > > NOMURA
> > > > > -----Original Message-----
> > > > > From: David Plowman <david.plowman at raspberrypi.com>
> > > > > Sent: Wednesday, October 7, 2020 7:37 PM
> > > > > To: tetsuya.nomura at soho-enterprise.com
> > > > > Cc: Laurent Pinchart <laurent.pinchart at ideasonboard.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
> > > > >
> > > > > Thanks for your message.
> > > > >
> > > > > So we're not aware of any problems like the one you report but we'll see if we can reproduce it - obviously it will take a little while. Do you believe the Pi crashed completely and rebooted? If so, might we be able to get any system logs that could give us a clue as to what happened?
> > > > >
> > > > > Thanks and best regards
> > > > > David

-- 
Regards,

Laurent Pinchart


More information about the libcamera-devel mailing list