Good day,
I'm working on a V4L2 (Video for Linux) application with OpenVX & TIDL (vision_apps).
Currently I'm not able to get the application running without copying the images from V4L2 to OpenVX (DQBUF + memcpy). I've tried the following approaches:
1) V4L2_MEMORY_MMAP (very similar to: https://github.com/KhronosGroup/OpenVX-sample-impl/blob/openvx_1.3/sample/tests/vx_cam_test.c#L342 )
Memory is mmap'ed and the vx_image is created via vxCreateImageFromHandle.
This doesn't work because vx_images not allocated via tivxMemAlloc do not access the correct data (at least for me).
2) V4L2_MEMORY_USERPTR
Memory is allocated via vxCreateImage + vxMapImagePatch → buffers[i].m.userptr = (unsigned long) data_ptr
This doesn't work because VIDIOC_QBUF crashes with Bad address
Compacted stack trace:
get_vaddr_frames() cannot follow VM_IO mapping get_vaddr_frames+0x1a4/0x1b8 vb2_create_framevec+0x54/0xb0 [videobuf2_memops] vb2_vmalloc_get_userptr+0x54/0x190 [videobuf2_vmalloc] vb2_qbuf+0x8c/0xe0 [videobuf2_v4l2] v4l2_ioctl+0x40/0x60
I assume the memory allocated via OpenVX is not accessible to the kernel/V4L2 driver.
3) V4L2_MEMORY_USERPTR, same as 2) but with tivxMemAlloc + vxCreateImageFromHandle
same problem as with 2); also tests with tivxMemHost2SharedPtr, tivxMemShared2TargetPtr, tivxMemShared2PhysPtr didn't work.
Do you have any idea how to either solve one of the issues above or have an alternative idea?
Thanks for your help,
Thomas