Skip to main content

Prerequisites

Before you begin, set up your device and go to the required menu as described in Set up the device for A2DP functions.

Connect a remote device

To connect a remote device in the A2DP source role, run the following command from the bluetoothctl menu:
Parameters <bt_address> is the Bluetooth address of the remote device. Example To connect to a paired remote device with <bt_address> 17:1A:35:8D:A2:A4, run the following command:
Sample output

List available transport

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

Get information about codec capabilities

To get the information about the codec capabilities of a transport, run the following command from the menu transport submenu:
Parameters <transport> is the transport path. Example To get the information about the codec capabilities of <transport> /org/bluez/hci0/dev_17_1A_35_8D_A2_A4/sep1/fd0, run the following command:
Sample output

Set absolute volume

Ensure that the DUT and the remote device support the setabsvolume feature.
To set the absolute volume of a transport, run the following command from the menu transport submenu:
Parameters
  • <transport> is the transport path.
  • [value] is the volume level.
Example To set the absolute volume of <transport> /org/bluez/hci0/dev_17_1A_35_8D_A2_A4/sep1/fd0 as 50, run the following command:
Sample output

Play an audio file

The DUT doesn’t support an audio player. Use paplay commands to play music.Only PCM audio sample is supported.
To play songs from the DUT, do the following:
  1. Run SSH.
  2. Play a WAV file by running the following command:
    Parameters <audio_filepath> is the filepath of the WAV file. Example To play a WAV file at /tmp/playback.wav, run the following command:
    Sample output

Get a list of sinks

To get the list of sinks when multiple devices are connected, run the following command in SSH:
The pactl tool isn’t available by default. Enable and build the tool on your device.
Sample output

Play audio on a specific sink

To play audio on a specific sink when multiple devices are connected, run the following command in SSH:
Parameters
  • <audio_filepath> is the filepath of the WAV file.
  • <device_name> is the sink name.
Example To play pcmtest.wav on the bluez_output.17:1A:35:8D:A2:A4 sink, run the following command:
Sample output

Disconnect a remote device

To disconnect a remote device, run the following command from the bluetoothctl menu:
Parameters <bt_address> is the Bluetooth address of the remote device. Example To disconnect a paired remote device with <bt_address> 17:1A:35:8D:A2:A4, run the following command:
Sample output