How to fix latency when setting exposure using argus framework?

Hi,

Currently working with userAutoExposure sample.

Upon running this sample I see that when setting an exposure it takes almost 5 frames for the exposure to reflect on the acquired frame.

  1. I tried to fix this by using removing repeat call and using capture call. After implementing this I see that the exposure set is being reflected in the next frame acquired. But the time taken for acquiring frame is more.

  2. Also I tried by cancelling the request calls and then calling the repeat api. The exposure set is being reflected in the next frame acquired. But in here as well the time taken for acquiring frame is more.

I guess that almost 5 frames are queued in ISP before setting the exposure value. Is there any way to reduce the queue size?

How do I set exposure and have it reflected in my next frame?

Thanks

How do you verify this case?
Detail reproduce process will help us to find out the problem.

Hi,

Run the sample in tegra_multimedia_api/argus/samples/userAutoExposure/

Debug Prints acquired after running application,
"
PREVIEW CONSUMER: Acquired frame 13. Rendering.
USER AUTO EXPOSURE SAMPLE: Frame metadata ExposureTime 449999, Analog Gain 31.622776
USER AUTO EXPOSURE SAMPLE: Exposure level at 0.145, increasing Exposure Time to 560431
PREVIEW CONSUMER: Acquired frame 14. Rendering.
USER AUTO EXPOSURE SAMPLE: Frame metadata ExposureTime 449999, Analog Gain 31.622776
USER AUTO EXPOSURE SAMPLE: Exposure level at 0.145, increasing Exposure Time to 560431
PREVIEW CONSUMER: Acquired frame 15. Rendering.
USER AUTO EXPOSURE SAMPLE: Frame metadata ExposureTime 449999, Analog Gain 31.622776
USER AUTO EXPOSURE SAMPLE: Exposure level at 0.145, increasing Exposure Time to 560431
PREVIEW CONSUMER: Acquired frame 16. Rendering.
USER AUTO EXPOSURE SAMPLE: Frame metadata ExposureTime 449999, Analog Gain 31.622776
USER AUTO EXPOSURE SAMPLE: Exposure level at 0.145, increasing Exposure Time to 560431
PREVIEW CONSUMER: Acquired frame 17. Rendering.
USER AUTO EXPOSURE SAMPLE: Frame metadata ExposureTime 449999, Analog Gain 31.622776
USER AUTO EXPOSURE SAMPLE: Exposure level at 0.145, increasing Exposure Time to 560431
PREVIEW CONSUMER: Acquired frame 18. Rendering.
USER AUTO EXPOSURE SAMPLE: Frame metadata ExposureTime 449999, Analog Gain 31.622776
USER AUTO EXPOSURE SAMPLE: Exposure level at 0.145, increasing Exposure Time to 560431
PREVIEW CONSUMER: Acquired frame 19. Rendering.
USER AUTO EXPOSURE SAMPLE: Frame metadata ExposureTime 560430, Analog Gain 31.622776
USER AUTO EXPOSURE SAMPLE: Exposure level at 0.176, currently within target range
PREVIEW CONSUMER: Acquired frame 20. Rendering.
USER AUTO EXPOSURE SAMPLE: Frame metadata ExposureTime 560430, Analog Gain 31.622776
USER AUTO EXPOSURE SAMPLE: Exposure level at 0.176, currently within target range
"

In the print statements from the application you could see that in acquired frame 13 there is a increase in exposure settings to 560431 from current exposure 449999.

Only in acquired frame 19 this exposure (560431) is reflected in frame metadata.

I expect the exposure(560431) to be reflected in the frame 14.

Thanks

@gkk.tricky
Just review and confirm 5 frames delay is what we can reach now.

@ShaneCCC
I am sorry i am unable to understand your previous comment.

Are you trying to convey that you have reviewed and confirmed 5 frames delay is what you can reach now?

Is this Argus limitation?

Thanks

Hi gkk
Yes, it’s argus limitation currently and we may have long term plan to improve it.

There’s a way can try but the best improve to 3 frames. And could have frame drop side effect.

first repeat() call in the app from this:

    EXIT_IF_NOT_OK(iSession->repeat(request.get()), "Unable to submit repeat() request");

To this:

    const uint32_t CAPTURE_QUEUE_DEPTH = 3;
    for (uint32_t i = 0; i < CAPTURE_QUEUE_DEPTH; i++)
    {
        iSession->capture(request.get());
    }

And the second repeat() call from this:

    iSession->repeat(request.get());

To this:

    iSession->capture(request.get());

Hi,

We have tried the above implementation but with CAPTURE_QUEUE_DEPTH = 1.

By using this we are able to have our exposure set reflected in the next frame. But it is taking more time to acquire frames.

Is this due to the frame drop you have mentioned before?

Thanks

Yes, that’s the trade off. You have to tune the CAPTURE_QUEUE_DEPTH to optimize it.