Difference between revisions of "ON Semiconductor AP1302 Linux driver"

From RidgeRun Developer Connection
Jump to: navigation, search
m
m
 
(13 intermediate revisions by 2 users not shown)
Line 1: Line 1:
<seo title="ON Semiconductor Linux Drivers | Linux Driver for Jetson TX2 | RidgeRun Developer" titlemode="replace" keywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework,AP1302 Jetson TX2,AP1302,V4L2 Driver,AP1302 Linux driver." description="Check out our comprehensive overview of the ON Semiconductor AP1302 Linux driver for Jetson TX2.Check out the features and more at RidgeRun!"></seo>
+
<seo title="ON Semiconductor Linux Drivers | Linux Driver for Jetson TX2 | RidgeRun Developer" titlemode="replace" metakeywords="GStreamer, Linux SDK, Linux BSP,  Embedded Linux, Device Drivers, Nvidia, Xilinx, TI, NXP, Freescale, Embedded Linux driver development, Linux Software development, Embedded Linux SDK, Embedded Linux Application development, GStreamer Multimedia Framework, AP1302 Jetson TX2, AP1302, V4L2 Driver, AP1302 Linux driver" metadescription="Check out our comprehensive overview of the ON Semiconductor AP1302 Linux driver for Jetson TX2"></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-1572041456478'></div>
 
<script type="text/javascript">
 
/*<![CDATA[*/
 
(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: '4318335008839',
 
        node: document.getElementById('product-component-1572041456478'),
 
        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>
{{Debug Symbol}} Problems running the pipelines shown on this page?<br>Please see our [http://developer.ridgerun.com/wiki/index.php?title=GStreamer_Debugging GStreamer Debugging guide] for help.
+
{{NVIDIA Preferred Partner logo}}
<br>
+
<td>
<br>
+
<td>
<div style='text-align: center;'>[[File:RR Contact Us.png|200px|link=http://www.ridgerun.com/contact]]</div>
+
{{GStreamer debug}}
</td>
+
<td>  
</td>
+
<center>
 +
{{ContactUs Button}}
 +
</center>
 
</tr>
 
</tr>
 
</table>
 
</table>
 +
<br>
  
= AP1302 Features=
+
== AP1302 Features==
  
 
The AP1302 is an image sensor with the following features:
 
The AP1302 is an image sensor with the following features:
  
* TODO
+
* Up to 13 Mp (4224x3156) sensor support.
 +
* 450 Mp/second processing (13Mp at 30/1080p at 120/720p at 240 - subject to sensor limitations).
 +
* Dual on-chip 32-bit RISC processor cores.
 +
* Optimized for operation with Aptina's Clarity+™ Pixel technology sensors as well as Bayer pattern CMOS Image Sensors (CIS).
 +
* Designed to support Aptina sensors that provide video interlaced HDR (iHDR).
 +
* Color gaining and gamma correction.
 +
* Frame rate reduction, image resizing and clipping.
 +
* Auto exposure, auto white balance, auto focus, auto flicker detection and control.
 +
* Adaptive Tone Mapping, Local Tone Mapping.
 +
* Scene mode support: scene selection and automatic detection.
 +
* Preferred Color reproduction.
 +
* Motion-assisted anti-shake with ISO control, face detection and smile detection.
 +
* Video (Movie) stabilization assist for video resolutions up to 1080p.
 +
* Batch-mode capture, Best-picture assist.
 +
* Smooth digital zoom up to 16X.
 +
* Exposure bracketing for improved dynamic range.
 +
* OSD, special effects.
 +
* Test pattern generator.
 +
* Programmable JPEG encoder with EXIF header support.
 +
* Scalado SpeedTagsTM Encode support.
 +
* Two-wire serial interface (I2C) for sensor and peripheral control and register access supporting Standard (100kbps), Fast mode (400kbps), FM+ (1Mbps) and HS (3.4 Mbps).
 +
* Dual sensor support (second camera or 3D bridge application).
 +
* 6 MIPI data lanes shared between two sensor interfaces (4+2/3+3/4+1/3+2).
 +
* SPI External EEPROM/FLASH (4 M-bit) support for code and/or configuration data storage. Additional four-wire serial interface (SPI) for register access supporting up to 25 Mbps.
 +
* 12 GPIOs (shared functionality with SPI master and slave, second I2C master).
 +
* Xenon, LED Flash, pulsed LED Flash Support.
 +
* Fail-safe IO, programmable slew-rate control.
  
 
RidgeRun has developed a driver for the Jetson TX2 with the following support:
 
RidgeRun has developed a driver for the Jetson TX2 with the following support:
  
* TODO
+
* L4T 32.2.0 and Jetpack 4.2
 +
* V4L2 Media controller driver
 +
* Supported Formats:
 +
** Raw10
 +
** UYVY
 +
* Supported Resolutions:
 +
** 640x360@30
 +
** 640x400@30
 +
** 1280x720@30
 +
** 1920x1080@30
 +
** 3840x2160@25
 +
** 3968x2160@25
 +
** 4096x2160@20
 +
** 3968x3120@15
 +
** 4208x3120@15
 +
 
 +
==Enabling the driver==
 +
In order to use this driver, you have to patch and compile the kernel source using JetPack:
 +
 
 +
* Follow the instructions in [[Compiling_Jetson_TX1/TX2_source_code#Download_the_kernel_source_code | (Downloading sources)]] to get the kernel source code.
  
=Enabling the driver=
+
* Once you have the source code, apply the following patche in order to add the changes required for the AP1302 camera at kernel and dtb level.
  
 
<pre>
 
<pre>
TODO
+
4.2_ap1302.patch
 
</pre>
 
</pre>
  
=Using the driver=
+
* Follow the instructions in [[Compiling_Jetson_TX1/TX2_source_code#Build_Kernel | (Build Kernel)]] for building the kernel, and then flash the image.
 +
 
 +
Make sure to enable AP1302 driver support:
 +
<pre>
 +
make menuconfig
 +
</pre>
  
==Gstreamer examples==
+
<pre>
 +
-> Device Drivers                                                                                                                       
 +
  -> Multimedia support                                                                                         
 +
    -> NVIDIA overlay Encoders, decoders, sensors and other helper chips
 +
      -> <*> AP1302 camera sensor support
 +
</pre>
  
=== Capture ===
+
==Using the driver==
 +
 
 +
===GStreamer examples===
 +
 
 +
==== Capture ====
  
 
<pre style="background:#d6e4f1">
 
<pre style="background:#d6e4f1">
TODO
+
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)4208, height=(int)3120, format=(string)UYVY' ! autovideosink
 
</pre>
 
</pre>
  
The sensor will capture in the TODO mode
+
The sensor will capture in the 4208x3120@15 mode
 
<pre>
 
<pre>
 
Setting pipeline to PAUSED ...
 
Setting pipeline to PAUSED ...
 
Available Sensor modes :
 
3840 x 2160 FR=30.000000 CF=0x1209208a10 SensorModeType=4 CSIPixelBitDepth=10 DynPixelBitDepth=10
 
 
Pipeline is live and does not need PREROLL ...
 
Pipeline is live and does not need PREROLL ...
 
Setting pipeline to PLAYING ...
 
Setting pipeline to PLAYING ...
 
NvCameraSrc: Trying To Set Default Camera Resolution. Selected sensorModeIndex = 0 WxH = 3840x2160 FrameRate = 30.000000 ...
 
 
 
New clock: GstSystemClock
 
New clock: GstSystemClock
 
</pre>
 
</pre>
  
=== Video Encoding ===
+
==== Video Encoding ====
  
 
<pre style="background:#d6e4f1">
 
<pre style="background:#d6e4f1">
TODO
+
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)4208, height=(int)3120, format=(string)UYVY' ! nvvidconv ! omxh264enc ! mpegtsmux ! filesink location=test.ts
 
</pre>
 
</pre>
  
The sensor will capture in the TODO mode and the pipeline will encode the video and save it into test.ts file.
+
The sensor will capture in the 4208x3120@15 mode and the pipeline will encode the video and save it into test.ts file.
  
=== Dual Capture + Encoding ===
+
=== Performance ===
  
<pre style="background:#d6e4f1">
+
==== ARM Load ====
TODO
 
</pre>
 
 
 
The sensor will capture from TODO cameras in the TODO mode and the pipeline will encode the videos and save them into test_0.ts and test_1.ts files.
 
 
 
== Performance ==
 
 
 
=== ARM Load ===
 
  
 
Tegrastats display the following output when capturing with the sensor:
 
Tegrastats display the following output when capturing with the sensor:
 
<pre>
 
<pre>
RAM 1263/7855MB (lfb 1501x4MB) CPU [0%@2035,off,off,0%@2035,0%@2035,0%@2035]  
+
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [27%@2035,off,off,17%@2035,12%@2035,9%@2035]
RAM 1263/7855MB (lfb 1501x4MB) CPU [23%@960,off,off,17%@960,16%@960,23%@960]  
+
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [31%@2035,off,off,17%@2035,13%@2035,4%@2035]
RAM 1263/7855MB (lfb 1500x4MB) CPU [17%@345,off,off,17%@345,18%@345,20%@345]  
+
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [27%@2035,off,off,18%@2035,9%@2035,13%@2035]
RAM 1263/7855MB (lfb 1500x4MB) CPU [20%@345,off,off,16%@345,18%@345,15%@345]  
+
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [51%@2035,off,off,4%@2035,9%@2035,3%@2035]
RAM 1263/7855MB (lfb 1500x4MB) CPU [19%@345,off,off,13%@345,15%@345,14%@345]
+
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [51%@2035,off,off,4%@2035,8%@2035,0%@2035]
RAM 1263/7855MB (lfb 1500x4MB) CPU [20%@345,off,off,15%@345,12%@345,15%@345]  
+
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [44%@2035,off,off,0%@2035,22%@2035,0%@2035]
RAM 1263/7855MB (lfb 1500x4MB) CPU [19%@345,off,off,15%@345,15%@345,16%@345]
+
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [46%@2035,off,off,8%@2035,13%@2035,0%@2035]
RAM 1263/7855MB (lfb 1500x4MB) CPU [20%@345,off,off,18%@345,18%@345,17%@345]  
 
RAM 1263/7855MB (lfb 1500x4MB) CPU [16%@345,off,off,15%@345,27%@345,17%@345]
 
RAM 1263/7855MB (lfb 1500x4MB) CPU [19%@345,off,off,18%@345,17%@345,19%@345]  
 
 
</pre>
 
</pre>
  
=== Framerate ===
+
==== Framerate ====
Using the next pipeline we were able to measure the framerate for single capture with perf element:
+
Using the next pipeline we were able to measure the framerate for single capture with the [https://github.com/RidgeRun/gst-perf perf] element:
 
<pre style="background:#d6e4f1">
 
<pre style="background:#d6e4f1">
TODO
+
gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)4208, height=(int)3120, format=(string)UYVY' ! perf ! fakesink
 
</pre>
 
</pre>
  
 
<pre>
 
<pre>
GST-PERF INFO -->  Timestamp: 0:07:19.108602798; Bps: 782; fps: 30.0  
+
INFO: perf: perf0; timestamp: 0:20:41.612503008; bps: 0,000; mean_bps: 0,000; fps: 0,000; mean_fps: 0,000
GST-PERF INFO -->  Timestamp: 0:07:20.141189052; Bps: 782; fps: 30.3
+
INFO: perf: perf0; timestamp: 0:20:42.641163584; bps: 3279792536,737; mean_bps: 3279792536,737; fps: 15,554; mean_fps: 15,554
GST-PERF INFO -->  Timestamp: 0:07:21.174265435; Bps: 782; fps: 30.0  
+
INFO: perf: perf0; timestamp: 0:20:43.684277280; bps: 3234348559,450; mean_bps: 3257070548,093; fps: 15,339; mean_fps: 15,446
GST-PERF INFO -->  Timestamp: 0:07:22.207318757; Bps: 782; fps: 30.0
+
INFO: perf: perf0; timestamp: 0:20:44.728300096; bps: 3231532135,405; mean_bps: 3248557743,864; fps: 15,325; mean_fps: 15,406
GST-PERF INFO -->  Timestamp: 0:07:23.240543516; Bps: 782; fps: 30.0
+
INFO: perf: perf0; timestamp: 0:20:45.773840800; bps: 3226840683,574; mean_bps: 3243128478,791; fps: 15,303; mean_fps: 15,380
GST-PERF INFO -->  Timestamp: 0:07:24.273697886; Bps: 782; fps: 30.0
+
INFO: perf: perf0; timestamp: 0:20:46.816163744; bps: 3236802278,431; mean_bps: 3241863238,719; fps: 15,350; mean_fps: 15,374
GST-PERF INFO -->  Timestamp: 0:07:25.306822764; Bps: 782; fps: 30.0
+
INFO: perf: perf0; timestamp: 0:20:47.862452032; bps: 3224535071,925; mean_bps: 3238975210,920; fps: 15,292; mean_fps: 15,361
GST-PERF INFO -->  Timestamp: 0:07:26.340117514; Bps: 782; fps: 30.0
+
INFO: perf: perf0; timestamp: 0:20:48.903999360; bps: 3239212649,586; mean_bps: 3239009130,730; fps: 15,362; mean_fps: 15,361
GST-PERF INFO -->  Timestamp: 0:07:27.373087284; Bps: 782; fps: 30.3
+
INFO: perf: perf0; timestamp: 0:20:49.950199680; bps: 3224806201,550; mean_bps: 3237233764,582; fps: 15,293; mean_fps: 15,352
GST-PERF INFO -->  Timestamp: 0:07:28.406069581; Bps: 782; fps: 30.3
+
INFO: perf: perf0; timestamp: 0:20:50.991857952; bps: 3238867650,446; mean_bps: 3237415307,456; fps: 15,360; mean_fps: 15,353
GST-PERF INFO -->  Timestamp: 0:07:29.439238457; Bps: 782; fps: 30.0
+
INFO: perf: perf0; timestamp: 0:20:52.035787040; bps: 3231822274,886; mean_bps: 3236856004,199; fps: 15,327; mean_fps: 15,351
GST-PERF INFO -->  Timestamp: 0:07:30.472398102; Bps: 782; fps: 30.0
+
INFO: perf: perf0; timestamp: 0:20:53.082210528; bps: 3224118455,567; mean_bps: 3235698045,232; fps: 15,290; mean_fps: 15,345
GST-PERF INFO -->  Timestamp: 0:07:31.472948042; Bps: 808; fps: 30.0
+
INFO: perf: perf0; timestamp: 0:20:54.126004192; bps: 3232241578,351; mean_bps: 3235410006,326; fps: 15,329; mean_fps: 15,344
 +
INFO: perf: perf0; timestamp: 0:20:55.167571168; bps: 3239151545,450; mean_bps: 3235697817,028; fps: 15,361; mean_fps: 15,345
 +
INFO: perf: perf0; timestamp: 0:20:56.211503776; bps: 3231811377,617; mean_bps: 3235420214,212; fps: 15,327; mean_fps: 15,344
 +
INFO: perf: perf0; timestamp: 0:20:57.255406240; bps: 3231904700,246; mean_bps: 3235185846,615; fps: 15,327; mean_fps: 15,343
 +
INFO: perf: perf0; timestamp: 0:20:58.301784736; bps: 3224257085,650; mean_bps: 3234502799,054; fps: 15,291; mean_fps: 15,339
 +
INFO: perf: perf0; timestamp: 0:20:59.343773824; bps: 3237839358,256; mean_bps: 3234699067,243; fps: 15,355; mean_fps: 15,340
 
</pre>
 
</pre>
  
The results show the framerate constant at 30FPS that use nvcamerasrc and passing frames through the ISP to convert from bayer to yuv.
+
The results show the framerate constant at 15FPS that uses v4l2src.
  
=== Latency ===
+
<!--
 +
==== Latency ====
  
 
The glass to glass latency measured is about TODO ms with nvcamerasrc.
 
The glass to glass latency measured is about TODO ms with nvcamerasrc.
 
+
-->
 
{{ContactUs}}
 
{{ContactUs}}
  
[[Category:Jetson]][[Category:Jetson V4L2 Drivers]]
+
[[Category:Jetson]][[Category:Jetson V4L2 Drivers]][[Category:ON Semiconductor‎]]

Latest revision as of 14:20, 23 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


AP1302 Features

The AP1302 is an image sensor with the following features:

  • Up to 13 Mp (4224x3156) sensor support.
  • 450 Mp/second processing (13Mp at 30/1080p at 120/720p at 240 - subject to sensor limitations).
  • Dual on-chip 32-bit RISC processor cores.
  • Optimized for operation with Aptina's Clarity+™ Pixel technology sensors as well as Bayer pattern CMOS Image Sensors (CIS).
  • Designed to support Aptina sensors that provide video interlaced HDR (iHDR).
  • Color gaining and gamma correction.
  • Frame rate reduction, image resizing and clipping.
  • Auto exposure, auto white balance, auto focus, auto flicker detection and control.
  • Adaptive Tone Mapping, Local Tone Mapping.
  • Scene mode support: scene selection and automatic detection.
  • Preferred Color reproduction.
  • Motion-assisted anti-shake with ISO control, face detection and smile detection.
  • Video (Movie) stabilization assist for video resolutions up to 1080p.
  • Batch-mode capture, Best-picture assist.
  • Smooth digital zoom up to 16X.
  • Exposure bracketing for improved dynamic range.
  • OSD, special effects.
  • Test pattern generator.
  • Programmable JPEG encoder with EXIF header support.
  • Scalado SpeedTagsTM Encode support.
  • Two-wire serial interface (I2C) for sensor and peripheral control and register access supporting Standard (100kbps), Fast mode (400kbps), FM+ (1Mbps) and HS (3.4 Mbps).
  • Dual sensor support (second camera or 3D bridge application).
  • 6 MIPI data lanes shared between two sensor interfaces (4+2/3+3/4+1/3+2).
  • SPI External EEPROM/FLASH (4 M-bit) support for code and/or configuration data storage. Additional four-wire serial interface (SPI) for register access supporting up to 25 Mbps.
  • 12 GPIOs (shared functionality with SPI master and slave, second I2C master).
  • Xenon, LED Flash, pulsed LED Flash Support.
  • Fail-safe IO, programmable slew-rate control.

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

  • L4T 32.2.0 and Jetpack 4.2
  • V4L2 Media controller driver
  • Supported Formats:
    • Raw10
    • UYVY
  • Supported Resolutions:
    • 640x360@30
    • 640x400@30
    • 1280x720@30
    • 1920x1080@30
    • 3840x2160@25
    • 3968x2160@25
    • 4096x2160@20
    • 3968x3120@15
    • 4208x3120@15

Enabling the 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 patche in order to add the changes required for the AP1302 camera at kernel and dtb level.
4.2_ap1302.patch
  • Follow the instructions in (Build Kernel) for building the kernel, and then flash the image.

Make sure to enable AP1302 driver support:

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

Using the driver

GStreamer examples

Capture

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)4208, height=(int)3120, format=(string)UYVY' ! autovideosink

The sensor will capture in the 4208x3120@15 mode

Setting pipeline to PAUSED ...
Pipeline is live and does not need PREROLL ...
Setting pipeline to PLAYING ...
New clock: GstSystemClock

Video Encoding

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)4208, height=(int)3120, format=(string)UYVY' ! nvvidconv ! omxh264enc ! mpegtsmux ! filesink location=test.ts

The sensor will capture in the 4208x3120@15 mode and the pipeline will encode the video and save it into test.ts file.

Performance

ARM Load

Tegrastats display the following output when capturing with the sensor:

RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [27%@2035,off,off,17%@2035,12%@2035,9%@2035]
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [31%@2035,off,off,17%@2035,13%@2035,4%@2035]
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [27%@2035,off,off,18%@2035,9%@2035,13%@2035]
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [51%@2035,off,off,4%@2035,9%@2035,3%@2035]
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [51%@2035,off,off,4%@2035,8%@2035,0%@2035]
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [44%@2035,off,off,0%@2035,22%@2035,0%@2035]
RAM 667/7860MB (lfb 1687x4MB) SWAP 0/3930MB (cached 0MB) CPU [46%@2035,off,off,8%@2035,13%@2035,0%@2035]

Framerate

Using the next pipeline we were able to measure the framerate for single capture with the perf element:

gst-launch-1.0 v4l2src device=/dev/video0 ! 'video/x-raw, width=(int)4208, height=(int)3120, format=(string)UYVY' ! perf ! fakesink
INFO: perf: perf0; timestamp: 0:20:41.612503008; bps: 0,000; mean_bps: 0,000; fps: 0,000; mean_fps: 0,000
INFO: perf: perf0; timestamp: 0:20:42.641163584; bps: 3279792536,737; mean_bps: 3279792536,737; fps: 15,554; mean_fps: 15,554
INFO: perf: perf0; timestamp: 0:20:43.684277280; bps: 3234348559,450; mean_bps: 3257070548,093; fps: 15,339; mean_fps: 15,446
INFO: perf: perf0; timestamp: 0:20:44.728300096; bps: 3231532135,405; mean_bps: 3248557743,864; fps: 15,325; mean_fps: 15,406
INFO: perf: perf0; timestamp: 0:20:45.773840800; bps: 3226840683,574; mean_bps: 3243128478,791; fps: 15,303; mean_fps: 15,380
INFO: perf: perf0; timestamp: 0:20:46.816163744; bps: 3236802278,431; mean_bps: 3241863238,719; fps: 15,350; mean_fps: 15,374
INFO: perf: perf0; timestamp: 0:20:47.862452032; bps: 3224535071,925; mean_bps: 3238975210,920; fps: 15,292; mean_fps: 15,361
INFO: perf: perf0; timestamp: 0:20:48.903999360; bps: 3239212649,586; mean_bps: 3239009130,730; fps: 15,362; mean_fps: 15,361
INFO: perf: perf0; timestamp: 0:20:49.950199680; bps: 3224806201,550; mean_bps: 3237233764,582; fps: 15,293; mean_fps: 15,352
INFO: perf: perf0; timestamp: 0:20:50.991857952; bps: 3238867650,446; mean_bps: 3237415307,456; fps: 15,360; mean_fps: 15,353
INFO: perf: perf0; timestamp: 0:20:52.035787040; bps: 3231822274,886; mean_bps: 3236856004,199; fps: 15,327; mean_fps: 15,351
INFO: perf: perf0; timestamp: 0:20:53.082210528; bps: 3224118455,567; mean_bps: 3235698045,232; fps: 15,290; mean_fps: 15,345
INFO: perf: perf0; timestamp: 0:20:54.126004192; bps: 3232241578,351; mean_bps: 3235410006,326; fps: 15,329; mean_fps: 15,344
INFO: perf: perf0; timestamp: 0:20:55.167571168; bps: 3239151545,450; mean_bps: 3235697817,028; fps: 15,361; mean_fps: 15,345
INFO: perf: perf0; timestamp: 0:20:56.211503776; bps: 3231811377,617; mean_bps: 3235420214,212; fps: 15,327; mean_fps: 15,344
INFO: perf: perf0; timestamp: 0:20:57.255406240; bps: 3231904700,246; mean_bps: 3235185846,615; fps: 15,327; mean_fps: 15,343
INFO: perf: perf0; timestamp: 0:20:58.301784736; bps: 3224257085,650; mean_bps: 3234502799,054; fps: 15,291; mean_fps: 15,339
INFO: perf: perf0; timestamp: 0:20:59.343773824; bps: 3237839358,256; mean_bps: 3234699067,243; fps: 15,355; mean_fps: 15,340

The results show the framerate constant at 15FPS that uses v4l2src.


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