This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Sharing V4L2 Memory Buffers with C6EZRun-Lib

Good Evening,

I have an application running on the TI8148 that uses the V4L2 APIs to capture and display video.  I need to pass those buffers onto DSP accelerated algorithms that I'm building with C6EZRun-Lib and calling from my main application on the ARM.

The only problem is that I can't find a way to get my buffers into the DSP space.

If I directly pass the user-space pointer, I'm presented with a "C6RUN_SHAREDMEM_lookupBuffer() failed for pointer ..." error.  I have read the documentation on the tool (http://processors.wiki.ti.com/index.php/C6RunLib_Documentation#Buffer_Passing_using_C6RunLib) and noticed that the memory buffers need to be contiguous.  They are, as they have been allocated from the display driver space per the "saLoopBackScale" demo.

I have also tried allocating the V4L2 buffers using C6RUN_MEM_malloc() instead of the mmap from the display driver, but that results in some M3 VPSS malfuctions that trashes the system.

I have a temporary work around by allocating another C6RUN_MEM_malloc() buffer and copying my V4L2 buffer into it prior to every DSP algorithm call.  This seems to make it across but as you might imagine, the performance takes an unacceptable hit.

Any suggestions or insight is greatly appreciated!  I'm in the 11th hr on this one and desperately need a better resolution!

Thank You!

  • Hi, Charles.

    You cannot use arm-linux user pointer on DSP. You should pass physical address. You can get physical address of framebuffer from the "struct fb_fix_screeninfo". Use smem_start member of this struct. You can find how to get this struct in the "saLoopBackScale" demo.

    Regards,

    Alexander Vasiljev.

  • Alexander,

    Thanks very much for your reply.

    I have tried passing"disp.fixinfo.smem_start" cast as a pointer to my DSP processing function.  The error still remains dsp_lib/RTA.gpp_stub.c: C6RUN_SHAREDMEM_lookupBuffer() failed for pointer 0xB0B00000.  It seems like I still need to add this space to a DSP memory map or something of that nature to allow it to use the memory space.

    My application has the debug printouts from saLoopBackScale, and the physical address does in fact seem to be passed correctly:

    Fix Screen Info:
    ----------------
    Line Length - 1440
    Physical Address = b0b00000
    Buffer Length = 41943040

    LINUX_MEM_2_2 317 13D00000 A0000000

    Per the 1G EVM memory map, this space appears to come out of the Linux_Mem segment.

    Do you have any other suggestions?

  • Hi, Charles.

    As far as i know dsp usually doesn't use memory mapping. But i don't work with C6EZRun. I use syslink and don't have problems with physical addresses in dsp.

    Best regards,

    Alexander.