NvOdmDevice Help

NvOdmDevice

What is it, is the source available? I can’t find any mention of it, or why it’s throwing errors in the camera daemon.

This is for a custom driver. Yes I’ve followed the sensor programming guide, I’ve read through it in full twice. I’ve looked at both the ov5693 and imx185 examples and I do everything they do. The only difference is enabling my driver through the device tree instead of plugin manager.

Source is here: https://github.com/DaxBot/daxc02/tree/64bit_controls

Start up camera daemon in debug mode:

sudo service nvcamera-daemon stop
enableCamScfLogs=1
enableCamPclLogs=1
sudo /usr/sbin/nvcamera-daemon

Run nvcamerasrc

gst-launch-1.0 nvcamerasrc ! fakesink

Errors

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
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/daxc02_slave_mt9m021.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/daxc02_slave_mt9m021.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/daxc02_slave_mt9m021.isp] 8/16---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
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/daxc02_master_mt9m021.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/daxc02_master_mt9m021.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/daxc02_master_mt9m021.isp] 8/16---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
LSC: LSC surface is not based on full res!
setControlValMultiple: Frame Rate Control class inconsistent
setControlValMultiple: Gain Control class inconsistent
setControlValMultiple: Exposure Control class inconsistent
(NvOdmDevice) Error BadParameter: Invalid control list (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setControlValMultiple(), line 761)
(NvOdmDevice) Error BadParameter:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1558)
updateOutputSettings: Set Control failed. Use cached values
(NvOdmDevice) Error InsufficientMemory: Cannot allocate control string (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function getControlValMultiple(), line 541)

The gain is looks like not right. Could you try move all of the settings GAIN/EXPOSURE/FRAME RATE from imx185 to try.

    .ops            = &daxc02_ctrl_ops,
    .id             = V4L2_CID_GAIN,
    .name           = "Gain",
    .type           = V4L2_CTRL_TYPE_INTEGER64,
    .flags          = V4L2_CTRL_FLAG_SLIDER,
    .min            = 100000 * FIXED_POINT_SCALING_FACTOR / 100000,
    .max            = 796875 * FIXED_POINT_SCALING_FACTOR / 100000,
    .def            = 100000 * FIXED_POINT_SCALING_FACTOR / 100000,
    .step           = 3125 * FIXED_POINT_SCALING_FACTOR / 100000,

Good idea! I’ve definitely run into the problem where the ISP won’t do auto exposure because the values are out of range.

The reason the Gain looks strange is that the MT9M021 has a base 2 xxx.yyyyy format for gain so my settings are configured for a minimum of 1.0x a maximum of 7.96875x and a 0.03125 (1/32) step.

I set all the controls and device tree settings to the same numbers as the imx185:

{
        .ops = &daxc02_ctrl_ops,
        .id = V4L2_CID_GAIN,
	.name = "Gain",
	.type = V4L2_CTRL_TYPE_INTEGER64,
	.flags = V4L2_CTRL_FLAG_SLIDER,
	.min = 0 * FIXED_POINT_SCALING_FACTOR,
	.max = 48 * FIXED_POINT_SCALING_FACTOR,
	.def = 0 * FIXED_POINT_SCALING_FACTOR,
	.step = 1,
    },
    {
        .ops = &daxc02_ctrl_ops,
        .id = V4L2_CID_EXPOSURE,
	.name = "Exposure",
	.type = V4L2_CTRL_TYPE_INTEGER64,
	.flags = V4L2_CTRL_FLAG_SLIDER,
	.min = 30 * FIXED_POINT_SCALING_FACTOR / 1000000,
	.max = 1000000LL * FIXED_POINT_SCALING_FACTOR / 1000000,
	.def = 30 * FIXED_POINT_SCALING_FACTOR / 1000000,
	.step = 1,
    },
    {
        .ops = &daxc02_ctrl_ops,
        .id = V4L2_CID_FRAME_RATE,
	.name = "Frame Rate",
	.type = V4L2_CTRL_TYPE_INTEGER64,
	.flags = V4L2_CTRL_FLAG_SLIDER,
	.min = 1 * FIXED_POINT_SCALING_FACTOR,
	.max = 60 * FIXED_POINT_SCALING_FACTOR,
	.def = 30 * FIXED_POINT_SCALING_FACTOR,
	.step = 1,
    },
mode0 {
                    /* 1280x720, 30 FPS */
                    mclk_khz = "24000";
                    num_lanes = "1";
                    tegra_sinterface = "serial_a";
                    discontinuous_clk = "yes";
                    dpcm_enable = "false";
                    cil_settletime = "0";

                    dynamic_pixel_bit_depth = "12";
                    csi_pixel_bit_depth = "12";
                    mode_type = "bayer";
                    pixel_phase = "rggb";

                    active_w = "1280";
                    active_h = "720";
                    readout_orientation = "0";
                    line_length = "1650";
                    inherent_gain = "1";
                    mclk_multiplier = "3.09375";
                    pix_clk_hz = "74250000";

                   [b] min_gain_val = "0"; /* dB */
                        max_gain_val = "48"; /* dB */
                        min_hdr_ratio = "1";
                        max_hdr_ratio = "1";
                        min_framerate = "1.5";
                        max_framerate = "30";
                        min_exp_time = "30";
                        max_exp_time = "660000";[/b]

                };

Also made sure it was running in that mode for the test. Same errors from nvcamera-daemon:

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
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/daxc02_slave_mt9m021.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/daxc02_slave_mt9m021.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/daxc02_slave_mt9m021.isp] 8/16---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
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/daxc02_master_mt9m021.isp] 6/16LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/daxc02_master_mt9m021.isp] 7/16LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/daxc02_master_mt9m021.isp] 8/16---- imager: No override file found. ----
LSC: LSC surface is not based on full res!
LSC: LSC surface is not based on full res!
setControlValMultiple: Frame Rate Control class inconsistent
setControlValMultiple: Gain Control class inconsistent
setControlValMultiple: Exposure Control class inconsistent
(NvOdmDevice) Error BadParameter: Invalid control list (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setControlValMultiple(), line 761)
(NvOdmDevice) Error BadParameter:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1558)
updateOutputSettings: Set Control failed. Use cached values
(NvOdmDevice) Error InsufficientMemory: Cannot allocate control string (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function getControlValMultiple(), line 541)
setControlValMultiple: Gain Control class inconsistent
setControlValMultiple: Exposure Control class inconsistent
(NvOdmDevice) Error BadParameter: Invalid control list (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setControlValMultiple(), line 761)
(NvOdmDevice) Error BadParameter:  (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function setDeviceControls(), line 1558)
updateOutputSettings: Set Control failed. Use cached values
(NvOdmDevice) Error InsufficientMemory: Cannot allocate control string (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function getControlValMultiple(), line 541)
PowerServiceCore:handleRequests: timePassed = 1215

Could you check the control id information? I think the issue is we recommend to use the control ids defined in camera_common.h as they all belong to V4L2_CTRL_CLASS_CAMERA instead of V4L2_CTRL_CLASS_USER.
You can look at the macro values in …/kernel/kernel-4.4/include/uapi/linux/v4l2-controls.h. The values will start either 0x0098xxxx or 0x009axxxx. we expect is 0x009axxxx.

I am including <media/camera_common.h> and assumed I was using the controls defined therein. I’ll print out the values tomorrow and see for sure.

The control IDs are the following:

V4L2_CID_GAIN (0x9a200b)
V4L2_CID_EXPOSURE (0x9a200c)
V4L2_CID_FRAME_RATE (0x9a200d)
V4L2_CID_HDR_EN (0x9a2004)

Looks like they are from V4L2_CTRL_CLASS_CAMERA

/* Control classes */
#define V4L2_CTRL_CLASS_USER		0x00980000	/* Old-style 'user' controls */
#define V4L2_CTRL_CLASS_CAMERA		0x009a0000	/* Camera class controls */

@Atrer
Coud you add V4L2_CID_GROUP_HOLD to your driver to try.

That did it, thanks so much!

V4L2_CID_GROUP_HOLD is listed as optional in the Sensor Driver Programming Guide. Is this behavior intentional?

While I have you here, do you know have any idea what could be causing our image histogram to be off?

Our blacks are always around 70/255, instead of 0/255. It looks like the histogram was just truncated. It’s not a new development, but I was hoping you might have an idea of where to look.

Thanks for all your help!

Here’s an excerpt from the raw viewed in a hex editor:

001b3480: 3401 2d01 2a01 2c01 2f01 3001 2e01 3401  4.-.*.,./.0...4.
001b3490: 2e01 3d01 3801 3601 3001 2e01 3201 3901  ..=.8.6.0...2.9.
001b34a0: 3c01 2e01 3101 3601 3201 3701 3601 2a01  <...1.6.2.7.6.*.
001b34b0: 2a01 2701 3601 2c01 3a01 3a01 3401 3001  *.'.6.,.:.:.4.0.
001b34c0: 2801 2501 1e01 3801 3601 3101 2701 2701  (.%...8.6.1.'.'.
001b34d0: 3801 4401 2c01 3101 3201 3001 2c01 3601  8.D.,.1.2.0.,.6.
001b34e0: 2c01 3b01 3801 4001 4001 3001 3801 3a01  ,.;.8.@.@.0.8.:.
001b34f0: 3401 2401 3201 2c01 3001 3401 3401 4501  4.$.2.,.0.4.4.E.
001b3500: 3601 3301 2a01 4001 3d01 3101 3201 2f01  6.3.*.@.=.1.2./.
001b3510: 4601 3301 3c01 2701 3001 3301 3701 3101  F.3.<.'.0.3.7.1.
001b3520: 4001 3201 2001 3c01 2e01 4401 2e01 3401  @.2. .<...D...4.
001b3530: 3601 2801 3601 2001 2601 3401 3c01 2801  6.(.6. .&.4.<.(.
001b3540: 2c01 2f01 3201 2b01 3601 2e01 3301 2a01  ,./.2.+.6...3.*.
001b3550: 3601 2f01 3a01 3301 3001 2701 2f01 2c01  6./.:.3.0.'./.,.
001b3560: 2a01 4201 3601 1f01 3801 3401 4a01 3101  *.B.6...8.4.J.1.
001b3570: 2f01 2c01 3e01 3801 2a01 2c01 3a01 3b01  /.,.>.8.*.,.:.;.
001b3580: 3c01 2c01 3101 3101 3601 3c01 3a01 3601  <.,.1.1.6.<.:.6.
001b3590: 2d01 3501 2601 2f01 3e01 3901 3801 3401  -.5.&./.>.9.8.4.
001b35a0: 3201 2d01 2e01 2401 2401 2601 3a01 3801  2.-...$.$.&.:.8.
001b35b0: 3a01 2c01 3f01 3101 3301 2e01 2d01 3901  :.,.?.1.3...-.9.
001b35c0: 3001 2d01 3401 3801 3201 3601 3401 3901  0.-.4.8.2.6.4.9.
001b35d0: 2e01 3001 3801 3001 2601 3401 3201 3c01  ..0.8.0.&.4.2.<.
001b35e0: 2a01 3c01 3001 3101 3601 3501 3201 3101  *.<.0.1.6.5.2.1.
001b35f0: 2401 3001 3701 3801 3301 3301 3701 2501  $.0.7.8.3.3.7.%.
001b3600: 4601 4201 3801 2e01 3c01 3401 3201 3301  F.B.8...<.4.2.3.

I’m not 100% certain what raw should look like, but it is suspicious that in every byte the second nibble is fixed at “01.” It seems like only 8 bits are actually changing. I’ll investigate more next week. I’m pretty sure it’s a problem with my driver/camera.

@Atrer

Please check the TRM “Pixel Formats Memory Layout” for the detail information.