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’.
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.
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’
case VIDIOC_DQBUF: {
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.
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.
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.
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 15c10000.vi: channel : 2 no reply from camera processor
[ +0.000235] tegra194-vi5 15c10000.vi: 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){}
...
wait_event_interruptible(chan->start_wait,
release thread:
static int tegra_channel_kthread_capture_dequeue(void *data){}
...
wait_event_interruptible(chan->dequeue_wait,
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.
Yes,
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.
anyways,
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.