summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--audio_hal_interface/aidl/le_audio_software.cc27
-rw-r--r--audio_hal_interface/aidl/le_audio_software.h9
-rw-r--r--btif/include/btif_ahim.h8
-rw-r--r--btif/include/btif_api.h1
-rw-r--r--btif/src/btif_a2dp_source.cc10
-rw-r--r--btif/src/btif_ahim.cc64
-rw-r--r--btif/src/btif_core.cc6
-rw-r--r--internal_include/bt_target.h1
-rw-r--r--stack/btm/btm_devctl.cc10
9 files changed, 26 insertions, 110 deletions
diff --git a/audio_hal_interface/aidl/le_audio_software.cc b/audio_hal_interface/aidl/le_audio_software.cc
index 32ed8d242..ecfb2119f 100644
--- a/audio_hal_interface/aidl/le_audio_software.cc
+++ b/audio_hal_interface/aidl/le_audio_software.cc
@@ -150,11 +150,11 @@ bool LeAudioTransport::GetPresentationPosition(uint64_t* remote_delay_report_ns,
<< data_position_.tv_nsec
<< "s, delay report=" << remote_delay_report_ms_ << " msec.";
if (remote_delay_report_ns != nullptr) {
- *remote_delay_report_ns = (uint64_t)(remote_delay_report_ms_ * 1000000u);
+ *remote_delay_report_ns = remote_delay_report_ms_ * 1000000u;
}
if (total_bytes_processed != nullptr)
- *total_bytes_processed = (uint64_t)total_bytes_processed_;
- if (data_position != nullptr) *data_position = (timespec)data_position_;
+ *total_bytes_processed = total_bytes_processed_;
+ if (data_position != nullptr) *data_position = data_position_;
return true;
}
@@ -235,11 +235,6 @@ void LeAudioTransport::SetRemoteDelay(uint16_t delay_report_ms) {
remote_delay_report_ms_ = delay_report_ms;
}
-uint16_t LeAudioTransport::GetRemoteDelay() {
- LOG(INFO) << __func__ << ": delay_report=" << remote_delay_report_ms_ << " msec";
- return remote_delay_report_ms_;
-}
-
const PcmConfiguration& LeAudioTransport::LeAudioGetSelectedHalPcmConfig() {
return pcm_config_;
}
@@ -347,10 +342,6 @@ void LeAudioSinkTransport::SetRemoteDelay(uint16_t delay_report_ms) {
transport_->SetRemoteDelay(delay_report_ms);
}
-uint16_t LeAudioSinkTransport::GetRemoteDelay() {
- return transport_->GetRemoteDelay();
-}
-
const PcmConfiguration& LeAudioSinkTransport::LeAudioGetSelectedHalPcmConfig() {
return transport_->LeAudioGetSelectedHalPcmConfig();
}
@@ -444,10 +435,6 @@ void LeAudioSourceTransport::SetRemoteDelay(uint16_t delay_report_ms) {
transport_->SetRemoteDelay(delay_report_ms);
}
-uint16_t LeAudioSourceTransport::GetRemoteDelay() {
- return transport_->GetRemoteDelay();
-}
-
const PcmConfiguration&
LeAudioSourceTransport::LeAudioGetSelectedHalPcmConfig() {
return transport_->LeAudioGetSelectedHalPcmConfig();
@@ -556,10 +543,6 @@ void LeAudioClientInterface::Sink::SetRemoteDelay(uint16_t delay_report_ms) {
delay_report_ms);
}
-uint16_t LeAudioClientInterface::Sink::GetRemoteDelay() {
- return get_aidl_transport_instance(is_broadcaster_)->GetRemoteDelay();
-}
-
void LeAudioClientInterface::Sink::StartSession() {
LOG(ERROR) << __func__;
AudioConfigurationAIDL audio_config;
@@ -698,10 +681,6 @@ void LeAudioClientInterface::Source::SetRemoteDelay(uint16_t delay_report_ms) {
delay_report_ms);
}
-uint16_t LeAudioClientInterface::Source::GetRemoteDelay() {
- return aidl::le_audio::LeAudioSourceTransport::instance->GetRemoteDelay();
-}
-
void LeAudioClientInterface::Source::StartSession() {
LOG(INFO) << __func__;
AudioConfigurationAIDL audio_config;
diff --git a/audio_hal_interface/aidl/le_audio_software.h b/audio_hal_interface/aidl/le_audio_software.h
index faa3a61fb..ab2beb692 100644
--- a/audio_hal_interface/aidl/le_audio_software.h
+++ b/audio_hal_interface/aidl/le_audio_software.h
@@ -127,8 +127,6 @@ class LeAudioTransport {
void SetRemoteDelay(uint16_t delay_report_ms);
- uint16_t GetRemoteDelay();
-
const PcmConfiguration& LeAudioGetSelectedHalPcmConfig();
void LeAudioSetSelectedHalPcmConfig(uint32_t sample_rate_hz, uint8_t bit_rate,
@@ -183,8 +181,6 @@ class LeAudioSinkTransport
void SetRemoteDelay(uint16_t delay_report_ms);
- uint16_t GetRemoteDelay();
-
const PcmConfiguration& LeAudioGetSelectedHalPcmConfig();
void LeAudioSetSelectedHalPcmConfig(uint32_t sample_rate_hz, uint8_t bit_rate,
@@ -234,8 +230,6 @@ class LeAudioSourceTransport
void SetRemoteDelay(uint16_t delay_report_ms);
- uint16_t GetRemoteDelay();
-
const PcmConfiguration& LeAudioGetSelectedHalPcmConfig();
void LeAudioSetSelectedHalPcmConfig(uint32_t sample_rate_hz, uint8_t bit_rate,
@@ -268,7 +262,6 @@ class LeAudioClientInterface {
virtual void Cleanup() = 0;
virtual void SetPcmParameters(const PcmParameters& params) = 0;
virtual void SetRemoteDelay(uint16_t delay_report_ms) = 0;
- virtual uint16_t GetRemoteDelay() = 0;
virtual void StartSession() = 0;
virtual void StopSession() = 0;
virtual tA2DP_CTRL_CMD GetPendingCmd() = 0;
@@ -291,7 +284,6 @@ class LeAudioClientInterface {
void Cleanup() override;
void SetPcmParameters(const PcmParameters& params) override;
void SetRemoteDelay(uint16_t delay_report_ms) override;
- uint16_t GetRemoteDelay() override;
void StartSession() override;
void StopSession() override;
tA2DP_CTRL_CMD GetPendingCmd() override;
@@ -319,7 +311,6 @@ class LeAudioClientInterface {
void Cleanup() override;
void SetPcmParameters(const PcmParameters& params) override;
void SetRemoteDelay(uint16_t delay_report_ms) override;
- uint16_t GetRemoteDelay() override;
void StartSession() override;
void StopSession() override;
tA2DP_CTRL_CMD GetPendingCmd() override;
diff --git a/btif/include/btif_ahim.h b/btif/include/btif_ahim.h
index 6fee2b349..239893e46 100644
--- a/btif/include/btif_ahim.h
+++ b/btif/include/btif_ahim.h
@@ -144,7 +144,6 @@ typedef void (* ahim_update_src_metadata)(const source_metadata_t& source_metada
typedef void (* ahim_update_snk_metadata)(const sink_metadata_t& sink_metadata);
typedef uint32_t (* ahim_get_mode_callback)();
typedef uint16_t (* ahim_get_frame_duration)(uint8_t direction);
-typedef void (* ahim_update_params)(uint16_t delay, uint8_t mode);
typedef struct {
uint8_t mode;
@@ -169,7 +168,6 @@ typedef struct {
ahim_update_snk_metadata snk_meta_update;
ahim_get_mode_callback get_mode_cb;
ahim_get_frame_duration get_frame_duration;
- ahim_update_params params_update;
}btif_ahim_client_callbacks_t;
extern btif_ahim_client_callbacks_t* pclient_cbs[MAX_CLIENT];
@@ -200,10 +198,6 @@ bool btif_ahim_is_restart_session_needed(uint8_t profile);
void btif_ahim_update_session_params(SessionParamType param_type);
-void btif_ahim_update_audio_config();
-
-uint16_t btif_ahim_get_remote_delay();
-
bool btif_ahim_setup_codec(uint8_t profile);
void btif_ahim_start_session(uint8_t profile);
@@ -217,8 +211,6 @@ tA2DP_CTRL_CMD btif_ahim_get_pending_command(uint8_t profile,
void btif_ahim_reset_pending_command(uint8_t profile);
-void btif_ahim_update_params (uint16_t delay, uint8_t mode);
-
void btif_ahim_reset_pending_command(uint8_t profile, uint8_t direction);
void btif_ahim_update_pending_command(tA2DP_CTRL_CMD cmd, uint8_t profile);
diff --git a/btif/include/btif_api.h b/btif/include/btif_api.h
index 1e733720a..f549519bf 100644
--- a/btif/include/btif_api.h
+++ b/btif/include/btif_api.h
@@ -527,7 +527,6 @@ bt_status_t btif_set_dynamic_audio_buffer_size(int codec, int size);
* Returns void
*
******************************************************************************/
-void btif_update_params(uint16_t delay, uint8_t mode);
#ifdef ADV_AUDIO_FEATURE
void btif_register_uuid_srvc_disc(bluetooth::Uuid uuid);
#endif
diff --git a/btif/src/btif_a2dp_source.cc b/btif/src/btif_a2dp_source.cc
index d1b5ec373..d1647576d 100644
--- a/btif/src/btif_a2dp_source.cc
+++ b/btif/src/btif_a2dp_source.cc
@@ -66,7 +66,6 @@ using ::bluetooth::audio::a2dp::SessionType;
#include "btif_hf.h"
#include "btif_av.h"
#include "bta_sys.h"
-#include "btif_acm.h"
using system_bt_osi::BluetoothMetricsLogger;
using system_bt_osi::A2dpSessionMetrics;
@@ -175,9 +174,6 @@ extern int btif_av_get_tws_pair_idx(int index);
extern void btif_av_clear_pending_start_flag();
extern bool btif_av_is_tws_suspend_triggered(int index);
-extern bool btif_acm_check_in_call_tracker_timer_exist();
-extern void stop_stream_acm_initiator_now();
-
static char a2dp_hal_imp[PROPERTY_VALUE_MAX] = "false";
UNUSED_ATTR static const char* dump_media_event(uint16_t event) {
switch (event) {
@@ -1832,12 +1828,6 @@ void btif_a2dp_source_process_request(tA2DP_CTRL_CMD cmd) {
status = A2DP_CTRL_ACK_INCALL_FAILURE;
break;
}
- if (btif_ahim_is_aosp_aidl_hal_enabled() &&
- btif_acm_check_in_call_tracker_timer_exist()) {
- stop_stream_acm_initiator_now();
- status = A2DP_CTRL_ACK_INCALL_FAILURE;
- break;
- }
if (btif_ba_is_active())
{
ba_send_message(BTIF_BA_AUDIO_START_REQ_EVT, 0, NULL, false);
diff --git a/btif/src/btif_ahim.cc b/btif/src/btif_ahim.cc
index b7cdafacb..c9d0de4b2 100644
--- a/btif/src/btif_ahim.cc
+++ b/btif/src/btif_ahim.cc
@@ -68,8 +68,10 @@ IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
#include "audio_hal_interface/aidl/le_audio_software.h"
#include <hardware/audio.h>
#include <vector>
+#ifdef ADV_AUDIO_FEATURE
#include <hardware/bt_pacs_client.h>
#include <btif_vmcp.h>
+#endif
#include <aidl/vendor/qti/hardware/bluetooth/audio/LeAudioVendorConfiguration.h>
#include <aidl/vendor/qti/hardware/bluetooth/audio/VendorCodecType.h>
@@ -94,7 +96,9 @@ using VendorConfiguration =
::aidl::android::hardware::bluetooth::audio::LeAudioCodecConfiguration::VendorConfiguration;
using ::aidl::android::hardware::bluetooth::audio::UnicastCapability;
using vendor::qti::hardware::bluetooth_audio::V2_1::LC3ChannelMode;
+#ifdef ADV_AUDIO_FEATURE
using bluetooth::bap::pacs::CodecIndex;
+#endif
//using ::bluetooth::audio::BitsPerSample;
LeAudioClientInterface* leAudioClientInterface = nullptr;
LeAudioClientInterface::Sink* unicastSinkClientInterface = nullptr;
@@ -248,17 +252,6 @@ void btif_ahim_update_src_metadata (const source_metadata_t& source_metadata) {
}
}
-void btif_ahim_update_params (uint16_t delay, uint8_t mode) {
- // pass on the callbacks to ACM only for new vendor
- if(btif_ahim_is_aosp_aidl_hal_enabled()) {
- if (pclient_cbs[AUDIO_GROUP_MGR - 1] &&
- pclient_cbs[AUDIO_GROUP_MGR - 1]->params_update) {
- BTIF_TRACE_IMP("%s: calling updateParams for Audio Group Manager", __func__);
- pclient_cbs[AUDIO_GROUP_MGR - 1]->params_update(delay, mode);
- }
- }
-}
-
void btif_ahim_update_sink_metadata (const sink_metadata_t& sink_metadata) {
auto track_count = sink_metadata.track_count;
auto source = sink_metadata.tracks->source;
@@ -518,6 +511,8 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
uint16_t type = pclient_cbs[profile - 1]->get_profile_status_cb();
uint16_t frame_duration = pclient_cbs[profile - 1]->get_frame_length_cb(direction);
+
+#ifdef ADV_AUDIO_FEATURE
bool is_lc3q_supported = false;
CodecIndex codec_type = (CodecIndex) pclient_cbs[profile - 1]->get_codec_type(direction);
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_LE ||
@@ -528,7 +523,6 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
<< frame_duration << ", from leaudio_configs.xml";
}
uint8_t encoder_version = 0;
- if(1) {
/*if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_LE ||
pclient_cbs[profile - 1]->get_is_codec_type_lc3q(direction)) {*/
VendorConfiguration vendor_config;
@@ -566,12 +560,11 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
le_vendor_config.vendorCodecType = VendorCodecType::APTX_ADAPTIVE_R4;
LOG(ERROR) << __func__ << ": AptX R4 metadata params are updated";
for (int i = 0; i < 4; i++) {
- le_vendor_config.codecSpecificData.push_back((pclient_cbs[profile - 1]->get_mode_cb() &
- (0xff <<((3 - i)*8))) >> ((3 - i)*8));
- }
- for (int i = 4; i < 6; i++) {
- le_vendor_config.codecSpecificData.push_back((unicastSinkClientInterface->GetRemoteDelay() &
- (0xff <<((5 - i)*8))) >> ((5 - i)*8));
+ le_vendor_config.codecSpecificData.push_back((
+ pclient_cbs[profile - 1]->get_mode_cb() &
+ (0xff <<((3 - i)*8))) >> ((3 - i)*8));
+ BTIF_TRACE_IMP("%s: AIDL, extension metadata for AAR4 [%d]: %d", __func__, i+16,
+ le_vendor_config.codecSpecificData[i+16]);
}
} else {
le_vendor_config.vendorCodecType = VendorCodecType::APTX_ADAPTIVE_R3;
@@ -637,7 +630,7 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
}
}
return ucast_config;
- } else {
+#else /* ADV_AUDIO_FEATURE */
// TODO to fill the right PD
Lc3Configuration lc3_config = {
.pcmBitDepth = 24,
@@ -663,7 +656,7 @@ LeAudioConfiguration fetch_offload_audio_config(int profile, int direction) {
});
}
return ucast_config;
- }
+#endif /* ADV_AUDIO_FEATURE */
}
bool leAudio_get_selected_hal_codec_config(AudioConfigurationAIDL *lea_config,
@@ -700,6 +693,7 @@ bool btif_ahim_setup_codec(uint8_t profile) {
uint16_t profile_type = btif_ahim_get_lea_active_profile(profile);
BTIF_TRACE_IMP("%s: AIDL, profile_type: %d", __func__, profile_type);
if(profile_type == BAP || profile_type == GCP) { // ToAIr only
+#ifdef ADV_AUDIO_FEATURE
CodecIndex codec_type = (CodecIndex) pclient_cbs[profile - 1]->get_codec_type(TX_ONLY_CONFIG);
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
if (!leAudio_get_selected_hal_codec_config(&lea_tx_config, profile,
@@ -718,6 +712,7 @@ bool btif_ahim_setup_codec(uint8_t profile) {
if(unicastSourceClientInterface)
unicastSourceClientInterface->UpdateAudioConfigToHal(lea_rx_config);
} else {
+#endif
if (!leAudio_get_selected_hal_codec_config(&lea_tx_config, profile,
TX_ONLY_CONFIG)) {
LOG(ERROR) << __func__ << ": Failed to get CodecConfiguration";
@@ -729,7 +724,9 @@ bool btif_ahim_setup_codec(uint8_t profile) {
// TODO to fill both session/single session configs based on profile
if(unicastSinkClientInterface)
unicastSinkClientInterface->UpdateAudioConfigToHal(lea_tx_config);
+#ifdef ADV_AUDIO_FEATURE
}
+#endif
} else if(profile_type == BAP_CALL ||
profile_type == GCP_RX ||
profile_type == WMCP_TX) { // Toair and FromAir
@@ -787,6 +784,7 @@ void btif_ahim_start_session(uint8_t profile) {
btif_ahim_get_lea_active_profile(profile);
BTIF_TRACE_IMP("%s: AIDL, profile_type: %d", __func__, profile_type);
if(profile_type == BAP || profile_type == GCP) { // ToAIr only
+#ifdef ADV_AUDIO_FEATURE
CodecIndex codec_type = (CodecIndex) pclient_cbs[profile - 1]->get_codec_type(TX_ONLY_CONFIG);
if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
if(unicastSinkClientInterface)
@@ -794,9 +792,12 @@ void btif_ahim_start_session(uint8_t profile) {
if(unicastSourceClientInterface)
unicastSourceClientInterface->StartSession();
} else {
+#endif
if(unicastSinkClientInterface)
unicastSinkClientInterface->StartSession();
+#ifdef ADV_AUDIO_FEATURE
}
+#endif
} else if(profile_type == BAP_CALL ||
profile_type == GCP_RX ||
profile_type == WMCP_TX) { // Toair and FromAir
@@ -1182,28 +1183,6 @@ size_t btif_ahim_read(uint8_t* p_buf, uint32_t len) {
return bluetooth::audio::aidl::a2dp::read(p_buf, len);
}
-void btif_ahim_update_audio_config() {
- AudioConfigurationAIDL lea_tx_config, lea_rx_config;
- CodecIndex codec_type =
- (CodecIndex) pclient_cbs[AUDIO_GROUP_MGR - 1]->get_codec_type(TX_ONLY_CONFIG);
- if (codec_type == CodecIndex::CODEC_INDEX_SOURCE_APTX_ADAPTIVE_R4) {
- if (!leAudio_get_selected_hal_codec_config(&lea_tx_config, AUDIO_GROUP_MGR,
- TX_ONLY_CONFIG)) {
- LOG(ERROR) << __func__ << ": Failed to get CodecConfiguration";
- return;
- }
- if(unicastSinkClientInterface)
- unicastSinkClientInterface->UpdateAudioConfigToHal(lea_tx_config);
- }
-}
-
-uint16_t btif_ahim_get_remote_delay() {
-if(unicastSinkClientInterface)
- return unicastSinkClientInterface->GetRemoteDelay();
-else
- return 0xFFFF;
-}
-
void btif_ahim_set_remote_delay(uint16_t delay_report, uint8_t profile) {
BTIF_TRACE_IMP("%s: AIDL, profile: %d, delay_report: %d",
__func__, profile, delay_report);
@@ -1228,6 +1207,7 @@ void btif_ahim_set_remote_delay(uint16_t delay_report, uint8_t profile) {
if(unicastSourceClientInterface)
unicastSourceClientInterface->SetRemoteDelay(delay_report);
}
+
} else if (profile == BROADCAST) {
if (broadcastSinkClientInterface) {
broadcastSinkClientInterface->SetRemoteDelay(delay_report);
diff --git a/btif/src/btif_core.cc b/btif/src/btif_core.cc
index 843b1eb66..44d6acb94 100644
--- a/btif/src/btif_core.cc
+++ b/btif/src/btif_core.cc
@@ -67,7 +67,6 @@
#include "stack_manager.h"
#include "device/include/device_iot_config.h"
-#include "btif_ahim.h"
using bluetooth::Uuid;
/*******************************************************************************
* Constants & Macros
@@ -1450,8 +1449,3 @@ bt_status_t btif_set_dynamic_audio_buffer_size(int codec, int size) {
return BT_STATUS_SUCCESS;
}
-
-void btif_update_params(uint16_t delay, uint8_t mode) {
- BTIF_TRACE_DEBUG("%s", __func__);
- btif_ahim_update_params(delay, mode);
-}
diff --git a/internal_include/bt_target.h b/internal_include/bt_target.h
index ac594ff68..47947e3ca 100644
--- a/internal_include/bt_target.h
+++ b/internal_include/bt_target.h
@@ -67,6 +67,7 @@
#include "bdroid_buildcfg.h"
#endif
+#include <hardware/bt_av.h>
#include "bt_types.h" /* This must be defined AFTER buildcfg.h */
//------------------Added from bdroid_buildcfg.h---------------------
diff --git a/stack/btm/btm_devctl.cc b/stack/btm/btm_devctl.cc
index 0e0ef828a..e83f00823 100644
--- a/stack/btm/btm_devctl.cc
+++ b/stack/btm/btm_devctl.cc
@@ -44,7 +44,6 @@
#include "gatt_int.h"
#include "hci/include/vendor.h"
-#include "btif/include/btif_api.h"
extern thread_t* bt_workqueue_thread;
@@ -62,7 +61,6 @@ extern thread_t* bt_workqueue_thread;
*/
#define BTM_INFO_TIMEOUT 5 /* 5 seconds for info response */
-#define HCI_VSE_SUBCODE_PARAMS_REPORT 0x12
/******************************************************************************/
/* L O C A L F U N C T I O N P R O T O T Y P E S */
@@ -928,14 +926,6 @@ void btm_vendor_specific_evt(uint8_t* p, uint8_t evt_len) {
break;
}
return;
- } else if (HCI_VSE_SUBCODE_PARAMS_REPORT == vse_subcode){
- BTM_TRACE_DEBUG ("BTM Event: Vendor Specific params report evt");
- uint16_t delay;
- uint8_t mode;
- STREAM_TO_UINT16(delay, pp);
- STREAM_TO_UINT8(mode, pp);
- BTM_TRACE_DEBUG ("%s: Delay value = %x, Mode value = %x", __func__, delay, mode);
- btif_update_params(delay, mode);
}
}