I’m hitting an issue with setExposureTimeRange, and wanted to know if it’s expected behavior or not. This is with L4T 32.1. The problem is that my calls to setExposureTimeRange before starting any capture requests don’t seem to have any effect. I have to specify the settings a second time and restart the capture requests in order for the image to be affected.
In terms of code, the following sequence does not work… i.e. regardless of the exposure and gain values I specify, the resulting images always look the same. However, the metadata for the images reports the values that I specified, which is confusing.
captureStream = UniqueObj<OutputStream>(iCaptureSession->createOutputStream(streamSettings.get()));
request = UniqueObj<Request>(iCaptureSession->createRequest());
iRequest = interface_cast<IRequest>(request);
iRequest->enableOutputStream(captureStream.get());
iSourceSettings = interface_cast<ISourceSettings>(iRequest->getSourceSettings());
iAutoControlSettings = interface_cast<IAutoControlSettings>(iRequest->getAutoControlSettings());
iSourceSettings->setExposureTimeRange(exp_range);
iSourceSettings->setGainRange(gain_range);
iAutoControlSettings->setIspDigitalGainRange(ispgain_range);
frameConsumer = UniqueObj<FrameConsumer>(FrameConsumer::create(captureStream.get()));
iFrameConsumer = interface_cast<IFrameConsumer>(frameConsumer);
iCaptureSession->repeat(request.get());
This sequence does work… i.e. after the second repeat call the images look as expected.
captureStream = UniqueObj<OutputStream>(iCaptureSession->createOutputStream(streamSettings.get()));
request = UniqueObj<Request>(iCaptureSession->createRequest());
iRequest = interface_cast<IRequest>(request);
iRequest->enableOutputStream(captureStream.get());
iSourceSettings = interface_cast<ISourceSettings>(iRequest->getSourceSettings());
iAutoControlSettings = interface_cast<IAutoControlSettings>(iRequest->getAutoControlSettings());
frameConsumer = UniqueObj<FrameConsumer>(FrameConsumer::create(captureStream.get()));
iFrameConsumer = interface_cast<IFrameConsumer>(frameConsumer);
iCaptureSession->repeat(request.get());
usleep(20000); // without this the settings below don't reliably take effect
iSourceSettings->setExposureTimeRange(exp_range);
iSourceSettings->setGainRange(gain_range);
iAutoControlSettings->setIspDigitalGainRange(ispgain_range);
iCaptureSession->stopRepeat();
iCaptureSession->waitForIdle();
iCaptureSession->repeat(request.get());
In the first case am I doing anything in an incorrect order? Is this expected behavior?