New libargus bugs on L4T 32.3.1

Hi there,

I just wanted to report that I am seeing problems setting the gain range and frame duration range via libargus on latest L4T 32.3.1. I have verified this by replacing libnvargus.so, libnvargus_socketclient.so, and libnvargus_socketserver.so libraries with the previous versions from L4T 32.2.3.

Here is the relevant code (part of a loop setting up a multi-sensor array):

min_gain = 4.0;
max_gain = 4.0;
Range<float> gain_range(min_gain, max_gain);
ARGUS_PRODUCER_PRINT("Setting camera %d gain range to %.2f,%.2f\n",
        		i, gain_range.min(), gain_range.max());
if(iSourceSettings->setGainRange(gain_range) != STATUS_OK)
        ORIGINATE_ERROR("Failed to set gain range for camera %d", i);
gain_range = iSourceSettings->getGainRange();
ARGUS_PRODUCER_PRINT("Camera %d gain range set to %.2f,%.2f\n",
        		i, gain_range.min(), gain_range.max());

Range<uint64_t> frame_duration_range(33333334,33333334);
ARGUS_PRODUCER_PRINT("Setting camera %d frame duration range to %ld,%ld\n",
        		i, frame_duration_range.min(), frame_duration_range.max());
if(iSourceSettings->setFrameDurationRange(frame_duration_range) != STATUS_OK)
        ORIGINATE_ERROR("Failed to set frame duration range for camera %d", i);

Here is the output with latest libraries:

ARGUS PRODUCER: Setting camera 0 gain range to 4.00,4.00
ARGUS PRODUCER: Camera 0 gain range set to 0.00,68306424311101110878208.00
ARGUS PRODUCER: Setting camera 0 frame duration range to 33333334,33333334
ARGUS PRODUCER: Camera 0 frame duration range set to 3893494768,549354340640

Here is the output when I replace the argus libraries with the ones from 32.2.3 and restart nvargus-daemon:

ARGUS PRODUCER: Setting camera 0 gain range to 4.00,4.00
ARGUS PRODUCER: Camera 0 gain range set to 4.00,4.00
ARGUS PRODUCER: Setting camera 0 frame duration range to 33333334,33333334
ARGUS PRODUCER: Camera 0 frame duration range set to 33333334,33333334

My camera control code is broken as a result of new libraries, so I am staying with previous version of libraries for the time being.

Edit: This code is running on AGX Xavier

I add below code to the userAutoExposure sample code I can set the gain range without problem on r32.3.1
Did you rebuild the APP on r32.3.1 again?

USER AUTO EXPOSURE SAMPLE: Sensor Exposure Range min 34000, max 550385000
USER AUTO EXPOSURE SAMPLE: Sensor Analog Gain range min 1.000000, max 16.000000
USER AUTO EXPOSURE SAMPLE: Setting camera gain range to 4.00,4.00
USER AUTO EXPOSURE SAMPLE: Camera gain range set to 4.00,4.00
USER AUTO EXPOSURE SAMPLE: Exposure target range is from 0.170000 to 0.190000
PREVIEW CONSUMER: Producer(s) connected; continuing.

diff --git a/public/samples/userAutoExposure/main.cpp b/public/samples/userAutoExposure/main.cpp
index dede616..c647d25 100644
--- a/public/samples/userAutoExposure/main.cpp
+++ b/public/samples/userAutoExposure/main.cpp
@@ -206,6 +206,15 @@ static bool execute(const UserAutoExposureSampleOptions& options)
     EXIT_IF_NOT_OK(iSourceSettings->setGainRange(Range<float>(sensorModeAnalogGainRange.min())),
         "Unable to set the Source Settings Gain Range");
 
+Range<float> gain_range(4.0, 4.0);
+USER_AUTO_EXPOSURE_PRINT("Setting camera gain range to %.2f,%.2f\n",
+                       gain_range.min(), gain_range.max());
+if(iSourceSettings->setGainRange(gain_range) != STATUS_OK)
+        ORIGINATE_ERROR("Failed to set gain range for camera");
+gain_range = iSourceSettings->getGainRange();
+USER_AUTO_EXPOSURE_PRINT("Camera gain range set to %.2f,%.2f\n",
+                       gain_range.min(), gain_range.max());
+

Hi ShaneCCC, thanks for the reply. I cross-compile the app in Nsight using the “CUDA Toolkit 10.0” toolchain. Have there been any changes from 32.2.1 to 32.3.1 that I should be aware of in terms of toolchains?

I think should re-compile for each release should be safe to avoid the problem.

I am recompiling constantly as the app is under active development. I’m using the CUDA Toolkit 10.0 toolchain, compiling with 32.3.1 headers and linking to 32.3.1 libraries. Is there something else I am missing?

Please just try build the sample by cmake as the README.TXT to verify.

Hi ShaneCCC,

Please excuse the delay, other priorities took precedence. I compiled the sample as you instructed, and am seeing the same issue:

USER AUTO EXPOSURE SAMPLE: Sensor Exposure Range min 10000, max 33260000
USER AUTO EXPOSURE SAMPLE: Sensor Analog Gain range min 1.000000, max 354.000000
USER AUTO EXPOSURE SAMPLE: Setting camera gain range to 4.00,4.00
USER AUTO EXPOSURE SAMPLE: Camera gain range set to 0.00,210358112577291722686464.00
USER AUTO EXPOSURE SAMPLE: Exposure target range is from 0.170000 to 0.190000
PREVIEW CONSUMER: Producer(s) connected; continuing.

So this appears to confirm it is not a problem with my cross-compile environment. Please let me know your thoughts at your earliest convenience.

Could you attached your binary here. You may need rename as .txt or .log

Please see attached. Thank you.argus_userautoexposure_bin.log (927.7 KB)

Wow, I run yours get the error too.
Not sure if you get the sample code from the r32.3.1, attached it here for you to try.

argus.zip (3.3 MB)

Great, this code works, thank you. I assume it is part of the latest L4T Multimedia API source code for r32.3.1? It is not listed on the Jetson Download Center (the latest is r32.2.3).

So, there must exist somewhere the latest tegra_multimedia_api source tree as Tegra_Multimedia_API_R32.3.1_aarch64.tbz2? Where can I find it?

You need use sdkmanager to download it from now on.