Adafruit_ZeroDMA icon indicating copy to clipboard operation
Adafruit_ZeroDMA copied to clipboard

Add option for setting block interrupts

Open deanm1278 opened this issue 7 years ago • 1 comments
trafficstars

To avoid dropouts in audio or video while using ping-pong style buffers it's necessary for the system to be notified when a buffer is done transmitting so a new buffer can be filled, but have the DMAC continue on seamlessly to the next descriptor in the list. This can be done by setting desc->BTCTRL.bit.BLOCKACT = DMA_BLOCK_ACTION_INT The current library fixes this bit to desc->BTCTRL.bit.BLOCKACT = DMA_BLOCK_ACTION_NOACT and the user must change it manually in the descriptor.

It would be nice if we could add a setBlockact(action) method or something

deanm1278 avatar Jul 23 '18 18:07 deanm1278

I agree, it would be nice to have something explicit in the API. BTW I've made an example that makes use of this DMA_BLOCK_ACTION_INT mode, writing an audio buffer directly and then playing it seamlessly. It's not ping-pong, just a very short snippet of synthesized sine wave. https://github.com/dfl/Adafruit_ZeroDMA_I2S_DSP_example

dfl avatar Jul 01 '20 01:07 dfl