OmniVision OVM6211 Linux Driver

From RidgeRun Developer Wiki




Problems running the pipelines shown on this page? Please see our GStreamer Debugging guide for help.


Driver List Information
Refer to the RidgeRun Linux Camera Drivers to meet all the list of Drivers available


Keywords: OVM6211 Jetson Nano, GStreamer, Raspberry PI, NVIDIA, RidgeRun, V4L2 Driver, OmniVision

OVM6211 features

The OmniVision OVM6211 is a CMOS image sensor with the following features:

  • Automatic image control functions:
    • Automatic black level calibration (ABLC)
  • Image quality controls: lens correction, defective pixel canceling
  • CSI2 serial data output (MIPI interface 1 lane)
  • Support for output formats: 8/10 Raw Monochrome data
  • Maximum image transfer rate:
    • 400x400: 120 fps
    • 200x200: 220 fps
    • 100x100: 380 fps

RidgeRun has developed a driver for the Jetson Nano platform with the following support:

  • V4l2 Media controller driver
  • Tested resolution 400x400 @ 10 fps.
  • Output format: RAW8 Bayer RGGB Monochrome pattern.
  • Capture with GStreamer v4l2src and v4l2-ctl

Currently available for:

  • OVM6211 - Nano - Jetpack 4.3

Enabling the driver

To use this driver, you have to patch and compile the kernel source.

Using Jetpack

Follow these instructions:

1. Download the toolchain following the instructions from:
Download and install the Toolchain

2. Download the NVIDIA SDK Manager from:
NVIDIA SDK Manager
- Then choose the platform (Jetson Nano) and version of JetPack (4.3).

3. Download the L4T Nano sources from:
L4T Nano sources

4. Decompress the public sources following the instructions from:
Decompress kernel sources

5. Apply the patch present in the attached 4.3_ovm6211-v0.1.0.tar file:

- First, untar the provided tarball:

 tar -xvf 4.3_ovm6211-v0.1.0.tar

- Move the decompress patches folder into your $JETSON_NANO_KERNEL_SOURCE directory, along with hardware, kernel, and u-boot directories.
- Apply the patches from the $JETSON_NANO_KERNEL_SOURCE directory as follow:

 quilt push

6. To compile the code follow the steps in this link:
Compile kernel and dtb

7. Flash the Tegra following this guide:
Flash Jetson NANO

Using the driver (GStreamer and v4l2-ctl examples)

The OVM6211 supports a resolution of 400x400 but the platform used (Jetson Nano) defined padding of 48 pixels to the image in order to align and optimize the capture process.
The following image shows the captured image with and without the padding. The post-process applied is to open the image with a 448x400 resolution.

Padding 48 pixels

Video Pipeline Example

The below pipeline capture video at 10fps with a resolution of 400x400:

gst-launch-1.0 v4l2src ! video/x-bayer,format=rggb,width=400,height=400,framerate=10/1 ! perf ! filesink location=test.bayer

Performance statistics

  • Tegrastats in normal operation:
RAM 645/3964MB (lfb 648x4MB) CPU [3%@102,0%@102,0%@102,0%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,0%@102,0%@102,1%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,3%@102,0%@102,0%@102]
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,2%@102,0%@102,0%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [2%@102,0%@102,0%@102,0%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [5%@102,0%@102,0%@102,1%@102] 
RAM 645/3964MB (lfb 648x4MB) CPU [1%@102,0%@102,0%@102,0%@102] 

  • Tegrastats with the above pipeline running
RAM 650/3964MB (lfb 647x4MB) CPU [10%@102,0%@102,3%@102,1%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [10%@102,4%@102,0%@102,2%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [8%@102,2%@102,0%@102,1%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [7%@102,3%@102,1%@102,0%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [8%@102,3%@102,0%@102,0%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [11%@102,1%@102,0%@102,0%@102]
RAM 650/3964MB (lfb 647x4MB) CPU [7%@102,2%@102,3%@102,0%@102] 
RAM 650/3964MB (lfb 647x4MB) CPU [11%@102,5%@102,1%@102,1%@102]
RAM 650/3964MB (lfb 646x4MB) CPU [8%@307,3%@307,2%@307,1%@307]

Framerate

To test the framerate use the following command:

 v4l2-ctl --device /dev/video0 --stream-mmap --stream-count=120 --set-fmt-video=width=400,height=400,pixelformat=RGGB

Obtain:

<<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<< 10.00 fps
<<<<<<<<<

Single Capture

It is possible to take captures with GStreamer using v4l2src and with v4l2-ctrl, both will return the same image.

  • 400x400 - gst-launch-1.0
gst-launch-1.0 -v v4l2src num-buffers=1 ! video/x-bayer,format=rggb,width=400,height=400 ! identity silent=false ! filesink location=test.raw
  • 400x400 - v4l2-ctl
v4l2-ctl -d /dev/video0 --set-fmt-video=width=400,height=400,pixelformat=RGGB --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw

Check the snapshot at https://rawpixels.net/:

Access to raw pixels opens the image captured in the last step and configures the following parameters:

  • width = 448
  • height = 400
  • Predefined format = Grayscale 8bit
  • Pixel Format = Grayscale


For direct inquiries, please refer to the contact information available on our Contact page. Alternatively, you may complete and submit the form provided at the same link. We will respond to your request at our earliest opportunity.


Links to RidgeRun Resources and RidgeRun Artificial Intelligence Solutions can be found in the footer below.