Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add option for setting block interrupts #8

Open
deanm1278 opened this issue Jul 23, 2018 · 1 comment
Open

Add option for setting block interrupts #8

deanm1278 opened this issue Jul 23, 2018 · 1 comment
Assignees

Comments

@deanm1278
Copy link
Contributor

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 deanm1278 self-assigned this Jul 23, 2018
@dfl
Copy link

dfl commented Jul 1, 2020

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants