summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLinux Build Service Account <lnxbuild@localhost>2022-06-07 05:53:05 -0700
committerLinux Build Service Account <lnxbuild@localhost>2022-06-07 05:53:05 -0700
commit4e9b5e2df1bcaa0135ccbb6138e85f9e7987ba3b (patch)
treed49843e99981ae25363ec087b6537c1e5e2c92ee
parent25d310aa3901d5d48882b35b4ee0c1821154ad50 (diff)
parentec1716dead52b49806dcb787033dc60eb9eb4df8 (diff)
Merge ec1716dead52b49806dcb787033dc60eb9eb4df8 on remote branch
Change-Id: I4bbe365dadb0f88938480e049b7b83bd07e887c5
-rw-r--r--hal/AudioStream.cpp20
-rw-r--r--hal/audio_extn/Hfp.cpp39
2 files changed, 48 insertions, 11 deletions
diff --git a/hal/AudioStream.cpp b/hal/AudioStream.cpp
index c386a6f7..5b42b8fd 100644
--- a/hal/AudioStream.cpp
+++ b/hal/AudioStream.cpp
@@ -1772,7 +1772,7 @@ int StreamOutPrimary::CreateMmapBuffer(int32_t min_size_frames,
int StreamOutPrimary::Stop() {
int ret = -ENOSYS;
- AHAL_DBG("Enter");
+ AHAL_INFO("Enter: OutPrimary usecase(%d: %s)", GetUseCase(), use_case_table[GetUseCase()]);
stream_mutex_.lock();
if (usecase_ == USECASE_AUDIO_PLAYBACK_VOIP)
hac_voip = false;
@@ -1792,7 +1792,8 @@ int StreamOutPrimary::Stop() {
int StreamOutPrimary::Start() {
int ret = -ENOSYS;
- AHAL_DBG("Enter");
+
+ AHAL_INFO("Enter: OutPrimary usecase(%d: %s)", GetUseCase(), use_case_table[GetUseCase()]);
stream_mutex_.lock();
if (usecase_ == USECASE_AUDIO_PLAYBACK_MMAP &&
pal_stream_handle_ && !stream_started_) {
@@ -2498,7 +2499,7 @@ int StreamOutPrimary::Open() {
bool *payload_hifiFilter = &isHifiFilterEnabled;
size_t param_size = 0;
- AHAL_DBG("Enter OutPrimary ");
+ AHAL_INFO("Enter: OutPrimary usecase(%d: %s)", GetUseCase(), use_case_table[GetUseCase()]);
if (!mInitialized) {
AHAL_ERR("Not initialized, returning error");
@@ -2620,8 +2621,7 @@ int StreamOutPrimary::Open() {
streamAttributes_.out_media_config.ch_info.channels, streamAttributes_.out_media_config.sample_rate,
streamAttributes_.out_media_config.aud_fmt_id, streamAttributes_.type,
streamAttributes_.out_media_config.bit_width);
- AHAL_DBG("msample_rate %d mchannels %d", msample_rate, mchannels);
- AHAL_DBG("mNoOfOutDevices %zu", mAndroidOutDevices.size());
+ AHAL_DBG("msample_rate %d mchannels %d mNoOfOutDevices %zu", msample_rate, mchannels, mAndroidOutDevices.size());
ret = pal_stream_open(&streamAttributes_,
mAndroidOutDevices.size(),
mPalOutDevice,
@@ -2631,7 +2631,6 @@ int StreamOutPrimary::Open() {
(uint64_t)this,
&pal_stream_handle_);
- AHAL_DBG("(%x:ret)",ret);
if (ret) {
AHAL_ERR("Pal Stream Open Error (%x)", ret);
ret = -EINVAL;
@@ -3472,6 +3471,7 @@ int StreamInPrimary::GetPalDeviceIds(pal_device_id_t *palDevIds, int *numPalDevs
int StreamInPrimary::Stop() {
int ret = -ENOSYS;
+ AHAL_INFO("Enter: InPrimary usecase(%d: %s)", GetUseCase(), use_case_table[GetUseCase()]);
stream_mutex_.lock();
if (usecase_ == USECASE_AUDIO_PLAYBACK_VOIP)
hac_voip = false;
@@ -3489,7 +3489,7 @@ int StreamInPrimary::Stop() {
int StreamInPrimary::Start() {
int ret = -ENOSYS;
- AHAL_DBG("Enter");
+ AHAL_INFO("Enter: InPrimary usecase(%d: %s)", GetUseCase(), use_case_table[GetUseCase()]);
stream_mutex_.lock();
if (usecase_ == USECASE_AUDIO_RECORD_MMAP &&
pal_stream_handle_ && !stream_started_) {
@@ -3746,7 +3746,7 @@ int StreamInPrimary::RouteStream(const std::set<audio_devices_t>& new_devices, b
struct pal_channel_info ch_info = {0, {0}};
std::shared_ptr<AudioDevice> adevice = AudioDevice::GetInstance();
- AHAL_DBG("enter ");
+ AHAL_INFO("Enter: InPrimary usecase(%d: %s)", GetUseCase(), use_case_table[GetUseCase()]);
stream_mutex_.lock();
if (!mInitialized){
@@ -3905,7 +3905,7 @@ int StreamInPrimary::Open() {
dynamic_media_config_t dynamic_media_config;
std::shared_ptr<AudioDevice> adevice = AudioDevice::GetInstance();
- AHAL_DBG("Enter InPrimary");
+ AHAL_INFO("Enter: InPrimary usecase(%d: %s)", GetUseCase(), use_case_table[GetUseCase()]);
if (!mInitialized) {
AHAL_ERR("Not initialized, returning error");
ret = -EINVAL;
@@ -4052,8 +4052,6 @@ int StreamInPrimary::Open() {
(uint64_t)this,
&pal_stream_handle_);
- AHAL_DBG("(%x:ret)", ret);
-
if (ret) {
AHAL_ERR("Pal Stream Open Error (%x)", ret);
ret = -EINVAL;
diff --git a/hal/audio_extn/Hfp.cpp b/hal/audio_extn/Hfp.cpp
index b63467cc..e7b93cdc 100644
--- a/hal/audio_extn/Hfp.cpp
+++ b/hal/audio_extn/Hfp.cpp
@@ -60,6 +60,41 @@
* IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+/*
+Changes from Qualcomm Innovation Center are provided under the following license:
+Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted (subject to the limitations in the
+disclaimer below) provided that the following conditions are met:
+
+ * Redistributions of source code must retain the above copyright
+ notice, this list of conditions and the following disclaimer.
+
+ * Redistributions in binary form must reproduce the above
+ copyright notice, this list of conditions and the following
+ disclaimer in the documentation and/or other materials provided
+ with the distribution.
+
+ * Neither the name of Qualcomm Innovation Center, Inc. nor the names of its
+ contributors may be used to endorse or promote products derived
+ from this software without specific prior written permission.
+
+NO EXPRESS OR IMPLIED LICENSES TO ANY PARTY'S PATENT RIGHTS ARE
+GRANTED BY THIS LICENSE. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT
+HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
+IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
+ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
+GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
+IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
+IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+*/
+
#define LOG_TAG "AHAL: hfp"
#define LOG_NDDEBUG 0
@@ -192,9 +227,13 @@ static int hfp_set_mic_volume(float value)
pal_volume->volume_pair[0].vol = value;
if (pal_stream_set_volume(hfpmod.tx_stream_handle, pal_volume) < 0) {
AHAL_ERR("Couldn't set HFP Volume: [%d]", volume);
+ free(pal_volume);
+ pal_volume = NULL;
return -EINVAL;
}
+ free(pal_volume);
+ pal_volume = NULL;
hfpmod.mic_volume = value;
return ret;