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

# Session

**Header:** `session/inc/Session.h`

## Structures

### `Session`

#### Nested Types

##### `Session::eventPayload`

**Members**

<ParamField path="eventId" type="uint32_t" />

<ParamField path="payload" type="void *" />

<ParamField path="payloadSize" type="size_t" />

**Members**

<ParamField path="handle_t _(protected)_" type="void *" />

<ParamField path="rm _(protected)_" type="std::shared_ptr< ResourceManager >" />

<ParamField path="rxAifBackEnds _(protected)_" type="std::vector< std::pair< int32_t, std::string > >" />

<ParamField path="txAifBackEnds _(protected)_" type="std::vector< std::pair< int32_t, std::string > >" />

<ParamField path="streamHandle _(protected)_" type="Stream *" />

<ParamField path="frontEndIdAllocated _(protected)_" type="bool" />

<ParamField path="pm" type="std::shared_ptr< PluginManager >" />

#### Functions

##### `Session`

*protected*

```cpp theme={null}
 Session()
```

##### `~Session`

```cpp theme={null}
 ~Session()
```

##### `open`

```cpp theme={null}
int open(Stream *s)=0
```

##### `prepare`

```cpp theme={null}
int prepare(Stream *s)=0
```

##### `start`

```cpp theme={null}
int start(Stream *s)=0
```

##### `stop`

```cpp theme={null}
int stop(Stream *s)=0
```

##### `close`

```cpp theme={null}
int close(Stream *s)=0
```

##### `pause`

```cpp theme={null}
int pause(Stream *s)=0
```

##### `suspend`

```cpp theme={null}
int suspend(Stream *s)=0
```

##### `resume`

```cpp theme={null}
int resume(Stream *s)=0
```

##### `mute`

```cpp theme={null}
int mute(Stream *s, bool state)=0
```

##### `setVolume`

```cpp theme={null}
int setVolume(Stream *s)=0
```

##### `drain`

```cpp theme={null}
int drain(pal_drain_type_t type __unused)=0
```

##### `flush`

```cpp theme={null}
int flush()=0
```

##### `read`

```cpp theme={null}
int read(Stream *s __unused, struct pal_buffer *buf __unused, int *size __unused)=0
```

##### `write`

```cpp theme={null}
int write(Stream *s __unused, struct pal_buffer *buf __unused, int *size __unused)=0
```

##### `getParameters`

```cpp theme={null}
int32_t getParameters(Stream *s, uint32_t param_id, void **payload)=0
```

##### `setParameters`

```cpp theme={null}
int setParameters(Stream *s, uint32_t param_id, void *payload)=0
```

##### `setCustomParam`

```cpp theme={null}
int32_t setCustomParam(custom_payload_uc_info_t *uc_info, std::string param_str, void *param_payload, size_t payload_size, Stream *s)=0
```

##### `getCustomParam`

```cpp theme={null}
int32_t getCustomParam(custom_payload_uc_info_t *uc_info, std::string param_str, void *param_payload, size_t *payload_size, Stream *s)=0
```

##### `getTimestamp`

```cpp theme={null}
int getTimestamp(struct pal_session_time *stime __unused)=0
```

##### `setupSessionDevice`

```cpp theme={null}
int setupSessionDevice(Stream *streamHandle, pal_stream_type_t streamType, std::shared_ptr< Device > deviceToCconnect)=0
```

##### `connectSessionDevice`

```cpp theme={null}
int connectSessionDevice(Stream *streamHandle, pal_stream_type_t streamType, std::shared_ptr< Device > deviceToCconnect)=0
```

##### `disconnectSessionDevice`

```cpp theme={null}
int disconnectSessionDevice(Stream *streamHandle, pal_stream_type_t streamType, std::shared_ptr< Device > deviceToDisconnect)=0
```

##### `registerCallBack`

```cpp theme={null}
int registerCallBack(session_callback cb __unused, uint64_t cookie __unused)
```

##### `setECRef`

```cpp theme={null}
int setECRef(Stream *s, std::shared_ptr< Device > rx_dev, bool is_enable)
```

##### `getFrontEndIds`

```cpp theme={null}
int32_t getFrontEndIds(std::vector< int > &devices, uint32_t ldir) const
```

##### `createMmapBuffer`

```cpp theme={null}
int createMmapBuffer(Stream *s __unused, int32_t min_size_frames __unused, struct pal_mmap_buffer *info __unused)
```

##### `GetMmapPosition`

```cpp theme={null}
int GetMmapPosition(Stream *s __unused, struct pal_mmap_position *position __unused)
```

##### `ResetMmapBuffer`

```cpp theme={null}
int ResetMmapBuffer(Stream *s __unused)
```

##### `openGraph`

```cpp theme={null}
int openGraph(Stream *s __unused)
```

##### `sendMsg`

```cpp theme={null}
int sendMsg(pal_cshm_id_t memID, uint32_t offset, uint32_t length, uint32_t destID, uint32_t flags, Stream *s)
```

##### `addRemoveEffect`

```cpp theme={null}
int addRemoveEffect(Stream *s, pal_audio_effect_t effect, bool enable)
```

##### `makeSession`

```cpp theme={null}
Session * makeSession(const std::shared_ptr< ResourceManager > &rm, const struct pal_stream_attributes *sAttr)
```

#### Type Aliases

##### `eventPayload`

```cpp theme={null}
using eventPayload = struct Session::eventPayload
```

### `Session::eventPayload`

**Members**

<ParamField path="eventId" type="uint32_t" />

<ParamField path="payload" type="void *" />

<ParamField path="payloadSize" type="size_t" />

## Type Definitions

### `session_callback`

```cpp theme={null}
typedef void(* session_callback
```

### `SessionCreate`

```cpp theme={null}
typedef Session *(* SessionCreate
```

## Enumerations

### `configType`

#### Values

| Name               | Value | Description |
| ------------------ | ----- | ----------- |
| `GRAPH`            | = 0   |             |
| `MODULE`           |       |             |
| `CALIBRATION`      |       |             |
| `CODEC_DMA_CONFIG` |       |             |
| `MEDIA_CONFIG`     |       |             |
| `IN_MEDIA_CONFIG`  |       |             |
| `OUT_MEDIA_CONFIG` |       |             |

### `sessionState`

#### Values

| Name              | Value | Description |
| ----------------- | ----- | ----------- |
| `SESSION_IDLE`    |       |             |
| `SESSION_OPENED`  |       |             |
| `SESSION_STARTED` |       |             |
| `SESSION_FLUSHED` |       |             |
| `SESSION_STOPPED` |       |             |
