[Sound-open-firmware] Questions about the DMA driver flow in SOF

Lauda, Tomasz tomasz.lauda at intel.com
Fri Aug 30 11:43:14 CEST 2019


Hi Paul,

DAI DMA is the one, which interrupts usually drive the scheduling of the pipeline (the other possibility is timer).
IRQ callback should be called in the interrupt handler of the DMA and in our case DAI schedules pipeline copy in such cb.
Next is used to transfer information from DAI callback function back to the DMA and based on this information DMA executes some additional action e.g. after getting an interrupt we need to load the next linked list item in order for the DMA to continue the data transfer.
COPY callback should be called in dma_copy and it's used to tell DAI how much data has been copied, so it can increment read/write pointers of the buffer.
I must admit, that this solution is very hard to follow and I'm working on little simplification, but it's tough to write common handling code for different types of DMAs.
Does your DMA also use interrupts to schedule the pipe?

Tomek

-----Original Message-----
From: Sound-open-firmware [mailto:sound-open-firmware-bounces at alsa-project.org] On Behalf Of Paul Olaru
Sent: Thursday, August 29, 2019 4:27 PM
To: sound-open-firmware at alsa-project.org
Subject: [Sound-open-firmware] Questions about the DMA driver flow in SOF

I need to understand the general flow on how a DMA driver should Work in SOF. In particular what each callback should do.

I get channel_get, channel_put, start, stop, pause, release (although I don't quite get the nuance between stop and pause, or between start and release; thankfully I hope it's not important if I treat them the same). I get most of the others too, at least for the most part.

What I don't get at all is how the copy callback should work. In the DW DMA driver it seems to just run the callback and do something based on what the callback set in next, in HDA it seems to wait for the host buffer to be full or empty (I think this one may be the more intuitive one?) and the link HDA DMA seems to again just run the callback.

What should the copy callback really do? Is it different between a host DMA and a DAI DMA?
_______________________________________________
Sound-open-firmware mailing list
Sound-open-firmware at alsa-project.org
https://mailman.alsa-project.org/mailman/listinfo/sound-open-firmware
--------------------------------------------------------------------

Intel Technology Poland sp. z o.o.
ul. Slowackiego 173 | 80-298 Gdansk | Sad Rejonowy Gdansk Polnoc | VII Wydzial Gospodarczy Krajowego Rejestru Sadowego - KRS 101882 | NIP 957-07-52-316 | Kapital zakladowy 200.000 PLN.

Ta wiadomosc wraz z zalacznikami jest przeznaczona dla okreslonego adresata i moze zawierac informacje poufne. W razie przypadkowego otrzymania tej wiadomosci, prosimy o powiadomienie nadawcy oraz trwale jej usuniecie; jakiekolwiek
przegladanie lub rozpowszechnianie jest zabronione.
This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). If you are not the intended recipient, please contact the sender and delete all copies; any review or distribution by
others is strictly prohibited.



More information about the Sound-open-firmware mailing list