JETSON TX2 e-CAM131_CUTX2 driver issue

Hello,

I bought a e-con System camera, ref e-CAM131_CUTX2 for my NVIDIA JETSON TX2 Developer Kit and i would try to use it.

So, I have used documents provide by e-con Systems (e-CAM131_CUTX2 - 13 MP TX1/TX2 Camera Getting Started Manual and GUVCView Build and Installation Guide) to download and install camera driver to use it, but I have two different issues according to the method I used :

I precise that I have a Host-Pc with GNU/Linux 4.15.0

Method1) Flashing method explained in “e-CAM131_CUTX2 - 13 MP TX1/TX2 Camera Getting Started Manual” :

After I had downloaded “e-CAM131_CUTX2_JETSON_TX2_RELEASE_PACKAGE_V1.00-23-06-2017.rar” file as explain in the document, I flashed my TX2 card with the Quick Starter contained in Archive, following the instruction provided by this one.

And then, when I reboot the card as asked, I have a black screen from HDMI port as if the card doesn’t boot.

Method 2) Flashing Method provided by Nvidia with JetPack :

I flash my card as explain in https://docs.nvidia.com/jetpack-l4t/index.html#jetpack/3.2.1/install.htm%3FTocPath%3D_____3, which work perfectly. And then on the embedded Ubuntu system, I execute the bash script provide in the archive presented upstream and name “install_TX2_bins.sh”. Once the script has finished, he displayed in the console the following message:

Done! Now reboot the board to get the camera working.
Refer to README.txt and e-CAM131_TX2_Linux_App_User_Manual.pdf in case of any doubt.

At this point the operating system still working, but when I reboot the card, this time I have a display, but it’s stuck on the nvidia’s logo screen which appears when the card boot and if we look the serial port output we got this :

U-Boot 2016.07-g9c3b9a4 (May 17 2018 - 00:08:48 -0700)                          
                                                                                
TEGRA186                                                                        
Model: NVIDIA P2771-0000-500                                                    
DRAM:  7.8 GiB                                                                  
MC:   Tegra SD/MMC: 0, Tegra SD/MMC: 1                                          
*** Warning - bad CRC, using default environment                                
                                                                                
In:    serial                                                                   
Out:   serial                                                                   
Err:   serial                                                                   
Net:   eth0: ethernet@2490000                                                   
Hit any key to stop autoboot:  0                                                
MMC: no card present                                                            
switch to partitions #0, OK                                                     
mmc0(part 0) is current device                                                  
Scanning mmc 0:1...                                                             
Found /boot/extlinux/extlinux.conf                                              
Retrieving file: /boot/extlinux/extlinux.conf                                   
939 bytes read in 93 ms (9.8 KiB/s)                                             
p2771-0000 eMMC boot options                                                    
1:      primary kernel                                                          
2:      custom built kernel with ar1335 support                                 
Enter choice: 2:        custom built kernel with ar1335 support                 
Retrieving file: /boot/Image                                                    
19223128 bytes read in 507 ms (36.2 MiB/s)                                      
append: fbcon=map:0 net.ifnames=0 console=tty0 OS=l4t console=ttyS0,115200n8 met
Retrieving file: /boot/tegra186-quill-p3310-1000-c03-00-ar1335.dtb              
248256 bytes read in 127 ms (1.9 MiB/s)                                         
## Flattened Device Tree blob at 82200000                                       
   Booting using the fdt blob at 0x82200000                                     
   reserving fdt memory region: addr=80000000 size=10000                        
   Using Device Tree in place at 0000000082200000, end 000000008223f9bf         
WARNING: could not set reg FDT_ERR_NOSPACE.                                     
ERROR: arch-specific fdt fixup failed                                           
 - must RESET the board to recover.

Sadly, if I don’t install the camera driver, I wouldn’t can use it. However I need to use it for an application hence my question.

Does someone already had this issue? Or does someone know how to resolve it?

Thanks

Hi lgauthier,

Thanks for the detailed description about the issue you are facing. We need some clarifications,

  1. The host PC that you are using to flash the Jetson Device should run Ubuntu 14.04 with ~100GB free hard disk space (in the drive you are using the flash script).

  2. The method 2, won’t work here. In the new Jetpack 3.2.1 supported L4T is R28.2.1. But the binaries present in package “e-CAM131_CUTX2_JETSON_TX2_RELEASE_PACKAGE_V1.00-23-06-2017.rar” only supports L4T R27.1. This may cause unexpected behavior.

  3. We suggest you to download the latest software package from “https://developer.e-consystems.com/” and flash the same. The package that you are using “e-CAM131_CUTX2_JETSON_TX2_RELEASE_PACKAGE_V1.00-23-06-2017.rar” is depreciated.

Hope this helps to solve your issue. If you face further issue kindly write to “techsupport@e-consystems.com”.

Hi JeslinPaul,

Thanks for your response. I’m actually on Ubuntu 18.08 on my host PC and I can’t have an L4T R27.1 system because JetPack 3.0 only work on Ubuntu 14 and 16. However, I will deal with this point.

What’s annoy me more, is that you tell me “e-CAM131_CUTX2_JETSON_TX2_RELEASE_PACKAGE_V1.00-23-06-2017.rar” is depreciated and to download the latest software package from https://developer.e-consystems.com/.

However, “e-CAM131_CUTX2_JETSON_TX2_RELEASE_PACKAGE_V1.00-23-06-2017.rar” is the latest version provide on the website for my camera as you can see in the following picture : LINK

Do you think it’s a mistake on the website or is it really the latest version for this device ?

Hi Lgauthier,
The release package “e-CAM131_CUTX2_JETSON_TX2_RELEASE_PACKAGE_V1.00-23-06-2017.rar” is depreciated. Somehow latest release package is not updated to developer website “https://developer.e-consystems.com/”. We will rectify it shortly.
Kindly write a mail to “techsupport@e-consystems.com” we will share the latest release package to you.

Regards,
Jeslin Paul

Does e-con systems have a patch file for L4T R28.2 for the e-CAM131_CUTx2?

Hi Connorsoohoo,
For e-CAM131_CUTX2, currently we are supporting L4T27.1 for TX2 and L4T24.2 for TX1. Shortly we will add support to latest L4T version (R28.2.1 for TX2 and 28.2 for TX1).

Regards,
Jeslin Paul

Hi, I replace Lgauthier on this work, so I will be your new interlocutor.

Actually, we have used a VM with ubuntu 14 to flash JetPack card and we installed the latest version of driver provide on your web site. This solution allowed us to make your camera work properly. So thank’s to you for your help on this point.

However, even if we can use ecam_tk1_guvcview and gst-launch command on terminal, we can’t use gstreamer pipelines with the VideCapture calls of openCV. In fact, when we use it, as follow

int main(){
    // Create OpenCV capture object, ensure it works.
    cv::VideoCapture cap("v4l2src ! video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1080 ! nvvidconv ! video/x-raw(memory:NVMM),format=(string)I420, width=(int)1280, height=(int)720 ! nvoverlaysink overlay-w=1280 overlay-h=720 sync=false", cv::CAP_V4L);
    if (!cap.isOpened()) {
        std::cout << "Connection failed";
        return -1;
    }

    // View video
    cv::Mat frame;
    while (1) {
        cap >> frame;  // Get a new frame from camera

        // Display frame
        imshow("Display window", frame);
        cv::waitKey(1); //needed to show frame
    }
}

We get the following error mesage:

VIDEOIO ERROR: V4L: device v4l2src ! video/x-raw, format=(string)UYVY, width=(int)1920,height=(int)1080 ! 
nvvidconv ! video/x-raw(memory:NVMM),format=(string)I420, width=(int)1280, height=(int)720 ! 
nvoverlaysink overlay-w=1280 overlay-h=720 sync=false: Unable to query number of channels

Connection failed

When we made research on web we saw that this problem could be caused by opencv which would not have been built with gstreamer support, but we removed opencv4tegra from the TX2 board and we had compiled and installed opencv 3.4.1 with gstreamer support. So if someone has any idea to how resolve this error, he or she would be welcome.

Regards, Perret Quentin

Hi Perret Quentin,
Great to know one of your major issue resolved.
Yes, your research is correct, you need to compile OpenCV with GStreamer support. Kindly use the below pipeline to stream from the camera.

cv::VideoCapture cap("v4l2src device=/dev/video0 ! video/x-raw,width=1920,height=1080,format=(string)UYVY ! nvvidconv ! video/x-raw(memory:NVMM),width=1920,height=1080,format=(string)I420 ! nvvidconv! video/x-raw, format=(string)BGRx ! videoconvert ! video/x-raw, format=(string)BGR ! appsink");

Regards,
Jeslin Paul

Hi Jeslin Paul,

Thank you very much for your help, your pipe works perfectly for our usage.

Have a great continuation

Regards,
Perret Quentin

The pipeline with multiple copies to/from NVMM memory looks a bit complicated.
Does this simpler pipeline works ?

v4l2src device=/dev/video0 ! 'video/x-raw, format=UYVY' ! videoconvert ! 'video/x-raw, format=BGR' ! appsink

Hi Honey_Patouceul,

Your pipeline doesn’t work with gst-launch-1.0 or with cv::videoCapture.
I got this error with cv::videoCapture:

(gstream_test:5113): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

(gstream_test:5113): GStreamer-CRITICAL **: gst_element_make_from_uri: assertion 'gst_uri_is_valid (uri)' failed

(gstream_test:5113): GLib-GObject-WARNING **: invalid cast from 'GstAppSink' to 'GstBin'

(gstream_test:5113): GStreamer-CRITICAL **: gst_bin_iterate_elements: assertion 'GST_IS_BIN (bin)' failed

(gstream_test:5113): GStreamer-CRITICAL **: gst_iterator_next: assertion 'it != NULL' failed

(gstream_test:5113): GStreamer-CRITICAL **: gst_iterator_free: assertion 'it != NULL' failed

(gstream_test:5113): GStreamer-CRITICAL **: gst_element_get_state: assertion 'GST_IS_ELEMENT (element)' failed
VIDEOIO ERROR: V4L: device v4l2src device=/dev/video0 ! 'video/x-raw, format=UYVY' ! videoconvert ! 'video/x-raw, format=BGR' ! appsink: Unable to query number of channels
***Could not initialize capturing...***

What is the ouput of:

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, format=UYVY' ! videoconvert ! 'video/x-raw, format=BGR' ! appsink

If this fails, you may add the resolution:

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, format=UYVY, width=1920, height=1080' ! videoconvert ! 'video/x-raw, format=BGR' ! appsink

If it still fails, check the available formats from your camera with:

v4l2-ctl --list-formats-ext

Note that v4l2-ctl is part of package v4l-utils.

Also note that caps are only quoted in terminal with gst-launch, but not for using from opencv:

cv::VideoCapture cap("v4l2src device=/dev/video0 ! video/x-raw, width=1920, height=1080, format=UYVY ! videoconvert ! video/x-raw, format=BGR ! appsink

Ah yes, it’s better without the quotes, it works now but I lose 10 FPS compared to the longest pipeline.

Here is the output of your pipeline with the resolution (Sorry, it’s in french):

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, format=UYVY, width=1920, height=1080' ! videoconvert ! 'video/x-raw, format=BGR' ! appsink
Définition du pipeline à PAUSED...
Le pipeline est actif et n’a pas besoin de phase PREROLL…
Passage du pipeline à la phase PLAYING…
New clock: GstSystemClock

The process will stop by itself, but sometimes, I get a segfault.

Ok, probably the copy to NVMM memory allows to use nvvidconv for faster conversion from YUV to RGB colorspace.
videoconvert is CPU only, it may be slow for this, but ok for simpler BGRx → BGR.
Sorry for bad advice.

Hi Lgauthier,
We have added support for Latest L4T R28.2.1 for e-CAM131_CUTX2. You can download the latest release package from our developer website.