Difference between revisions of "Sony IMX214 Linux Driver"

From RidgeRun Developer Connection
Jump to: navigation, search
(Enabling IMX214 Linux Driver)
m
 
(9 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<seo title="Sony IMX214 Linux Driver | IMX214 Linux Driver for NVIDIA Jetson | RidgeRun" titlemode="replace" keywords="GStreamer, Embedded Linux, Device Drivers, NVIDIA, Xilinx, TI, NXP, Freescale, IMX214 Jetson Nano, IMX214, V4L2 Driver, Sony IMX214, Sony IMX214, IMX214 Linux driver, Sony IMX214 Linux Driver, Sony, Sony IMX214, IMX214 Linux driver support"  description="Check out our comprehensive overview and features of the Sony IMX214 Linux driver for NVIDIA Jetson!."></seo>
+
<seo title="Sony IMX214 Linux Driver | IMX214 Linux Driver for NVIDIA Jetson | RidgeRun" titlemode="replace" metakeywords="GStreamer, Embedded Linux, Device Drivers, NVIDIA, Xilinx, TI, NXP, Freescale, IMX214 Jetson Nano, IMX214, V4L2 Driver, Sony IMX214, Sony IMX214, IMX214 Linux driver, Sony IMX214 Linux Driver, Sony, Sony IMX214, IMX214 Linux driver support"  metadescription="Check out our comprehensive overview and features of the Sony IMX214 Linux driver for NVIDIA Jetson!."></seo>
  
 
<table>
 
<table>
Line 5: Line 5:
 
<td><div class="clear; float:right">__TOC__</div></td>
 
<td><div class="clear; float:right">__TOC__</div></td>
 
<td>
 
<td>
<html>
+
{{Shopping cart mpo for V4L2 camera drivers}}
<div id='product-component-1594671854188'></div>
+
<td>
<script type="text/javascript">
+
{{NVIDIA Preferred Partner logo}}
/*<![CDATA[*/
+
<td>
(function () {
 
  var scriptURL = 'https://sdks.shopifycdn.com/buy-button/latest/buy-button-storefront.min.js';
 
  if (window.ShopifyBuy) {
 
    if (window.ShopifyBuy.UI) {
 
      ShopifyBuyInit();
 
    } else {
 
      loadScript();
 
    }
 
  } else {
 
    loadScript();
 
  }
 
  function loadScript() {
 
    var script = document.createElement('script');
 
    script.async = true;
 
    script.src = scriptURL;
 
    (document.getElementsByTagName('head')[0] || document.getElementsByTagName('body')[0]).appendChild(script);
 
    script.onload = ShopifyBuyInit;
 
  }
 
  function ShopifyBuyInit() {
 
    var client = ShopifyBuy.buildClient({
 
      domain: 'ridgerun1.myshopify.com',
 
      storefrontAccessToken: 'b0ca98633a82de5d2f63cd51f5af30ac',
 
    });
 
    ShopifyBuy.UI.onReady(client).then(function (ui) {
 
      ui.createComponent('product', {
 
        id: '1684420821063',
 
        node: document.getElementById('product-component-1594671854188'),
 
        moneyFormat: '%24%7B%7Bamount%7D%7D',
 
        options: {
 
  "product": {
 
    "styles": {
 
      "product": {
 
        "@media (min-width: 601px)": {
 
          "max-width": "calc(25% - 20px)",
 
          "margin-left": "20px",
 
          "margin-bottom": "50px"
 
        }
 
      },
 
      "button": {
 
        "font-family": "Open Sans, sans-serif",
 
        "font-weight": "bold",
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px",
 
        ":hover": {
 
          "background-color": "#0187a7"
 
        },
 
        "background-color": "#0196ba",
 
        ":focus": {
 
          "background-color": "#0187a7"
 
        },
 
        "border-radius": "5px",
 
        "padding-left": "50px",
 
        "padding-right": "50px"
 
      },
 
      "quantityInput": {
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px"
 
      }
 
    },
 
    "text": {
 
      "button": "Add to cart"
 
    },
 
    "googleFonts": [
 
      "Open Sans"
 
    ]
 
  },
 
  "productSet": {
 
    "styles": {
 
      "products": {
 
        "@media (min-width: 601px)": {
 
          "margin-left": "-20px"
 
        }
 
      }
 
    }
 
  },
 
  "modalProduct": {
 
    "contents": {
 
      "img": false,
 
      "imgWithCarousel": true,
 
      "button": false,
 
      "buttonWithQuantity": true
 
    },
 
    "styles": {
 
      "product": {
 
        "@media (min-width: 601px)": {
 
          "max-width": "100%",
 
          "margin-left": "0px",
 
          "margin-bottom": "0px"
 
        }
 
      },
 
      "button": {
 
        "font-family": "Open Sans, sans-serif",
 
        "font-weight": "bold",
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px",
 
        ":hover": {
 
          "background-color": "#0187a7"
 
        },
 
        "background-color": "#0196ba",
 
        ":focus": {
 
          "background-color": "#0187a7"
 
        },
 
        "border-radius": "5px",
 
        "padding-left": "50px",
 
        "padding-right": "50px"
 
      },
 
      "quantityInput": {
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px"
 
      }
 
    },
 
    "googleFonts": [
 
      "Open Sans"
 
    ]
 
  },
 
  "cart": {
 
    "styles": {
 
      "button": {
 
        "font-family": "Open Sans, sans-serif",
 
        "font-weight": "bold",
 
        "font-size": "18px",
 
        "padding-top": "17px",
 
        "padding-bottom": "17px",
 
        ":hover": {
 
          "background-color": "#0187a7"
 
        },
 
        "background-color": "#0196ba",
 
        ":focus": {
 
          "background-color": "#0187a7"
 
        },
 
        "border-radius": "5px"
 
      },
 
      "title": {
 
        "color": "#4c4c4c"
 
      },
 
      "header": {
 
        "color": "#4c4c4c"
 
      },
 
      "lineItems": {
 
        "color": "#4c4c4c"
 
      },
 
      "subtotalText": {
 
        "color": "#4c4c4c"
 
      },
 
      "subtotal": {
 
        "color": "#4c4c4c"
 
      },
 
      "notice": {
 
        "color": "#4c4c4c"
 
      },
 
      "currency": {
 
        "color": "#4c4c4c"
 
      },
 
      "close": {
 
        "color": "#4c4c4c",
 
        ":hover": {
 
          "color": "#4c4c4c"
 
        }
 
      },
 
      "empty": {
 
        "color": "#4c4c4c"
 
      },
 
      "noteDescription": {
 
        "color": "#4c4c4c"
 
      },
 
      "discountText": {
 
        "color": "#4c4c4c"
 
      },
 
      "discountIcon": {
 
        "fill": "#4c4c4c"
 
      },
 
      "discountAmount": {
 
        "color": "#4c4c4c"
 
      }
 
    },
 
    "googleFonts": [
 
      "Open Sans"
 
    ]
 
  },
 
  "toggle": {
 
    "styles": {
 
      "toggle": {
 
        "font-family": "Open Sans, sans-serif",
 
        "font-weight": "bold",
 
        "background-color": "#0196ba",
 
        ":hover": {
 
          "background-color": "#0187a7"
 
        },
 
        ":focus": {
 
          "background-color": "#0187a7"
 
        }
 
      },
 
      "count": {
 
        "font-size": "18px"
 
      }
 
    },
 
    "googleFonts": [
 
      "Open Sans"
 
    ]
 
  },
 
  "lineItem": {
 
    "styles": {
 
      "variantTitle": {
 
        "color": "#4c4c4c"
 
      },
 
      "title": {
 
        "color": "#4c4c4c"
 
      },
 
      "price": {
 
        "color": "#4c4c4c"
 
      },
 
      "fullPrice": {
 
        "color": "#4c4c4c"
 
      },
 
      "discount": {
 
        "color": "#4c4c4c"
 
      },
 
      "discountIcon": {
 
        "fill": "#4c4c4c"
 
      },
 
      "quantity": {
 
        "color": "#4c4c4c"
 
      },
 
      "quantityIncrement": {
 
        "color": "#4c4c4c",
 
        "border-color": "#4c4c4c"
 
      },
 
      "quantityDecrement": {
 
        "color": "#4c4c4c",
 
        "border-color": "#4c4c4c"
 
      },
 
      "quantityInput": {
 
        "color": "#4c4c4c",
 
        "border-color": "#4c4c4c"
 
      }
 
    }
 
  }
 
},
 
      });
 
    });
 
  }
 
})();
 
/*]]>*/
 
</script>
 
</html>
 
 
<td>
 
<td>
 
{{GStreamer debug}}
 
{{GStreamer debug}}
Line 266: Line 17:
 
</tr>
 
</tr>
 
</table>
 
</table>
 +
<br>
  
== Sony IMX214 Features ==
+
== Sony IMX214 CMOS image sensor features ==
  
IMX214 is a diagonal 5.867mm(Type 1/3.06) 13 Mega-pixel CMOS active pixel type stacked image sensor with a square pixel array. It adopts Exmor RS™ technology to achieve high speed  mage capturing by column parallel A/D converter circuits and high sensitivity and low noise image (comparing with conventional CMOS image sensor) through the backside illuminated imaging pixel structure. R, G, and B pigment primary color mosaic filter is employed. (Taken from [https://www.mouser.com/datasheet/2/897/ProductBrief_IMX214_20150428-1289331.pdf Mouser webpage]).
+
IMX214 is a diagonal 5.867mm(Type 1/3.06) 13 Mega-pixel CMOS active pixel type stacked image sensor with a square pixel array. It adopts Exmor RS™ technology to achieve high speed  image capturing by column parallel A/D converter circuits and high sensitivity and low noise image (comparing with conventional CMOS image sensor) through the backside illuminated imaging pixel structure. R, G, and B pigment primary color mosaic filter is employed. (Taken from [https://www.mouser.com/datasheet/2/897/ProductBrief_IMX214_20150428-1289331.pdf Mouser webpage]).
  
== IMX214 Linux driver support ==
+
== Linux driver support ==
  
 
* NVIDIA Jetson Nano
 
* NVIDIA Jetson Nano
  
== IMX214 Linux driver features ==
+
== Linux driver features ==
  
 
<center>
 
<center>
Line 310: Line 62:
 
* {{Download}} Follow the instructions in [[Jetson_Xavier_NX/Development/Building_the_Kernel_from_Source#Download_the_kernel_sources_for_L4T_32.4.3 | (Downloading sources)]] to get the kernel source code.
 
* {{Download}} Follow the instructions in [[Jetson_Xavier_NX/Development/Building_the_Kernel_from_Source#Download_the_kernel_sources_for_L4T_32.4.3 | (Downloading sources)]] to get the kernel source code.
  
* Once you have the source code, apply the following patch in order to add the changes required for the IMX214 camera at kernel and dtb level.
+
* Once you have the source code, apply the following patch in order to add the changes required for the IMX214 camera at the kernel and dtb level.
  
 
<pre>
 
<pre>
Line 316: Line 68:
 
</pre>
 
</pre>
  
* Follow the instructions in [[Jetson_Xavier_NX/Development/Building_the_Kernel_from_Source#Compile_Jetson_Xavier_NX_kernel_and_dtb_.28device_tree_blob.29 | (Build Kernel)]] for building the kernel, and then flash the image.
+
* Follow the instructions in [[Jetson_Nano/Development/Building_the_Kernel_from_Source | (Build Kernel)]] for building the kernel, and then flash the image.
  
Make sure to enable ARX3A0 driver support:
+
Make sure to enable IMX214 driver support:
 
<pre>
 
<pre>
 
make menuconfig
 
make menuconfig
Line 330: Line 82:
 
</pre>
 
</pre>
  
==GStreamer Examples: Testing a ARX3A0 Linux Driver==
+
Testing the IMX214 Linux Driver==
 
 
=== Capture and Display ===
 
 
 
<pre style="background:#d6e4f1">
 
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=560,height=560,format=GRAY16_LE ! videoconvert ! xvimagesink
 
</pre>
 
 
 
=== Video Encoding ===
 
 
 
<pre style="background:#d6e4f1">
 
RECORDING_FILE="recording.mp4"
 
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=560,height=560,format=GRAY16_LE ! videoconvert ! omxh264enc ! h264parse ! qtmux ! filesink location=$RECORDING_FILE_0 -e
 
</pre>
 
 
 
The sensor will capture in the 560x560@360 mode and the pipeline will encode the video and save it into a recording.mp4 file.
 
 
 
=== Dual Capture + Encoding ===
 
  
<pre style="background:#d6e4f1">
+
===GStreamer===
RECORDING_FILE_0="recording_0.mp4"
+
Video capture with a single camera.
RECORDING_FILE_1="recording_1.mp4"
+
<pre style="white-space: pre-wrap;">
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=560,height=560,format=GRAY16_LE ! videoconvert ! omxh264enc ! h264parse ! qtmux ! filesink location=$RECORDING_FILE_0 v4l2src device=/dev/video1 ! video/x-raw,width=560,height=560,format=GRAY16_LE ! videoconvert ! omxh264enc ! h264parse ! qtmux ! filesink location=$RECORDING_FILE_1 ! xvimagesink -e
+
gst-launch-1.0 nvarguscamerasrc sensor-id=<0 or 1> ! nvvidconv ! xvimagesink
 
</pre>
 
</pre>
 +
Video capture with simultaneous dual cameras.
  
The sensor will capture from 2 cameras in the 560x560@360 mode and the pipeline will encode the videos and save them into recording_0.mp4 and recording_1.mp4 files.
+
<pre style="white-space: pre-wrap;">
 
+
gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! nvvidconv ! xvimagesink nvarguscamerasrc sensor-id=1 ! nvvidconv ! xvimagesink
==Global Gain Example==
 
 
 
The driver allows global gain control.
 
<pre style="background:#d6e4f1">
 
v4l2-ctl -d /dev/video0 --set-ctrl gain=$GAIN_VALUE
 
 
</pre>
 
</pre>
  
==Exposure Example==
+
===v4l2-ctl===
 
+
Capture an image.
The driver allows also exposure time control.  
+
<pre style="white-space: pre-wrap;">
<pre style="background:#d6e4f1">
+
v4l2-ctl -d /dev/video<0 or 1> --set-fmt-video=width=4160,height=3120,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw
v4l2-ctl -d /dev/video0 --set-ctrl exposure=$EXPOSURE_VALUE
 
 
</pre>
 
</pre>
  
== Performance of the IMX214 Linux Driver==
 
 
Using the next pipeline we were able to measure the framerate and CPU load for single capture with perf element:
 
<pre style="background:#d6e4f1">
 
gst-launch-1.0 v4l2src device=/dev/video0 ! video/x-raw,width=560,height=560,format=GRAY16_LE ! perf print-arm-load=true ! fakesink
 
</pre>
 
 
<pre>
 
GST-PERF INFO: timestamp 0:03:16.383008862; bps: 1863106560,000; fps: 360,442; cpu: 14;
 
GST-PERF INFO: timestamp 0:03:17.384480538; bps: 1863106560,000; fps: 360,470; cpu: 16;
 
GST-PERF INFO: timestamp 0:03:18.385772573; bps: 1863106560,000; fps: 360,534; cpu: 14;
 
GST-PERF INFO: timestamp 0:03:19.387378203; bps: 1863106560,000; fps: 359,423; cpu: 14;
 
GST-PERF INFO: timestamp 0:03:20.388781521; bps: 1857945600,000; fps: 360,494; cpu: 15;
 
</pre>
 
  
 
{{ContactUs}}
 
{{ContactUs}}
  
 
[[Category:Jetson]][[Category:Jetson V4L2 Drivers]][[Category:Sony]]
 
[[Category:Jetson]][[Category:Jetson V4L2 Drivers]][[Category:Sony]]

Latest revision as of 14:02, 17 March 2023

Nvidia-preferred-partner-badge-rgb-for-screen.png

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

RR Contact Us.png


Sony IMX214 CMOS image sensor features

IMX214 is a diagonal 5.867mm(Type 1/3.06) 13 Mega-pixel CMOS active pixel type stacked image sensor with a square pixel array. It adopts Exmor RS™ technology to achieve high speed image capturing by column parallel A/D converter circuits and high sensitivity and low noise image (comparing with conventional CMOS image sensor) through the backside illuminated imaging pixel structure. R, G, and B pigment primary color mosaic filter is employed. (Taken from Mouser webpage).

Linux driver support

  • NVIDIA Jetson Nano

Linux driver features

Nano
Feature Details SDK Support
RG10 Capture L4T 32.6.1 / Jetpack 4.6.1
4160x3120@30fps 4 Lanes L4T 32.6.1 / Jetpack 4.6.1
2 simultaneous cameras L4T 32.6.1 / Jetpack 4.6.1

Enabling IMX214 Linux Driver

In order to use this driver, you have to patch and compile the kernel source using JetPack:

  • Once you have the source code, apply the following patch in order to add the changes required for the IMX214 camera at the kernel and dtb level.
4.6_B-82_03_imx214_v0.1.patch
  • Follow the instructions in (Build Kernel) for building the kernel, and then flash the image.

Make sure to enable IMX214 driver support:

make menuconfig
-> Device Drivers                                                                                                                        
  -> Multimedia support                                                                                           
    -> NVIDIA overlay Encoders, decoders, sensors and other helper chips 
       -> <*> IMX214 camera sensor support

Testing the IMX214 Linux Driver==

GStreamer

Video capture with a single camera.

gst-launch-1.0 nvarguscamerasrc sensor-id=<0 or 1> ! nvvidconv ! xvimagesink

Video capture with simultaneous dual cameras.

gst-launch-1.0 nvarguscamerasrc sensor-id=0 ! nvvidconv ! xvimagesink nvarguscamerasrc sensor-id=1 ! nvvidconv ! xvimagesink

v4l2-ctl

Capture an image.

v4l2-ctl -d /dev/video<0 or 1> --set-fmt-video=width=4160,height=3120,pixelformat=RG10 --set-ctrl bypass_mode=0 --stream-mmap --stream-count=1 --stream-to=test.raw



RidgeRun Resources

Quick Start Client Engagement Process RidgeRun Blog Homepage
Technical and Sales Support RidgeRun Online Store RidgeRun Videos Contact Us

OOjs UI icon message-progressive.svg Contact Us

Visit our Main Website for the RidgeRun Products and Online Store. RidgeRun Engineering informations are available in RidgeRun Professional Services, RidgeRun Subscription Model and Client Engagement Process wiki pages. Please email to support@ridgerun.com for technical questions and contactus@ridgerun.com for other queries. Contact details for sponsoring the RidgeRun GStreamer projects are available in Sponsor Projects page. Ridgerun-logo.svg
RR Contact Us.png