Problem with exposure setting on camera


Our system setup consists of a J140 Auvidea daughter board and 3x IMX377 sensors connected to separate I2C buses and CSI lanes. For our program we need to set constant exposure values to all 3 cameras, acquire images and based on our custom algorithm determine if the exposure value needs to be changed. This is performed in a loop.

As a first step we are trying to profile the IMX377 camera sensor based on constant lighting conditions and different exposure values. To do that we are using the Argus library based on the argus_camera app and userAutoExposure samples source codes.

*Deactivate auto control settings, set specific gain and isp value, lock AE, AWB
Trying to set constant exposure values to the camera we follow the steps below.

/*disable auto control settings*/
float gain = 0, isp = 1;
Range< float > range(gain, gain+0.1);
Range< float > ispRange(isp, isp+0.1);

unsigned long int exposure = 83000;
while(exposure<66600000) {
    Argus::Range< uint64_t> exposureRange(exposure,exposure);

    ISourceSettings* iSourceSettings = interface_cast<ISourceSettings>(iRequest->getSourceSettings());

    Argus::UniqueObj<EGLStream::Frame> frame(iFrameConsumer->acquireFrame());

    EGLStream::IFrame *iFrame = Argus::interface_cast<EGLStream::IFrame>(frame);
    if(!iFrame) {
        cout<<"Failed to get IFrame interface\n";
        return -1;

    EGLStream::Image *image = iFrame->getImage();
    if(!image) {
        cout<<"Failed to get Image from iFrame->getImage()\n";
        return -1;

    EGLStream::IImageJPEG *iImageJPEG = Argus::interface_cast<EGLStream::IImageJPEG>(image);
    if(!iImageJPEG) {
        cout<<"Failed to get ImageJPEG Interface\n";
        return -1;

    status = iImageJPEG->writeJPEG(filename.c_str());
    if(status!=Argus::STATUS_OK) {
        cout<<"Failed to write JPEG\n";
        return -1;

    exposure += 1000;

The problem arises when the exposure is quite high and causes several pixels to be burnt. From that point on we get several images that appear to have very high exposure (2nd image) and after 5-6 frame acquisitions the acquired image seems to be with the correct set exposure (3rd image). You can better understand the issue by inspecting the images below and the exposure that was set for each.

Exposure = 33258500

Exposure = 33325000

Similar images appear for exposure values ranging from 33325000 to 34721900

Exposure = 34722000

Do you see a fault in the steps or way we handle setting the exposure and acquiring the image ? Is there something else that we are missing ?

Thank you in advance for your help.