Skip to main content

SetShapeDmaAudioBuffer

Sets the DMA audio buffer. This is an overloaded function: one function accepts a virtual pointer, the other a physical address.

Syntax

Parameters

context   _Inout_
Type: SHAPE_DMA_CONTEXT*
Pointer to a SHAPE_DMA_CONTEXT structure. audioBuffer   _In_
Type: APU_ADDRESS
Physical address of the buffer.

Return value

Type: HRESULT HRESULT success or error code.

Remarks

You can prevent blocked Direct Memory Access (DMA) commands by ensuring that your audio buffer is sufficiently large and that data is streamed at regular intervals (related to the buffer size). For example, if you are streaming four hardware frames at a time, ensure that some multiple of those frames (at least double-buffered at eight frames) are in the buffer so the hardware can write ahead of the title’s read pointer. Alternatively, you could enforce emptying of the buffer before submitting the next flowgraph (consume, update DMA read pointer, and then submit the flowgraph). For more details, see Blocked commands in Overview of SHAPE.

Requirements

Header: shapedmacontext.h Supported platforms: XBOX One family consoles and XBOX Series consoles

See also

ShapeDmaContext
Last modified on August 20, 2026