Camera Support on IGX BaseOS#
IGX is a server-based system that uses the GRUB bootloader. This section explains how you can enable camera support by modifying the device-tree during system boot.
Generating the DTB File#
You can generate the device-tree binary (DTB) file from the BSP, located at Linux_for_Tegra/kernel/dtb/
.
Creating the Camera-Enabled DTB#
To apply the overlay and generate the final DTB:
IGX500 Camera Support#
IGX500 supports multiple camera modules, such as Dual IMX274 and GMSL3762.
Base DTB:
tegra234-p3971-0000+p3701-0008-nv.dtb
GMSL Camera Overlay:
tegra234-p3971-0000+p3701-0008-camera-p3762-a00-overlay.dtbo
Dual IMX274 Overlay:
tegra234-p3971-0000+p3701-0008-camera-dual-imx274-overlay.dtbo
Creating the Camera-Enabled DTB#
For GMSL Camera:
fdtoverlay -i tegra234-p3971-0000+p3701-0008-nv.dtb -o tegra234-p3971-0000+p3701-0008-camera-p3762-a00-camera.dtb tegra234-p3971-0000+p3701-0008-camera-p3762-a00-overlay.dtbo
For Dual IMX274:
fdtoverlay -i tegra234-p3971-0000+p3701-0008-nv.dtb -o tegra234-p3971-0000+p3701-0008-dual-imx274-camera.dtb tegra234-p3971-0000+p3701-0008-camera-dual-imx274-overlay.dtbo
Adding Boot Option with Custom DTB#
Boot the IGX system with the default Ubuntu option.
Add the boot option with the newly generated DTB file. To do so, copy the generated DTB file
tegra234-p3971-0000+p3701-0008-dual-imx274-camera.dtb
on the IGX and apply these steps.sudo mkdir /boot/custom_dtbs sudo cp tegra234-p3971-0000+p3701-0008-dual-imx274-camera.dtb /boot/custom_dtbs
Copy the “Ubuntu” entry from
/boot/grub/grub.cfg
.Modify
/etc/grub.d/40_custom
by adding the new entry from yourgrub.cfg
file. Adddevicetree /boot/custom_dtbs/tegra234-p3971-0000+p3701-0008-dual-imx274-camera.dtb
as the last entry in the grub configuration file. Be sure to also rename “Ubuntu” to something like “Ubuntu Custom” or “Ubuntu Camera Support”. Here is an example:menuentry 'Ubuntu Camera Support' --class ubuntu --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-3a9d6c12-14c0-4672-bda3-412194f528f5' { recordfail load_video gfxmode $linux_gfx_mode insmod gzio if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi insmod part_gpt insmod ext2 search --no-floppy --fs-uuid --set=root 3a9d6c12-14c0-4672-bda3-412194f528f5 linux /boot/vmlinuz-5.15.0-1020-nvidia-tegra-igx root=UUID=3a9d6c12-14c0-4672-bda3-412194f528f5 ro console=ttyTCU0,115200 console=tty0 fbcon=map:0 video=efifb:off rd.driver.blacklist=nouveau nouveau.modeset=0 console=tty0 console=ttyTCU0,115200 initrd /boot/initrd.img-5.15.0-1020-nvidia-tegra-igx devicetree /boot/custom_dtbs/tegra234-p3971-0000+p3701-0008-dual-imx274-camera.dtb }
Update GRUB and reboot:
sudo grub-mkconfig -o /boot/grub/grub.cfg sudo reboot
Select Ubuntu Camera Support during boot.
Verifying Camera Probe#
Once your system boots, check if the camera device nodes are created:
ls -l /dev/video*
Expected output:
crw-rw----+ 1 root video 81, 0 Jul 12 14:13 /dev/video0
crw-rw----+ 1 root video 81, 4 Jul 12 14:13 /dev/video1
If the camera is not detected, verify the hardware connections.
Capturing Images#
Install v4l2 utilities:
sudo apt-get update sudo apt-get install v4l-utils
Capture raw images:
v4l2-ctl -d /dev/video0 --stream-mmap --stream-count=100 v4l2-ctl -d /dev/video1 --stream-mmap --stream-count=100
Using Argus Camera Application#
Obtain
Jetson_Multimedia_API_R36.x.x_aarch64.tbz2
from the customer release.Build and run the Argus application:
./argus_oneshot
Example output:
Executing Argus Sample: argus_oneshot Argus Version: 0.99.3.3 (multi-process) Capturing from device 0 using sensor mode 0 (1920x1200) Wrote file: argus_oneShot.jpg