Until recently I’ve been using an IMX219 camera sensor on the TX1 without issue. A couple of weeks ago I was attempting use gstreamer to capture video from different boards (circuit board with TX1 module) when one of the TX1 module with a camera sensor started acting strange.
On the misbehaving TX1 I could capture a raw bayer image from the camera sensor and use some userland applications to convert it to a png and the image looked fine but when I would use nvgstcapture or a gstreamer pipeline the image would come out oversaturated with one of the following: blue, red or yellow, it was like a grayscale image except instead of white as the brightest it would be blue.
I have two TX1 modules both with different rootfs, call them A and B for reference.
I can flash both TX1s with rootfs ‘A’ and they would both capture images correctly.
I can flash both TX1s with rootfs ‘B’ and they would both fail.
This proves it’s not a hardware issue (Circuit board or the TX1 Module).
If one TX1 had ‘A’ and the other had ‘B’ and I installed the same bootloader, kernel and DTB I would see the same result (‘A’ would work and ‘B’ would fail)!?
The one difference I noticed between ‘A’ and ‘B’ was if I ran ‘nvcamera-daemon’ as a foreground application and run the following gstreamer command on both:
gst-launch-1.0 -v -m nvcamerasrc sensor-id=0 fpsRange="30 30" num-buffers=1 ! 'video/x-raw(memory:NVMM), width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! nvvidconv ! 'video/x-raw, width=(int)1920, height=(int)1080, format=(string)I420, framerate=(fraction)30/1' ! jpegenc ! filesink location=/home/ubuntu/Projects/video-tester/test.jpg -e
I would see differing outputs as follows:
‘A’ (Working):
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
(NvOdmDevice) Error NotInitialized: V4L2Device not powered on (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setControlVal(), line 378)
(NvOdmDevice) Error NotInitialized: V4L2Device not powered on (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setControlVal(), line 378)
‘B’ (Not Working):
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
NvPclHwGetModuleList: No module data found
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
Sensor_LoadModeModeType: mode 0: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 0: Failed to load pixeltype
Sensor_LoadModeModeType: mode 1: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 1: Failed to load pixeltype
Sensor_LoadModeModeType: mode 2: Failed to load pixeltype
Sensor_LoadModePixelPhase: mode 2: Failed to load pixeltype
LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12LSC:patch width less than 12(NvOdmDevice) Error NotInitialized: V4L2Device not powered on (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setControlVal(), line 378)
(NvOdmDevice) Error NotInitialized: V4L2Device not powered on (in dvs/git/dirty/git-master_linux/camera-partner/imager/src/V4L2Device.cpp, function setControlVal(), line 378)
Note the: LSC:patch width less than 12
When I run a different pipeline to capture a video stream that above error would repeat continuously
I won’t go into the painful details about using a hex editor to view where those errors come from but I finally found something that would effect the behavior of the cameras.
in the /var/nvidia/nvcam/settings/ directory if I replaced the nvcam_cache*.bin from ‘B’ with the content of the same file within ‘A’ I wouldn’t see that error. The camera sensors would work fine and the problem is fixed.
If I delete the files and run the applications again the error would arise.
It looks like these files store the settings for the ISP for use with a camera. Unfortunately there is something going weird when the application needs to populate the camera’s cache:
Here is an excerpt from the nvcamera-daemon when I delete the cache files and re-run the jpeg capture pipeline.
...
ISP Config file did not load from cache, quering deviceNvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 170: Error: Invalid isp config attribute element: "flash.TorchLevel[0]=100.00"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 171: Error: Invalid isp config attribute element: "flash.FlashLevel[0]=180.00"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 180: Error: Invalid isp config attribute: "nr.v1.luma.Enable=TRUE"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 181: Error: Invalid isp config attribute: "nr.v1.luma.IsoThreshold=100"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 182: Error: Invalid isp config attribute: "nr.v1.luma.Slope=0.01"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 183: Error: Invalid isp config attribute: "nr.v1.luma.Threshold=0.015"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 184: Error: Invalid isp config attribute: "nr.v1.chroma.Enable=TRUE"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 185: Error: Invalid isp config attribute: "nr.v1.chroma.IsoThreshold=100"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 186: Error: Invalid isp config attribute: "nr.v1.chroma.Slope=0.40"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 187: Error: Invalid isp config attribute: "nr.v1.chroma.Threshold=0.08"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 188: Error: Invalid isp config attribute: "nr.v2.chroma.Enable=FALSE"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 189: Error: Invalid isp config attribute: "nr.v2.chroma.IsoThreshold=100"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 190: Error: Invalid isp config attribute: "nr.v2.chroma.Slope=1.0"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 191: Error: Invalid isp config attribute: "nr.v2.chroma.Threshold=0.0"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 192: Error: Invalid isp config attribute: "nr.v2.chroma.PredefinedGainResponse={0,0,0,0,0,0,1,2,3,4,4,4,4,4,4,4}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 193: Error: Invalid isp config attribute element: "ae.noiseReduction.Preview[0]={0,0,1,2,2,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 194: Error: Invalid isp config attribute element: "ae.noiseReduction.Preview[1]={0,1,1,2,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 195: Error: Invalid isp config attribute element: "ae.noiseReduction.Preview[2]={1,1,2,2,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 196: Error: Invalid isp config attribute element: "ae.noiseReduction.Preview[3]={2,2,2,3,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 197: Error: Invalid isp config attribute element: "ae.noiseReduction.Still[0]={0,0,1,2,2,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 198: Error: Invalid isp config attribute element: "ae.noiseReduction.Still[1]={0,1,1,2,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 199: Error: Invalid isp config attribute element: "ae.noiseReduction.Still[2]={1,1,2,2,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 200: Error: Invalid isp config attribute element: "ae.noiseReduction.Still[3]={2,2,2,3,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 201: Error: Invalid isp config attribute element: "ae.noiseReduction.Video[0]={0,0,1,2,2,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 202: Error: Invalid isp config attribute element: "ae.noiseReduction.Video[1]={0,1,1,2,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 203: Error: Invalid isp config attribute element: "ae.noiseReduction.Video[2]={1,1,2,2,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 204: Error: Invalid isp config attribute element: "ae.noiseReduction.Video[3]={2,2,2,3,3,3,3}"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 205: Error: Invalid isp config attribute: "edgeEnhance.strength.Preview=0.113"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 206: Error: Invalid isp config attribute: "edgeEnhance.strength.Still=0.113"
NvCameraIspConfigFileLoad: Config file "sensor.cfg" Line 207: Error: Invalid isp config attribute: "edgeEnhance.strength.Video=0.113"
LSC:patch width less than 12
...
I’ve been searching around for a ‘sensor.cfg’ file but couldn’t find it.
I would think that the dts file for the camera would be the thing used to populate this cache file but it doesn’t seem as though the changes I make within the DTS file fixes this problem.
How can I configure the ISPs correctly whenever the cache needs to be rebuilt?
I don’t have access to the NVIDIA partners program so all of these files are opaque to me.
Thanks in advance for any help,
Dave