Hi,
My use-case is an avionics DVR.
I am using Linux R35.5.0 (Jetpack 5.1.3) with a custom carrier board.
I have modified the device tree and ov5693 driver to support camera capture from an FPGA.
In this use-case the data path is NTSC composite camera 720x480 ->ADV7842->FPGA->Jetson MIPI.
De-interlacing to 480p is done by ADV7842. Jetson captures at 768x480 to obey 64 byte stride alignment requirement. I use nvidconv to remove the extra 48 pixels per line. This works fine but when there is horizontal motion near the top of the frame tearing occurs.
Running “/usr/bin/jetson_clocks” prior does not fix the issue.
Putting an extra “queue” before nvvidconv does not fix the issue.
When I use nvvidconv with:
v4l2src with caps “video/x-raw” as below instead of
nvv4l2camerasrc with caps “video/x-raw(memory:NVMM)” there is no tearing.
Why? Seems like memory:NVMM DMA with 768x480 is the issue?
I could go that way but we want to avoid the overhead of v4l2c memcpy to move video frames.
my bad, nvv4l2camerasrc only support video/x-raw(memory:NVMM)
you may execute $ gst-inspect-1.0 nvv4l2camerasrc to check plugin details.
is it progressive mode or interlaced mode? could you please change sink element for testing?
for instance, $ gst-launch-1.0 nvv4l2camerasrc device=/dev/video0 ! 'video/x-raw(memory:NVMM), ,width=768,height=480,framerate=60/1' ! interlace-mode=progressive' ! nvvidconv ! fpsdisplaysink text-overlay=0 video-sink=xvimagesink sync=0 -v
Hi,
The frames are captured in ioctl(VIDIOC_DQBUF) in gst_nvv4l2camera_buffer_pool_acquire_buffer(). Please add NvBufSurfaceSyncForDevice() or NvBufSurfaceSyncForCpu() after the frame data is captured for a try. The source code of nvv4l2camerasrc is in
I added that (see below), but I am now getting these errors for both Cpu and Device:
NvMapMemCacheMaint Bad parameter
NvMapMemCacheMaint Bad parameter
e: Error(4) in sync
nvbusurface: NvBufSurfaceSyncForDevice: Error(4) in sync
nvbusurface: NvBufSurfaceSyncForDevice: Error(4) in sync
Anyway, both of these are now working without returning any errors but tearing issue persists:
NvBufSurfaceSyncForCpu (nv_mem->nvcam_buf->surface, 0, 0);
NvBufSurfaceSyncForDevice(nv_mem->nvcam_buf->surface, 0, 0);
The data path is:
Composite video input (720x480i60)
TO: ADV7842 (deinterlaces and outputs 720x480p60)
TO: FPGA (adds 48 pixels to obey Jetson 64 byte stride alignment requirement and puts 768x480p60 on MIPI bus)
TO: Jetson MIPI.
For FPGA MIPI source we use a hacked OV5693 driver.
We use gstreamer and nvvidconv to remove added 48 pixels as per pipeline below. As for CPU or DMA buffer… I believe the answer to that is DMA buffer since we use nvv4l2camerasrc and memory:NVMM
Hi,
The frame data is not synchronized while VIC engine accesses it. You would need to check if it is possible to do synchronization in kernel driver. If it is not possible, please use v4l2src plugin to capture frame data to CPU buffer first and then copy to NVMM buffer(NvBufSurface).