Skip to main content

SetShapeDmaCommand

Initializes a SHAPE DMA command.

Syntax

Parameters

command   _Inout_
Type: SHAPE_FLOWGRAPH_COMMAND*
The SHAPE_FLOWGRAPH_COMMAND command to initialize. contextId   
Type: UINT32
DMA context ID (that is, the index) this command will reference. mixBuffer   
Type: UINT32
The mix buffer to be read from or written to, depending on the setting of the writeToMemory flag. writeToMixBuffer   
Type: bool
True if the DMA command is to write to the specified mix buffer and to read from main memory. False if the DMA command is to read from the specified mix buffer and to write to main memory.

Return value

Type: HRESULT If the function succeeds, it returns S_OK. If one or more of the arguments are invalid, the function returns E_INVALIDARG.

Remarks

The Direct Memory Access (DMA) system supports read and write functionality with automatic float-to-integer and integer-to-float conversion. The DMA system uses circular buffers containing de-interleaved samples in 128 sample blocks. The DMA processor allows the Scalable Hardware Audio Processing Engine (SHAPE) to send data from mix buffers to main system memory and retrieve data from main system into the mix buffers for further processing. DMA is done on a block basis, transferring one audio frame of data at a time. To enable block-interleaved data, a skip value specifies the number of audio frame blocks in system memory to skip from the base address when reading or writing samples. Multichannel streams require one DMA context per channel. Audio data samples are always read and written as 32-bit values, either integer or float, as specified in the DMA context floatConvert flag.
the direction of the DMA (read or write) is specified in the DMA command, not in the DMA context. This helps reduce the amount of data bandwidth. The DMA engine has no signal processing, but it can perform float-to-integer conversion or integer-to-float. This allows the application CPU to process data samples in floating-point format.

Requirements

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

See also

ACP Overview SHAPE Overview shapeflowgraph
Last modified on August 20, 2026