> ## Documentation Index
> Fetch the complete documentation index at: https://devdocs.xbox.com/llms.txt
> Use this file to discover all available pages before exploring further.

# XDSP overview

> Use the XDSP API for hardware-accelerated convolution reverb, FFT and IFFT, and impulse-response enveloping on XBOX Series X|S consoles.

This topic provides an overview of the [XDSP APIs](/reference/audio/xdspaudio/xdspaudio_members). XDSP allows titles to leverage the Hardware Accelerated Convolution Reverb feature on the XBOX Series X|S generation of consoles. The current implementation is capable of processing 80 seconds of impulse response in real-time. For example, 40 streams of 2 seconds impulse response each simultaneously in real-time.

### New in the October 2022 release

* Two new APIs [XDspConnectWithMaximumStreamLimit](/reference/audio/xdspaudio/functions/xdspconnectwithmaximumstreamlimit) and [XDspSubmitCommandWithEnvelope](/reference/audio/xdspaudio/functions/xdspsubmitcommandwithenvelope) have been added.  **XDspConnectWithMaximumStreamLimit** uses less memory internally if the maximum number of streams that can be activated is less than 256. [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect) on the other hand accounts for 256 streams and hence uses more memory.
  **XDspSubmitCommandWithEnvelope** enables enveloping of the impulse response filter. Please see [Overview of Enveloping using XDSP API](/build/console-features/audio/overviews/xdsp-overview-enveloping).

### Release features

* For convolution, the supported block sizes are 512 and 1024 frames. Performance will be better with a block size of 1024 frames.
* For FFT/IFFT, the supported block sizes are 512, 1024 and 2048 frames.
* Convolution is supported in mono, stereo, and stereo de-interleaved modes, with mono and stereo impulse responses.
* [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect) or [XDspConnectWithMaximumStreamLimit](/reference/audio/xdspaudio/functions/xdspconnectwithmaximumstreamlimit) call makes a connection to the hardware and returns an XDspClientHandle. Only 8 connections can be active at any given point.
* The maximum *aggregateImpulseResponseInSeconds* supported in the call to [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect) is 128. This is also the maximum across all XDspConnect calls. If a single XDspConnect call is made with 128 for aggregateImpulseResponseInSeconds, no more XDspConnect calls can be made with aggregateImpulseResponseInSeconds value of greater than 0. aggregateImpulseResponseInSeconds must be greater than zero to allow stream activation for convolution processing.
* A maximum of 256 streams can be activated using [XDspActivate](/reference/audio/xdspaudio/functions/xdspactivate) for a given [XDspClientHandle](/reference/audio/xdspaudio/handles/xdspclienthandle) returned by [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect). A maximum of *maximumStreamCount* streams can be activated using [XDspActivate](/reference/audio/xdspaudio/functions/xdspactivate) for a given [XDspClientHandle](/reference/audio/xdspaudio/handles/xdspclienthandle) returned by [XDspConnectWithMaximumStreamLimit](/reference/audio/xdspaudio/functions/xdspconnectwithmaximumstreamlimit) where *maximumStreamCount* is the number of streams used in the **XDspConnectWithMaximumStreamLimit** call. These streams can be of any [XDspProcessType](/reference/audio/xdspaudio/enums/xdspprocesstype).
* When stereo input is used, the maximum aggregate impulse response supported drops to 64 seconds.
* All buffers passed to the API must be 16 byte aligned. The hardware may run into a fault and reset if the buffers are not 16 byte aligned. [XDspStatus.result](/reference/audio/xdspaudio/structs/xdspstatus) will indicate XDSP\_E\_DEVICE\_FATAL\_ERROR when the hardware ran into a crash/hang.
* **The impulse response should be in frequency domain. A tool is being provided to convert impulse responses in time domain to frequency domain.** Download from [https://aka.ms/gdkdl](https://aka.ms/gdkdl).
* The impulse response conversion tool now includes reduction support, allowing you to trade a reduction in quality for higher performance. See [XDSP Impulse Response Reduction Overview](/build/console-features/audio/overviews/xdsp-overview-ir-reduction) for further details.
* Improvements to the latency of the [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect) call have been made.

### Known Issues

* The "EnablePolarFormat" option in [XDspActivationOptions](/reference/audio/xdspaudio/enums/xdspactivationoptions) for FFT/IFFT processing takes considerable time compared to the default Cartesian format, which is more performant.

### Best Practices

* There will be a response for each command submitted to the hardware even when the hardware runs into a fault. The caller should wait for all commands to be processed by the hardware before calling [XDspDeactivate](/reference/audio/xdspaudio/functions/xdspdeactivate) to deactivate the stream. [XDspStatus.lastProcessedCommandSequence](/reference/audio/xdspaudio/structs/xdspstatus) shows the sequence number of the last processed command by the hardware for this stream. Other XDSP streams will not be affected and hardware will continue to process their commands.
* The *"baseBuffer"* that is passed to the [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect) call should not be freed until all streams are deactivated using [XDspDeactivate](/reference/audio/xdspaudio/functions/xdspdeactivate) and [XDspDisconnect](/reference/audio/xdspaudio/functions/xdspdisconnect) succeeds.
* There is an internal queue limit for each stream and [XDspSubmitCommand](/reference/audio/xdspaudio/functions/xdspsubmitcommand) returns XDSP\_E\_QUEUE\_FULL when this limit is reached. When this error is encountered, please allow enough time for the hardware to process commands for this stream before submitting more commands. [XDspStatus.lastProcessedCommandSequence](/reference/audio/xdspaudio/structs/xdspstatus) can be used to check the last command that was processed by the hardware for this stream.
* Performance is better for convolution with a 1024 block size compared to a 512 block size.
* Convolution algorithm is not homogeneous when it comes to processing consecutive commands i.e., not all blocks take the same amount of time to complete and some may take longer than the others.

### Pausing and resuming a title

A title must be able to pause and resume, for example, when the user puts it into Constrained mode. When the suspend handler is called, simply stop submitting XDSP commands to the hardware. The commands that were already submitted will be processed normally and the XDspStatus updated accordingly.

### Samples

* Available for download from [https://aka.ms/gdkdl](https://aka.ms/gdkdl) and from ATG samples.
  Sample walkthroughs are available for [Single Stream Convolution Reverb](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution) and [Single Stream FFT IFFT](/build/console-features/audio/overviews/xdsp-overview-single-stream-fft-ifft)
* An XDSP sample that uses the hardware accelerator to convert an impulse response in time domain to frequency domain is included with the rest of the samples in the GDK download portal [https://aka.ms/gdkdl](https://aka.ms/gdkdl). This sample produces exactly the same output as the Impulse Response Transform tool included with the GDK installation. This sample demonstrates how hardware acceleration can be used to convert an impulse response on the fly for using with XDSP API.

### Contact

If you have questions or concerns about this feature, please email [AnaAud@microsoft.com](mailto:AnaAud@microsoft.com) or use the online forums.

## Reference API documentation

* [Xdspaudio (API contents)](/reference/audio/xdspaudio/xdspaudio_members)
  * Functions
    * [XDspConnectWithMaximumStreamLimit](/reference/audio/xdspaudio/functions/xdspconnectwithmaximumstreamlimit)
    * [XDspSubmitCommandWithEnvelope](/reference/audio/xdspaudio/functions/xdspsubmitcommandwithenvelope)
    * [XDspConnect](/reference/audio/xdspaudio/functions/xdspconnect)
    * [XDspActivate](/reference/audio/xdspaudio/functions/xdspactivate)
    * [XDspDeactivate](/reference/audio/xdspaudio/functions/xdspdeactivate)
    * [XDspDisconnect](/reference/audio/xdspaudio/functions/xdspdisconnect)
    * [XDspSubmitCommand](/reference/audio/xdspaudio/functions/xdspsubmitcommand)
  * Structures
    * [xdspstatus](/reference/audio/xdspaudio/structs/xdspstatus)


## Related topics

- [XDSP Enveloping Overview](/build/console-features/audio/overviews/xdsp-overview-enveloping.md)
- [XDSP audio](/reference/audio/xdspaudio/xdspaudio_members.md)
- [XDSP Impulse Response Reduction Overview](/build/console-features/audio/overviews/xdsp-overview-ir-reduction.md)
- [Overview of a single stream Convolution using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution.md)
- [Single-stream convolution with envelope using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope.md)
