Merge "configs: lahaina: disable BCS for Lahaina CDP"
diff --git a/configs/holi/audio_platform_info.xml b/configs/holi/audio_platform_info.xml
index fe127d3..d9a59cf 100644
--- a/configs/holi/audio_platform_info.xml
+++ b/configs/holi/audio_platform_info.xml
@@ -111,8 +111,8 @@
<usecase name="USECASE_AUDIO_RECORD_VOIP" type="in" id="12" />
<usecase name="USECASE_AUDIO_PLAYBACK_MMAP" type="out" id="29" />
<usecase name="USECASE_AUDIO_RECORD_MMAP" type="in" id="29" />
- <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="in" id="36" />
- <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="out" id="36" />
+ <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="in" id="35" />
+ <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="out" id="35" />
<usecase name="USECASE_INCALL_MUSIC_UPLINK" type="out" id="23" />
<usecase name="USECASE_INCALL_MUSIC_UPLINK2" type="out" id="23" />
<usecase name="USECASE_AUDIO_RECORD_COMPRESS2" type="in" id="37" />
diff --git a/configs/holi/audio_platform_info_intcodec.xml b/configs/holi/audio_platform_info_intcodec.xml
index 2c9fde1..02e6290 100644
--- a/configs/holi/audio_platform_info_intcodec.xml
+++ b/configs/holi/audio_platform_info_intcodec.xml
@@ -93,8 +93,8 @@
<usecase name="USECASE_AUDIO_HFP_SCO_WB" type="in" id="12" />
<usecase name="USECASE_AUDIO_PLAYBACK_MMAP" type="out" id="29" />
<usecase name="USECASE_AUDIO_RECORD_MMAP" type="in" id="29" />
- <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="in" id="36" />
- <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="out" id="36" />
+ <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="in" id="35" />
+ <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="out" id="35" />
<usecase name="USECASE_INCALL_MUSIC_UPLINK" type="out" id="23" />
<usecase name="USECASE_INCALL_MUSIC_UPLINK2" type="out" id="23" />
<usecase name="USECASE_AUDIO_RECORD_COMPRESS2" type="in" id="36" />
diff --git a/configs/holi/audio_platform_info_qrd.xml b/configs/holi/audio_platform_info_qrd.xml
index 05614f7..01cc404 100644
--- a/configs/holi/audio_platform_info_qrd.xml
+++ b/configs/holi/audio_platform_info_qrd.xml
@@ -93,8 +93,8 @@
<usecase name="USECASE_AUDIO_HFP_SCO_WB" type="in" id="12" />
<usecase name="USECASE_AUDIO_PLAYBACK_MMAP" type="out" id="29" />
<usecase name="USECASE_AUDIO_RECORD_MMAP" type="in" id="29" />
- <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="in" id="36" />
- <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="out" id="36" />
+ <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="in" id="35" />
+ <usecase name="USECASE_AUDIO_A2DP_ABR_FEEDBACK" type="out" id="35" />
<usecase name="USECASE_INCALL_MUSIC_UPLINK" type="out" id="23" />
<usecase name="USECASE_INCALL_MUSIC_UPLINK2" type="out" id="23" />
<usecase name="USECASE_AUDIO_RECORD_COMPRESS2" type="in" id="36" />
diff --git a/configs/lahaina/audio_platform_info_hdk.xml b/configs/lahaina/audio_platform_info_hdk.xml
index 0a34ae2..3f161bb 100644
--- a/configs/lahaina/audio_platform_info_hdk.xml
+++ b/configs/lahaina/audio_platform_info_hdk.xml
@@ -168,7 +168,7 @@
<device name="SND_DEVICE_OUT_VOICE_TTY_FULL_HEADSET" backend="headset" interface="RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_TTY_VCO_HEADPHONES" backend="headphones" interface="RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_TTY_VCO_HEADSET" backend="headset" interface="RX_CDC_DMA_RX_0"/>
- <device name="SND_DEVICE_OUT_HANDSET" interface="RX_CDC_DMA_RX_0"/>
+ <device name="SND_DEVICE_OUT_HANDSET" backend="handset" interface="RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER" interface="WSA_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_1" interface="WSA_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_EXTERNAL_2" interface="WSA_CDC_DMA_RX_0"/>
@@ -176,9 +176,9 @@
<device name="SND_DEVICE_OUT_SPEAKER_VBAT" interface="WSA_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2" interface="WSA_CDC_DMA_RX_0-and-RX_CDC_DMA_RX_0"/>
- <device name="SND_DEVICE_OUT_VOICE_HANDSET" interface="RX_CDC_DMA_RX_0"/>
- <device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" interface="RX_CDC_DMA_RX_0"/>
- <device name="SND_DEVICE_OUT_VOICE_HAC_HANDSET" interface="RX_CDC_DMA_RX_0"/>
+ <device name="SND_DEVICE_OUT_VOICE_HANDSET" backend="handset" interface="RX_CDC_DMA_RX_0"/>
+ <device name="SND_DEVICE_OUT_VOICE_HANDSET_TMUS" backend="handset" interface="RX_CDC_DMA_RX_0"/>
+ <device name="SND_DEVICE_OUT_VOICE_HAC_HANDSET" backend="handset" interface="RX_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_IN_HANDSET_GENERIC_QMIC" interface="TX_CDC_DMA_TX_3"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER" interface="WSA_CDC_DMA_RX_0"/>
<device name="SND_DEVICE_OUT_VOICE_SPEAKER_STEREO" interface="WSA_CDC_DMA_RX_0"/>
diff --git a/configs/lahaina/mixer_paths_hdk.xml b/configs/lahaina/mixer_paths_hdk.xml
index ea40d03..c73a1e9 100644
--- a/configs/lahaina/mixer_paths_hdk.xml
+++ b/configs/lahaina/mixer_paths_hdk.xml
@@ -407,7 +407,7 @@
<ctl name="BCS Channel" value="CH6" />
<!-- Volume controls -->
- <ctl name="WSA_RX0 Digital Volume" value="78" />
+ <ctl name="WSA_RX0 Digital Volume" value="84" />
<ctl name="WSA_RX1 Digital Volume" value="84" />
<ctl name="RX_RX0 Digital Volume" value="84" />
<ctl name="RX_RX1 Digital Volume" value="84" />
diff --git a/configs/lahaina/shima_overlay/mixer_paths_shimaqrd_overlay.xml b/configs/lahaina/shima_overlay/mixer_paths_shimaqrd_overlay.xml
index ec2f416..d85a784 100644
--- a/configs/lahaina/shima_overlay/mixer_paths_shimaqrd_overlay.xml
+++ b/configs/lahaina/shima_overlay/mixer_paths_shimaqrd_overlay.xml
@@ -47,6 +47,7 @@
<ctl name="TX_DEC1 Volume" value="96"/>
<ctl name="TX_DEC2 Volume" value="96"/>
<ctl name="TX_DEC3 Volume" value="96"/>
+ <ctl name="RX_EAR Mode" value="OFF" />
<path name="echo-reference">
<ctl name="AUDIO_REF_EC_UL1 MUX" value="WSA_CDC_DMA_RX_0"/>
<ctl name="EC Reference Channels" value="One"/>
@@ -127,6 +128,7 @@
<ctl name="RX INT0 DEM MUX" value="CLSH_DSM_OUT"/>
<ctl name="EAR_RDAC Switch" value="1"/>
<ctl name="RDAC3_MUX" value="RX1"/>
+ <ctl name="RX_EAR Mode" value="ON" />
</path>
<path name="handset-mic">
<path name="dmic2"/>
@@ -211,4 +213,4 @@
<path name="voice-tty-vco-handset-mic">
<path name="dmic3"/>
</path>
-</mixer>
\ No newline at end of file
+</mixer>
diff --git a/configs/msm8953/msm8953.mk b/configs/msm8953/msm8953.mk
index a72a102..e68cc7e 100644
--- a/configs/msm8953/msm8953.mk
+++ b/configs/msm8953/msm8953.mk
@@ -266,7 +266,7 @@
vendor.audio.feature.ras.enable=false \
vendor.audio.feature.a2dp_offload.enable=false \
vendor.audio.feature.wsa.enable=true \
-vendor.audio.feature.compress_meta_data.enablef=false \
+vendor.audio.feature.compress_meta_data.enable=true \
vendor.audio.feature.vbat.enable=true \
vendor.audio.feature.display_port.enable=false \
vendor.audio.feature.fluence.enable=true \
diff --git a/hal/audio_extn/Android.mk b/hal/audio_extn/Android.mk
index de05c1d..597b6bd 100755
--- a/hal/audio_extn/Android.mk
+++ b/hal/audio_extn/Android.mk
@@ -524,7 +524,6 @@
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
LOCAL_HEADER_LIBRARIES += audio_kernel_headers
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
- LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
endif
LOCAL_HEADER_LIBRARIES += libhardware_headers
@@ -592,7 +591,6 @@
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
LOCAL_HEADER_LIBRARIES += audio_kernel_headers
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
- LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_LOG)), true)
@@ -666,7 +664,6 @@
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
LOCAL_HEADER_LIBRARIES += audio_kernel_headers
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
- LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
endif
LOCAL_HEADER_LIBRARIES += libhardware_headers
@@ -734,7 +731,6 @@
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
LOCAL_HEADER_LIBRARIES += audio_kernel_headers
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
- LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
endif
LOCAL_HEADER_LIBRARIES += libhardware_headers
@@ -801,7 +797,6 @@
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
LOCAL_HEADER_LIBRARIES += audio_kernel_headers
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
- LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
endif
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DYNAMIC_LOG)), true)
@@ -885,7 +880,6 @@
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
LOCAL_HEADER_LIBRARIES += audio_kernel_headers
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
- LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
endif
LOCAL_HEADER_LIBRARIES += libhardware_headers
@@ -948,7 +942,6 @@
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
LOCAL_HEADER_LIBRARIES += audio_kernel_headers
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
- LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
endif
LOCAL_HEADER_LIBRARIES += libhardware_headers
@@ -1136,7 +1129,6 @@
ifeq ($(strip $(AUDIO_FEATURE_ENABLED_DLKM)),true)
LOCAL_HEADER_LIBRARIES += audio_kernel_headers
LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/vendor/qcom/opensource/audio-kernel/include
- LOCAL_ADDITIONAL_DEPENDENCIES += $(BOARD_VENDOR_KERNEL_MODULES)
endif
LOCAL_HEADER_LIBRARIES += libhardware_headers
diff --git a/hal/audio_hw.c b/hal/audio_hw.c
old mode 100755
new mode 100644
index c5f3c7a..fd04f3f
--- a/hal/audio_hw.c
+++ b/hal/audio_hw.c
@@ -102,6 +102,7 @@
#define INVALID_OUT_VOLUME -1
#define AUDIO_IO_PORTS_MAX 32
+#define PLAYBACK_GAIN_MAX 1.0f
#define RECORD_GAIN_MIN 0.0f
#define RECORD_GAIN_MAX 1.0f
#define RECORD_VOLUME_CTL_MAX 0x2000
@@ -1286,15 +1287,10 @@
if (audio_extn_is_maxx_audio_enabled())
audio_extn_ma_set_device(usecase);
audio_extn_utils_send_audio_calibration(adev, usecase);
- if ((usecase->type == PCM_PLAYBACK) &&
- ((out = usecase->stream.out) != NULL)) {
- if (!is_offload_usecase(out->usecase)) {
- pthread_mutex_lock(&out->latch_lock);
- out->muted = false;
- pthread_mutex_unlock(&out->latch_lock);
- } else if (out->compr) {
+ if ((usecase->type == PCM_PLAYBACK) && is_offload_usecase(usecase->id)) {
+ out = usecase->stream.out;
+ if (out && out->compr)
audio_extn_utils_compress_set_clk_rec_mode(usecase);
- }
}
if (usecase->type == PCM_CAPTURE) {
@@ -3721,6 +3717,8 @@
return -EINVAL;
}
+ out->a2dp_muted = false;
+
if (audio_extn_ext_hw_plugin_usecase_stop(adev->ext_hw_plugin, uc_info))
ALOGE("%s: failed to stop ext hw plugin", __func__);
@@ -3771,9 +3769,6 @@
list_remove(&uc_info->list);
out->started = 0;
- pthread_mutex_lock(&out->latch_lock);
- out->muted = false;
- pthread_mutex_unlock(&out->latch_lock);
if (is_offload_usecase(out->usecase) &&
(audio_extn_passthru_is_passthrough_stream(out))) {
ALOGV("Disable passthrough , reset mixer to pcm");
@@ -5063,17 +5058,19 @@
platform_set_swap_channels(adev, true);
audio_extn_perf_lock_release(&adev->perf_lock_handle);
}
- if (is_offload_usecase(out->usecase) &&
- (!is_a2dp_out_device_type(&out->device_list) || audio_extn_a2dp_source_is_ready())) {
- pthread_mutex_lock(&out->latch_lock);
- if (out->a2dp_compress_mute) {
- out->a2dp_compress_mute = false;
- out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
+ pthread_mutex_lock(&out->latch_lock);
+ if (!is_a2dp_out_device_type(&out->device_list) || audio_extn_a2dp_source_is_ready()) {
+ if (out->a2dp_muted) {
+ out->a2dp_muted = false;
+ if (is_offload_usecase(out->usecase))
+ out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
+ else if (out->usecase != USECASE_AUDIO_PLAYBACK_VOIP)
+ out_set_pcm_volume(&out->stream, out->volume_l, out->volume_r);
}
- pthread_mutex_unlock(&out->latch_lock);
- } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
- out_set_voip_volume(&out->stream, out->volume_l, out->volume_r);
}
+ if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP && !out->a2dp_muted)
+ out_set_voip_volume(&out->stream, out->volume_l, out->volume_r);
+ pthread_mutex_unlock(&out->latch_lock);
}
}
@@ -5625,9 +5622,7 @@
ALOGD("%s: called with left_vol=%f, right_vol=%f", __func__, left, right);
if (out->usecase == USECASE_AUDIO_PLAYBACK_MULTI_CH) {
/* only take left channel into account: the API is for stereo anyway */
- pthread_mutex_lock(&out->latch_lock);
out->muted = (left == 0.0f);
- pthread_mutex_unlock(&out->latch_lock);
return 0;
} else if (is_offload_usecase(out->usecase)) {
if (audio_extn_passthru_is_passthrough_stream(out)) {
@@ -5665,15 +5660,15 @@
}
}
pthread_mutex_lock(&out->latch_lock);
- if (!out->a2dp_compress_mute) {
+ if (!out->a2dp_muted) {
ret = out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
}
pthread_mutex_unlock(&out->latch_lock);
return ret;
} else {
pthread_mutex_lock(&out->latch_lock);
- ALOGV("%s: compress mute %d", __func__, out->a2dp_compress_mute);
- if (!out->a2dp_compress_mute)
+ ALOGV("%s: compress mute %d", __func__, out->a2dp_muted);
+ if (!out->a2dp_muted)
ret = out_set_compr_volume(stream, left, right);
out->volume_l = left;
out->volume_r = right;
@@ -5683,14 +5678,17 @@
} else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
out->app_type_cfg.gain[0] = (int)(left * VOIP_PLAYBACK_VOLUME_MAX);
out->app_type_cfg.gain[1] = (int)(right * VOIP_PLAYBACK_VOLUME_MAX);
+ pthread_mutex_lock(&out->latch_lock);
if (!out->standby) {
audio_extn_utils_send_app_type_gain(out->dev,
out->app_type_cfg.app_type,
&out->app_type_cfg.gain[0]);
- ret = out_set_voip_volume(stream, left, right);
+ if (!out->a2dp_muted)
+ ret = out_set_voip_volume(stream, left, right);
}
out->volume_l = left;
out->volume_r = right;
+ pthread_mutex_unlock(&out->latch_lock);
return ret;
} else if (out->usecase == USECASE_AUDIO_PLAYBACK_MMAP) {
ALOGV("%s: MMAP set volume called", __func__);
@@ -5702,21 +5700,25 @@
} else if (out->usecase == USECASE_AUDIO_PLAYBACK_LOW_LATENCY ||
out->usecase == USECASE_AUDIO_PLAYBACK_DEEP_BUFFER ||
out->usecase == USECASE_AUDIO_PLAYBACK_ULL) {
+ pthread_mutex_lock(&out->latch_lock);
/* Volume control for pcm playback */
- if (!out->standby)
+ if (!out->standby && !out->a2dp_muted)
ret = out_set_pcm_volume(stream, left, right);
else
out->apply_volume = true;
out->volume_l = left;
out->volume_r = right;
+ pthread_mutex_unlock(&out->latch_lock);
return ret;
} else if (audio_extn_auto_hal_is_bus_device_usecase(out->usecase)) {
ALOGV("%s: bus device set volume called", __func__);
- if (!out->standby)
+ pthread_mutex_lock(&out->latch_lock);
+ if (!out->standby && !out->a2dp_muted)
ret = out_set_pcm_volume(stream, left, right);
out->volume_l = left;
out->volume_r = right;
+ pthread_mutex_unlock(&out->latch_lock);
return ret;
}
@@ -6102,10 +6104,8 @@
} else {
if (out->pcm) {
size_t bytes_to_write = bytes;
- pthread_mutex_lock(&out->latch_lock);
if (out->muted)
memset((void *)buffer, 0, bytes);
- pthread_mutex_unlock(&out->latch_lock);
ALOGV("%s: frames=%zu, frame_size=%zu, bytes_to_write=%zu",
__func__, frames, frame_size, bytes_to_write);
@@ -7857,7 +7857,7 @@
out->non_blocking = 0;
out->convert_buffer = NULL;
out->started = 0;
- out->a2dp_compress_mute = false;
+ out->a2dp_muted = false;
out->hal_output_suspend_supported = 0;
out->dynamic_pm_qos_config_supported = 0;
out->set_dual_mono = false;
@@ -8588,6 +8588,8 @@
out->kernel_buffer_size = out->config.period_size * out->config.period_count;
out->standby = 1;
+ out->volume_l = PLAYBACK_GAIN_MAX;
+ out->volume_r = PLAYBACK_GAIN_MAX;
/* out->muted = false; by calloc() */
/* out->written = 0; by calloc() */
@@ -8728,7 +8730,7 @@
free(out->compr_config.codec);
}
- out->a2dp_compress_mute = false;
+ out->a2dp_muted = false;
if (is_interactive_usecase(out->usecase))
free_interactive_usecase(adev, out->usecase);
@@ -8981,17 +8983,12 @@
//force device switch to re configure encoder
select_devices(adev, usecase->id);
ALOGD("Unmuting the stream after select_devices");
- pthread_mutex_lock(&usecase->stream.out->latch_lock);
- usecase->stream.out->a2dp_compress_mute = false;
- out_set_compr_volume(&usecase->stream.out->stream,
- usecase->stream.out->volume_l,
- usecase->stream.out->volume_r);
- pthread_mutex_unlock(&usecase->stream.out->latch_lock);
+ check_a2dp_restore_l(adev, usecase->stream.out, true);
audio_extn_a2dp_set_handoff_mode(false);
break;
} else if (is_offload_usecase(usecase->stream.out->usecase)) {
pthread_mutex_lock(&usecase->stream.out->latch_lock);
- if (usecase->stream.out->a2dp_compress_mute) {
+ if (usecase->stream.out->a2dp_muted) {
pthread_mutex_unlock(&usecase->stream.out->latch_lock);
reassign_device_list(&usecase->stream.out->device_list,
AUDIO_DEVICE_OUT_BLUETOOTH_A2DP, "");
@@ -10471,8 +10468,8 @@
}
list_init(&devices);
- ALOGD("%s: enter: usecase(%d: %s)", __func__,
- out->usecase, use_case_table[out->usecase]);
+ ALOGD("%s: enter: usecase(%d: %s), a2dp muted %d", __func__,
+ out->usecase, use_case_table[out->usecase], out->a2dp_muted);
if (restore) {
pthread_mutex_lock(&out->latch_lock);
@@ -10481,42 +10478,50 @@
ALOGD("%s: restoring A2dp and unmuting stream", __func__);
if (uc_info->out_snd_device != SND_DEVICE_OUT_BT_A2DP)
select_devices(adev, uc_info->id);
- if (is_offload_usecase(out->usecase) &&
- (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP)) {
- if (out->a2dp_compress_mute) {
- out->a2dp_compress_mute = false;
+
+ if (is_offload_usecase(out->usecase)) {
+ if (uc_info->out_snd_device == SND_DEVICE_OUT_BT_A2DP)
out_set_compr_volume(&out->stream, out->volume_l, out->volume_r);
- }
+ } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
+ out_set_voip_volume(&out->stream, out->volume_l, out->volume_r);
+ } else {
+ out_set_pcm_volume(&out->stream, out->volume_l, out->volume_r);
}
+ out->a2dp_muted = false;
}
- out->muted = false;
pthread_mutex_unlock(&out->latch_lock);
} else {
pthread_mutex_lock(&out->latch_lock);
- if (is_offload_usecase(out->usecase)) {
- // mute compress stream if suspended
- if (!out->a2dp_compress_mute && !out->standby) {
- ALOGD("%s: selecting speaker and muting stream", __func__);
- assign_devices(&devices, &out->device_list);
- reassign_device_list(&out->device_list, AUDIO_DEVICE_OUT_SPEAKER, "");
- left_p = out->volume_l;
- right_p = out->volume_r;
+ // mute stream and switch to speaker if suspended
+ if (!out->a2dp_muted && !out->standby) {
+ ALOGD("%s: selecting speaker and muting stream", __func__);
+ assign_devices(&devices, &out->device_list);
+ reassign_device_list(&out->device_list, AUDIO_DEVICE_OUT_SPEAKER, "");
+ left_p = out->volume_l;
+ right_p = out->volume_r;
+ out->a2dp_muted = true;
+ if (is_offload_usecase(out->usecase)) {
if (out->offload_state == OFFLOAD_STATE_PLAYING)
compress_pause(out->compr);
out_set_compr_volume(&out->stream, (float)0, (float)0);
- out->a2dp_compress_mute = true;
- select_devices(adev, out->usecase);
+ } else if (out->usecase == USECASE_AUDIO_PLAYBACK_VOIP) {
+ out_set_voip_volume(&out->stream, (float)0, (float)0);
+ } else {
+ out_set_pcm_volume(&out->stream, (float)0, (float)0);
+ /* wait for stale pcm drained before switching to speaker */
+ uint32_t latency =
+ (out->config.period_count * out->config.period_size * 1000) /
+ (out->config.rate);
+ usleep(latency * 1000);
+ }
+ select_devices(adev, out->usecase);
+ if (is_offload_usecase(out->usecase)) {
if (out->offload_state == OFFLOAD_STATE_PLAYING)
compress_resume(out->compr);
- assign_devices(&out->device_list, &devices);
- out->volume_l = left_p;
- out->volume_r = right_p;
}
- } else {
- // mute for non offloaded streams
- if (audio_extn_a2dp_source_is_suspended()) {
- out->muted = true;
- }
+ assign_devices(&out->device_list, &devices);
+ out->volume_l = left_p;
+ out->volume_r = right_p;
}
pthread_mutex_unlock(&out->latch_lock);
}
diff --git a/hal/audio_hw.h b/hal/audio_hw.h
index a2e5331..05382e4 100755
--- a/hal/audio_hw.h
+++ b/hal/audio_hw.h
@@ -455,7 +455,7 @@
qahwi_stream_out_t qahwi_out;
bool is_iec61937_info_available;
- bool a2dp_compress_mute;
+ bool a2dp_muted;
float volume_l;
float volume_r;
bool apply_volume;
diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c
index 15cff67..3bffe9b 100755
--- a/hal/msm8974/platform.c
+++ b/hal/msm8974/platform.c
@@ -3485,10 +3485,12 @@
my_data, PLATFORM);
} else if (!strncmp(snd_card_name, "bengal-scubaidp-snd-card",
sizeof("bengal-scubaidp-snd-card"))) {
- platform_info_init(PLATFORM_INFO_XML_PATH_SCUBA_IDP, my_data, PLATFORM);
+ platform_info_init(get_xml_file_path(PLATFORM_INFO_XML_PATH_SCUBA_IDP),
+ my_data, PLATFORM);
} else if (!strncmp(snd_card_name, "bengal-scubaqrd-snd-card",
sizeof("bengal-scubaqrd-snd-card"))) {
- platform_info_init(PLATFORM_INFO_XML_PATH_SCUBA_QRD, my_data, PLATFORM);
+ platform_info_init(get_xml_file_path(PLATFORM_INFO_XML_PATH_SCUBA_QRD),
+ my_data, PLATFORM);
} else if (my_data->is_internal_codec) {
platform_info_init(get_xml_file_path(PLATFORM_INFO_XML_PATH_INTCODEC_NAME),
my_data, PLATFORM);