summaryrefslogtreecommitdiffstats
path: root/hal/voice_extn
diff options
context:
space:
mode:
authorArun Mirpuri <amirpuri@codeaurora.org>2018-09-11 18:01:15 -0700
committerGerrit - the friendly Code Review server <code-review@localhost>2018-09-14 16:39:10 -0700
commit7da752abb48d0c4207be88dd099f23c36df78aeb (patch)
tree90db60781be3fe69a2b143409f670f079e43b640 /hal/voice_extn
parent0dd741a11928a9a4564797d0945089ef163e54b7 (diff)
downloadhardware_qcom_audio-7da752abb48d0c4207be88dd099f23c36df78aeb.tar.gz
hardware_qcom_audio-7da752abb48d0c4207be88dd099f23c36df78aeb.tar.bz2
hardware_qcom_audio-7da752abb48d0c4207be88dd099f23c36df78aeb.zip
hal: Fix incall music delivery during voice call issues
Fix incall music delivery issue by adding support for incall music usecase in out_write and adev_open_output_stream CRs-Fixed:2308665 Change-Id: I26f9f36c29017480ec064b8db2b2b9ae6b357fb5
Diffstat (limited to 'hal/voice_extn')
-rw-r--r--hal/voice_extn/voice_extn.c25
-rw-r--r--hal/voice_extn/voice_extn.h7
2 files changed, 8 insertions, 24 deletions
diff --git a/hal/voice_extn/voice_extn.c b/hal/voice_extn/voice_extn.c
index 93653cac..ec852590 100644
--- a/hal/voice_extn/voice_extn.c
+++ b/hal/voice_extn/voice_extn.c
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2018, The Linux Foundation. All rights reserved.
* Not a contribution.
*
* Copyright (C) 2013 The Android Open Source Project
@@ -594,27 +594,16 @@ void voice_extn_in_get_parameters(struct stream_in *in,
voice_extn_compress_voip_in_get_parameters(in, query, reply);
}
-#ifdef INCALL_MUSIC_ENABLED
int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev,
struct stream_out *out)
{
- uint32_t session_id = 0;
-
- session_id = get_session_id_with_state(adev, CALL_LOCAL_HOLD);
- if (session_id == VOICE_VSID) {
- out->usecase = USECASE_INCALL_MUSIC_UPLINK;
- } else if (session_id == VOICE2_VSID) {
- out->usecase = USECASE_INCALL_MUSIC_UPLINK2;
- } else {
- ALOGE("%s: Invalid session id %x", __func__, session_id);
- return -EINVAL;
- }
-
+ out->usecase = USECASE_INCALL_MUSIC_UPLINK;
out->config = pcm_config_incall_music;
- out->supported_channel_masks[0] = AUDIO_CHANNEL_OUT_MONO;
- out->channel_mask = AUDIO_CHANNEL_OUT_MONO;
+ //FIXME: add support for MONO stream configuration when audioflinger mixer supports it
+ out->supported_channel_masks[0] = AUDIO_CHANNEL_OUT_STEREO;
+ out->channel_mask = AUDIO_CHANNEL_OUT_STEREO;
+ out->config.rate = out->sample_rate;
+ ALOGV("%s: mode=%d, usecase id=%d", __func__, adev->mode, out->usecase);
return 0;
}
-#endif
-
diff --git a/hal/voice_extn/voice_extn.h b/hal/voice_extn/voice_extn.h
index f35344f2..5d1cac3d 100644
--- a/hal/voice_extn/voice_extn.h
+++ b/hal/voice_extn/voice_extn.h
@@ -1,5 +1,5 @@
/*
- * Copyright (c) 2013-2014, 2016-2017, The Linux Foundation. All rights reserved.
+ * Copyright (c) 2013-2014, 2016-2018, The Linux Foundation. All rights reserved.
* Not a contribution.
*
* Copyright (C) 2013 The Android Open Source Project
@@ -101,13 +101,8 @@ static void __unused voice_extn_out_get_parameters(struct stream_out *out __unus
}
#endif
-#ifdef INCALL_MUSIC_ENABLED
int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev,
struct stream_out *out);
-#else
-#define voice_extn_check_and_set_incall_music_usecase(adev, out) -ENOSYS
-#endif
-
#ifdef COMPRESS_VOIP_ENABLED
int voice_extn_compress_voip_close_output_stream(struct audio_stream *stream);
int voice_extn_compress_voip_open_output_stream(struct stream_out *out);