diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h index b9ea90be..8a27fe3d 100644 --- a/hal/audio_extn/audio_extn.h +++ b/hal/audio_extn/audio_extn.h @@ -55,10 +55,6 @@ #define AUDIO_DEVICE_OUT_PROXY 0x40000 #endif -#ifndef COMPRESS_VOIP_ENABLED -#define AUDIO_OUTPUT_FLAG_VOIP_RX 0x4000 -#endif - #ifndef INCALL_MUSIC_ENABLED #define AUDIO_OUTPUT_FLAG_INCALL_MUSIC 0x8000 #endif diff --git a/hal/audio_extn/utils.c b/hal/audio_extn/utils.c index 811bd89a..20f2e7f6 100644 --- a/hal/audio_extn/utils.c +++ b/hal/audio_extn/utils.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2014-2015, The Linux Foundation. All rights reserved. * Not a Contribution. * * Copyright (C) 2014 The Android Open Source Project @@ -68,9 +68,6 @@ const struct string_to_enum s_flag_name_to_enum_table[] = { #ifdef INCALL_MUSIC_ENABLED STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_INCALL_MUSIC), #endif -#ifdef COMPRESS_VOIP_ENABLED - STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_VOIP_RX), -#endif #ifdef HDMI_PASSTHROUGH_ENABLED STRING_TO_ENUM(AUDIO_OUTPUT_FLAG_COMPRESS_PASSTHROUGH), #endif diff --git a/hal/voice_extn/compress_voip.c b/hal/voice_extn/compress_voip.c index 14af6fc7..b8c38fd1 100644 --- a/hal/voice_extn/compress_voip.c +++ b/hal/voice_extn/compress_voip.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2013-2014, The Linux Foundation. All rights reserved. + * Copyright (c) 2013-2015, The Linux Foundation. All rights reserved. * Not a contribution. * * Copyright (C) 2013 The Android Open Source Project @@ -64,17 +64,9 @@ struct voip_data { uint32_t sample_rate; }; -#define MODE_IS127 0x2 -#define MODE_4GV_NB 0x3 -#define MODE_4GV_WB 0x4 -#define MODE_AMR 0x5 -#define MODE_AMR_WB 0xD #define MODE_PCM 0xC -#define MODE_4GV_NW 0xE #define AUDIO_PARAMETER_KEY_VOIP_RATE "voip_rate" -#define AUDIO_PARAMETER_KEY_VOIP_EVRC_RATE_MIN "evrc_rate_min" -#define AUDIO_PARAMETER_KEY_VOIP_EVRC_RATE_MAX "evrc_rate_max" #define AUDIO_PARAMETER_KEY_VOIP_DTX_MODE "dtx_on" #define AUDIO_PARAMETER_VALUE_VOIP_TRUE "true" #define AUDIO_PARAMETER_KEY_VOIP_CHECK "voip_flag" @@ -94,8 +86,6 @@ static int voip_set_volume(struct audio_device *adev, int volume); static int voip_set_mic_mute(struct audio_device *adev, bool state); static int voip_set_mode(struct audio_device *adev, int format); static int voip_set_rate(struct audio_device *adev, int rate); -static int voip_set_evrc_min_max_rate(struct audio_device *adev, int min_rate, - int max_rate); static int voip_set_dtx(struct audio_device *adev, bool enable); static int voip_stop_call(struct audio_device *adev); static int voip_start_call(struct audio_device *adev, @@ -103,32 +93,10 @@ static int voip_start_call(struct audio_device *adev, static int audio_format_to_voip_mode(int format) { - int mode; + int mode = AUDIO_FORMAT_INVALID; - switch(format) { - case AUDIO_FORMAT_PCM_16_BIT: - mode = MODE_PCM; - break; - case AUDIO_FORMAT_AMR_NB: - mode = MODE_AMR; - break; - case AUDIO_FORMAT_AMR_WB: - mode = MODE_AMR_WB; - break; - case AUDIO_FORMAT_EVRC: - mode = MODE_IS127; - break; - case AUDIO_FORMAT_EVRCB: - mode = MODE_4GV_NB; - break; - case AUDIO_FORMAT_EVRCWB: - mode = MODE_4GV_WB; - break; - case AUDIO_FORMAT_EVRCNW: - mode = MODE_4GV_NW; - break; - default: - mode = MODE_PCM; + if (format == AUDIO_FORMAT_PCM_16_BIT) { + mode = MODE_PCM; } return mode; } @@ -233,30 +201,6 @@ static int voip_set_rate(struct audio_device *adev, int rate) return 0; } -static int voip_set_evrc_min_max_rate(struct audio_device *adev, int min_rate, - int max_rate) -{ - struct mixer_ctl *ctl; - const char *mixer_ctl_name = "Voip Evrc Min Max Rate Config"; - uint32_t set_values[ ] = {0, 0}; - - ALOGD("%s: enter, min_rate=%d, max_rate=%d", - __func__, min_rate, max_rate); - - set_values[0] = min_rate; - set_values[1] = max_rate; - ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name); - if (!ctl) { - ALOGE("%s: Could not get ctl for mixer cmd - %s", - __func__, mixer_ctl_name); - return -EINVAL; - } - mixer_ctl_set_array(ctl, set_values, ARRAY_SIZE(set_values)); - - ALOGV("%s: exit", __func__); - return 0; -} - static int voip_set_dtx(struct audio_device *adev, bool enable) { struct mixer_ctl *ctl; @@ -438,26 +382,6 @@ int voice_extn_compress_voip_set_parameters(struct audio_device *adev, if (err >= 0) { rate = atoi(value); voip_set_rate(adev, rate); - voip_set_evrc_min_max_rate(adev, rate, rate); - } - - memset(value, 0, sizeof(value)); - err = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_VOIP_EVRC_RATE_MIN, - value, sizeof(value)); - if (err >= 0) { - min_rate = atoi(value); - str_parms_del(parms, AUDIO_PARAMETER_KEY_VOIP_EVRC_RATE_MIN); - memset(value, 0, sizeof(value)); - err = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_VOIP_EVRC_RATE_MAX, - value, sizeof(value)); - if (err >= 0) { - max_rate = atoi(value); - voip_set_evrc_min_max_rate(adev, min_rate, max_rate); - } else { - ALOGE("%s: AUDIO_PARAMETER_KEY_VOIP_EVRC_RATE_MAX not found", __func__); - ret = -EINVAL; - goto done; - } } memset(value, 0, sizeof(value)); @@ -780,22 +704,11 @@ bool voice_extn_compress_voip_is_active(struct audio_device *adev) bool voice_extn_compress_voip_is_format_supported(audio_format_t format) { - switch (format) { - case AUDIO_FORMAT_PCM_16_BIT: - if (voice_extn_compress_voip_pcm_prop_check()) - return true; - else - return false; - case AUDIO_FORMAT_AMR_NB: - case AUDIO_FORMAT_AMR_WB: - case AUDIO_FORMAT_EVRC: - case AUDIO_FORMAT_EVRCB: - case AUDIO_FORMAT_EVRCWB: - case AUDIO_FORMAT_EVRCNW: - return true; - default: - return false; - } + if (format == AUDIO_FORMAT_PCM_16_BIT && + voice_extn_compress_voip_pcm_prop_check()) + return true; + else + return false; } bool voice_extn_compress_voip_is_config_supported(struct audio_config *config)