Multi-threaded DSP Buffering

Coordinating a long running DSP process to run on two DSP chips while performing other tasks on the CPU does require some planning. This is an example of that planning for the freeze-stretch driver. (In this case "long" means that it takes longer than a single buffer's amount of time)

StepBuffers ABuffers B
1Fill a complete input window AComplete playback of output window B
2Enqueue map DSP input buffer A for writing

Copy input window A to DSP input buffer A

Enqueue unmap DSP input buffer A

Enqueue DSP task A with event A
3
DSP event B wait for completion


Enqueue map DSP output buffers B for reading


Copy DSP output buffers B to output window A


Enqueue unmap DSP input buffers B
4Begin playback of output window ABegin recording data into input window B
5Complete playback of output window AFill a complete input window B
6
Enqueue map DSP input buffer B for writing


Copy input window B to DSP input buffer B


Enqueue unmap DSP input buffer B


Enqueue DSP task B with event B
7DSP event A wait for completion

Enqueue map DSP output buffers A for reading

Copy DSP output buffers A to output window B

Enqueue unmap DSP input buffers A
8Begin recording data into input window ABegin playback of output window B