How to use ISP in Xavier when connected with IMX390

I have LI-IMX390-GMSL2 camera and a borad transfer GMSL2 into USB. And I connect USB with Xavier.
LI-IMX390-GMSL2 link: https://leopardimaging.com/product/li-imx390-gmsl2/

Now I wonder if I can use the ISP for auto-exposure and so on in Xavier? If it is available, How can I use it, If there has any API i can use for ISP function?

Hi Chad-Ding,

The IMX390-GMSL2 must connect to Xavier through MIPI interface to use the ISP file. The USB camera cannot use it.
We have IMX390-GMSL2-XAVIER kit which can connect to Xavier through MIPI interface.

If you would like to try the MIPI interface, you can just buy the two adapter boards and one cable since you already have the IMX390-GMSL2 camera.

LI-JXAV-MIPI-ADPT-4CAM: https://leopardimaging.com/product/li-jxav-mipi-adpt-4cam/
LI-GMSL2-IPX-DESER: https://leopardimaging.com/product/li-gmsl2-ipx-deser/
FAW-1233-03: https://leopardimaging.com/product/faw-1233-cable/
12V power supply: https://leopardimaging.com/product/li-ps12-01/

I wonder that if I can use libargus to control ISP when I buy LI-IMX390-GMSL2-XAVIER
libargus:http://on-demand.gputechconf.com/gtc/2016/webinar/getting-started-jetpack-camera-api.pdf
Also, this API(Argus Camera API) is included in terga multi-media? is it right?

Meanwhile, if I do not use ISP function for this camera, can i get frame from IMX390 using usb instead of using MIPI,

In this process, I found that after camera connected with Xavier, the dmesg print that it works ok, and I can found video0 in /dev
After that, I try to run demo in

tegra_multimedia_api/argus/build/samples/histogram

However, the demo run with error that “No camera device is found”

So I wonder that the code in multi-media depends on CSI not for v4l2?
because, i run

nvidia@nvidia-desktop:~/tegra_multimedia_api/shell$ v4l2-ctl -d /dev/video0 --all
Driver Info (not using libv4l2):
        Driver name   : uvcvideo
        Card type     : LI-IMX390
        Bus info      : usb-3610000.xhci-4
        Driver version: 4.9.140
        Capabilities  : 0x84200001
                Video Capture
                Streaming
                Extended Pix Format
                Device Capabilities
        Device Caps   : 0x04200001
                Video Capture
                Streaming
                Extended Pix Format
Priority: 2
Video input : 0 (Camera 1: ok)
Format Video Capture:
        Width/Height      : 640/480
        Pixel Format      : 'YUYV'
        Field             : None
        Bytes per Line    : 1280
        Size Image        : 1843200
        Colorspace        : Default
        Transfer Function : Default (maps to Rec. 709)
        YCbCr/HSV Encoding: Default (maps to ITU-R 601)
        Quantization      : Default (maps to Limited Range)
        Flags             :
Crop Capability Video Capture:
        Bounds      : Left 0, Top 0, Width 640, Height 480
        Default     : Left 0, Top 0, Width 640, Height 480
        Pixel Aspect: 1/1
Selection: crop_default, Left 0, Top 0, Width 640, Height 480
Selection: crop_bounds, Left 0, Top 0, Width 640, Height 480
Streaming Parameters Video Capture:
        Capabilities     : timeperframe
        Frames per second: 30.000 (30/1)
        Read buffers     : 0
                           gain 0x00980913 (int)    : min=1 max=63 step=1 default=32 value=60

Also, when I use gstreamer, I can not see the image.

gst-launch-1.0 v4l2src device=/dev/video0 ! videoconvert ! ximagesink

can you help me?

Hi Chad_Ding,

You can try guvcview to run the LI-USB30-IMX390-GMSL2 camera.
The guvcview can be installed by below commands on Xavier.

sudo add-apt-repository main
sudo add-apt-repository universe
sudo add-apt-repository restricted
sudo add-apt-repository multiverse
sudo apt-get update
sudo apt-get install guvcview

I try to run guvview, and it print error as follows:

nvidia@nvidia-desktop:~$ guvcview -d /dev/video0
nvbuf_utils: Could not get EGL display connection
nvbuf_utils: Could not get EGL display connection
Opening in O_NONBLOCKING MODE
GUVCVIEW: version 2.0.5
nvbuf_utils: Could not get EGL display connection
nvbuf_utils: Could not get EGL display connection
Opening in O_NONBLOCKING MODE
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (UVCIOC_CTRL_MAP) Error: No such file or directory
V4L2_CORE: (VIDIOC_G_EXT_CTRLS) failed
V4L2_CORE: using VIDIOC_G_EXT_CTRLS on single controls for class: 0x009a0000
V4L2_CORE: control id: 0x009a0903 failed to get (error -1)
ALSA lib confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.tegra-hda-galen.pcm.front.0:CARD=0'
ALSA lib conf.c:4528:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
ALSA lib conf.c:5007:(snd_config_expand) Evaluate error: No such file or directory
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM front
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_hw.c:1713:(_snd_pcm_hw_open) Invalid value for card
ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
V4L2_CORE: Could not grab image (select timeout): Resource temporarily unavailable
V4L2_CORE: Could not grab image (select timeout): Resource temporarily unavailable
GUVCVIEW: (status) saving video to /home/nvidia/my_video-1.mkv
ENCODER: add stream 0 to stream list
ENCODER: add stream 1 to stream list
ENCODER: (matroska) add seekhead entry 0 (max 10)
ENCODER: (matroska) add seekhead entry 1 (max 10)
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1771846
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1755621
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1755303
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1758142
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1756776
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1759644
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1330708
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1161788
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1161223
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1152723
ENCODER: Error encoding video frame: -1
[mpeg4 @ 0x7f5c000e50] Provided packet is too small, needs to be 1153572
ENCODER: Error encoding video frame: -1
AUDIO: (portaudio) Aborting audio stream
AUDIO: Closing audio stream...
ENCODER: (matroska) closing context
ENCODER: (matroska) closing cluster
ENCODER: (matroska)write seekhead
ENCODER: (matroska) end duration = 22647 (22647.000000)

While i can see the green screen which caps by camera, However, I play the record in VLC, it shows black always.

The dmesg show as follows:

[59037.522750] usb 2-4: new SuperSpeed USB device number 5 using tegra-xusb
[59037.542881] usb 2-4: LPM exit latency is zeroed, disabling LPM.
[59037.543294] usb 2-4: Int endpoint with wBytesPerInterval of 1024 in config 1 interface 0 altsetting 0 ep 130: setting to 64
[59037.544338] usb 2-4: New USB device found, idVendor=2a0b, idProduct=00c7
[59037.544393] usb 2-4: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[59037.544400] usb 2-4: Product: LI-IMX390
[59037.544403] usb 2-4: Manufacturer: Leopard Imaging
[59037.544406] usb 2-4: SerialNumber: 0000000001
[59037.547073] uvcvideo: Found UVC 1.10 device LI-IMX390 (2a0b:00c7)
[59037.549736] uvcvideo 2-4:1.0: Entity type for entity Extension 3 was not initialized!
[59037.549931] uvcvideo 2-4:1.0: Entity type for entity Processing 2 was not initialized!
[59037.550063] uvcvideo 2-4:1.0: Entity type for entity Camera 1 was not initialized!
[59037.550406] input: LI-IMX390 as /devices/3610000.xhci/usb2/2-4/2-4:1.0/input/input11
[59040.421797] usb 2-4: usb_suspend_both: status 0
[59040.422244] usb usb2: usb_suspend_both: status 0
[59040.422279] tegra-xusb 3610000.xhci: entering ELPG
[59040.442302] tegra-xusb 3610000.xhci: entering ELPG done

Hi Chad_Ding,

Please follow below sequence to run the camera:

  1. Plug in the 12V power supply to USB 3.0 Tester.
  2. Connect the camera to Xavier (USB3.0 port) through USB 3.0 cable.
  3. Open guvcview.

Have you tested this camera on regular Windows PCs to make sure the camera works properly?

How to test the camera in windows PC, what software do i need to install?

I connect IMX390 USB into windows10 PC and test it using windows camera, and it show like this.

Hi Chad_Ding,

I cannot see the image. If possible, you can send the image to my Email (simonz@leopardimaging.com).

The picture is attach in #9,thanks!

Hi Chad_Ding,

Thanks for image. The image looks normal since this camera outputs raw data.
We will try the camera on Xavier here.

I wonder how to convert raw data into NV12 or RGB, so I can use this camera.

Hi Chad_Ding,

We can get vide output from IMX390-GMSL2 via VLC on Xavier. Maybe some libs missing for guvcview.

We have a Linux camera tool which can convert the raw to RGB. Please give it a try.

Hi,

is there any support for AR0231 Sensors which we have connected via GMSL2 and USB3.0 Deserializer? I can get a picture with the linux_camera_tool but with a lot of noise and weird colors. Any plan to support the RCCB Sensor?

Hi cschro,

The current Linux camera tool doesn’t support RCCB. Our team may give it a try to add the RCCB mode. Once there is a new version, we will update it to github.

Hi Simon,

so am I right that LI sells a product/sensor, which there is absolutely no support for?

–> CameraTool on Windows does not work, gives a greenish picture (not RAW data) at approx. 0.5 fps
–> guvcview on Linux gives same picture at approx 1-2 fps
–> linux camera tool also not working

It might be that we are doing something wrong but since there is no manual or instructions at all and support tends to only answer the easiest questions (did you plug in USB correctly?), we cannot tell what is wrong.

Just wondering…

Hi cschro,

Sorry for the trouble.
Actually, it is normal that you see the greenish image. The AR0231-GMSL2 camera outputs RAW data encapsulated in YUY2 format. Since UVC standard has no RAW image format, we use YUY2 as the wrapper. In regular video software, it doesn’t know this is RAW, and it interprets it as YUY2. That is why you see greenish image. Our camera tool can convert the raw to bmp image. We didn’t see any issues with the camera tool and AR0231-GMSL2 camera on Windows OS, and we can use our camera tool to capture raw images. If your camera has problems, please contact our support (support@leopardimaging.com) for further assistance.

Hello @SimonZhu I’m Harshwardhan Bhangale from India. I’m currently working on project which invovles capturing of raw format images from IMX390-dual-GMSL camera by leopard imaging, using xavier. So could you help me with resources which woukd guide me to install all the necessary drivers and capture images through that camera using only V4L2 and also with Libargus.

Hi hbhangale3,

Please contact support@leopardimaging.com to ask for the driver guide.