When the application is linked against libnvargus_socketclient.so instead of libnvargus.so, it is not possible to capture any images. The FrameConsumer::acquireFrame() method always returns an error STATUS_DISCONNECTED even for the first frame in any CaptureSession.
Before that, the application calls IEGLOutputStream::waitUntilConnected() successfully to ensure that the producer has actually connected, so this error seems unexpected.
The same code runs successfully when linking against libnvargus.so and not using nvargus-daemon.
The error exists at least in L4T releases R32.1 and R32.2.
you should provide the commands you’re working with.
please also share your environment setups and the failure messages for checking.
Our application does the following steps to set-up 4 parallel capture sessions, using the appropriate Argus APIs:
- selects a camera device
- creates a capture session for the selected camera device
- selects a suitable sensor mode
- creates stream settings for the capture session
- configures the streeam settings for I420 output with metadata enabled
- creates an EGLOutputStream output stream from the stream settings
- creates a capture request for CAPTURE_INTEND_VIDEO_RECORD
- configures the capture request with the selected sensor mode, frame rate and output stream
- creates a FrameConsumer from the output stream
- calls ICaptureSession::repeat() with our request
- calls IEGLOutputStream::waitUntilConnected()
- repeatedly calls IFrameConsumer::acquireFrame()
The code is based on the available examples and works when linking against libnvargus.so as already mentioned, but fails when linking against libnvargus_socketclient.so. The status returned by IFrameConsumer::acquireFrame() is 8, which maps to STATUS_DISCONNECTED.
you might still narrow down for the root-cause.
could you please reproduce the issue with default argus application,
please have a try with multi-session mode or launch four argus instances for verification.
I think we found the problem in our code.
Reason was that our code destroyed the CameraProvider object after setting up the captures, e.g. the following code statements were in the constructor of a class:
UniqueObj<CameraProvider> cp = CameraProvider::create();
ICameraProvider * icp = interface_cast<ICameraProvider>(cp.get());
The return from the constructor expects the cameras to be running but also implicitly destroys the UniqueObj object. Apparently this causes some cleanup in nvargus-dameon that breaks at least the EGLStreams. It is unknown to me why the code works when linking against libargus.so and is not using nvargus-daemon.
Please note that the Argus documentation does not mention that a reference to the object must be held for all the time that capture sessions are active. Usually the documentation talks about the life-cycles of the objects. Misleadingly the documentation indicates that most objects are reference counted and destroyed automatically when no longer needed, so the programmer doesn’t need to care and keep pointers in variables unless otherwise noted.