BACKGROUND:
running Linux 2.6.29 on OMAP3530
Using V4L2 driver to capture images from USB camera
Allocating memory for images in DSPLink Pool memory (DSPLink 1.61.03)
PROBLEM:
memcpy from buffer allocated by V4L2 to buffer allocated by Pool is very slow (~30ms).
memcpy from buffer allocated by V4L2 to memory allocated in the application is pretty fast (~5ms).
<code>
char localbuffer[307200];
char * poolBuffer = GetPoolMemory( 307200 );
// Dequeue the buffer from V4L2
buf.type = V4L2_BUF_TYPE_VIDEO_CAPTURE;
buf.memory = V4L2_MEMORY_MMAP;
ret = ioctl( fd, VIDIOC_DQBUF, &buf);
char * psrc = (u8*)vd->mem[vd->buf.index];
memcpy( poolBuffer, psrc, 307200 ); // slow ~ 30ms
memcpy( localbuffer, psrc, 307200 ); // fast ~ 5ms
...
</code>
QUESTION:
Q1: Why would the memcpy be so slow to the memory allocated by Pool (DSPLink)?
Q2: Is there a "better" [i.e. faster] way to get an image from the V4L2 interface into memory that can then be processed by the DSP core?