Hi, I am writing a driver for an IMX290 camera module. I can initialise a camera which outputs frames over CSI-2 when I scope it.
I’ve also written a kernel driver which initialises the camera no problem. But now I’m completely stuck.
The nvcamera-daemon crashes when I run gst-launch-1.0 nvcamerasrc, so I am unable to create a /dev/video0. The offending line seems to be “(NvOdmDevice) Error ModuleNotPresent: V4L2Device not available (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function findDevice(), line 231)”.
This error doesn’t really help - how should I go about making the daemon recognise my cameras, so it creates the /dev/video device files, and I can start to fit my driver into the v4l2 pipeline?
I have also tried putting my driver code inside the existing IMX274 driver and using the same name, but it gives similar errors.
Debug output from nvcamera-daemon:
NvPclHwInitializeModule: allocate overrides pathname @ 0x7facbdff10
NvPclHwInitializeModule: allocate overrides pathname @ 0x7facbdffa0
NvPclHwInitializeModule: allocate overrides pathname @ 0x7facbc34b0
NvPclHwInitializeModule: allocate overrides pathname @ 0x7facbc3540
NvPclHwInitializeModule: allocate overrides pathname @ 0x7facbc35d0
LoadOverridesFile: looking for override file [/Calib/camera_override.isp] 1/16CheckOverridesPermissions: cannot stat file [/Calib/camera_override.isp]
LoadOverridesFile: looking for override file [/data/nvcam/settings/camera_overrides.isp] 2/16CheckOverridesPermissions: cannot stat file [/data/nvcam/settings/camera_overrides.isp]
LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/camera_overrides.isp] 3/16CheckOverridesPermissions: cannot stat file [/opt/nvidia/nvcam/settings/camera_overrides.isp]
LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/camera_overrides.isp] 4/16CheckOverridesPermissions: cannot stat file [/var/nvidia/nvcam/settings/camera_overrides.isp]
LoadOverridesFile: looking for override file [/data/nvcam/camera_overrides.isp] 5/16CheckOverridesPermissions: cannot stat file [/data/nvcam/camera_overrides.isp]
LoadOverridesFile: looking for override file [/data/nvcam/settings/imx290_bottom_A6V26.isp] 6/16CheckOverridesPermissions: cannot stat file [/data/nvcam/settings/imx290_bottom_A6V26.isp]
LoadOverridesFile: looking for override file [/opt/nvidia/nvcam/settings/imx290_bottom_A6V26.isp] 7/16CheckOverridesPermissions: cannot stat file [/opt/nvidia/nvcam/settings/imx290_bottom_A6V26.isp]
LoadOverridesFile: looking for override file [/var/nvidia/nvcam/settings/imx290_bottom_A6V26.isp] 8/16CheckOverridesPermissions: cannot stat file [/var/nvidia/nvcam/settings/imx290_bottom_A6V26.isp]
---- imager: No override file found. ----
Imager: looking for override file [/mnt/factory/camera/factory.bin] 1/16
Imager: looking for override file [/Calib/factory.bin] 2/16
Imager: looking for override file [/Calib/calibration.bin] 3/16
Imager: looking for override file [(null)] 4/16
Imager: looking for override file [(null)] 5/16
Imager: looking for override file [(null)] 6/16
Imager: looking for override file [(null)] 7/16
Imager: looking for override file [(null)] 8/16
Imager: looking for override file [(null)] 9/16
Imager: looking for override file [(null)] 10/16
Imager: looking for override file [(null)] 11/16
Imager: looking for override file [(null)] 12/16
Imager: looking for override file [(null)] 13/16
Imager: looking for override file [(null)] 14/16
Imager: looking for override file [(null)] 15/16
Imager: looking for override file [(null)] 16/16
Imager: looking for override file [/data/nvcam/settings/factory.bin] 1/16
Imager: looking for override file [/data/nvcam/settings/imx290_bottom_A6V26.bin] 2/16
Imager: looking for override file [/opt/nvidia/nvcam/settings/imx290_bottom_A6V26.bin] 3/16
Imager: looking for override file [/var/nvidia/nvcam/settings/imx290_bottom_A6V26.bin] 4/16
Imager: looking for override file [(null)] 5/16
Imager: looking for override file [(null)] 6/16
Imager: looking for override file [(null)] 7/16
Imager: looking for override file [(null)] 8/16
Imager: looking for override file [(null)] 9/16
Imager: looking for override file [(null)] 10/16
Imager: looking for override file [(null)] 11/16
Imager: looking for override file [(null)] 12/16
Imager: looking for override file [(null)] 13/16
Imager: looking for override file [(null)] 14/16
Imager: looking for override file [(null)] 15/16
Imager: looking for override file [(null)] 16/16
NvPclCreateDriver: Found NvPcl Driver Hal dev_name match (v4l2_sensor)
NvPclCreateDriver: Found a Driver name match (v4l2_sensor)
NvPclConnectDrivers: hImager was NULL, creating new imager
NvPclInitializeDrivers: v4l2_sensor ++++++++++++++++++
OFDPropertyGetString: could not read property [devnode-bus]
initialize: imx290 31-001a
(NvOdmDevice) Error ModuleNotPresent: V4L2Device not available (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function findDevice(), line 231)
(NvOdmDevice) Error ModuleNotPresent: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function initialize(), line 54)
(NvOdmDevice) Error ModuleNotPresent: (propagating from dvs/git/dirty/git-master_linux/camera-partner/imager/src/devices/V4L2SensorViCsi.cpp, function initialize(), line 97)
NvPclDriverInitializeData: Unable to initialize driver v4l2_sensor
NvPclInitializeDrivers: error: Failed to init camera sub module v4l2_sensor
NvPclStartPlatformDrivers: Failed to start module drivers
NvPclCloseModuleDrivers: deallocate/free overrides pathname @ 0x7facbc34b0
NvPclCloseModuleDrivers: deallocate/free overrides pathname @ 0x7facbc3540
NvPclCloseModuleDrivers: deallocate/free overrides pathname @ 0x7facbc35d0
NvPclCloseModuleDrivers: deallocate/free overrides pathname @ 0x7facbdfe80
NvPclCloseModuleDrivers: deallocate/free overrides pathname @ 0x7facbdff10
NvPclCloseModuleDrivers: deallocate/free overrides pathname @ 0x7facbdffa0
NvPclStateControllerOpen: Failed ImagerGUID 0. (error 0xA000E)
NvPclStateControllerClose: Module imx290_bottom_A6V26 closed
NvPclOpen: PCL Open Failed. Error: 0xf
NvPclClose: ++++++++++++++++++++++
NvPclClose: ----------------------
NvPclOpen: ----------------------
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 ...
[1]+ Segmentation fault (core dumped) /usr/sbin/nvcamera-daemon (wd: /home/nvidia)
(wd now: /dev)
Lines from device tree:
// from i2c@c240000
imx290_b@1a {
compatible = "nvidia,imx290";
reg = <0x1a>;
devnode = "video0";
physical_w = "3.674";
physical_h = "2.738";
avdd-reg = "vana";
iovdd-reg = "vif";
dvdd-reg = "vdig";
delayed_gain = "true";
clocks = <0xd 0x5a 0xd 0x10d>;
clock-names = "extperiph2", "pllp_grtba";
mclk = "extperiph2";
reset-gpios = <0x12 0x8d 0x0>;
vana-supply = <0x1d>;
vif-supply = <0x1f>;
vdig-supply = <0x2c>;
status = "okay";
mode0 {
mclk_khz = "37125";
num_lanes = [34 00];
tegra_sinterface = "serial_a";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = [30 00];
active_w = "1920";
active_h = "1080";
pixel_t = "bayer_rggb";
readout_orientation = "90";
line_length = "4200";
inherent_gain = [31 00];
mclk_multiplier = "25";
pix_clk_hz = "756000000";
min_gain_val = "1.0";
max_gain_val = "22.2";
min_hdr_ratio = [31 00];
max_hdr_ratio = "64";
min_framerate = "1.462526";
max_framerate = "60";
min_exp_time = "16.165";
max_exp_time = "165770";
embedded_metadata_height = [31 00];
};
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
reg = <0x0>;
endpoint {
csi-port = <0x0>;
bus-width = <0x4>;
remote-endpoint = <0x25>;
/*linux,phandle = <0xab>;
phandle = <0xab>;*/
};
};
};
...
// on i2c@3180000
imx290_c@1a {
compatible = "nvidia,imx290";
reg = <0x1a>;
devnode = "video1";
physical_w = "3.674";
physical_h = "2.738";
avdd-reg = "vana";
iovdd-reg = "vif";
dvdd-reg = "vdig";
delayed_gain = "true";
clocks = <0xd 0x59 0xd 0x10d>;
clock-names = "extperiph1", "pllp_grtba";
mclk = "extperiph1";
reset-gpios = <0x12 0x8d 0x0>;
vana-supply = <0x1d>;
vif-supply = <0x1f>;
vdig-supply = <0x2c>;
status = "okay";
mode0 {
mclk_khz = "37125";
num_lanes = [34 00];
tegra_sinterface = "serial_a";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = [30 00];
active_w = "1920";
active_h = "1080";
pixel_t = "bayer_rggb";
readout_orientation = "90";
line_length = "4200";
inherent_gain = [31 00];
mclk_multiplier = "25";
pix_clk_hz = "756000000";
min_gain_val = "1.0";
max_gain_val = "22.2";
min_hdr_ratio = [31 00];
max_hdr_ratio = "64";
min_framerate = "1.462526";
max_framerate = "60";
min_exp_time = "16.165";
max_exp_time = "165770";
embedded_metadata_height = [31 00];
};
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
reg = <0x0>;
endpoint {
csi-port = <0x2>;
bus-width = <0x4>;
remote-endpoint = <0x25>;
/*linux,phandle = <0xab>;
phandle = <0xab>;*/
};
};
};
};
...
// on i2c@3190000
imx290_d@1a {
compatible = "nvidia,imx290";
reg = <0x1a>;
devnode = "video2";
physical_w = "3.674";
physical_h = "2.738";
avdd-reg = "vana";
iovdd-reg = "vif";
dvdd-reg = "vdig";
delayed_gain = "true";
clocks = <0xd 0x5b 0xd 0x10d>;
clock-names = "extperiph3", "pllp_grtba";
mclk = "extperiph3";
reset-gpios = <0x12 0x8d 0x0>;
vana-supply = <0x1d>;
vif-supply = <0x1f>;
vdig-supply = <0x2c>;
status = "okay";
/*linux,phandle = <0x177>;
phandle = <0x177>;*/
mode0 {
mclk_khz = "37125";
num_lanes = [34 00];
tegra_sinterface = "serial_a";
discontinuous_clk = "no";
dpcm_enable = "false";
cil_settletime = [30 00];
active_w = "1920";
active_h = "1080";
pixel_t = "bayer_rggb";
readout_orientation = "90";
line_length = "4200";
inherent_gain = [31 00];
mclk_multiplier = "25";
pix_clk_hz = "756000000";
min_gain_val = "1.0";
max_gain_val = "22.2";
min_hdr_ratio = [31 00];
max_hdr_ratio = "64";
min_framerate = "1.462526";
max_framerate = "60";
min_exp_time = "16.165";
max_exp_time = "165770";
embedded_metadata_height = [31 00];
};
ports {
#address-cells = <0x1>;
#size-cells = <0x0>;
port@0 {
reg = <0x0>;
endpoint {
csi-port = <0x4>;
bus-width = <0x4>;
remote-endpoint = <0x25>;
/*linux,phandle = <0xab>;
phandle = <0xab>;*/
};
};
};
};
tegra-camera-platform {
compatible = "nvidia, tegra-camera-platform";
num_csi_lanes = <0x4>;
max_lane_speed = <0x16e360>;
min_bits_per_pixel = <0xa>;
vi_peak_byte_per_pixel = <0x2>;
vi_bw_margin_pct = <0x19>;
max_pixel_rate = <0xb71b0>;
isp_peak_byte_per_pixel = <0x5>;
isp_bw_margin_pct = <0x19>;
tpg_max_iso = <0x3bc400>;
linux,phandle = <0x134>;
phandle = <0x134>;
modules {
module0 {
badge = "imx290_bottomleft_A6V26";
position = "bottomleft";
orientation = [31 00];
status = "okay";
/*linux,phandle = <0x12c>;*/
/*phandle = <0x12c>;*/
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx290 31-001a";
proc-device-tree = "/proc/device-tree/i2c@c240000/imx290_b@1a";
status = "okay";
};
};
module1 {
badge = "imx290_centerleft_A6V26";
position = "centerleft";
orientation = [31 00];
status = "okay";
/*linux,phandle = <0x12c>;*/
/*phandle = <0x12c>;*/
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx290 32-001a";
proc-device-tree = "/proc/device-tree/i2c@3180000/imx290_c@1a";
status = "okay";
};
};
module2 {
badge = "imx290_centerright_A6V26";
position = "centerright";
orientation = [31 00];
status = "okay";
/*linux,phandle = <0x12c>;*/
/*phandle = <0x12c>;*/
drivernode0 {
pcl_id = "v4l2_sensor";
devname = "imx290 33-001a";
proc-device-tree = "/proc/device-tree/i2c@3190000/imx290_d@1a";
status = "okay";
};
};
};
Note: I am developing and rebuilding my kernel on a TX2 according to Build Kernel and Modules - NVIDIA Jetson TX2 - JetsonHacks
Thank you!
James