Skip to main content

XDspConnect

Establishes a connection with the hardware server, creates an XDSP client instance, and allocates the necessary resources for processing. There is a global limit of 8 active XDSP clients simultaneously.

Syntax

Parameters

baseBuffer   _In_
Type: float*
Contiguous buffer that is allocated by an XDSP caller to be used to pass input data and retrieve the output data. For additional details, see the Remarks section below. baseBufferLength   _In_
Type: uint32_t
Length of the baseBuffer, in bytes. This length must be at least 64 KB and no more than 500 MB. aggregateImpulseResponseInSeconds   _In_
Type: uint32_t
Represents the overall duration of all the individual impulse responses duration that will be activated simultaneously on this client. aggregateImpulseResponseInSeconds, must be set to a value larger than zero for XDspProcessType::Convolution, otherwise it must be zero. There is a global limit of 128 seconds of aggregate impulse response across all XDSP clients. handle   _Outptr_
Type: XDspClientHandle*
Handle to an XDSP client that should be used to activate streams via XDspActivate and disconnect the client from the hardware sever via XDspDisconnect. A maximum of 256 streams can be active at any given time for all XDSPClientHandles.

Return value

Type: HRESULT If the method succeeds, it returns S_OK. If the method fails, it returns one of the following codes (partial list):

Remarks

If the call succeeds, the baseBuffer can be used by the caller to pass input data and retrieve the output data of the stream via XDspCommand parameters. If enveloping is used, this buffer should also account for the buffers for storing envelope parameters. Please see Overview of Enveloping using XDSP API for more information on enveloping. This function must be called before activating XDSP streams to register one large memory chunk enough to hold multiple complete audio streams for use as input, multiple output buffers for all the XDSP streams that will be activated via XDspActivate, and multiple block multiplier buffers that may be used as part of the XDspCommand for the XDspProcessType::ForwardFourierTransform processing type. Please be aware of the minimum and maximum size requirements for this buffer, as noted above. If this call succeeds, all XDSP streams can access any part of this memory chunk. This memory should be allocated via XMemAlloc() with these attributes: XALLOC_MEMTYPE_PHYSICAL_CACHEABLE, XALLOC_PAGESIZE_64KB, XALLOC_ALIGNMENT_64K These attributes should be set using MAKE_XALLOC_ATTRIBUTES(). An example of this is as follows:
allocatorId in the above example should be replaced with the correct allocator id used by the title. It is up to the caller to partition and recycle baseBuffer to hold different input streams and output buffers for multiple streams. The impulseResponse need not be from this baseBuffer and it can be from any memory allocated by the caller. The memory pointed to by baseBuffer should not be freed until XDspConnect is called. All memory pointers that are passed to XDSP API must be 16-byte aligned. If the call succeeds, a valid XDspClientHandle will be returned to be used with XDspActivate and XDspDisconnect calls.

Requirements

Header: XDspAudio.h Library: Chad.lib Supported platforms: XBOX Series X|S

Conceptual documentation

See also

XDSP
XDspConnectWithMaximumStreamLimit
XDspDisconnect
XDSP Errors
Overview of a single stream Convolution using the XDSP API
Overview of a single stream FFT/IFFT using the XDSP API
Overview of a single stream Convolution with Envelope using the XDSP API
Last modified on August 20, 2026