L4T R23.2 ov5693 v4l2 camera video using yavta

i can get video from onboard ov5693 using nvgstcapture utility with nvhost_vi module added.

but i want to use ov5693_v4l2 driver. But i am not getting /dev/video0 for ov5693.
if i remove “nvhost_vi” and add “tegra_camera” module it shows /dev/video0 but its shows the name “vi”. and i unable to view camera video using yavta.

./yavta /dev/video0 -c1 -n1 -s1920x1080 -fSRGGB10 -Fov.raw
Device /dev/video0 opened.
Device `vi' on `' is a video capture (without mplanes) device.
Unable to set format: Invalid argument (22).

in forum i read that i have to apply 0001-ARM64-adding-OV5693-V4L2-on-E3326-jetson_cv.patch for 23.2 to get /dev/video0 for ov5693.
https://devtalk.nvidia.com/default/topic/920739/jetson-tx1/l4t-r23-2-for-jetson-tx1-released/1

i have downloaded “kernel_src.tbz2” and extracted and cross compile on that folder.
But for applying the patch i need to init git on that folder so whats the procedure for applying patch?

I am using git so I just do ‘git patch patchfile’ in you case you can just use ‘patch’ to apply the patch to your linux kernel and then re-compile the kernel following the instruction from SDK

Thanks for the reply.
ya patch is successfully done using “git apply”

This patch is suppose to give /dev/video0 for ov5693 right?

But i am not getting any video device in /dev. But after this patch “ov5693_v4l2.ko” is pre-inserted after reboot.

Here is my procedure.

  1. I am using 23.2 release without “0001-ARM64-adding-OV5693-V4L2-on-E3326-jetson_cv.patch” and in menuconfig i have enabled ov5693_v4l2. Below is my observations.
  • on reboot nvhost_vi is inserted but no ov5693_v4l2.
  • not getting any video device in /dev/
  • camera video can be view using nvgstcapture-1.0
  • if i remove nvhost_vi and add tegra_camera i can see video0 named “vi” but not able to view video using yavta. getting below error
./yavta /dev/video0 -c1 -n1 -s1920x1080 -fSRGGB10 -Fov.raw
Device /dev/video0 opened.
Device `vi' on `' is a video capture (without mplanes) device.
Unable to set format: Invalid argument (22).
  1. This time i patched kernel and ov5693_v4l2 enable in menuconfig.
  • i am not getting any video device in /dev. But after this patch “ov5693_v4l2.ko” is pre-inserted after reboot
ubuntu@tegra-ubuntu:~$ lsmod
Module                  Size  Used by
rfcomm                 65310  0 
bnep                   14664  2 
bcmdhd               7445589  0 
cfg80211              449990  1 bcmdhd
ov5693_v4l2            25987  0 
nvhost_vi               5071  0 
bluedroid_pm           11244  0

-not able to view camera video using nvgstcapture-1.0 here is error

Inside NvxLiteH264DecoderLowLatencyInitNvxLiteH264DecoderLowLatencyInit set DPB and MjstreamingInside NvxLiteH265DecoderLowLatencyInitNvxLiteH265DecoderLowLatencyInit set DPB and MjstreamingS.
gst_nvcamera_open() failed ret=0

** (nvgstcapture-1.0:2164): CRITICAL **: <create_capture_pipeline:4485> can't set camera to playing


** (nvgstcapture-1.0:2164): CRITICAL **: <main:5301> Capture Pipeline creation failed
  • if i remove nvhost_vi and add tegra_camera i am getting video0 named ‘vi’. but not getting video using yavta. getting same error as in procedure 1

soc_camera_platform is added automatically if i add tegra_camera. and getting video0 device. If i manually remove soc_camera_platform from /lib/modules/… after adding tegra_camera, now soc_camera_platform is not added but i am not getting any video0 device.

So which step i am missing to add ov5693_v4l2 successfully.???

Now, I can successfully get .raw image using yavta. And i can see image using Irfanview.

root@tegra-ubuntu:/home/ubuntu/yavta# ./yavta /dev/video0 -c1 -n1 -s1920x1080 -fSRGGB10 -Fov.raw
Device /dev/video0 opened.
Device `vi' on `' is a video capture (without mplanes) device.
Video format set: SRGGB10 (30314752) 1920x1080 (stride 3840) field none buffer size 4147200
Video format: SRGGB10 (30314752) 1920x1080 (stride 3840) field none buffer size 4147200
1 buffers requested.
length: 4147200 offset: 0 timestamp type/source: mono/EoF
Buffer 0/0 mapped at address 0xf6b4b000.
0 (0) [-] none 0 4147200 B 1460369667.629424 3405.333283 0.014 fps ts mono/EoF
Captured 1 frames in 0.059598 seconds (16.779059 fps, 69586112.134214 B/s).
1 buffers released.

The actual proble was soc_camera_platform. When i tried to modprobe tegra_camera it will automatically add soc_camera_platform module. So i dispable it from defconfig file. and flash the new image. so now it will not added when i modprobe tegra_camera.

Now my problem is that i can’t use video0 with gstreamer pipeline.
I have tried many pipeline shown in below link.
https://devtalk.nvidia.com/default/topic/923984/jetson-tx1/ov5693-through-v4l2-interface-not-working-in-23-2/1
This will give error containing these lines

ERROR: from element /GstPipeline:pipeline0/GstV4l2Src:v4l2src0: Internal data flow error.
Additional debug info:
gstbasesrc.c(2865): gst_base_src_loop (): /GstPipeline:pipeline0/GstV4l2Src:v4l2src0:

so whats the problem ?

Hi RiteshPanchal,

ov5693 only support bayer format and current ov5693 v4l2 driver is incorrectly listed more format it can support. So during GST caps negotiation, bad format was negotiated that’s probably why you see above error. I have not figured a good way to manually force bayer format in the gstreamer.