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

# Perform Bluetooth A2DP sink functions

> You can perform Bluetooth A2DP sink functions using the ``bluetoothctl`` menu, ``menu transport`` submenu, and ``menu player`` submenu. Bluetooth A2DP sink functions include connecting or disconnecting to a remote device and listing available transport options for audio streams. They allow you to retrieve information about codec capabilities, set the absolute volume, and play an audio file. You can use playback controls to pause, stop, play the next or previous audio file, and fast-forward during playback.

## Prerequisites

Before you begin, set up your device and go to the required menu as described in <a href="verify-a2-dp-functions#set-up-the-device-for-a2dp-functions" target="_self">Set up the device for A2DP functions</a>.

## Connect a remote device

To connect a remote device, run the following command from the `bluetoothctl` menu:

```text theme={null}
connect <bt_address>
```

**Parameters**

`<bt_address>` is the Bluetooth address of the remote device.

**Example**

To connect to a paired remote device with `<bt_address>` `D4:8A:39:78:27:41`, run the following command:

```text theme={null}
connect D4:8A:39:78:27:41
```

**Sample output**

```text theme={null}
[bluetooth]# connect D4:8A:39:78:27:41
Attempting to connect to D4:8A:39:78:27:41
[CHG] Device D4:8A:39:78:27:41 Connected: yes
[NEW] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1
[NEW] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep2
[NEW] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep3
[NEW] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep4
[NEW] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep5
[NEW] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2
Connection successful
[NEW] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 [default]
[CHG] Device D4:8A:39:78:27:41 ServicesResolved: yes
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Repeat: off
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Shuffle: off
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Status: stopped
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Title: Not Provided
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 TrackNumber: 0x00000001 (1)
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 NumberOfTracks: 0x00000001 (1)
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Duration: 0x00000000 (0)
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Album:
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Artist:
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Genre:
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x00000000 (0)
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x00000000 (0)
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 Volume: 0x004d (77)
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 State: pending
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 State: active
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Status: playing
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x00000000 (0)
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 State: idle
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x00000000 (0)
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Status: stopped
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x00000000 (0)
[MyDeviceB]#
```

## List available transport

To list the available transport, run the following command from the `menu transport` submenu:

```text theme={null}
list
```

**Sample output**

```text theme={null}
[MyDeviceB]# list
Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2
```

## Get information about codec capabilities

To get information about the codec capabilities of a transport, run the following command from the `menu transport` submenu:

```text theme={null}
show <transport>
```

**Parameters**

`<transport>` is the transport path.

**Example**

To get information about the codec capabilities of `<transport>` `/org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2`, run the following command:

```text theme={null}
show /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2
```

**Sample output**

```text theme={null}
[MyDeviceB]# show /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2
Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2
   UUID: 0000110b-0000-1000-8000-00805f9b34fb
   Codec: 0x00 (0)
   Configuration: 0x21 (33)
   Configuration: 0x15 (21)
   Configuration: 0x02 (2)
   Configuration: 0x35 (53)
   Device: /org/bluez/hci0/dev_D4_8A_39_78_27_41
   State: active
   Volume: 0x007f (127)
```

## Set absolute volume

<Note>
  Ensure that the DUT and the remote device support the `setabsvolume` feature.
</Note>

To set the absolute volume of a transport, run the following command from the `menu transport` submenu:

```text theme={null}
volume <transport> [value]
```

**Parameters**

* `<transport>` is the transport path.

* `[value]` is the volume level.

**Example**

To set the absolute volume of `<transport>` `/org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2` as `0`, run the following command:

```text theme={null}
volume /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 0
```

**Sample output**

```text theme={null}
<me /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 0
Changing Volume succeeded
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 Volume: 0x0000 (0)
<me /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 100
Changing Volume succeeded
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 Volume: 0x0064 (100)
< /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 50
Changing Volume succeeded
```

## Play an audio file

To play an audio file, run the following command from the `menu player` submenu:

```text theme={null}
play [item]
```

**Sample output**

```text theme={null}
[MyDeviceB]# play
Attempting to play
Play successful
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 State: pending
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 State: active
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x000cc8b9 (837817)
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Status: playing
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x000cc932 (837938)
[MyDeviceB]#
```

## Pause playback

To pause playback, run the following command from the `menu player` submenu:

```text theme={null}
pause
```

**Sample output**

```text theme={null}
[MyDeviceB]# pause
Attempting to pause
Pause successful
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x000cc888 (837768)
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Status: paused
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x000cc888 (837768)
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 State: idle
[MyDeviceB]#
```

## Stop playback

To stop playback, run the following command from the `menu player` submenu:

```text theme={null}
stop
```

**Sample output**

```text theme={null}
[MyDeviceB]# stop
Attempting to stop
Stop successful
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x00000000 (0)
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Status: stopped
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x00000000 (0)
[CHG] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd2 State: idle
```

## Play the next audio file

To play the next audio file, run the following command from the `menu player` submenu:

```text theme={null}
next
```

**Sample output**

```text theme={null}
[MyDeviceB]# next
Attempting to jump to next
Next successful
```

## Play the previous audio file

To play the previous audio file, run the following command from the `menu player` submenu:

```text theme={null}
previous
```

**Sample output**

```text theme={null}
[MyDeviceB]# previous
Attempting to jump to previous
Previous successful
```

## Fast forward playback

To fast forward playback, run the following command from the `menu player` submenu:

```text theme={null}
fast-forward
```

**Sample output**

```text theme={null}
[MyDeviceB]# fast-forward
Fast forward playback
FastForward successful
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Status: forward-seek
[CHG] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 Position: 0x00000000 (0)
```

## Disconnect a remote device

To disconnect a remote device, run the following command from the `bluetoothctl` menu:

```text theme={null}
disconnect <bt_address>
```

**Parameters**

`<bt_address>` is the Bluetooth address of the remote device.

**Example**

To disconnect a paired remote device with `<bt_address>` `D4:8A:39:78:27:41`, run the following command:

```text theme={null}
disconnect D4:8A:39:78:27:41
```

**Sample output**

```text theme={null}
[MyDeviceB]# disconnect D4:8A:39:78:27:41
Attempting to disconnect from D4:8A:39:78:27:41
[DEL] Player /org/bluez/hci0/dev_D4_8A_39_78_27_41/player0 [default]
[DEL] Transport /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1/fd1
[DEL] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep1
[DEL] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep2
[DEL] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep3
[DEL] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep4
[DEL] Endpoint /org/bluez/hci0/dev_D4_8A_39_78_27_41/sep5
[CHG] Device D4:8A:39:78:27:41 ServicesResolved: no
Successful disconnected
[CHG] Device D4:8A:39:78:27:41 Connected: no
```

## Other player functions

The `menu player` submenu offers other functions that enable you to:

* Shuffle tracks

* Rewind an audio file

* Repeat a single track, all tracks, or a playlist

* Switch the equalizer on or off

* Search a track
