Loading hal/Android.mk +3 −6 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ LOCAL_SRC_FILES := \ LOCAL_SRC_FILES += audio_extn/audio_extn.c \ audio_extn/utils.c LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD)),true) LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED Loading Loading @@ -89,8 +91,7 @@ endif ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true) LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED LOCAL_SRC_FILES += voice_extn/voice_extn.c LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INCALL_MUSIC)),true) LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED endif Loading @@ -108,8 +109,6 @@ endif ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true) LOCAL_CFLAGS += -DSPKR_PROT_ENABLED LOCAL_SRC_FILES += audio_extn/spkr_protection.c LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr endif ifdef MULTIPLE_HW_VARIANTS_ENABLED Loading @@ -124,8 +123,6 @@ endif ifeq ($(strip $(DOLBY_DDP)),true) LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr LOCAL_SRC_FILES += audio_extn/dolby.c endif Loading hal/audio_hw.c +19 −3 Original line number Diff line number Diff line Loading @@ -628,6 +628,8 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) { snd_device_t out_snd_device = SND_DEVICE_NONE; snd_device_t in_snd_device = SND_DEVICE_NONE; snd_device_t prev_out_snd_device = SND_DEVICE_NONE; snd_device_t prev_in_snd_device = SND_DEVICE_NONE; struct audio_usecase *usecase = NULL; struct audio_usecase *vc_usecase = NULL; struct audio_usecase *voip_usecase = NULL; Loading Loading @@ -723,7 +725,9 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) * and enable both RX and TX devices though one of them is same as current * device. */ if (usecase->type == VOICE_CALL || usecase->type == VOIP_CALL) { if ((usecase->type == VOICE_CALL) && (usecase->in_snd_device != SND_DEVICE_NONE) && (usecase->out_snd_device != SND_DEVICE_NONE)) { status = platform_switch_voice_call_device_pre(adev->platform); } Loading @@ -742,10 +746,13 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) * New device information should be sent to modem before enabling * the devices to reduce in-call device switch time. */ if (usecase->type == VOICE_CALL) if ((usecase->type == VOICE_CALL) && (usecase->in_snd_device != SND_DEVICE_NONE) && (usecase->out_snd_device != SND_DEVICE_NONE)) { status = platform_switch_voice_call_enable_device_config(adev->platform, out_snd_device, in_snd_device); } /* Enable new sound devices */ if (out_snd_device != SND_DEVICE_NONE) { Loading @@ -764,6 +771,12 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) out_snd_device, in_snd_device); /* Cache the current usecase devices. This is required to avoid * sending device enable command to the external modem. */ prev_in_snd_device = usecase->in_snd_device; prev_out_snd_device = usecase->out_snd_device; usecase->in_snd_device = in_snd_device; usecase->out_snd_device = out_snd_device; Loading @@ -773,10 +786,13 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) * Enable device command should be sent to modem only after * enabling voice call mixer controls */ if (usecase->type == VOICE_CALL) if ((usecase->type == VOICE_CALL) && (prev_in_snd_device != SND_DEVICE_NONE) && (prev_out_snd_device != SND_DEVICE_NONE)) { status = platform_switch_voice_call_usecase_route_post(adev->platform, out_snd_device, in_snd_device); } ALOGD("%s: done",__func__); Loading hal/msm8916/platform.c +23 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <stdlib.h> #include <dlfcn.h> #include <sys/ioctl.h> #include <cutils/log.h> #include <cutils/properties.h> #include <cutils/str_parms.h> Loading Loading @@ -549,6 +550,14 @@ static struct csd_data *open_csd_client() __func__, dlerror()); goto error; } csd->set_lch = (set_lch_t)dlsym(csd->csd_client, "csd_client_set_lch"); if (csd->set_lch == NULL) { ALOGE("%s: dlsym error %s for csd_client_set_lch", __func__, dlerror()); /* Ignore the error as this is not mandatory function for * basic voice call to work. */ } csd->start_record = (start_record_t)dlsym(csd->csd_client, "csd_client_start_record"); if (csd->start_record == NULL) { Loading Loading @@ -1840,6 +1849,20 @@ int platform_stop_incall_music_usecase(void *platform) return ret; } int platform_update_lch(void *platform, struct voice_session *session, enum voice_lch_mode lch_mode) { int ret = 0; struct platform_data *my_data = (struct platform_data *)platform; if ((my_data->csd != NULL) && (my_data->csd->set_lch != NULL)) ret = my_data->csd->set_lch(session->vsid, lch_mode); else ret = pcm_ioctl(session->pcm_tx, SNDRV_VOICE_IOCTL_LCH, &lch_mode); return ret; } void platform_get_parameters(void *platform, struct str_parms *query, struct str_parms *reply) Loading hal/msm8916/platform.h +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #ifndef QCOM_AUDIO_PLATFORM_H #define QCOM_AUDIO_PLATFORM_H #include <sound/voice_params.h> enum { FLUENCE_NONE, Loading Loading @@ -205,6 +206,7 @@ typedef int (*start_voice_t)(uint32_t); typedef int (*stop_voice_t)(uint32_t); typedef int (*start_playback_t)(uint32_t); typedef int (*stop_playback_t)(uint32_t); typedef int (*set_lch_t)(uint32_t, enum voice_lch_mode); typedef int (*start_record_t)(uint32_t, int); typedef int (*stop_record_t)(uint32_t); /* CSD Client structure */ Loading @@ -222,6 +224,7 @@ struct csd_data { stop_voice_t stop_voice; start_playback_t start_playback; stop_playback_t stop_playback; set_lch_t set_lch; start_record_t start_record; stop_record_t stop_record; }; Loading hal/msm8960/platform.c +8 −0 Original line number Diff line number Diff line Loading @@ -914,6 +914,14 @@ int platform_set_incall_recoding_session_id(void *platform, uint32_t session_id) return -ENOSYS; } int platform_update_lch(void *platform __unused, struct voice_session *session __unused, enum voice_lch_mode lch_mode __unused) { LOGE("%s: Not implemented", __func__); return -ENOSYS; } /* Delay in Us */ int64_t platform_render_latency(audio_usecase_t usecase) { Loading Loading
hal/Android.mk +3 −6 Original line number Diff line number Diff line Loading @@ -43,6 +43,8 @@ LOCAL_SRC_FILES := \ LOCAL_SRC_FILES += audio_extn/audio_extn.c \ audio_extn/utils.c LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr ifeq ($(strip $(AUDIO_FEATURE_ENABLED_PCM_OFFLOAD)),true) LOCAL_CFLAGS += -DPCM_OFFLOAD_ENABLED Loading Loading @@ -89,8 +91,7 @@ endif ifeq ($(strip $(AUDIO_FEATURE_ENABLED_MULTI_VOICE_SESSIONS)),true) LOCAL_CFLAGS += -DMULTI_VOICE_SESSION_ENABLED LOCAL_SRC_FILES += voice_extn/voice_extn.c LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr ifeq ($(strip $(AUDIO_FEATURE_ENABLED_INCALL_MUSIC)),true) LOCAL_CFLAGS += -DINCALL_MUSIC_ENABLED endif Loading @@ -108,8 +109,6 @@ endif ifeq ($(strip $(AUDIO_FEATURE_ENABLED_SPKR_PROTECTION)),true) LOCAL_CFLAGS += -DSPKR_PROT_ENABLED LOCAL_SRC_FILES += audio_extn/spkr_protection.c LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr endif ifdef MULTIPLE_HW_VARIANTS_ENABLED Loading @@ -124,8 +123,6 @@ endif ifeq ($(strip $(DOLBY_DDP)),true) LOCAL_CFLAGS += -DDS1_DOLBY_DDP_ENABLED LOCAL_C_INCLUDES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr/include LOCAL_ADDITIONAL_DEPENDENCIES += $(TARGET_OUT_INTERMEDIATES)/KERNEL_OBJ/usr LOCAL_SRC_FILES += audio_extn/dolby.c endif Loading
hal/audio_hw.c +19 −3 Original line number Diff line number Diff line Loading @@ -628,6 +628,8 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) { snd_device_t out_snd_device = SND_DEVICE_NONE; snd_device_t in_snd_device = SND_DEVICE_NONE; snd_device_t prev_out_snd_device = SND_DEVICE_NONE; snd_device_t prev_in_snd_device = SND_DEVICE_NONE; struct audio_usecase *usecase = NULL; struct audio_usecase *vc_usecase = NULL; struct audio_usecase *voip_usecase = NULL; Loading Loading @@ -723,7 +725,9 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) * and enable both RX and TX devices though one of them is same as current * device. */ if (usecase->type == VOICE_CALL || usecase->type == VOIP_CALL) { if ((usecase->type == VOICE_CALL) && (usecase->in_snd_device != SND_DEVICE_NONE) && (usecase->out_snd_device != SND_DEVICE_NONE)) { status = platform_switch_voice_call_device_pre(adev->platform); } Loading @@ -742,10 +746,13 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) * New device information should be sent to modem before enabling * the devices to reduce in-call device switch time. */ if (usecase->type == VOICE_CALL) if ((usecase->type == VOICE_CALL) && (usecase->in_snd_device != SND_DEVICE_NONE) && (usecase->out_snd_device != SND_DEVICE_NONE)) { status = platform_switch_voice_call_enable_device_config(adev->platform, out_snd_device, in_snd_device); } /* Enable new sound devices */ if (out_snd_device != SND_DEVICE_NONE) { Loading @@ -764,6 +771,12 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) out_snd_device, in_snd_device); /* Cache the current usecase devices. This is required to avoid * sending device enable command to the external modem. */ prev_in_snd_device = usecase->in_snd_device; prev_out_snd_device = usecase->out_snd_device; usecase->in_snd_device = in_snd_device; usecase->out_snd_device = out_snd_device; Loading @@ -773,10 +786,13 @@ int select_devices(struct audio_device *adev, audio_usecase_t uc_id) * Enable device command should be sent to modem only after * enabling voice call mixer controls */ if (usecase->type == VOICE_CALL) if ((usecase->type == VOICE_CALL) && (prev_in_snd_device != SND_DEVICE_NONE) && (prev_out_snd_device != SND_DEVICE_NONE)) { status = platform_switch_voice_call_usecase_route_post(adev->platform, out_snd_device, in_snd_device); } ALOGD("%s: done",__func__); Loading
hal/msm8916/platform.c +23 −0 Original line number Diff line number Diff line Loading @@ -23,6 +23,7 @@ #include <stdlib.h> #include <dlfcn.h> #include <sys/ioctl.h> #include <cutils/log.h> #include <cutils/properties.h> #include <cutils/str_parms.h> Loading Loading @@ -549,6 +550,14 @@ static struct csd_data *open_csd_client() __func__, dlerror()); goto error; } csd->set_lch = (set_lch_t)dlsym(csd->csd_client, "csd_client_set_lch"); if (csd->set_lch == NULL) { ALOGE("%s: dlsym error %s for csd_client_set_lch", __func__, dlerror()); /* Ignore the error as this is not mandatory function for * basic voice call to work. */ } csd->start_record = (start_record_t)dlsym(csd->csd_client, "csd_client_start_record"); if (csd->start_record == NULL) { Loading Loading @@ -1840,6 +1849,20 @@ int platform_stop_incall_music_usecase(void *platform) return ret; } int platform_update_lch(void *platform, struct voice_session *session, enum voice_lch_mode lch_mode) { int ret = 0; struct platform_data *my_data = (struct platform_data *)platform; if ((my_data->csd != NULL) && (my_data->csd->set_lch != NULL)) ret = my_data->csd->set_lch(session->vsid, lch_mode); else ret = pcm_ioctl(session->pcm_tx, SNDRV_VOICE_IOCTL_LCH, &lch_mode); return ret; } void platform_get_parameters(void *platform, struct str_parms *query, struct str_parms *reply) Loading
hal/msm8916/platform.h +3 −0 Original line number Diff line number Diff line Loading @@ -19,6 +19,7 @@ #ifndef QCOM_AUDIO_PLATFORM_H #define QCOM_AUDIO_PLATFORM_H #include <sound/voice_params.h> enum { FLUENCE_NONE, Loading Loading @@ -205,6 +206,7 @@ typedef int (*start_voice_t)(uint32_t); typedef int (*stop_voice_t)(uint32_t); typedef int (*start_playback_t)(uint32_t); typedef int (*stop_playback_t)(uint32_t); typedef int (*set_lch_t)(uint32_t, enum voice_lch_mode); typedef int (*start_record_t)(uint32_t, int); typedef int (*stop_record_t)(uint32_t); /* CSD Client structure */ Loading @@ -222,6 +224,7 @@ struct csd_data { stop_voice_t stop_voice; start_playback_t start_playback; stop_playback_t stop_playback; set_lch_t set_lch; start_record_t start_record; stop_record_t stop_record; }; Loading
hal/msm8960/platform.c +8 −0 Original line number Diff line number Diff line Loading @@ -914,6 +914,14 @@ int platform_set_incall_recoding_session_id(void *platform, uint32_t session_id) return -ENOSYS; } int platform_update_lch(void *platform __unused, struct voice_session *session __unused, enum voice_lch_mode lch_mode __unused) { LOGE("%s: Not implemented", __func__); return -ENOSYS; } /* Delay in Us */ int64_t platform_render_latency(audio_usecase_t usecase) { Loading