camera_v4l2_cuda dma buffer wrong video

Hi All! I write my own driver for ds90ub940 FPD-Link III to CSI deserializer. When i try to run sample 12_camera_v4l2_cuda i get wrong wideo with this driver (RGB pixel format)

Sample wrong wideo Images:

When I try to convert this camera captured image and encode with h265 i get this result:

qv4l2 application works fine, and I test:
if I use V4L2_MEMORY_MMAP all works fine

struct v4l2_buffer buf;
memset(&buf, 0, sizeof buf);

buf.index = i;
buf.memory = V4L2_MEMORY_MMAP;

Whats wrong with V4L2_MEMORY_DMABUF and NvBuffer from nvbuf_utils.h?

Hi Fobos,
Can your source output UYVY or YUYV?

Not sure but the HW conversion engine does not support RGB. This probably is the rootcause.

Also do you run standard resolution like 1280x720 or 1920x1080?

Hi DaneLLL,

I cant use UYVY or YUYV because camera working only with RGB and standart resolution 1280x720
Full launch args: -d /dev/video0 -r 30 -n 30 -s 1280x720 -f AR24
I change static nv_color_fmt nvcolor_fmt to

static nv_color_fmt nvcolor_fmt[] =
    // TODO add more pixel format mapping
    {V4L2_PIX_FMT_UYVY, NvBufferColorFormat_UYVY},
    {V4L2_PIX_FMT_VYUY, NvBufferColorFormat_VYUY},
    {V4L2_PIX_FMT_YUYV, NvBufferColorFormat_YUYV},
    {V4L2_PIX_FMT_YVYU, NvBufferColorFormat_YVYU},
    {V4L2_PIX_FMT_YUV420M, NvBufferColorFormat_YUV420},
    {V4L2_PIX_FMT_ABGR32, NvBufferColorFormat_ARGB32},

This code works fine with JetPack 3.1

Hi Fobos,
With ‘-n 30’, it dumps a raw frame, so the raw frame is correct on image installed via Jetpack 3.1 and wrong via Jetpack 3.2?

Hi DaneLLL,

Image is normal after crop, but wrong on convert or encode step, and for sure wrong on render

This behavior start via Jetpack 3.2 and 3.2.1, and i have corrent images via Jetpack 3.1 L4T 28.2

Raw AR24 file:
Image after convert to jpeg:

Hi Fobos,
We have new NvBuffer APIs to replace NvVideocinverter in 12_camera_v4l2_cuda from r28.2. Can you try to run 12_camera_v4l2_cuda of r28.1 on r28.2? It may be specific to new NvBuffer APIs.

Also do you have sample to reproduce the issue? We have to reproduce the issue first but don’t have the CSI deserializer. Any other ways we can reproduce the issue without the deserializer?

Hi DaneLLL,

Sorry I havn’t so much time to experiment with run 12_camera_v4l2_cuda of r28.1 on r28.2. I think that the error in new NvBuffer APIs with NvBufferColorFormat_ARGB32.

I think you can try to reproduce the issue if you have RGB888 CSI camera. Or we have error in deserializer.

I must return to Jetpack 3.1.
I hope in a short time there i will be an opportunity to continue experiment with Jetpack 3.2 and 3.2.1

Hi Fobos,
Still need your help to reproduce the issue. Please share a sample once you come back to 3.2.1