Skip to main content
To perform A2DP source or sink functions, you must first complete the steps in the following procedure.

Prerequisites

Set up the device for A2DP functions

  1. Run the SSH in command prompt using the following command:
    ssh root@<device_IP_address>
    
    Example If the IP address of the device is 10.92.160.222, run the following command:
    ssh root@10.92.160.222
    
  2. Connect to the SSH by entering the following password:
    oelinux123
    
  3. Open the Bluetooth test application by running the following command:
    bluetoothctl
    
    Sample output
    sh-5.1# bluetoothctl
    Agent registered        uetoothd...
    [CHG] Controller 22:22:F1:C1:99:C0 Pairable: yes
    
  4. Go to the Transport submenu or Player submenu, as required.
    • To go to the Transport submenu, run the following command from bluetoothctl:
      menu transport
      
      Sample output
      [bluetooth]# menu transport
      Menu transport:
      Available commands:
      -------------------
      list                                              List available transports
      show <transport>                                  Transport information
      acquire <transport>                               Acquire Transport
      release <transport>                               Release Transport
      send <transport> <filename>                       Send contents of a file
      receive <transport> [filename]                    Get/Set file to receive
      volume <transport> [value]                        Get/Set transport volume
      back                                              Return to main menu
      version                                           Display version
      quit                                              Quit program
      exit                                              Quit program
      help                                              Display help about this program
      export                                            Print environment variables
      
      To perform Transport submenu functions in the source, see Perform Bluetooth A2DP source functions. To perform Transport submenu functions in the sink, see Perform Bluetooth A2DP sink functions.
    • To go to the Player submenu, run the following command from bluetoothctl:
      menu player
      
      Sample output
      [bluetooth]# menu player
      Menu player:
      Available commands:
      -------------------
      list                                              List available players
      show [player]                                     Player information
      select <player>                                   Select default player
      play [item]                                       Start playback
      pause                                             Pause playback
      stop                                              Stop playback
      next                                              Jump to next item
      previous                                          Jump to previous item
      fast-forward                                      Fast forward playback
      rewind                                            Rewind playback
      equalizer <on/off>                                Enable/Disable equalizer
      repeat <singletrack/alltrack/group/off>           Set repeat mode
      shuffle <alltracks/group/off>                     Set shuffle mode
      scan <alltracks/group/off>                        Set scan mode
      change-folder <item>                              Change current folder
      list-items [start] [end]                          List items of current folder
      search <string>                                   Search items containing string
      queue <item>                                      Add item to playlist queue
      show-item <item>                                  Show item information
      back                                              Return to main menu
      version                                           Display version
      quit                                              Quit program
      exit                                              Quit program
      help                                              Display help about this program
      export                                            Print environment variables
      
      To perform Player submenu functions in the sink, see Perform Bluetooth A2DP sink functions.

Next steps

Perform Bluetooth A2DP source functions

You can perform Bluetooth A2DP source functions using the bluetoothctl menu, menu transport submenu, and paplay commands. Bluetooth A2DP source functions include connecting or disconnecting to a remote device and listing available transport options. They allow you to retrieve information about codec capabilities, set the absolute volume, and play an audio file. You can also get a list of available sinks and play audio on a specific sink using the Bluetooth A2DP source functions.

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.