mdegans / gst-nvmanualcamerasrc

(unofficial) Nvidia argus camera source fork
MIT License
4 stars 2 forks source link

isp error `... Error BadParameter ...` #12

Closed mdegans closed 3 years ago

mdegans commented 3 years ago

Works on one nano but not another. Issue occurs on both JetPack 4.4 and 4.5.

gst-launch-1.0 nvmanualcamerasrc ! autovideosink

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module0
OFParserListModules: module list: /proc/device-tree/tegra-camera-platform/modules/module1
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
OFParserGetVirtualDevice: NVIDIA Camera virtual enumerator not found in proc device-tree
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 460: Error: Bad parameter: "ae.CameraEfficiency=0.1508"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 473: Error: Bad parameter: "ae.MeanAlg.ConvergeSpeed=0.10"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 810: Error: Bad parameter: "awb.convergeSpeed=0.3"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3100: Error: Bad parameter: "af.alg.over_scan_percent=0.15"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3101: Error: Bad parameter: "af.alg.smooth_over_scan_percent=0.035"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3107: Error: Bad parameter: "af.alg.scene_change_t_guard_factor=0.30f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3108: Error: Bad parameter: "af.alg.scene_stable_sharpness=0.15f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3109: Error: Bad parameter: "af.alg.scene_change_sharpness=0.30f"
Motion points are not strictly ascending.NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 4524: Error: 11: "tnr.v1.consistencyPoints={0.00,0.25,0.50,0.75,1.00}"
---- imager: Found override file [/var/nvidia/nvcam/settings/camera_overrides.isp]. ----
(NvCamV4l2) Error ModuleNotPresent: V4L2Device not available (in /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function findDevice(), line 256)
(NvCamV4l2) Error ModuleNotPresent:  (propagating from /dvs/git/dirty/git-master_linux/camera/utils/nvcamv4l2/v4l2_device.cpp, function initialize(), line 60)
(NvOdmDevice) Error ModuleNotPresent:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 106)
NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
NvPclStartPlatformDrivers: Failed to start module drivers
NvPclStateControllerOpen: Failed ImagerGUID 0. (error 0xA000E)
NvPclOpen: PCL Open Failed. Error: 0xf
SCF: Error BadParameter: Sensor could not be opened. (in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 582)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 437)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 295)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 458)
Acquiring SCF Camera device source via index 1 has failed. NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 460: Error: Bad parameter: "ae.CameraEfficiency=0.1508"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 473: Error: Bad parameter: "ae.MeanAlg.ConvergeSpeed=0.10"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 810: Error: Bad parameter: "awb.convergeSpeed=0.3"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3100: Error: Bad parameter: "af.alg.over_scan_percent=0.15"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3101: Error: Bad parameter: "af.alg.smooth_over_scan_percent=0.035"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3107: Error: Bad parameter: "af.alg.scene_change_t_guard_factor=0.30f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3108: Error: Bad parameter: "af.alg.scene_stable_sharpness=0.15f"
NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 3109: Error: Bad parameter: "af.alg.scene_change_sharpness=0.30f"
Motion points are not strictly ascending.NvCameraIspConfigFileLoad: type = 0x5 Config file "common.cfg" Line 4524: Error: 11: "tnr.v1.consistencyPoints={0.00,0.25,0.50,0.75,1.00}"
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 24:81: 

    <!-- Flow -->
    <flow operation='clone' operand0='inputImageY' operand1='outputImageY' opera
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 15:57: 
    <node name='transmissionMap' file='networks/transmissionMapBlockYCbCr420.xml'/>
    <node name=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/DeFogStage.cpp, function doAsyncInitialize(), line 91)
SCF: Error InsufficientMemory: DeFogStage initialization failed (in src/components/stages/DeFogStage.cpp, function doAsyncInitialize(), line 151)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 22:81: 
    <attribute name='repetitions' type='parameter' dataType='uint' default='1'/>

    <!-- Flow -->
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:53: 
    <node name="lowpass" file="filters/box3x3.xml"/>
    <node name="ltmFilter" file="filters/ltm.x
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:46: 

    <!-- Parameters -->
    <export name="Quality" from="ltm" attribute="quality" default="3" min=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/AoltmStage.cpp, function doAsyncInitialize(), line 100)
SCF: Error InsufficientMemory: AoltmStage initialization failed (in src/components/stages/AoltmStage.cpp, function doAsyncInitialize(), line 130)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 95
        Invalid default value of type 'vec2'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 22:81: 
    <attribute name='repetitions' type='parameter' dataType='uint' default='1'/>

    <!-- Flow -->
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/samples/deFog/StoreDeFog.cpp function create() line 66
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:53: 
    <node name="lowpass" file="filters/box3x3.xml"/>
    <node name="ltmFilter" file="filters/ltm42
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function load() line 317
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function handleElementNetwork() line 103
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/networks/networkUser.cpp function xmlHandleStartElementNetwork() line 52
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 6:49: 

    <!-- Parameters -->
    <export name="Quality" from="ltm" attribute="quality" default="3" min=
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/storeHDFX/StoreHDFX.cpp function create() line 92
        Out of memory
SCF: Error InsufficientMemory:  (propagating from src/components/stages/HdfxStage.cpp, function doAsyncInitialize(), line 147)
SCF: Error InsufficientMemory: HdfxStage initialization failed (in src/components/stages/HdfxStage.cpp, function doAsyncInitialize(), line 252)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/value.cpp function set() line 115
        Invalid default value of type 'vec4'
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/attribute.h function setDefault() line 452
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function handleElementAttribute() line 666
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function handleElementFilter() line 73
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/filters/filterUser.cpp function xmlHandleStartElementFilter() line 49
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/xmlParse.cpp function parse() line 146
        parsing aborted at line 13:96: 

    <!-- Flow -->
    <flow operation="execute"/>
    <flow operation="detach" operand0="inputImag
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 339
        (propagating)
FNET: Error in /dvs/git/dirty/git-master_linux/camera/utils/nvfnet/src/common/node.cpp function create() line 41
        (propagating)
SCF: Error InsufficientMemory:  (propagating from src/components/stages/SharpenStage.cpp, function doAsyncInitialize(), line 159)
SCF: Error InsufficientMemory: SharpenStage initialization failed (in src/components/stages/SharpenStage.cpp, function doAsyncInitialize(), line 182)
(Autocontrol) Error BadParameter: Invalid use or bad call parameters (in src/algorithms/blender/blender.cpp, function interpolateValInternal(), line 306)
(Autocontrol) Error BadParameter:  (propagating from src/algorithms/blender/blender.cpp, function NvIspParamBlenderInterpolateValue(), line 156)
(Camera_ISP) Error BadParameter:  (propagating from state_update/blocks/SAPOR.cpp, function NvCameraIspUpdateState_SAPOR_isp2(), line 50)
(Camera_ISP) Error BadParameter:  (propagating from state_update/nvcamera_isp_update_state.cpp, function NvCameraIspUpdateInputStateHw(), line 92)
SCF: Error BadParameter:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function generate(), line 1161)
SCF: Error BadParameter:  (propagating from src/components/ac_stages/AcMergeStage.cpp, function doHandleRequest(), line 84)
SCF: Error BadParameter:  (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 158)
SCF: Error BadParameter: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 990)
(Autocontrol) Error BadParameter: Invalid use or bad call parameters (in src/algorithms/blender/blender.cpp, function interpolateValInternal(), line 306)
(Autocontrol) Error BadParameter:  (propagating from src/algorithms/blender/blender.cpp, function NvIspParamBlenderInterpolateValue(), line 156)
(Camera_ISP) Error BadParameter:  (propagating from state_update/blocks/SAPOR.cpp, function NvCameraIspUpdateState_SAPOR_isp2(), line 50)
(Camera_ISP) Error BadParameter:  (propagating from state_update/nvcamera_isp_update_state.cpp, function NvCameraIspUpdateInputStateHw(), line 92)
SCF: Error BadParameter:  (propagating from src/services/autocontrol/NvCameraIspDriver.cpp, function generate(), line 1161)
SCF: Error BadParameter:  (propagating from src/components/ac_stages/AcMergeStage.cpp, function doHandleRequest(), line 84)
SCF: Error BadParameter:  (propagating from src/components/stages/OrderedStage.cpp, function doExecute(), line 158)
SCF: Error Timeout:  (propagating from src/services/capture/CaptureServiceEvent.cpp, function wait(), line 59)
Error: Camera HwEvents wait, this may indicate a hardware timeout occured,abort current/incoming cc
^Chandling interrupt.
Interrupt: Stopping pipeline ...
Execution ended after 0:00:15.981591495
Setting pipeline to PAUSED ...
Setting pipeline to READY ...
^C

This happens with some pipelines but not others. This test works perfectly:

  g_autoptr(GstElement) pipe = nullptr;
  GstElement* camera = nullptr;
  GstElement* ptzf = nullptr;
  GstElement* sink = nullptr;
  g_autoptr(GstBus) bus = nullptr;
  g_autoptr(GstMessage) msg = nullptr;
  g_autoptr(GMainLoop) loop = nullptr;

#ifdef HAS_FLASHFIRE
  // Create a flash. This turns on the NIR automatically, and unique_ptr will
  // call `flash_free` at the end of this scope.
  std::unique_ptr<flashfire::Flash, void (*)(flashfire::Flash*)> flash(
      flashfire::flash_new(0, 0, 2), flashfire::flash_free);
  if (!flash) {
    GST_WARNING("Flash could not be created. Likely bad chip/pin id.");
  }
#endif  // HAS_FLASHFIRE

  pipe = gst_pipeline_new("pipe");
  g_assert(pipe);
  camera = gst_element_factory_make("nvmanualcamerasrc", "camera");
  g_assert(camera);
  ptzf = gst_element_factory_make("ptzf", "ptzf");
  g_assert(ptzf);
  sink = gst_element_factory_make("autovideosink", "sink");
  g_assert(sink);

  for (auto e : {camera, ptzf, sink}) {
    g_assert(gst_bin_add(GST_BIN(pipe), e));
  }

  g_assert(gst_element_link_many(camera, ptzf, sink, nullptr));

  g_object_set(camera, "metadata", true, nullptr);
  g_object_set(camera, "bayer-sharpness-map", true, nullptr);
  g_object_set(camera, "digitalgain", 4.0, NULL);
  g_object_set(camera, "gain", 8.0, NULL);
#ifdef PRINTER
  g_object_set(ptzf, "device", PRINTER, nullptr);
#endif  // PRINTER

  g_assert(GST_STATE_CHANGE_FAILURE !=
           gst_element_set_state(pipe, GST_STATE_PLAYING));

  // get the bus from the pipeline
  bus = gst_element_get_bus(pipe);
  g_assert(bus);

  // create the main loop
  loop = g_main_loop_new(nullptr, false);
  g_assert(loop);

  // add the bus message callback
  gst_bus_add_watch(bus, (GstBusFunc)on_bus_message, loop);

  // register the signal handler to quit the mainloop
  g_unix_signal_add(SIGINT, (GSourceFunc)on_sigint, loop);

  // run the main loop (blocks here)
  g_main_loop_run(loop);

  g_assert(GST_STATE_CHANGE_FAILURE !=
           gst_element_set_state(pipe, GST_STATE_NULL));

  return 0;
mdegans commented 3 years ago

Notes:

mdegans commented 3 years ago

Tests and demos in mdegans/dev that work:

mdegans commented 3 years ago

After flashing to 4.5, same issue occurs on the same machine so it appears JetPack is unrelated. One works. One consistently produces the above error. Problem is something else:.

Differences between the machines:

uname -a: Linux test45477 4.9.201-tib #1 SMP PREEMPT Thu Feb 4 17:07:40 PST 2021 aarch64 aarch64 aarch64 GNU/Linux identical rootfs: was identical on flash and both devices are fully updated using the r32.5 repos /boot/extlinux/extlinux.conf: identical (sha512 checked) /boot/kernel_tegra210-p3448-0000-p3449-0000-b00-user-custom.dtb : identical (sha512 checked) /etc/nv_tegra_release: identical (sha512 checked) /var/nvidia/nvcam/settings/camera_overrides.isp identical

mdegans commented 3 years ago

Seems Issue occurs on TX2 as well (with unmodified source):

https://forums.developer.nvidia.com/t/issues-when-running-nvarguscamerasrc-compiled-code-released-in-jetpack-4-4/122446

Likely related to AeRegion edit: nope

mdegans commented 3 years ago

Created thread on Nvidia forum to ask for external help with this: https://forums.developer.nvidia.com/t/nvarguscamerasrc-built-from-source-isp-error/178939/2

mdegans commented 3 years ago

Tried commenting out any reference to aeRegions (only in metadata). Same issue.

mdegans commented 3 years ago

ruled out clearing cache on both machines by rm ${HOME}/.cache/gstreamer-1.0/registry.aarch64.bin (GST_REGISTRY_UPDATE=yes was already set, but why not).

mdegans commented 3 years ago

Driver info for both nanos;

Driver Info (not using libv4l2):
        Driver name   : tegra-video
        Card type     : vi-output, imx477 7-001a
        Bus info      : platform:54080000.vi:0
        Driver version: 4.9.201
        Capabilities  : 0x84200001
                Video Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format

both using this driver revision for JetPack 4.5:

mdegans commented 3 years ago

So, I used GDB to take a look at what gst-launch is doing. when this is reached:

SCF: Error BadParameter: Sending critical error event (in src/api/Session.cpp, function sendErrorEvent(), line 992)

nvmanualcameras thread is blocked at g_cond_wait

  while (!self->stop_requested && !self->unlock_requested &&
         g_queue_is_empty(self->nvmm_buffers)) {
    g_cond_wait(&self->nvmm_buffers_queue_cond, &self->nvmm_buffers_queue_lock);
  }

consumer_thread is blocked at g_cond_wait

    while (g_queue_is_empty(self->manual_buffers)) {
      g_cond_wait(&self->manual_buffers_queue_cond,
                  &self->manual_buffers_queue_lock);
    }

ditto with manual_thread (producer.cpp)

    if (src->stop_requested == FALSE) {
      g_mutex_lock(&src->eos_lock);
      g_cond_wait(&src->eos_cond, &src->eos_lock);
      g_mutex_unlock(&src->eos_lock);
    }

another manual_thread is stuck at:

    UniqueObj<Frame> frame(iFrameConsumer->acquireFrame());

So the camera source is waiting on buffers, but they're not coming from libargus, so it stalls forever.

Why it works in a C app but breaks with gst-launch or with a gui app. idk. gst-launch is just a c app that (presumably) calls gst_parse_launch, yet the test_string_pipeline test that does exactly that and it works.

It would sure help if there were source code available for the Nvidia parts.

mdegans commented 3 years ago

same error in this thread: https://forums.developer.nvidia.com/t/writing-a-custom-gstreamer-plugin/154362/10?u=mdegans

mdegans commented 3 years ago

YAY. Found the fix: https://forums.developer.nvidia.com/t/writing-a-custom-gstreamer-plugin/154362/11?u=mdegans

Replace -largus with -largus_socketclient.

mdegans commented 3 years ago

and it works!

ninja: Entering directory `/home/dev/code/gst-nvmanualcamerasrc/builddir'
ninja: no work to do.
1/4 test metadata               OK               4.12s
2/4 test properties             OK              16.93s
3/4 test string pipeline        OK               4.25s
4/4 gstlaunch test              OK               4.25s

Ok:                 4   
Expected Fail:      0   
Fail:               0   
Unexpected Pass:    0   
Skipped:            0   
Timeout:            0   

Full log written to /home/dev/code/gst-nvmanualcamerasrc/builddir/meson-logs/testlog.txt