Needs help using DMA in linux

Hi

I am currently porting the FM modulator from TMS320C5510 DSP (using
DSP/BIOS) to OMAP 3530 (beagleboard with linux + alsa installed), the
DSP simultaneously captures audio input from the codec using DMA
controller while generating modulated signal to direct digital
synthesizer (DDS) via SPI using another channel of DMA controller. In
DSP/BIOS environment, I can easily configure 2 DMA channels (incoming
& outgoing) to use the same trigger (Frame Sync of Codec), but in
linux environment, I have no idea how to configure the outgoing DMA
controller because incoming data transfer from codec is done by alsa.
Please give me a few hints how to configure the outgoing DMA
controller because data transfer from codec and to DDS must be sync
each others.

Thank You

billy wrote:

Hi

I am currently porting the FM modulator from TMS320C5510 DSP (using
DSP/BIOS) to OMAP 3530 (beagleboard with linux + alsa installed), the
DSP simultaneously captures audio input from the codec using DMA
controller while generating modulated signal to direct digital
synthesizer (DDS) via SPI using another channel of DMA controller. In
DSP/BIOS environment, I can easily configure 2 DMA channels (incoming
& outgoing) to use the same trigger (Frame Sync of Codec), but in
linux environment, I have no idea how to configure the outgoing DMA
controller because incoming data transfer from codec is done by alsa.
Please give me a few hints how to configure the outgoing DMA
controller because data transfer from codec and to DDS must be sync
each others.
  
You can do DMA from linux user-mode. There is a kernel-module in the TI
linuxutils package that grants you user-mode access to the sDMA
registers. I don't think that you can simply handle interrupts or
synchronize to hardware events with it though.

I'm not exactly sure what you're trying to accomplish, but from what I
read between the lines I guess that Linux and ALSA just come into your
way. Seems like you need a lower level access to the hardware that Linux
user mode can give you.

If this is true you have to options:

- Stay on the ARM side, write a Linux kernel module that talks to the
hardware, do your DMA and synchronized audio IO. You need a kernel
without ALSA support for this (it would collide with your audio output
module).the

- Completely remove ALSA and McBSP support from the kernel and do all
the audio on the DSP. This way is a bit steeper (e.g. getting the DSP
running) but afterwards you have no stupid OS that can come into your way..

These are the options that come to my mind.. The decision is up to you.. :slight_smile:

Cheers,
    Nils Pipenbrinck

Actually, the solution needs not to be alsa as long as it's in linux
environment, but I was thinking if there's a way to access/tap the DMA
trigger (which is frame sync signal of the codec in this case) of
incoming data transfer (performed by alsa) it would be easier for me
to use it as the DMA trigger for outgoing data transfer to DDS. But
from your explanations, I think it won't be that easy :slight_smile: