TC358840 chip & V4L2 Sensor error

Hi,

To test the TC358840 chip, changed the device tree files. media-ctl is working fine. When try the below cmd and got the errors as:

nvidia@tegra-ubuntu:~/user$ gst-launch-1.0 nvcamerasrc sensor-id=0 ! ‘video/x-raw(memory:NVMM),width=1280, height=720, framerate=30/1, format=NV12’ ! nvoverlaysink -ev
Setting pipeline to PAUSED …
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
PCLHW_DTParser
PCLHW_DTParser
LoadOverridesFile: looking for override file [/Calib/camera_override.isp] 1/16LoadOverridesFile: looking for override file [/data/nvcam/settings/camera_overrides.isp] 2/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/camera_overrides.isp] 3/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/camera_overrides.isp] 4/16LoadOverridesFile: looking for override file [/data/nvcam/camera_overrides.isp] 5/16LoadOverridesFile: looking for override file [/data/nvcam/settings/tc358840_rear_1700.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/tc358840_rear_1700.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/tc358840_rear_1700.isp] 8/16---- imager: No override file found. ----
checkDriverVersion: Mixed or missing V4L2 controls!
checkDriverVersion: Make sure your kernel driver implements either
checkDriverVersion: V4L2_m_cidFrameLength + V4L2_m_cidCoarseTime(_SHORT)
checkDriverVersion: or
checkDriverVersion: V4L2_m_cidFrameRate + V4L2_m_cidExposure
(NvOdmDevice) Error BadParameter: (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function checkDriverVersion(), line 379)
(NvOdmDevice) Error BadParameter: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function findCustomCids(), line 309)
(NvOdmDevice) Error BadParameter: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initializeV4L2Items(), line 232)
(NvOdmDevice) Error BadParameter: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 107)
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 1. (error 0x4)
NvPclOpen: PCL Open Failed. Error: 0xf
SCF: Error BadParameter: Sensor could not be opened.
(in src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 596)
SCF: Error BadParameter: (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 781)
SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 276)
SCF: Error BadParameter: (propagating from src/api/CameraDriver.cpp, function getSource(), line 439)
Socket read error. Camera Daemon stopped functioning…
gst_nvcamera_open() failed ret=0
ERROR: Pipeline doesn’t want to pause.
ERROR: from element /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0: GStreamer error: state change failed and some element failed to post a proper error message with the reason for the failure.
Additional debug info:
gstbasesrc.c(3354): gst_base_src_start (): /GstPipeline:pipeline0/GstNvCameraSrc:nvcamerasrc0:
Failed to start
Setting pipeline to NULL …
Freeing pipeline …
nvidia@tegra-ubuntu:~/user$

But the same cmd is working fine in Camera module.

@BalajiNP
Could you try v4l2-ctl instead of nvcamerasrc.

v4l2-ctl -d /dev/videox -set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=t.raw

Hi ShaneCCC,

Ran the above cmd, it is working fine and creates the raw image. I could not find the tool to play this raw file. So I am not sure whether this is captured the image or video or not. Do you know that any software for play this raw image?

Second, why nvcamerasrc software is giving the above errors. What is the reason for this?
If we want to test using nvcamerasrc, what changes we need to make it. Please provide some inputs.

-Thanks

Try to use v4l2src for the YUV sensor instead of nvcamerasrc. Reference to below command to try the gst-launch-1.0 with v4l2src.

gst-launch-1.0 -v v4l2src device="/dev/video0" ! "video/x-raw,width=1920,height=1080, format=(string)I420" ! nvvidconv ! "video/x-raw(memory:NVMM)" ! nvoverlaysink

Hi ShaneCCC,

Tried this cmd,

v4l2-ctl -d /dev/video0 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=10 --stream-to=t.raw

Got the error as in dmesg:

[ 223.273939] tegra-vi4 15700000.vi: Status: 4 channel:00 frame:0000
[ 223.280248] tegra-vi4 15700000.vi: timestamp sof 233007918400 eof 233007920896 data 0x00000200
[ 223.289663] tegra-vi4 15700000.vi: capture_id 1 stream 0 vchan 0
[ 224.270183] tegra-vi4 15700000.vi: PXL_SOF syncpt timeout! err = -11
[ 225.274236] tegra-vi4 15700000.vi: ATOMP_FE syncpt timeout!

May be, I am doing some wrong configuration/missing some configuration. Please help on this.

-Thanks.

Hi,
In device tree, in camera sensors, the below values are given:

/* A modeX node is required to support v4l2 driver
implementation with NVIDIA camera software stack
*/

mode0 {
mclk_khz = “24000”;
num_lanes = “4”;
tegra_sinterface = “serial_a”;
discontinuous_clk = “yes”;
dpcm_enable = “false”;
cil_settletime = “0”;

   active_w = "3864";
   active_h = "2174";
   pixel_t = "bayer_rggb";
   readout_orientation = "90";
   line_length = "4200";
   inherent_gain = "1";
   mclk_multiplier = "25";
   pix_clk_hz = "756000000";

   min_gain_val = "1.0";
   max_gain_val = "16.0";
   min_hdr_ratio = "1";
   max_hdr_ratio = "64";
   min_framerate = "1.462526";
   max_framerate = "60";
   min_exp_time = "16.165";
   max_exp_time = "165770";
   embedded_metadata_height = "1";

};

Whether I need to add these values for tc358840 device. Please confirm.

-Thanks.

You need to add correct information for your sensor like the pixel_t = “bayer_rggb”; should be incorrect and I believe the embedded_metadata_height = “1”; should be comment out for this chip.