audio-hal: enable low latency support for playback and record usecase with voice comm usage
Enable low latency support for phone bus playback and record usecase
with voice comm usage for 8, 16, 24, 32 and 48KHz sample rates
Change-Id: I11c85989176dd6db71f56399f0f17acef99ebca8
Signed-off-by: Kogara Naveen Kumar <quic_nkogara@quicinc.com>
diff --git a/hal/audio_extn/auto_hal.c b/hal/audio_extn/auto_hal.c
index 037b0e5..6e59f6e 100644
--- a/hal/audio_extn/auto_hal.c
+++ b/hal/audio_extn/auto_hal.c
@@ -25,6 +25,10 @@
* 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.
+ *
+ * Changes from Qualcomm Innovation Center are provided under the following license:
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#define LOG_TAG "auto_hal_extn"
/*#define LOG_NDEBUG 0*/
@@ -432,7 +436,13 @@
out->volume_l = out->volume_r = MAX_VOLUME_GAIN;
break;
case CAR_AUDIO_STREAM_PHONE:
- out->usecase = USECASE_AUDIO_PLAYBACK_PHONE;
+ if (out->flags == AUDIO_OUTPUT_FLAG_PRIMARY) {
+ out->usecase = USECASE_AUDIO_PLAYBACK_PHONE;
+ out->flags = AUDIO_OUTPUT_FLAG_PHONE;
+ }
+ else if (out->flags == AUDIO_OUTPUT_FLAG_NONE) {
+ out->usecase = USECASE_AUDIO_PLAYBACK_PHONE_LL;
+ }
switch(out->sample_rate)
{
case 48000:
@@ -1072,6 +1082,7 @@
snd_device = SND_DEVICE_OUT_BUS_NAV;
break;
case USECASE_AUDIO_PLAYBACK_PHONE:
+ case USECASE_AUDIO_PLAYBACK_PHONE_LL:
snd_device = SND_DEVICE_OUT_BUS_PHN;
break;
case USECASE_AUDIO_PLAYBACK_ALERTS:
diff --git a/hal/audio_extn/auto_hal.h b/hal/audio_extn/auto_hal.h
index dfe78f2..531f3f0 100644
--- a/hal/audio_extn/auto_hal.h
+++ b/hal/audio_extn/auto_hal.h
@@ -15,6 +15,9 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Not a contribution.
*/
#include <audio_hw.h>
#include "platform.h"
@@ -115,6 +118,7 @@
USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION,
USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE,
USECASE_AUDIO_PLAYBACK_PHONE,
+ USECASE_AUDIO_PLAYBACK_PHONE_LL,
USECASE_AUDIO_PLAYBACK_ALERTS,
USECASE_AUDIO_PLAYBACK_FRONT_PASSENGER,
USECASE_AUDIO_PLAYBACK_REAR_SEAT,
diff --git a/hal/audio_extn/ext_hw_plugin.c b/hal/audio_extn/ext_hw_plugin.c
index 5f21c3f..661553b 100644
--- a/hal/audio_extn/ext_hw_plugin.c
+++ b/hal/audio_extn/ext_hw_plugin.c
@@ -25,6 +25,10 @@
* 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.
+*
+* Changes from Qualcomm Innovation Center are provided under the following license:
+* Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+* SPDX-License-Identifier: BSD-3-Clause-Clear
*/
#define LOG_TAG "audio_ext_hw_plugin"
@@ -199,6 +203,7 @@
*plugin_usecase = AUDIO_HAL_PLUGIN_USECASE_DRIVER_SIDE_PLAYBACK;
break;
case USECASE_AUDIO_PLAYBACK_PHONE:
+ case USECASE_AUDIO_PLAYBACK_PHONE_LL:
*plugin_usecase = AUDIO_HAL_PLUGIN_USECASE_PHONE_PLAYBACK;
break;
case USECASE_AUDIO_FM_TUNER_EXT:
diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c
index 174e43f..d7eeb35 100644
--- a/hal/audio_extn/utils.c
+++ b/hal/audio_extn/utils.c
@@ -15,6 +15,9 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Not a contribution.
*/
#define LOG_TAG "audio_hw_utils"
@@ -943,10 +946,6 @@
ALOGV("%s Selected apptype: %d", __func__, usecase->stream.out->app_type_cfg.app_type);
break;
case PCM_CAPTURE:
- if (usecase->id == USECASE_AUDIO_RECORD_VOIP
- || usecase->id == USECASE_AUDIO_RECORD_VOIP_LOW_LATENCY)
- usecase->stream.in->app_type_cfg.app_type = APP_TYPE_VOIP_AUDIO;
- else
audio_extn_utils_update_stream_input_app_type_cfg(adev->platform,
&adev->streams_input_cfg_list,
&usecase->stream.in->device_list,
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
index 8d36847..0e221e2 100644
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -494,6 +494,7 @@
[USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION] = "sys-notification-playback",
[USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE] = "nav-guidance-playback",
[USECASE_AUDIO_PLAYBACK_PHONE] = "phone-playback",
+ [USECASE_AUDIO_PLAYBACK_PHONE_LL] = "phone-playback-ll",
[USECASE_AUDIO_PLAYBACK_ALERTS] = "alerts-playback",
[USECASE_AUDIO_PLAYBACK_FRONT_PASSENGER] = "front-passenger-playback",
[USECASE_AUDIO_PLAYBACK_REAR_SEAT] = "rear-seat-playback",
@@ -8892,8 +8893,8 @@
out->hal_op_format, out->sample_rate,
out->bit_width, out->channel_mask, out->profile,
&out->app_type_cfg);
- if ((out->usecase == (audio_usecase_t)(GET_USECASE_AUDIO_PLAYBACK_PRIMARY(use_db_as_primary))) ||
- (flags & AUDIO_OUTPUT_FLAG_PRIMARY)) {
+ if (((out->usecase == (audio_usecase_t)(GET_USECASE_AUDIO_PLAYBACK_PRIMARY(use_db_as_primary))) ||
+ (flags & AUDIO_OUTPUT_FLAG_PRIMARY)) && (!compare_device_type(&out->device_list, AUDIO_DEVICE_OUT_BUS))) {
/* Ensure the default output is not selected twice */
if(adev->primary_output == NULL)
adev->primary_output = out;
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index 058d7a2..85223e1 100644
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -36,7 +36,7 @@
* Changes from Qualcomm Innovation Center are provided under the following license:
- * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Copyright (c) 2022-2023 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
@@ -302,6 +302,7 @@
USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION,
USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE,
USECASE_AUDIO_PLAYBACK_PHONE,
+ USECASE_AUDIO_PLAYBACK_PHONE_LL,
USECASE_AUDIO_PLAYBACK_ALERTS,
USECASE_AUDIO_PLAYBACK_FRONT_PASSENGER,
USECASE_AUDIO_PLAYBACK_REAR_SEAT,
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index a3a943f..bc3106d 100644
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -15,6 +15,9 @@
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
+ *
+ * Copyright (c) 2023 Qualcomm Innovation Center, Inc. All rights reserved.
+ * Not a contribution.
*/
#define LOG_TAG "msm8974_platform"
@@ -579,6 +582,8 @@
MSM_FRONTEND_DAI_MULTIMEDIA2, MSM_FRONTEND_DAI_MULTIMEDIA2},
[USECASE_AUDIO_PLAYBACK_PHONE] = {PHONE_PCM_DEVICE, PHONE_PCM_DEVICE,
MSM_FRONTEND_DAI_MULTIMEDIA10, MSM_FRONTEND_DAI_MULTIMEDIA10},
+ [USECASE_AUDIO_PLAYBACK_PHONE_LL] = {PHONE_PCM_DEVICE, PHONE_PCM_DEVICE,
+ MSM_FRONTEND_DAI_MULTIMEDIA10, MSM_FRONTEND_DAI_MULTIMEDIA10},
[USECASE_AUDIO_PLAYBACK_ALERTS] = {ALERTS_PCM_DEVICE, ALERTS_PCM_DEVICE,
MSM_FRONTEND_DAI_MULTIMEDIA31, MSM_FRONTEND_DAI_MULTIMEDIA31},
[USECASE_AUDIO_PLAYBACK_FRONT_PASSENGER] = {FRONT_PASSENGER_PCM_DEVICE, FRONT_PASSENGER_PCM_DEVICE,
@@ -1524,6 +1529,7 @@
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION)},
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_NAV_GUIDANCE)},
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_PHONE)},
+ {TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_PHONE_LL)},
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_ALERTS)},
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_FRONT_PASSENGER)},
{TO_NAME_INDEX(USECASE_AUDIO_PLAYBACK_REAR_SEAT)},
@@ -9332,6 +9338,7 @@
case USECASE_AUDIO_PLAYBACK_SYS_NOTIFICATION:
case USECASE_AUDIO_PLAYBACK_FRONT_PASSENGER:
case USECASE_AUDIO_PLAYBACK_PHONE:
+ case USECASE_AUDIO_PLAYBACK_PHONE_LL:
case USECASE_AUDIO_PLAYBACK_ALERTS:
delay = LOW_LATENCY_PLATFORM_DELAY;
break;