Jump to content

Mira130 Linux Driver: Difference between revisions

m
no edit summary
No edit summary
 
mNo edit summary
Line 1: Line 1:
<seo title="MIRA130 Linux Driver for NVIDIA Jetson | AMS MIRA130 Linux Driver | RidgeRun" 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, MIRA130 Jetson Nano, MIRA130, V4L2 Driver, AMS MIRA130, AMS MIRA130 Linux Driver, MIRA130 Linux driver, AMS MIRA130 Linux Driver, AMS, AMS MIRA130, MIRA 130." metadescription="Check out our comprehensive overview and features of the AMS MIRA130 Linux Driver for NVIDIA Jetson!."></seo>
{{#seo:
 
|title=MIRA130 Linux Driver for NVIDIA Jetson
|title_mode=replace
|description={{{description|Check out our comprehensive overview and features of the AMS MIRA130 Linux Driver for NVIDIA Jetson!.}}}
}}
{{Driver-shoppingcart & NVIDIA logo & RR Contact}}  
{{Driver-shoppingcart & NVIDIA logo & RR Contact}}  
<br>
<br>
Line 7: Line 10:
<td>
<td>


{{message|title=Driver List Information|Refer to the [[RidgeRun_Linux_Camera_Drivers/Available_Camera_Drivers/List_of_Tested_Camera_Sensors|RidgeRun Linux Camera Drivers]] to meet all the list of Drivers available}}
{{Colored box|background-content-color=#EDF1F7|background-title-color=#6586B9|title-color=#FFFFFF|title='''Driver List Information'''|icon=notice-icon-white.png
  |style=overflow:hidden;
  |content=
  Refer to the [[RidgeRun_Linux_Camera_Drivers/Available_Camera_Drivers/List_of_Tested_Camera_Sensors|RidgeRun Linux Camera Drivers]] to meet all the list of Drivers available
}}


== AMS MIRA130 Features ==
== AMS MIRA130 Features ==
Line 90: Line 97:
</source>
</source>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
# Create the directory to store the compiled image and dtb
# Create the directory to store the compiled image and dtb
mkdir -p $DEVDIR/images/dtb
mkdir -p $DEVDIR/images/dtb
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
export TEGRA_KERNEL_OUT=$DEVDIR/images
export TEGRA_KERNEL_OUT=$DEVDIR/images
export ARCH=arm64
export ARCH=arm64
Line 103: Line 110:
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
cd $KERNEL_DIR
cd $KERNEL_DIR
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
make mrproper
make mrproper
</syntaxhighlight>
</syntaxhighlight>
Line 139: Line 146:
* Compile the kernel:  
* Compile the kernel:  


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
make O=$TEGRA_KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 zImage
make O=$TEGRA_KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 zImage
</syntaxhighlight>
</syntaxhighlight>


* Compile the device tree:  
* Compile the device tree:  
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
make O=$TEGRA_KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 dtbs
make O=$TEGRA_KERNEL_OUT CROSS_COMPILE=${CROSS_COMPILE} -j4 dtbs
</syntaxhighlight>
</syntaxhighlight>
Line 153: Line 160:


* Copy the compiled image to the kernel directory.
* Copy the compiled image to the kernel directory.
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $TEGRA_KERNEL_OUT/arch/arm64/boot/zImage $DEVDIR/kernel/
cp $TEGRA_KERNEL_OUT/arch/arm64/boot/Image $TEGRA_KERNEL_OUT/arch/arm64/boot/zImage $DEVDIR/kernel/
</syntaxhighlight>
</syntaxhighlight>


* Copy the compiled device tree to the kernel directory.
* Copy the compiled device tree to the kernel directory.
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
cp -r $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/* $DEVDIR/kernel/dtb/
cp -r $TEGRA_KERNEL_OUT/arch/arm64/boot/dts/* $DEVDIR/kernel/dtb/
</syntaxhighlight>
</syntaxhighlight>


* Flash the memory following the next guide:
* Flash the memory following the next guide:
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
cd $DEVDIR
cd $DEVDIR
sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1
sudo ./flash.sh jetson-nano-qspi-sd mmcblk0p1
Line 176: Line 183:
'''1.''' Please extract the contents provided in <code> extra_gstreamer_flashing_patches.tar</code> in <code> sources/patches</code> directory:  
'''1.''' Please extract the contents provided in <code> extra_gstreamer_flashing_patches.tar</code> in <code> sources/patches</code> directory:  


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
cd $PATCHESPATH
cd $PATCHESPATH
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
tar -xvf extra_gstreamer_flashing_patches.tar
tar -xvf extra_gstreamer_flashing_patches.tar
</syntaxhighlight>
</syntaxhighlight>
Line 188: Line 195:
1. Transfer the patch to the board:
1. Transfer the patch to the board:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
cd $PATCHESPATH
cd $PATCHESPATH
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
scp add-Y10-support-1.14.5.patch <nvidia-nano-user>@<nvidia-nano-ip>:/home/<nvidia-nano-username>
scp add-Y10-support-1.14.5.patch <nvidia-nano-user>@<nvidia-nano-ip>:/home/<nvidia-nano-username>
</syntaxhighlight>
</syntaxhighlight>
Line 198: Line 205:
2. In the board, download the necessary gstreamer dependencies:  
2. In the board, download the necessary gstreamer dependencies:  


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
sudo apt update
sudo apt update
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
sudo apt install libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev
</syntaxhighlight>
</syntaxhighlight>
Line 208: Line 215:
3. Download gst-plugins-good:
3. Download gst-plugins-good:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
mkdir gstreamer-1.14.5; cd gstreamer-1.14.5
mkdir gstreamer-1.14.5; cd gstreamer-1.14.5
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
wget https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.14.5.tar.xz
wget https://gstreamer.freedesktop.org/src/gst-plugins-good/gst-plugins-good-1.14.5.tar.xz
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
tar -xvf gst-plugins-good-1.14.5.tar.xz
tar -xvf gst-plugins-good-1.14.5.tar.xz
</syntaxhighlight>
</syntaxhighlight>


4. Apply the patch:
4. Apply the patch:
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
cd gst-plugins-good-1.14.5/sys/v4l2/
cd gst-plugins-good-1.14.5/sys/v4l2/
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
patch -i $HOME/add-Y10-support-1.14.5.patch
patch -i $HOME/add-Y10-support-1.14.5.patch
</syntaxhighlight>
</syntaxhighlight>
Line 232: Line 239:


1. Compile:  
1. Compile:  
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
cd ~/gstreamer-1.14.5/gst-plugins-good-1.14.5
cd ~/gstreamer-1.14.5/gst-plugins-good-1.14.5
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
./configure --prefix=/usr --libdir=/usr/lib/aarch64-linux-gnu/
./configure --prefix=/usr --libdir=/usr/lib/aarch64-linux-gnu/
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
make
make
</syntaxhighlight>
</syntaxhighlight>


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
DESTDIR=$(pwd)/install make install
DESTDIR=$(pwd)/install make install
</syntaxhighlight>
</syntaxhighlight>


2. Install the library:  
2. Install the library:  
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
sudo cp install/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so
sudo cp install/usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so /usr/lib/aarch64-linux-gnu/gstreamer-1.0/libgstvideo4linux2.so
</syntaxhighlight>
</syntaxhighlight>
Line 258: Line 265:


* Install v4l utils:
* Install v4l utils:
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
sudo apt install v4l-utils
sudo apt install v4l-utils
</syntaxhighlight>
</syntaxhighlight>
Line 264: Line 271:
* Test the capture framerate:
* Test the capture framerate:


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1080,height=1280,pixelformat=Y10 --set-ctrl bypass_mode=0 --stream-mmap
v4l2-ctl -d /dev/video0 --set-fmt-video=width=1080,height=1280,pixelformat=Y10 --set-ctrl bypass_mode=0 --stream-mmap
</syntaxhighlight>
</syntaxhighlight>
Line 335: Line 342:
}}
}}


<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
sudo jetson_clocks
sudo jetson_clocks
</syntaxhighlight>
</syntaxhighlight>
Line 427: Line 434:


===== Capture and Display =====
===== Capture and Display =====
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! videoconvert ! xvimagesink sync=false
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! videoconvert ! xvimagesink sync=false
</syntaxhighlight>
</syntaxhighlight>


===== Video Encoding =====
===== Video Encoding =====
<syntaxhighlight lang=bash>
<syntaxhighlight lang="bash">
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! videoconvert ! queue ! omxh265enc ! h265parse ! qtmux ! filesink location=out.mp4 -e
gst-launch-1.0 v4l2src device=/dev/video0 ! "video/x-raw,width=1080,height=1280,framerate=120/1,format=GRAY16_LE" ! queue ! videoconvert ! queue ! omxh265enc ! h265parse ! qtmux ! filesink location=out.mp4 -e
</syntaxhighlight>
</syntaxhighlight>
Cookies help us deliver our services. By using our services, you agree to our use of cookies.