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.

DM3730, DMA under ARM, then DSP

Other Parts Discussed in Thread: DM3730

Hi all. I'm working on a problem of echo cahcellation. I plan to use Echo Cancellation Unit (ECU) from the VoLib library and run its functions on the DSP core of DM3730. I have linux device driver that fills buffer with voice data from the McBSP+DMA under the control of ARM at the kernel level. The problem is that I can't pass buffer with voice data to DSP. I feel that there exists a typical solution, but I didn't find it. Does anyone knows anything?

  • Hi Alexander,

    DSP Bridge driver provides features to control and communicate with DSP enabling parallel processing for multimedia acceleration using shared data buffers. You can find more details at:
    elinux.org/.../DSP_Howto
    omappedia.org/.../DSPBridge_Project

    BR
    Tsvetolin Shulev
  • Hi, Tsvetolin,

    Can I organize shared data buffers using CMEM driver? It seems to be simpler. The idea is to use shared data buffer for DMA and after the buffer is filled, interrupt routine in the DSP will start its job.

    Best Regards,
    Alexander.
  • Alexander,

    Yes, because CMEM is an API and library for managing of physically contiguous memory. It also provides address translation services (e.g. virtual to physical translation) and user-mode cache management APIs. This physically contiguous memory is useful as data buffers that can be shared with another processor or DSP. For more detail read the linked articles:
    processors.wiki.ti.com/.../CMEM_Overview
    processors.wiki.ti.com/.../Changing_the_DVEVM_memory_map

    BR
    Tsvetolin Shulev
  • OK, I used CMEM in the following way: first of all,  I set amount of memory for Linux equal to 112M (u-boot settings). Then I do 

    insmod cmemk.ko phys_start=0x87000000 phys_end=0x88000000

    To get the physical address of the shared memory region I applied the following code:

    cmem_params.type = CMEM_HEAP;
    cmem_params.flags = CMEM_NONCACHED;
    cmem_params.alignment = 32;
    if (CMEM_init() == -1) {
    fprintf(stderr, "Failed to initialize CMEM\n");
    exit(EXIT_FAILURE);
    }

    printf("CMEM initialized.\n");

    cmem_ptr = CMEM_alloc(PAGE_SIZE, &cmem_params);

    if (cmem_ptr == NULL) {
    fprintf(stderr, "Failed to allocate buffer of size %d\n", PAGE_SIZE);
    CMEM_exit();
    exit(EXIT_FAILURE);
    }
    physp = CMEM_getPhys(cmem_ptr); //the physical address

    This physical address is then passed to the driver via ioctl. I need it for DMA purposes an I need virtual address for copiing data in the driver. But phys_to_virt leads to kernel panic when I try to write anything to it. What could be the reason?

    Alexander.