> ## 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.

# XDspSubmitCommand

> XDspSubmitCommand

# XDspSubmitCommand

Submit one command to the hardware queue for a given XDSP stream.

## Syntax

```cpp theme={null}
HRESULT XDspSubmitCommand(  
         XDspStreamHandle handle,  
         XDspCommand* command,  
         uint32_t* commandSequence  
)  
```

### Parameters

*handle*   \_In\_\
Type: [XDspStreamHandle](/reference/audio/xdspaudio/handles/xdspstreamhandle)

A valid XDSP stream handle.

*command*   \_In\_\
Type: [XDspCommand\*](/reference/audio/xdspaudio/structs/xdspcommand)

Pointer to a [XDspCommand](/reference/audio/xdspaudio/structs/xdspcommand) structure.

*commandSequence*   \_Out\_\
Type: uint32\_t\*

Pointer to `uint32_t` to return a command sequence value. See the **Remarks** section for additional details.

### Return value

Type: HRESULT

If the method succeeds, it returns S\_OK. If the method fails, it returns the following code (partial list):

| Return code                   | Description                                                                                                                                                                                  |
| ----------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| E\_INVALIDARG                 | One or more of the arguments are invalid.                                                                                                                                                    |
| XDSP\_E\_QUEUE\_FULL          | This call will return XDSP\_E\_QUEUE\_FULL if the stream and hardware server reached max processing capacity. Wait for the hardware to process the commands before submitting more commands. |
| XDSP\_E\_DEVICE\_FATAL\_ERROR | If the hardware server is in a bad state, **XDspSubmitCommand** will return XDSP\_E\_DEVICE\_FATAL\_ERROR error code.                                                                        |

## Remarks

This call will be fast as it will not allocate resources or process data and just sends the command to the hardware server.

This call will also take a pointer to `uint32_t` to return a command sequence value, *commandSequence*, to track when the command result is ready later. This number represents the total number of commands that have been submitted successfully since the session started and after [XDspActivate](/reference/audio/xdspaudio/functions/xdspactivate) was called. This number will be one for the first command and is incremented by one for each successful [XDspSubmitCommand](/reference/audio/xdspaudio/functions/xdspsubmitcommand) call after that.

If the hardware server is in a bad state, **XDspSubmitCommand** will return XDSP\_E\_DEVICE\_FATAL\_ERROR error code. At this point, no more commands can be submitted for the XDSP stream that is in a failed state. [XDspStatus](/reference/audio/xdspaudio/structs/xdspstatus) for the stream will also indicate the same error. The affected XDSP stream should wait for all submitted commands to be processed by the hardware by checking the [XDspStatus](/reference/audio/xdspaudio/structs/xdspstatus) and it should be deactivated using [XDspDeactivate](/reference/audio/xdspaudio/functions/xdspdeactivate) once all the commands are processed. Other XDSP streams will not be affected and hardware will continue to process their commands.

## Requirements

**Header:** XDspAudio.h

**Library:** Chad.lib

**Supported platforms:** XBOX Series X|S

## Conceptual documentation

* [Overview of XDSP Enveloping](/build/console-features/audio/overviews/xdsp-overview-enveloping)
* [Overview of a single stream Convolution with Envelope using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope)
* [Overview of a single stream Convolution using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution)
* [XDSP overview](/build/console-features/audio/overviews/xdsp-overview)

## See also

[XDSP](/reference/audio/xdspaudio/xdspaudio_members)\
[XDspSubmitCommandWithEnvelope](/reference/audio/xdspaudio/functions/xdspsubmitcommandwithenvelope)\
[XDSP Errors](/reference/audio/xdspaudio/enums/xdsperrors)\
[Overview of a single stream Convolution using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution)\
[Overview of a single stream FFT/IFFT using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-fft-ifft)\
[Overview of a single stream Convolution with Envelope using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope)


## Related topics

- [XDspSubmitCommandWithEnvelope](/reference/audio/xdspaudio/functions/xdspsubmitcommandwithenvelope.md)
- [XDspCommand](/reference/audio/xdspaudio/structs/xdspcommand.md)
- [XDspStatus](/reference/audio/xdspaudio/structs/xdspstatus.md)
- [Single-stream convolution with envelope using the XDSP API](/build/console-features/audio/overviews/xdsp-overview-single-stream-convolution-with-envelope.md)
- [XDspActivationParameters](/reference/audio/xdspaudio/structs/xdspactivationparameters.md)
