# Advanced Audio Distribution Profile Source: [https://docs.qualcomm.com/doc/80-70017-13/topic/set-up-a2dp.html](https://docs.qualcomm.com/doc/80-70017-13/topic/set-up-a2dp.html) A2DP defines how multimedia audio can be streamed from one device to another over a Bluetooth connection. This mechanism is also called as Bluetooth audio streaming. To perform A2DP source or sink functions, you must first complete the steps in the following procedure. ## Set up device for A2DP functions **Prerequisites** - Enable SSH to access your host device. For instructions, see [Log in using SSH](https://docs.qualcomm.com/bundle/publicresource/topics/80-70017-254/how_to.html#use-ssh). - Enable A2DP [source](https://docs.qualcomm.com/doc/80-70017-13/topic/set-up-a2dp.html#set-up-a2dp__section_nbc_4cz_kcc_navyanka_08-18-24-2135-3-71) or [sink](https://docs.qualcomm.com/doc/80-70017-13/topic/set-up-a2dp.html#set-up-a2dp__section_ilx_4cz_kcc_navyanka_08-18-24-2135-17-523) role on the device, as required. - Place the DUT and the remote device in the Bluetooth vicinity. **Procedure** 1. Run the SSH in command prompt using the following command: ssh root@Copy to clipboard **Example** If the IP address of the device is `10.92.160.222`, run the following command: ssh root@10.92.160.222Copy to clipboard 2. Connect to the SSH by entering the following password: oelinux123Copy to clipboard 3. Open the Bluetooth test application by running the following command: btappCopy to clipboard **Sample output** sh-5.1# btapp get_ap_interface :: get_ap_interface ***************** Menu ******************* gap_menu test_menu a2dp_sink_menu hfp_client_menu gattctest_menu gattstest_menu hogp_menu hfp_ag_menu a2dp_source_menu spp_client_menu spp_server_menu eslap_menu exit ******************************************Copy to clipboard 4. Enable Bluetooth and pair the device as follows: 1. Go to the Gap Menu by running the following command: gap_menuCopy to clipboard 2. Enable Bluetooth by running the following command: enableCopy to clipboard **Sample output** gap_menu ***************** Menu ******************* enable disable inquiry cancel_inquiry get_role_req eg. get_role_req 00:11:22:33:44:55 pair eg. pair 00:11:22:33:44:55 0(auto)/1(BREDR)/2(BLE) unpair eg. unpair 00:11:22:33:44:55 inquiry_list bonded_list get_state get_bt_name get_bt_address set_bt_name eg. set_bt_name MDM_Fluoride set_scan_mode eg. set_scan_mode 0 --0-BT_SCAN_MODE_NONE,1- BT_SCAN_MODE_CONNECTABLE,2-BT_SCAN_MODE_CONNECTABLE_DISCOVERABLE set_afh eg. set_afh 112233445566778899f0 send_hci_cmd eg. send_hci_cmd 01,04,05,33,8b,9e,0a,00 - For Inquiry read_clock eg. read_clock 0(local)/1(acl connection) 00:11:22:33:44:55 main_menu switch_role_req eg. switch_role_req 00:11:22:33:44:55 0 or get_role_req 00:11:22:33:44:55 1 ****************************************** enable current State = 0, new state = 1 BT State is ONCopy to clipboard 3. Pair the device by running the following command: pair Copy to clipboard To accept the outgoing/incoming pairing, enter `yes`. **Parameters** - [Run Bluetooth inquiry scan](https://docs.qualcomm.com/doc/80-70017-13/topic/gap_commands.html#gap_commands__section_iy1_xnf_41c) to get the `` of the remote device. - The values of the ``parameter can be: - `0`: Auto selection - `1`: BR/EDR - `2`: Bluetooth Low Energy **Example** To initiate a BR/EDR pairing for `` `98:09:cf:a9:82:23`, run the following command: pair 98:09:cf:a9:82:23 1Copy to clipboard **Sample output** pair 98:09:cf:a9:82:23 1 BR/EDR Bonding ACL state:0 change with reason 00 for device: f8:7d:76:9d:9b:6b ************************************************ Pairing state for MyDeviceA is BOND NONE ************************************************ BT pairing request :: MyDeviceB :: Pairing Code :: 776996 ************************************************ **Please enter yes / no ** yes ************************************************ Pairing state for MyDeviceB is BONDED ************************************************Copy to clipboard 4. Return to the Main Menu by running the following command: main_menuCopy to clipboard 5. Go to the A2DP source or sink menu, as required. - To go to the A2DP Source Menu, run the following command from the `main_menu`: a2dp_source_menuCopy to clipboard **Sample output** main_menu ***************** Menu ******************* gap_menu test_menu a2dp_sink_menu hfp_client_menu gattctest_menu gattstest_menu hogp_menu hfp_ag_menu a2dp_source_menu spp_client_menu spp_server_menu eslap_menu exit ****************************************** a2dp_source_menu ***************** Menu ******************* connect disconnect codec_list avrcp_trackchange avrcp_now_playing_content_changed avrcp_setabsolutevol eg: setabsolutevol 10 (range 0-15) avrcp_sendvolupdown<1/0> eg: sendvolupdown 1 (1-up, 0-down) avrcp_availplayerchange avrcp_biggermetadata info:enables bigger avrcp metadata avrcp_setequalizerval (1/2) avrcp_setrepeatval (1 to 4) avrcp_setshuffleval(1 to 3) avrcp_setscanval (1 to 3) set_scmst_cp_flag<0-2> (0-Copyrighted 1-Only Once 2-Content not protected) main_menu ******************************************Copy to clipboard For A2DP source menu functions, see [Perform Bluetooth A2DP source functions](https://docs.qualcomm.com/doc/80-70017-13/topic/perform-a2dp-source-functions.html). - To go to the A2DP Sink Menu, run the following command from the `main_menu`: a2dp_sink_menuCopy to clipboard **Sample output** main_menu ***************** Menu ******************* gap_menu test_menu a2dp_sink_menu hfp_client_menu gattctest_menu gattstest_menu hogp_menu hfp_ag_menu a2dp_source_menu spp_client_menu spp_server_menu eslap_menu exit ****************************************** a2dp_sink_menu ***************** Menu ******************* connect disconnect play pause stop rewind fastforward forward backward power volup voldown volchangednoti mute codec_list getcap listplayersettingattr listplayersettingvalue getplayersetting setplayersetting getelementattr getplayerstatus regnotification setaddressedplayer setbrowsedplayer changepath getfolderitems getitemattributes playitem addtonowplaying search main_menu ******************************************Copy to clipboard For A2DP sink menu functions, see [Perform Bluetooth A2DP sink functions](https://docs.qualcomm.com/doc/80-70017-13/topic/perform-a2dp-sink-functions.html). ## Enable A2DP source role To enable the A2DP source role on the device, do the following: 1. Open the command prompt. 2. Pull the bt\_app.conf file from the device by running the following command: scp -r root@:/etc/bluetooth/bt_app.conf .Copy to clipboard `` is the IP address of the device. 3. Configure the following values in the bt\_app.conffile: - `BtA2dpSinkEnable=false` - `BtA2dpSinkSplitEnable=false` - `BtHfClientEnable=false` - `BtA2dpSourceEnable=true` 4. Save the bt\_app.conf file. 5. Push the bt\_app.conf file to the device by running the following command: scp -r bt_app.conf root@:/etc/bluetooth/bt_app.confCopy to clipboard `` is the IP address of the device. ## Enable A2DP sink role To enable the A2DP sink role on the device, do the following: 1. Open the command prompt. 2. Pull the bt\_app.conf file from the device by running the following command: scp -r root@:/etc/bluetooth/bt_app.conf .Copy to clipboard `` is the IP address of the device. 3. Configure the following values in the bt\_app.conffile: - `BtA2dpSinkEnable=true` - `BtA2dpSinkSplitEnable=true` - `BtHfClientEnable=true` - `BtA2dpSourceEnable=false` 4. Save the bt\_app.conf file. 5. Push the bt\_app.conf file to the device by running the following command: scp -r bt_app.conf root@:/etc/bluetooth/bt_app.confCopy to clipboard `` is the IP address of the device. - **[Perform Bluetooth A2DP source functions](https://docs.qualcomm.com/doc/80-70017-13/topic/perform-a2dp-source-functions.html)** You can perform A2DP source functions using the `a2dp_source_menu` options. - **[Perform Bluetooth A2DP sink functions](https://docs.qualcomm.com/doc/80-70017-13/topic/perform-a2dp-sink-functions.html)** You can perform A2DP sink functions using the `a2dp_sink_menu` options. **Parent Topic:** [Verify functionality of Fluoride stack](https://docs.qualcomm.com/doc/80-70017-13/topic/bluetooth_usecases.html) Last Published: Dec 26, 2024 [Previous Topic GATT configuration parameters](https://docs.qualcomm.com/bundle/publicresource/80-70017-13/topics/gatt_config_params.md) [Next Topic Perform Bluetooth A2DP source functions](https://docs.qualcomm.com/bundle/publicresource/80-70017-13/topics/perform-a2dp-source-functions.md)