Jetson VI driver with camera sensor


I have a IWR6843 radar modules connected through FPGA to jetson Xavier NX. I am able to capture the radar frames and store it into file. I am working on timestamps and sequence number on v4l2 level. V4l2 ioctl driver sends the buffer information from kernel level to user level. I am trying to get these information onto my application. But the timestamp and sequence number seems to be 0 always. I also tried printing it from the kernel which is also 0.
I have USB camera and tried to capture images using this setup. This does go inside vi5_fops.c driver and into vi5_capture_dequeue where start of frame (sof) and end of frame (eof) info apperas and from v4l2 ioctl driver the timestamps updates. But I do not get any prints from the vi5 driver with radar setup. Kindly help me to debug on this issue.


please refer to Camera Architecture Stack. it’s VI driver to process camera frames.
may I know what’s the actual use-case, are you going to synchronize the radar timestamps with capture images?

Hi Jerry,
Yeah… My radar devices are connected through i2c, which exactly works like a camera sensor.
I want to synchronize each captured frames with the respective time and sequence number. v4l2 buffers already provide this information. So I just want to pass these timestamps to userspace application. But observed that the timestamp values are always ‘0’.

Hey Jerry,

Can you help me out on debugging this issue? If any information is required I can provide you and point me out where do I look into for the fix or any workaround.


but it’s not sending out start-of-frame, end-of-frame to CSI channel, right?
it’s VI driver allocating buffers, and looking for those signals to update the vb2 buffers (user-space buffers) and write timestamps to each capture buffer.

please check below to help me understand this correctly.
you’ve already done implementation to have both camera and radar device operates correctly, and, you’re able to enable the camera stream and obtain the user-space buffers.
the problem is now you would like to obtain radar device’s v4l2 buffer and also its timestamp.
could you please share the code snippets, may I know how you obtain the timestamp values.

Thanks for the response @JerryChang

Yes, I had radars working previously and tried a few modifications in my application to get timestamps. But now, in the vi5_capture_dequeue function, I have added few prints for SOF and EOF and I am seeing no prints from vi5_fops.c driver in the dmesg log.

And from ‘kernel/kernel-4.9/drivers/media/v4l2-core/v4l2-ioctl.c’ driver, I am trying to print the buffer information in function ‘check_array_args’
struct v4l2_buffer *buf = parg;
printk(“%s: TEST ioctl\n”,func);
v4l_print_buffer(parg, NULL); // prints the buffer info also tried adding prints manually.
Also from my user space I am trying access the kernel v4l2 buffer using ’ if (-1 == xioctl (fd, VIDIOC_DQBUF, &buf)) { ’ call, I am getting timestamps as ‘0’ in kernel and user space.

Attached dtsi file of the radar devices which are connected to cam_i2cmux.
tegra194-radar-ti-iwr6843isk.dtsi (5.9 KB)
Dmesg log & application,
app_out.txt (573 Bytes)
dmesg (1).txt (171.2 KB)
application.cpp (15.7 KB)
application.hpp (6.9 KB)
I do not understand why it does not go inside the VI driver now.


may I have more details about working previously, do you see errors by moving to later Jetpack release?

It was on the same L4T version 32.5 and also tried with 32.7.1. But issue exists.
What could be a possible reason for not going inside VI driver? Device tree and kernel driver wise there is no changes done. Only modification is done with the application.

Hi @JerryChang ,

I am trying to trace the VI5 driver. The control does go inside ‘vi5_capture_enqueue’ function but the ‘vi5_capture_dequeue’. Also attached dmesg log for your reference.

dmesg_2.log (92.2 KB)



here’s timeout failure reported by VI driver.
for example,

[  +0.000664] vi5ops: vi5_setup_surface 
[  +0.000009] vi5ops: vi5_capture_enqueue 
[  +2.349128] tegra194-vi5 channel : 2 no reply from camera processor
[  +0.000235] tegra194-vi5 1 uncorr_err: request timed out after 2500 ms

as you can see, Xavier series using two threads approaches for capturing frames.
it should be buffer queue without available buffers cause such failure.
for example,
capture thread:

static int tegra_channel_kthread_capture_enqueue(void *data){}

release thread:

static int tegra_channel_kthread_capture_dequeue(void *data){}

as I said…
is your radar device actually sending out start-of-frame, end-of-frame to CSI channel?

Hello @JerryChang ,
Thank you for your inputs.

and even before, during successful capture state I was getting these prints on the dmesg log, so I did not worry much about this.
But now in the vi5_fops driver in the ‘vi5_capture_dequeue’ function, the driver checks for ‘vi_capture_status’ and waits for completion timeout (wait_for_completion_timeout in capture.c) and goes to -ETIMEDOUT condition and then goto uncorr_err; and fails eventually.

No, I am not getting start-of-frame or end-of-frame timestamps.
Also in the user level application I am receiving the buffer information as 0.
buf.txt (1.6 KB)


this should be the root cause to stalled VI driver and waits till timeout.
please see syncpts, it’s used by VI driver to synchronize with hardware signaling as an interrupt.
you need to program from low-level side for sending out timestamps and increasing sequence number.

it’s not a good practice to implement radar module with Video Input (VI) driver.
are you able to obtain radar’s serial data now? you may use the low-level API to write the kernel timestamp and embed to v4l buffers.

Hello @JerryChang ,

Thank you for the inputs. I will check on this.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.