MT9M021 Streaming

Sorry that took so long, was getting SPI and CAN working. Quick fix to the set_format function. I hadn’t filled it out due to hard coding the format for testing.

v4l2-compliance fully passes:

ubuntu@tegra-ubuntu:~$ v4l2-compliance -d /dev/video0 
Driver Info:
	Driver name   : tegra-video
	Card type     : vi-output-0, daxc02 6-0010
	Bus info      : platform:vi:0
	Driver version: 3.10.96
	Capabilities  : 0x84200001
		Video Capture
		Streaming
		Extended Pix Format
		Device Capabilities
	Device Caps   : 0x04200001
		Video Capture
		Streaming
		Extended Pix Format

Compliance test for device /dev/video0 (not using libv4l2):

Required ioctls:
	test VIDIOC_QUERYCAP: OK

Allow for multiple opens:
	test second video open: OK
	test VIDIOC_QUERYCAP: OK
	test VIDIOC_G/S_PRIORITY: OK

Debug ioctls:
	test VIDIOC_DBG_G/S_REGISTER: OK (Not Supported)
	test VIDIOC_LOG_STATUS: OK (Not Supported)

Input ioctls:
	test VIDIOC_G/S_TUNER/ENUM_FREQ_BANDS: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_S_HW_FREQ_SEEK: OK (Not Supported)
	test VIDIOC_ENUMAUDIO: OK (Not Supported)
	test VIDIOC_G/S/ENUMINPUT: OK
	test VIDIOC_G/S_AUDIO: OK (Not Supported)
	Inputs: 1 Audio Inputs: 0 Tuners: 0

Output ioctls:
	test VIDIOC_G/S_MODULATOR: OK (Not Supported)
	test VIDIOC_G/S_FREQUENCY: OK (Not Supported)
	test VIDIOC_ENUMAUDOUT: OK (Not Supported)
	test VIDIOC_G/S/ENUMOUTPUT: OK (Not Supported)
	test VIDIOC_G/S_AUDOUT: OK (Not Supported)
	Outputs: 0 Audio Outputs: 0 Modulators: 0

Input/Output configuration ioctls:
	test VIDIOC_ENUM/G/S/QUERY_STD: OK (Not Supported)
	test VIDIOC_ENUM/G/S/QUERY_DV_TIMINGS: OK (Not Supported)
	test VIDIOC_DV_TIMINGS_CAP: OK (Not Supported)
	test VIDIOC_G/S_EDID: OK (Not Supported)

Test input 0:

	Control ioctls:
		test VIDIOC_QUERY_EXT_CTRL/QUERYMENU: OK
		test VIDIOC_QUERYCTRL: OK
		test VIDIOC_G/S_CTRL: OK
		test VIDIOC_G/S/TRY_EXT_CTRLS: OK
		test VIDIOC_(UN)SUBSCRIBE_EVENT/DQEVENT: OK
		test VIDIOC_G/S_JPEGCOMP: OK (Not Supported)
		Standard Controls: 7 Private Controls: 13

	Format ioctls:
		test VIDIOC_ENUM_FMT/FRAMESIZES/FRAMEINTERVALS: OK
		test VIDIOC_G/S_PARM: OK (Not Supported)
		test VIDIOC_G_FBUF: OK (Not Supported)
		test VIDIOC_G_FMT: OK
		test VIDIOC_TRY_FMT: OK
		test VIDIOC_S_FMT: OK
		test VIDIOC_G_SLICED_VBI_CAP: OK (Not Supported)
		test Cropping: OK (Not Supported)
		test Composing: OK (Not Supported)
		fail: v4l2-test-formats.cpp(1486): node->can_scale && node->frmsizes_count[v4l_format_g_pixelformat(&cur)]
		test Scaling: OK

	Codec ioctls:
		test VIDIOC_(TRY_)ENCODER_CMD: OK (Not Supported)
		test VIDIOC_G_ENC_INDEX: OK (Not Supported)
		test VIDIOC_(TRY_)DECODER_CMD: OK (Not Supported)

	Buffer ioctls:
		test VIDIOC_REQBUFS/CREATE_BUFS/QUERYBUF: OK
		test VIDIOC_EXPBUF: OK

Test input 0:

Total: 42, Succeeded: 42, Failed: 0, Warnings: 0

No change to the “No module data found” issue.

ubuntu@tegra-ubuntu:~$ nvgstcapture-1.0 
Encoder null, cannot set bitrate!
Encoder Profile = Baseline
Supported resolutions in case of CSI Camera
  (2) : 640x480
  (3) : 1280x720
  (4) : 1920x1080
  (5) : 2104x1560
  (6) : 2592x1944
  (7) : 2616x1472
  (8) : 3840x2160
  (9) : 3896x2192
  (10): 4208x3120
  (11): 5632x3168
  (12): 5632x4224

Runtime CSI Camera Commands:

  Help : 'h'
  Quit : 'q'
  Set Capture Mode:
      mo:<val>
          (1): image
          (2): video
  Get Capture Mode:
      gmo
  Set Sensor Id (0 to 10):
      sid:<val> e.g., sid:2 
  Get Sensor Id:
      gsid
  Set sensor orientation:
      so:<val>
          (0): none
          (1): Rotate counter-clockwise 90 degrees
          (2): Rotate 180 degrees
          (3): Rotate clockwise 90 degrees
  Get sensor orientation:
      gso
  Set Whitebalance Mode:
      wb:<val>
          (0): off
          (1): auto
          (2): incandescent
          (3): fluorescent
          (4): warm-fluorescent
          (5): daylight
          (6): cloudy-daylight
          (7): twilight
          (8): shade
          (9): manual
  Get Whitebalance Mode:
      gwb
  Set Scene-Mode:
      scm:<val>
          (0): face-priority
          (1): action
          (2): portrait
          (3): landscape
          (4): night
          (5): night-portrait
          (6): theatre
          (7): beach
          (8): snow
          (9): sunset
          (10): steady-photo
          (11): fireworks
          (12): sports
          (13): party
          (14): candle-light
          (15): barcode
  Get Scene-Mode:
      gscm
  Set Color Effect Mode:
      ce:<val>
          (1): off
          (2): mono
          (3): negative
          (4): solarize
          (5): sepia
          (6): posterize
          (7): aqua
  Get Color Effect Mode:
      gce
  Set Auto-Exposure Mode:
      ae:<val>
          (1): off
          (2): on
          (3): OnAutoFlash
          (4): OnAlwaysFlash
          (5): OnFlashRedEye
  Get Auto-Exposure Mode:
      gae
  Set Flash Mode:
      f:<val>
          (0): off
          (1): on
          (2): torch
          (3): auto
  Get Flash Mode:
      gf
  Set Flicker Detection and Avoidance Mode:
      fl:<val>
          (0): off
          (1): 50Hz
          (2): 60Hz
          (3): auto
  Get Flicker Detection and Avoidance Mode:
      gfl
  Set Contrast (0 to 1):
      ct:<val> e.g., ct:0.75
  Get Contrast:
      gct
  Set Saturation (0 to 2):
      st:<val> e.g., st:1.25
  Get Saturation:
      gst
  Set Exposure Time in seconds:
      ext:<val> e.g., ext:0.033
  Get Exposure Time:
      gext
  Set Auto Exposure Lock(0/1):
      ael:<val> e.g., ael:1
  Get Auto Exposure Lock:
      gael
  Set Edge Enhancement (0 to 1):
      ee:<val> e.g., ee:0.75
  Get Edge Enhancement:
      gee
  Set ROI for AE:
      It needs five values, ROI coordinates(top,left,bottom,right)
      and weight in that order
      aer:<val> e.g., aer:20 20 400 400 1.2
  Get ROI for AE:
      gaer
  Set ROI for AWB:
      It needs five values, ROI coordinates(top,left,bottom,right)
      and weight in that order
      wbr:<val> e.g., wbr:20 20 400 400 1.2
  Get ROI for AWB:
      gwbr
  Set FPS range:
      It needs two values, FPS Range (low, high) in that order
      fpsr:<val> e.g., fpsr:15 30
  Get FPS range:
      gfpsr
  Set WB Gains:
      It needs four values (R, GR, GB, B) in that order
      wbg:<val> e.g., wbg:1.2 2.2 0.8 1.6
  Get WB Gains:
      gwbg
  Set TNR Strength (0 to 1):
      ts:<val> e.g., ts:0.75
  Get TNR Strength:
      gts
  Set TNR Mode:
      tnr:<val>
          (0): NoiseReduction_Off
          (1): NoiseReduction_Fast
          (2): NoiseReduction_HighQuality
  Get TNR Mode:
      gtnr
  Capture: enter 'j' OR
           followed by a timer (e.g., jx5000, capture after 5 seconds) OR
           followed by multishot count (e.g., j:6, capture 6 images)
           timer/multihot values are optional, capture defaults to single shot with timer=0s
  Start Recording : enter '1'
  Stop Recording  : enter '0'
  Video snapshot  : enter '2' (While recording video)
  Set Preview Resolution:
      pcr:<val> e.g., pcr:3
          (2) : 640x480
          (3) : 1280x720
          (4) : 1920x1080
          (5) : 2104x1560
          (6) : 2592x1944
          (7) : 2616x1472
          (8) : 3840x2160
          (9) : 3896x2192
          (10): 4208x3120
          (11): 5632x3168
          (12): 5632x4224
  Note - For preview resolutions 4208x3120 and more use option --svs=nveglglessink
  Get Preview Resolution:
      gpcr
  Set Image Resolution:
      icr:<val> e.g., icr:3
          (2) : 640x480
          (3) : 1280x720
          (4) : 1920x1080
          (5) : 2104x1560
          (6) : 2592x1944
          (7) : 2616x1472
          (8) : 3840x2160
          (9) : 3896x2192
          (10): 4208x3120
          (11): 5632x3168
          (12): 5632x4224
  Get Image Capture Resolution:
      gicr
  Set Video Resolution:
      vcr:<val> e.g., vcr:3
          (2) : 640x480
          (3) : 1280x720
          (4) : 1920x1080
          (5) : 2104x1560
          (6) : 2592x1944
          (7) : 2616x1472
          (8) : 3840x2160
          (9) : 3896x2192
  Get Video Capture Resolution:
      gvcr

Runtime encoder configuration options:

  Set Encoding Bit-rate(in bytes):
      br:<val> e.g., br:4000000
  Get Encoding Bit-rate(in bytes):
      gbr
  Set Encoding Profile(only for H.264):
      ep:<val> e.g., ep:1
          (0): Baseline
          (1): Main
          (2): High
  Get Encoding Profile(only for H.264):
      gep
  Force IDR Frame on video Encoder(only for H.264):
      Enter 'f' 

bitrate = 4000000
Encoder Profile = Baseline
Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingSocket read error. Camera Daemon stopped functioning.....
gst_nvcamera_open() failed ret=0

** (nvgstcapture-1.0:1996): CRITICAL **: <create_capture_pipeline:4399> can't set camera to playing

** (nvgstcapture-1.0:1996): CRITICAL **: <main:5187> Capture Pipeline creation failed
** Message: <main:5194> Capture completed
** Message: <main:5244> Camera application will now exit
NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
Sensor_CheckDriverVersion: Mixed or missing V4L2 controls!
Sensor_CheckDriverVersion: Make sure your kernel driver implements either
Sensor_CheckDriverVersion: V4L2_CID_FRAME_LENGTH + V4L2_CID_COARSE_TIME(_SHORT)
Sensor_CheckDriverVersion:      or  
Sensor_CheckDriverVersion: V4L2_CID_FRAME_RATE + V4L2_CID_EXPOSURE
Sensor_InitializeV4L2Items: Failure ------------
NvPclDriver_V4L2_Sensor_Initialize: Failure ---------------------
NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureServiceDeviceSensor.cpp, function open(), line 121)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureServiceDeviceSensor.cpp, function getSourceFromGuid(), line 516)
SCF: Error BadParameter:  (propagating from src/services/capture/CaptureService.cpp, function addSourceByGuid(), line 702)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function addSourceByIndex(), line 263)
SCF: Error BadParameter:  (propagating from src/api/CameraDriver.cpp, function getSource(), line 422)
./debug_daemon.sh: line 6:  1933 Segmentation fault      sudo /usr/sbin/nvcamera-daemon

compliance.txt (2.65 KB)

Also added drivernode1 back to the dtb. Attaching.

tegra-camera-platform {
	compatible = "nvidia, tegra-camera-platform";

	modules {

		module0 {
		        badge = "daxc02_master_mt9m021";
		        position = "front";
		        orientation = [31 00];
		        status = "okay";

		        drivernode0 {
		                pcl_id = "v4l2_sensor";
		                devname = "daxc02 6-0010";
		                proc-device-tree = "/proc/device-tree/host1x/i2c@546c0000/daxc02_a@10";
		                status = "okay";
		        };

		        drivernode1 {
		                status = "disabled";
		                pcl_id = "v4l2_focuser_stub";
		                proc-device-tree = [00];
		        };
		};
	};
};

dtb.txt (387 KB)

Suppose you may have something wrong with CID. Please show us the “v4l2_ctl --list-ctrls”

And please replace the attached lib locate /usr/lib/aarch64-linux-gnu/tegra/libnvodm_imager.so to collect the log again.
libnvodm_imager.so.tar.gz (763 KB)

Hi Atrer
Any update for the #23

Woops, didn’t get the notification email for some reason. Will check that out tomorrow!

In the meantime here is the v4l2_ctl list

User Controls

    	horizontal_flip (int)    : min=0 max=1 step=1 default=0 value=0
    	vertical_flip (int)    : min=0 max=1 step=1 default=0 value=0
    	gain_red (int)    : min=0 max=255 step=1 default=16 value=16
    	gain_green_r (int)    : min=0 max=255 step=1 default=16 value=16
    	gain_green_b (int)    : min=0 max=255 step=1 default=16 value=16
    	gain_blue (int)    : min=0 max=255 step=1 default=16 value=16
    	gain_column (int)    : min=0 max=3 step=1 default=0 value=0

    Camera Controls

    	auto_exposure (int)    : min=1 max=2 step=1 default=1 value=1
    	frame_length (int)    : min=0 max=32767 step=1 default=1984 value=1984 flags=slider
    	coarse_time (int)    : min=2 max=32761 step=1 default=32698 value=32698 flags=slider
    	coarse_time_short (int)    : min=2 max=32761 step=1 default=32698 value=32698 flags=slider
    	group_hold (intmenu): min=0 max=1 default=0 value=0
    	hdr_enable (intmenu): min=0 max=0 default=0 value=0
    	bypass_mode (intmenu): min=0 max=1 default=0 value=0
    	   gain (int)    : min=0 max=255 step=1 default=16 value=16 flags=slider
    	exposure (int)    : min=1 max=672 step=1 default=256 value=256

    Image Processing Controls

    	test_pattern (menu)   : min=0 max=4 default=0 value=0

Your driver are implemented the mixed V4L2 controls. Please remove the auto_exposure and exposure controls to verify it.

External Media

Good catch! I had it in my mind that more controls was always better, so I just did both sets. Didn’t think twice about the “Mixed” message.

I had issues downloading that lib, I’ll try later. But fixing those controls definitely made a difference!

NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_GetV4LPixelType: pixel type 0x101 invalid
(NvOdmDevice) Error BadParameter: 0x30314752 pixelFormat not found under current active buffer type (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setActivePixelFormat(), line 933)
Sensor_WriteMode: Sensor_EnableStreamingConfiguration FAILED
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
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
launchCC abort cc 104

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 105

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 106

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 107

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 108

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 109

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 110

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
./debug_daemon.sh: line 6:  1946 Segmentation fault      sudo /usr/sbin/nvcamera-daemon

I suspected my pixel format might not be supported (V4L2_MBUS_FMT_SGRBG12_1X12). But I set the device tree pixel_t to bayer_bggr12 which is in the docs. Maybe i’ll try switching that around.

Edit: Switched to V4l2_MBUS_FMT_SBGGR12 to match the dtb. Same errors.

Thanks for your help with this!

Please replace this lib to fixed the RAW12 error message.

Sensor_GetV4LPixelType: pixel type 0x101 invalid
(NvOdmDevice) Error BadParameter: 0x30314752 pixelFormat not found under current active buffer type (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setActivePixelFormat(), line 933)

libnvodm_imager.so_raw12.tar.gz (763 KB)

Great, can’t wait to try it!

I’m having issues downloading anything from the forums recently. Has anyone else reported that? I’m logged in and when I click on a download link I get the warning as usual and then I get forwarded to a blank page that doesn’t trigger the actual download. I’ve even tried different browsers and different computers.

Edit: Got the download to work.

Here’s the results with the first library

NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
Sensor_CheckDriverVersion: Check Frame Rate CID 0 0
Sensor_CheckDriverVersion: Check Exposure CID 0 0
Sensor_CheckDriverVersion: Check Frame Length CID 0 1
Sensor_CheckDriverVersion: Check Coarse Time 0 2
Sensor_CheckDriverVersion: Check Coarse Time Short 0 2
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_GetV4LPixelType: pixel type 0x101 invalid
(NvOdmDevice) Error BadParameter: 0x30314752 pixelFormat not found under current active buffer type (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function setActivePixelFormat(), line 933)
Sensor_WriteMode: Sensor_EnableStreamingConfiguration FAILED
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
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
launchCC abort cc 104

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 105

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 106

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 107

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 108

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
./debug_daemon.sh: line 6:  1902 Segmentation fault      sudo /usr/sbin/nvcamera-daemon

and here’s the result with the second library, getting ride of the pixel type 0x101 invalid error:

NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
(NvOdmDevice) Error BadParameter: 0x32314752 pixelFormat not found under current active buffer type (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function setActivePixelFormat(), line 933)
Sensor_WriteMode: Sensor_EnableStreamingConfiguration FAILED
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
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
launchCC abort cc 104

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 105

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 106

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 107

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 108

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 109

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
launchCC abort cc 110

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
Error: waitCsiFrameStart timeout guid 1
Error: waitCsiFrameStart Something went wrong with waiting on frame start
Error: waitCsiFrameStart Something went wrong with waiting on frame start
launchCC abort cc 111

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
launchCC abort cc 112

SCF: Error Timeout:  (propagating from src/api/Session.cpp, function capture(), line 731)
./debug_daemon.sh: line 6:  1745 Segmentation fault      sudo /usr/sbin/nvcamera-daemon

Is the source for this stuff available yet? It might be helpful if I could track down those errors myself, the debugging output seems nice and robust. Happy to sign an NDA if needed.

It got failed to set the pixelformat to 0x32314752 “RG12” . Could you list the VIDIOC_ENUM_FMT by “v4l2-ctl -d /dev/video0 --list-formats” and replace the attached lib to collect the log again.
libnvodm_imager.so_d0.tar.gz (763 KB)

ioctl: VIDIOC_ENUM_FMT
Index : 0
Type : Video Capture
Pixel Format: ‘BA12’
Name : GRGR… BGBG…

NvPclHwGetModuleList: WARNING: Could not map module to ISP config string
NvPclHwGetModuleList: No module data found
queryPixelFormats: type: 1, pixelformat 0x32314142 "BA12"
queryPixelFormats: type: 1, pixelformat 0x32314142 "BA12"
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
setActivePixelFormat: 0x32314752
(NvOdmDevice) Error BadParameter: 0x32314752 pixelFormat not found under current active buffer type (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function setActivePixelFormat(), line 933)
Sensor_WriteMode: Sensor_EnableStreamingConfiguration FAILED
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
Error: waitCsiFrameStart timeout guid 1
Error: waitCsiFrameStart Something went wrong with waiting on frame start
Error: waitCsiFrameStart Something went wrong with waiting on frame start
(NvOdmDevice) Error InvalidState: Invalid active Mode Size (in home/snchen/disk1/project/l4t-r24.2.1/camera-partner/imager/src/V4L2Device.cpp, function streamControl(), line 1130)
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
Error: waitCsiFrameStart timeout guid 1
SCF: Error Timeout: NvRmSyncWait failed (in src/api/Buffer.cpp, function cpuWaitFences(), line 494)
SCF: Error Timeout:  (propagating from src/api/Buffer.cpp, function unassignFromCapture(), line 261)
SCF: Error Timeout:  (propagating from src/components/CaptureContainerImpl.cpp, function returnBuffer(), line 350)
SCF: Error Timeout:  (propagating from src/components/CaptureContainerImpl.cpp, function returnAllBuffers(), line 488)
launchCC abort cc 105

./debug_daemon.sh: line 6:  3584 Segmentation fault      sudo /usr/sbin/nvcamera-daemon

Based on the documentation here: V4L2_PIX_FMT_SRGGB12 ('RG12'), V4L2_PIX_FMT_SGRBG12 ('BA12'), V4L2_PIX_FMT_SGBRG12 ('GB12'), V4L2_PIX_FMT_SBGGR12 ('BG12'),

The sensor uses V4L2_PIX_FMT_SGRBG12 (BA12), but I’ll try switching to V4L2_PIX_FMT_SRGGB12 (RG12).

Switching to RG12 fixed that issue. And I can try to take pictures. It’s setting the Coarse Time to 1 for some reason, so all I get is a vaguely pink blob. Need to play around with nvgstcapture and nvgstsource and see what I can get out. Thanks for your help! I’m sure i’ll have more questions later, but for now I think it’s working well enough for me to make progress with!

Ok, here are the experiment results.

nvgstcapture isn’t crashing anymore and lets me set the resolution with the --image-res flag and take pictures with j. However it is setting gain=0 and coarse_time=1 every time it starts the sensor…

[ 1326.841489] daxc02 6-0010: daxc02_s_ctrl: V4L2_CID_GAIN
[ 1326.841498] daxc02 6-0010: mt9m021_write: 0x0000 to 0x305e
[ 1326.841838] daxc02 6-0010: mt9m021_write: 0x0000 to 0x30c4
[ 1326.842094] daxc02 6-0010: daxc02_s_ctrl: V4L2_CID_COARSE_TIME
[ 1326.842102] daxc02 6-0010: mt9m021_write: 0x0001 to 0x3012
[ 1326.842338] daxc02 6-0010: mt9m021_write: 0x0001 to 0x3016

I tried the --wbGains flag and the --set-exposure flags but nothing happened, those controls still go set to 0 and 1. Subsequently all I got out was gray. I tried turning on auto-exposure to skip those controls and it brightened up a bit, but not enough for me to tell if it was an actual image or not.

Is there another way i’m supposed to set those values? In the meantime I’m going to try setting those in the driver itself so the controls don’t actually change it and see if I get an image.

Ok overwriting the controls and boosting the gain up worked. I got an image of my desk… kinda. It’s very pink which I expect might be due to using the wrong image format. Also each time I run nvgstcapture I get a different result. Hard to describe so I’ll attach pictures from 3 different runs.

Ideas?

Also are there any plans for adding support for other pixel formats such as V4L2_PIX_FMT_SGRBG12 (BA12)?



Attaching colorbars from nvgstcapture and v4l2


Hi

  1. Does any timeout or kernel message when get the half scene picture? It’s look like MIPI timing issue.
  2. For the color problem it looks like the pixel format is not correct.
  1. No warnings in dmesg, the camera daemon, or nvgstcapture itself. I’m going to try taking some video tomorrow and see if it is an issue for more than a few frames.

  2. Yeah, that was what I thought. The video sensor puts out in V4L2_PIX_FMT_SGRBG12 but I made the driver pretend it’s V4L2_PIX_FMT_SRGGB12 so everything would work. What would it take to get BA12 supported?

What is the correct way to set Gain and Coarse Time using the Nvidia framework? Should I just set the control minimum to a reasonable value?

I really appreciate all the support, so excited that we finally have picture!

  1. Can’t this sensor output V4L2_PIX_FMT_SRGGB12 ? Seems current only support V4L2_PIX_FMT_SRGGB12 and it’s take time to enhance the support.

  2. You have to report below information than the ALG will run automatically. And the min_gain_val should from 1.0

min_gain_val = "1.0";
                                                        max_gain_val = "16";
                                                        min_framerate = "1.816577";
                                                        max_framerate = "30";
                                                        min_exp_time = "34";
                                                        max_exp_time = "550385";