Are there any examples on how to build a deepstream app that gracefully handle when camera’s disappear ?
Or any hints on how to neatly cleanup a pipeline on error, so the application stays running and it can re-try again ?
I’m handling the GST_MESSAGE_ERROR by setting the play state to GST_STATE_NULL and removing the callback handler for that pipeline,
gst_element_set_state( sd->pipeline, GST_STATE_NULL );
gst_bus_remove_signal_watch (sd->bus);
however it looks like the v4l2src doesn’t get released, as when i try to startup a new pipeline once the camera is available again, it gives me a WARNING: CameraProvider was not destroyed before client connection terminated , which makes me believe i didn’t close the previous pipeline/plugin correctly .
any hints/tips/examples welcome !!
Jul 22 14:51:59 yoda-desktop kernel: [21004.935060] usb 1-2.1: new high-speed USB device number 47 using tegra-xusb
Jul 22 14:51:59 yoda-desktop kernel: [21005.178399] usb 1-2.1: New USB device found, idVendor=046d, idProduct=0825
Jul 22 14:51:59 yoda-desktop kernel: [21005.178423] usb 1-2.1: New USB device strings: Mfr=0, Product=0, SerialNumber=2
Jul 22 14:51:59 yoda-desktop kernel: [21005.178438] usb 1-2.1: SerialNumber: 2821F020
Jul 22 14:51:59 yoda-desktop kernel: [21005.181407] uvcvideo: Found UVC 1.00 device <unnamed> (046d:0825)
Jul 22 14:51:59 yoda-desktop kernel: [21005.271081] uvcvideo 1-2.1:1.0: Entity type for entity Extension 4 was not initialized!
Jul 22 14:51:59 yoda-desktop kernel: [21005.279141] uvcvideo 1-2.1:1.0: Entity type for entity Extension 6 was not initialized!
Jul 22 14:51:59 yoda-desktop kernel: [21005.287277] uvcvideo 1-2.1:1.0: Entity type for entity Extension 7 was not initialized!
Jul 22 14:51:59 yoda-desktop kernel: [21005.295424] uvcvideo 1-2.1:1.0: Entity type for entity Processing 2 was not initialized!
Jul 22 14:51:59 yoda-desktop kernel: [21005.303682] uvcvideo 1-2.1:1.0: Entity type for entity Extension 3 was not initialized!
Jul 22 14:51:59 yoda-desktop kernel: [21005.311830] uvcvideo 1-2.1:1.0: Entity type for entity Camera 1 was not initialized!
Jul 22 14:51:59 yoda-desktop kernel: [21005.320214] input: UVC Camera (046d:0825) as /devices/70090000.xusb/usb1/1-2/1-2.1/1-2.1:1.0/input/input46
Jul 22 14:52:00 yoda-desktop kernel: [21006.667704] usb 1-2.1: set resolution quirk: cval->res = 384
Jul 22 14:52:00 yoda-desktop mtp-probe: checking bus 1, device 47: "/sys/devices/70090000.xusb/usb1/1-2/1-2.1"
Jul 22 14:52:00 yoda-desktop mtp-probe: bus: 1, device: 47 was not an MTP device
Jul 22 14:52:01 yoda-desktop pulseaudio[5746]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Jul 22 14:52:01 yoda-desktop pulseaudio[5746]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="2" name="usb-046d_0825_2821F020-02" card_name="alsa_card.usb-046d_0825_2821F020-02" namereg_fail=false tsched=yes fixed_latency_range=no ignore_dB=no deferred_volume=yes use_ucm=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Jul 22 14:52:01 yoda-desktop pulseaudio[6518]: [pulseaudio] source.c: Default and alternate sample rates are the same.
Jul 22 14:52:01 yoda-desktop rtkit-daemon[5748]: Supervising 4 threads of 1 processes of 1 users.
Jul 22 14:52:01 yoda-desktop rtkit-daemon[5748]: Successfully made thread 30519 of process 6518 (n/a) owned by '1000' RT at priority 5.
Jul 22 14:52:01 yoda-desktop rtkit-daemon[5748]: Supervising 5 threads of 1 processes of 1 users.
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: === aethersprite[29820]: CameraProvider initialized (0x7f89bb5010)=== aethersprite[29820]: Connection closed (7F8EB1A1D0)=== aethersprite[29820]: WARNING: CameraProvider was not destroyed before client connection terminated.=== aethersprite[29820]: The client may have abnormally terminated. Destroying CameraProvider...=== aethersprite[29820]: CameraProvider destroyed (0x7f89bb5010)=== aethersprite[29820]: Connection cleaned up (7F8EB1A1D0)=== aethersprite[30395]: Connection established (7F8EB1A1D0)OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: ---- imager: No override file found. ----
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: (NvCamV4l2) Error ModuleNotPresent: V4L2Device not available (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function findDevice(), line 256)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: (NvCamV4l2) Error ModuleNotPresent: (propagating from /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function initialize(), line 60)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: (NvOdmDevice) Error ModuleNotPresent: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 107)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclStartPlatformDrivers: Failed to start module drivers
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclStateControllerOpen: Failed ImagerGUID 1. (error 0xA000E)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclOpen: PCL Open Failed. Error: 0xf
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 582)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: SCF: Error BadParameter: (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 303)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function getSource(), line 466)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: Acquiring SCF Camera device source via index 0 has failed. ---- imager: No override file found. ----
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: (NvCamV4l2) Error ModuleNotPresent: V4L2Device not available (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function findDevice(), line 256)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: (NvCamV4l2) Error ModuleNotPresent: (propagating from /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function initialize(), line 60)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: (NvOdmDevice) Error ModuleNotPresent: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 107)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclStartPlatformDrivers: Failed to start module drivers
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclStateControllerOpen: Failed ImagerGUID 0. (error 0xA000E)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: NvPclOpen: PCL Open Failed. Error: 0xf
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 582)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: SCF: Error BadParameter: (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 303)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function getSource(), line 466)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: Acquiring SCF Camera device source via index 1 has failed. ---- imager: No override file found. ----
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: initializeDevNode: Failed to open dev node '/dev/camera/video0'; No such file or directory, trying alternate default location
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: (NvCamV4l2) Error BadParameter: Control 10094858 not found (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function findControlById(), line 1874)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: (NvCamV4l2) Error BadParameter: (propagating from /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function getControlRange(), line 331)
Jul 22 14:52:03 yoda-desktop nvargus-daemon[5175]: initialize: focus query failed
Jul 22 14:52:06 yoda-desktop pulseaudio[5746]: [pulseaudio] source.c: Default and alternate sample rates are the same.
Jul 22 14:52:06 yoda-desktop rtkit-daemon[5748]: Supervising 5 threads of 1 processes of 1 users.
Jul 22 14:52:13 yoda-desktop kernel: [21019.338607] usb 1-2.1: usb_suspend_both: status 0