• Hardware Platform (Jetson / GPU): Jetson Orin Nano
• JetPack Version: JetPack5 (r35.5), JetPack 6.1 (r36.4.0)
• Issue Type( questions, new requirements, bugs): questions
nvargus entry point (Argus::CameraProvider) object to enumerate cameras seems to behave as a singleton, but this behavior does not appear to be documented.
Both in multi-process (with daemon) and single-process (without daemon) flavors of the library, an application cannot create more than one provider without encountering issues.
In particular:
Multi-process flavor
If using nvargus_socketclient library, creating a second provider results in the following errors:
(NvCameraUtils) Error InvalidState: Mutex already initialized (in Mutex.cpp, function initialize(), line 41)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/ClientSocketManager.cpp, function open(), line 54)
(Argus) Error InvalidState: (propagating from src/rpc/socket/client/SocketClientDispatch.cpp, function openSocketConnection(), line 263)
(Argus) Error InvalidState: Cannot create camera provider (in src/rpc/socket/client/SocketClientDispatch.cpp, function createCameraProvider(), line 107)
Single-process flavor
If using nvargus library, creating a second provider succeeds, but destroying it causes the underlying instance of any other provider to be destroyed as well, resulting in dangling pointers and segmentation fault.
As a consequence the Argus::CameraProvider must be used as a singleton.
This gist illustrates minimal repro case with build instructions.