diff options
Diffstat (limited to 'hal')
-rw-r--r-- | hal/audio_extn/a2dp.c | 10 | ||||
-rw-r--r-- | hal/audio_extn/audio_extn.c | 82 | ||||
-rw-r--r-- | hal/audio_extn/audio_extn.h | 10 | ||||
-rw-r--r-- | hal/audio_hw.c | 24 | ||||
-rw-r--r-- | hal/msm8974/hw_info.c | 3 | ||||
-rw-r--r-- | hal/msm8974/platform.c | 104 | ||||
-rw-r--r-- | hal/msm8974/platform.h | 2 | ||||
-rw-r--r-- | hal/voice_extn/voice_extn.c | 3 |
8 files changed, 200 insertions, 38 deletions
diff --git a/hal/audio_extn/a2dp.c b/hal/audio_extn/a2dp.c index bcdcb1cc..534abb36 100644 --- a/hal/audio_extn/a2dp.c +++ b/hal/audio_extn/a2dp.c @@ -1807,10 +1807,14 @@ static void audio_a2dp_update_tws_channel_mode() { char* channel_mode; struct mixer_ctl *ctl_channel_mode; + + ALOGD("Update tws for mono_mode on=%d",a2dp.is_tws_mono_mode_on); + if (a2dp.is_tws_mono_mode_on) channel_mode = "One"; else channel_mode = "Two"; + ctl_channel_mode = mixer_get_ctl_by_name(a2dp.adev->mixer,MIXER_FMT_TWS_CHANNEL_MODE); if (!ctl_channel_mode) { ALOGE("failed to get tws mixer ctl"); @@ -1851,14 +1855,8 @@ static int update_aptx_dsp_config_v2(struct aptx_enc_cfg_t *aptx_dsp_cfg, break; case 2: default: - if (!a2dp.is_tws_mono_mode_on) { aptx_dsp_cfg->custom_cfg.channel_mapping[0] = PCM_CHANNEL_L; aptx_dsp_cfg->custom_cfg.channel_mapping[1] = PCM_CHANNEL_R; - } - else { - a2dp.is_tws_mono_mode_on = true; - ALOGD("Update tws for mono_mode_on: %d",a2dp.is_tws_mono_mode_on); - } break; } a2dp.enc_channels = aptx_dsp_cfg->custom_cfg.num_channels; diff --git a/hal/audio_extn/audio_extn.c b/hal/audio_extn/audio_extn.c index 05da79fd..d5f303fc 100644 --- a/hal/audio_extn/audio_extn.c +++ b/hal/audio_extn/audio_extn.c @@ -192,6 +192,7 @@ static bool audio_extn_compress_in_enabled = false; static bool audio_extn_battery_listener_enabled = false; static bool audio_extn_maxx_audio_enabled = false; static bool audio_extn_audiozoom_enabled = false; +static bool audio_extn_hifi_filter_enabled = false; #define AUDIO_PARAMETER_KEY_AANC_NOISE_LEVEL "aanc_noise_level" #define AUDIO_PARAMETER_KEY_ANC "anc_enabled" @@ -5164,6 +5165,87 @@ bool audio_extn_battery_properties_is_charging() } // END: BATTERY_LISTENER ================================================================ +// START: HiFi Filter Feature ============================================================ +void audio_extn_enable_hifi_filter(struct audio_device *adev, bool value) +{ + const char *mixer_ctl_name = "HiFi Filter"; + struct mixer_ctl *ctl = NULL; + ctl = mixer_get_ctl_by_name(adev->mixer, mixer_ctl_name); + if (!ctl) { + ALOGE("%s: Could not get ctl for mixer cmd - %s, using default control", + __func__, mixer_ctl_name); + return; + } else { + mixer_ctl_set_value(ctl, 0, value); + ALOGD("%s: mixer_value set %d", __func__, value); + } + return; +} + +void audio_extn_hifi_filter_set_params(struct str_parms *parms, + char *value, int len) +{ + int ret = 0; + ret = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_HIFI_AUDIO_FILTER, value,len); + if (ret >= 0) { + if (value && !strncmp(value, "true", sizeof("true"))) + audio_extn_hifi_filter_enabled = true; + else + audio_extn_hifi_filter_enabled = false; + str_parms_del(parms, AUDIO_PARAMETER_KEY_HIFI_AUDIO_FILTER); + } +} + +bool audio_extn_hifi_check_usecase_params(int sample_rate, int usecase) +{ + if (sample_rate != 48000 && sample_rate != 44100) + return false; + if (usecase == USECASE_AUDIO_PLAYBACK_LOW_LATENCY || usecase == USECASE_AUDIO_PLAYBACK_ULL) + return false; + return true; +} + +bool audio_extn_is_hifi_filter_enabled(struct audio_device* adev, struct stream_out *out, + snd_device_t snd_device, char *codec_variant, + int channels, int usecase_init) +{ + int na_mode = platform_get_native_support(); + struct audio_usecase *uc = NULL; + struct listnode *node = NULL; + bool hifi_active = false; + + if (audio_extn_hifi_filter_enabled) { + /*Restricting the feature for Tavil and WCD9375 codecs only*/ + if ((strstr(codec_variant, "WCD9385") || strstr(codec_variant, "WCD9375")) + && (na_mode == NATIVE_AUDIO_MODE_MULTIPLE_MIX_IN_DSP) && channels <=2) { + /*Upsampling 8 time should be restricited to headphones playback only */ + if (snd_device == SND_DEVICE_OUT_HEADPHONES + || snd_device == SND_DEVICE_OUT_HEADPHONES_44_1 + || snd_device == SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER + || usecase_init) { + if (audio_extn_hifi_check_usecase_params(out->sample_rate, + out->usecase) && !usecase_init) + return true; + + list_for_each(node, &adev->usecase_list) { + /* checking if hifi_filter is already active to set */ + /* concurrent playback sessions with hifi_filter enabled*/ + uc = node_to_item(node, struct audio_usecase, list); + struct stream_out *curr_out = (struct stream_out*) uc->stream.out; + if (uc->type == PCM_PLAYBACK && curr_out + && audio_extn_hifi_check_usecase_params( + curr_out->sample_rate, curr_out->usecase) && + (curr_out->channel_mask == AUDIO_CHANNEL_OUT_STEREO || + curr_out->channel_mask == AUDIO_CHANNEL_OUT_MONO)) + hifi_active = true; + } + } + } + } + return hifi_active; +} +// END: HiFi Filter Feature ============================================================== + // START: AUDIOZOOM_FEATURE ===================================================================== #ifdef __LP64__ #define AUDIOZOOM_LIB_PATH "/vendor/lib64/libaudiozoom.so" diff --git a/hal/audio_extn/audio_extn.h b/hal/audio_extn/audio_extn.h index b1f4dda7..74581cd8 100644 --- a/hal/audio_extn/audio_extn.h +++ b/hal/audio_extn/audio_extn.h @@ -116,6 +116,8 @@ int audio_extn_parse_compress_metadata(struct stream_out *out, #define MAX_LENGTH_MIXER_CONTROL_IN_INT (128) #define HW_INFO_ARRAY_MAX_SIZE 32 +#define AUDIO_PARAMETER_KEY_HIFI_AUDIO_FILTER "hifi_filter" + struct snd_card_split { char device[HW_INFO_ARRAY_MAX_SIZE]; char snd_card[HW_INFO_ARRAY_MAX_SIZE]; @@ -261,6 +263,14 @@ int32_t audio_extn_read_afe_proxy_channel_masks(struct stream_out *out); int32_t audio_extn_get_afe_proxy_channel_count(); //END: AFE_PROXY_FEATURE +//START: HIFI FILTER +void audio_extn_enable_hifi_filter(struct audio_device *adev, bool value); +void audio_extn_hifi_filter_set_params(struct str_parms *parms, char *value, int len); +bool audio_extn_is_hifi_filter_enabled(struct audio_device* adev,struct stream_out *out, + snd_device_t snd_device, char *codec_variant, + int channels, int usecase_init); +//END: HIFI FILTER + /// ---- USB feature --------------------------------------------------------------- void audio_extn_usb_init(void *adev); void audio_extn_usb_deinit(); diff --git a/hal/audio_hw.c b/hal/audio_hw.c index b17e4b2f..5bbd5956 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -8162,16 +8162,13 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) if (strcmp(value, AUDIO_PARAMETER_VALUE_ON) == 0){ adev->bt_sco_on = true; } else { - ALOGD("sco is off, reset sco and route device to handset/mic"); + ALOGD("sco is off, reset sco and route device to handset mic"); adev->bt_sco_on = false; audio_extn_sco_reset_configuration(); list_for_each(node, &adev->usecase_list) { usecase = node_to_item(node, struct audio_usecase, list); - if ((usecase->type == PCM_PLAYBACK) && usecase->stream.out && - (usecase->stream.out->devices & AUDIO_DEVICE_OUT_ALL_SCO)) - usecase->stream.out->devices = AUDIO_DEVICE_OUT_EARPIECE; - else if ((usecase->type == PCM_CAPTURE) && usecase->stream.in && - (usecase->stream.in->device & AUDIO_DEVICE_IN_ALL_SCO)) + if ((usecase->type == PCM_CAPTURE) && usecase->stream.in && + (usecase->stream.in->device & AUDIO_DEVICE_IN_ALL_SCO)) usecase->stream.in->device = AUDIO_DEVICE_IN_BUILTIN_MIC; else continue; @@ -9509,11 +9506,10 @@ static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *ou pthread_mutex_unlock(&out->compr_mute_lock); } } else { - // mute compress stream if suspended - pthread_mutex_lock(&out->compr_mute_lock); - if ((out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) && - (!out->a2dp_compress_mute)) { - if (!out->standby) { + if (out->flags & AUDIO_OUTPUT_FLAG_COMPRESS_OFFLOAD) { + // mute compress stream if suspended + pthread_mutex_lock(&out->compr_mute_lock); + if (!out->a2dp_compress_mute && !out->standby) { ALOGD("%s: selecting speaker and muting stream", __func__); devices = out->devices; out->devices = AUDIO_DEVICE_OUT_SPEAKER; @@ -9530,8 +9526,12 @@ static int check_a2dp_restore_l(struct audio_device *adev, struct stream_out *ou out->volume_l = left_p; out->volume_r = right_p; } + pthread_mutex_unlock(&out->compr_mute_lock); + } else { + // tear down a2dp path for non offloaded streams + if (audio_extn_a2dp_source_is_suspended()) + out_standby_l(&out->stream.common); } - pthread_mutex_unlock(&out->compr_mute_lock); } ALOGV("%s: exit", __func__); return 0; diff --git a/hal/msm8974/hw_info.c b/hal/msm8974/hw_info.c index 8e3ad293..5113cffc 100644 --- a/hal/msm8974/hw_info.c +++ b/hal/msm8974/hw_info.c @@ -64,7 +64,8 @@ static const snd_device_t wsa_combo_devices[] = { SND_DEVICE_OUT_SPEAKER_AND_LINE, SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1, SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2, - SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET + SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET, + SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER }; static const snd_device_t taiko_fluid_variant_devices[] = { diff --git a/hal/msm8974/platform.c b/hal/msm8974/platform.c index 297c2dcb..0da267c9 100644 --- a/hal/msm8974/platform.c +++ b/hal/msm8974/platform.c @@ -298,6 +298,7 @@ struct platform_data { bool ec_ref_enabled; bool is_wsa_speaker; bool hifi_audio; + bool is_cls_ab_only_supported; bool is_i2s_ext_modem; bool is_acdb_initialized; /* Vbat monitor related flags */ @@ -498,6 +499,8 @@ static const char * const device_table[SND_DEVICE_MAX] = { [SND_DEVICE_OUT_SPEAKER_SAFE] = "speaker-safe", [SND_DEVICE_OUT_HEADPHONES] = "headphones", [SND_DEVICE_OUT_HEADPHONES_DSD] = "headphones-dsd", + [SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER] = "headphones-hifi-filter", + [SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER] = "speaker-and-headphones-hifi-filter", [SND_DEVICE_OUT_HEADPHONES_44_1] = "headphones-44.1", [SND_DEVICE_OUT_LINE] = "line", [SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES] = "speaker-and-headphones", @@ -830,6 +833,8 @@ static int acdb_device_table[SND_DEVICE_MAX] = { [SND_DEVICE_OUT_TRANSMISSION_FM] = 0, [SND_DEVICE_OUT_ANC_HEADSET] = 26, [SND_DEVICE_OUT_ANC_FB_HEADSET] = 27, + [SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER] = 188, + [SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER] = 188, [SND_DEVICE_OUT_VOICE_ANC_HEADSET] = 26, [SND_DEVICE_OUT_VOICE_ANC_FB_HEADSET] = 27, [SND_DEVICE_OUT_SPEAKER_AND_ANC_HEADSET] = 26, @@ -999,6 +1004,8 @@ static struct name_to_index snd_device_name_index[SND_DEVICE_MAX] = { {TO_NAME_INDEX(SND_DEVICE_OUT_SPEAKER_SAFE)}, {TO_NAME_INDEX(SND_DEVICE_OUT_HEADPHONES)}, {TO_NAME_INDEX(SND_DEVICE_OUT_HEADPHONES_DSD)}, + {TO_NAME_INDEX(SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER)}, + {TO_NAME_INDEX(SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER)}, {TO_NAME_INDEX(SND_DEVICE_OUT_HEADPHONES_44_1)}, {TO_NAME_INDEX(SND_DEVICE_OUT_LINE)}, {TO_NAME_INDEX(SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES)}, @@ -2118,6 +2125,9 @@ static void set_platform_defaults(struct platform_data * my_data) backend_tag_table[SND_DEVICE_IN_CAPTURE_FM] = strdup("capture-fm"); backend_tag_table[SND_DEVICE_OUT_TRANSMISSION_FM] = strdup("transmission-fm"); backend_tag_table[SND_DEVICE_OUT_HEADPHONES_DSD] = strdup("headphones-dsd"); + backend_tag_table[SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER] = strdup("headphones-hifi-filter"); + backend_tag_table[SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER] = + strdup("speaker-and-headphones-hifi-filter"); backend_tag_table[SND_DEVICE_OUT_HEADPHONES_44_1] = strdup("headphones-44.1"); backend_tag_table[SND_DEVICE_OUT_VOICE_SPEAKER_VBAT] = strdup("voice-speaker-vbat"); backend_tag_table[SND_DEVICE_OUT_VOICE_SPEAKER_2_VBAT] = strdup("voice-speaker-2-vbat"); @@ -3185,7 +3195,6 @@ void *platform_init(struct audio_device *adev) my_data->hifi_audio = true; set_platform_defaults(my_data); - /* Initialize ACDB ID's */ if (my_data->is_i2s_ext_modem && !is_auto_snd_card(snd_card_name)) platform_info_init(PLATFORM_INFO_XML_PATH_I2S, my_data, PLATFORM); @@ -3676,6 +3685,11 @@ acdb_init_fail: my_data->adev->snd_card, my_data->codec_version); + /* WCD9370 codec variant only supports Class AB power mode */ + if (strstr(my_data->codec_variant, "WCD9370")) { + my_data->is_cls_ab_only_supported = true; + } + if (NATIVE_AUDIO_MODE_INVALID != platform_get_native_support()) { /* * Native playback is enabled from the UI. @@ -4882,6 +4896,9 @@ int platform_get_backend_index(snd_device_t snd_device) if (strncmp(backend_tag_table[snd_device], "headphones-44.1", sizeof("headphones-44.1")) == 0) port = HEADPHONE_44_1_BACKEND; + else if (strncmp(backend_tag_table[snd_device], "headphones-hifi-filter", + sizeof("headphones-hifi-filter")) == 0) + port = HEADPHONE_BACKEND; else if (strncmp(backend_tag_table[snd_device], "headphones-dsd", sizeof("headphones-dsd")) == 0) port = DSD_NATIVE_BACKEND; @@ -5508,6 +5525,12 @@ int platform_split_snd_device(void *platform, new_snd_devices[0] = SND_DEVICE_OUT_SPEAKER; new_snd_devices[1] = SND_DEVICE_OUT_USB_HEADSET; ret = 0; + } else if (snd_device == SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER && + !platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER)) { + *num_devices = 2; + new_snd_devices[0] = SND_DEVICE_OUT_SPEAKER; + new_snd_devices[1] = SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER; + ret = 0; } else if (snd_device == SND_DEVICE_OUT_SPEAKER_AND_BT_SCO && !platform_check_backends_match(SND_DEVICE_OUT_SPEAKER, SND_DEVICE_OUT_BT_SCO)) { *num_devices = 2; @@ -5691,6 +5714,9 @@ snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *o snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2; else if (is_active_voice_call) snd_device = SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES; + else if (audio_extn_is_hifi_filter_enabled(adev, out, snd_device, + my_data->codec_variant, channel_count, 1)) + snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER; else snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES; } else if (devices == (AUDIO_DEVICE_OUT_LINE | @@ -5714,6 +5740,9 @@ snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *o snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_1; else if (my_data->external_spk_2) snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_EXTERNAL_2; + else if (audio_extn_is_hifi_filter_enabled(adev, out, snd_device, + my_data->codec_variant, channel_count, 1)) + snd_device = SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER; else { if (is_active_voice_call) snd_device = SND_DEVICE_OUT_VOICE_SPEAKER_AND_VOICE_HEADPHONES; @@ -5980,6 +6009,11 @@ snd_device_t platform_get_output_snd_device(void *platform, struct stream_out *o snd_device = SND_DEVICE_OUT_HEADPHONES_44_1; } else if (out->format == AUDIO_FORMAT_DSD) { snd_device = SND_DEVICE_OUT_HEADPHONES_DSD; + } else if (audio_extn_is_hifi_filter_enabled(adev, out, snd_device, + my_data->codec_variant, channel_count, 1)) { + snd_device = SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER; + } else if (devices & SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER) { + snd_device = SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER; } else if (devices & AUDIO_DEVICE_OUT_LINE) { snd_device = SND_DEVICE_OUT_LINE; } else @@ -7177,7 +7211,7 @@ static void true_32_bit_set_params(struct str_parms *parms, ret = str_parms_get_str(parms, AUDIO_PARAMETER_KEY_TRUE_32_BIT, value,len); if (ret >= 0) { - if (value && !strncmp(value, "true", sizeof("src"))) + if (value && !strncmp(value, "true", sizeof("true"))) supports_true_32_bit = true; else supports_true_32_bit = false; @@ -7527,6 +7561,7 @@ int platform_set_parameters(void *platform, struct str_parms *parms) audio_extn_hfp_set_parameters(my_data->adev, parms); perf_lock_set_params(platform, parms, value, len); true_32_bit_set_params(parms, value, len); + audio_extn_hifi_filter_set_params(parms, value, len); platform_spkr_device_set_params(platform, parms, value, len); done: ALOGV("%s: exit with code(%d)", __func__, ret); @@ -8602,6 +8637,12 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev, if (channels < out_channels) channels = out_channels; } + if ((snd_device == SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER) && + (usecase->id==USECASE_AUDIO_PLAYBACK_LOW_LATENCY || + usecase->id == USECASE_AUDIO_PLAYBACK_ULL)) { + sample_rate = my_data->current_backend_cfg[backend_idx].sample_rate; + bit_width = my_data->current_backend_cfg[backend_idx].bit_width; + } } } } @@ -8701,6 +8742,37 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev, } } + if (backend_idx != platform_get_voice_call_backend(adev) + && usecase->type == PCM_PLAYBACK) { + struct stream_out *out = (struct stream_out*) usecase->stream.out; + if(audio_extn_is_hifi_filter_enabled(adev, out, snd_device, + my_data->codec_variant, channels, 0)) { + switch (sample_rate) { + case 48000: + audio_extn_enable_hifi_filter(adev, true); + if (audio_is_true_native_stream_active(adev)) + sample_rate = 352800; + else + sample_rate = 384000; + bit_width = 32; + break; + case 44100: + audio_extn_enable_hifi_filter(adev, true); + sample_rate = 352800; + bit_width = 32; + break; + default: + audio_extn_enable_hifi_filter(adev, false); + } + } + if (snd_device != SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER) + audio_extn_enable_hifi_filter(adev, false); + ALOGD("%s:becf: updated afe: bitwidth %d, samplerate %d channels %d," + "backend_idx %d usecase = %d device (%s)", __func__, bit_width, + sample_rate, channels, backend_idx, usecase->id, + platform_get_snd_device_name(snd_device)); + } + /* * Handset and speaker may have diffrent backend. Check if the device is speaker or handset, * and these devices are restricited to 48kHz. @@ -8813,14 +8885,19 @@ static bool platform_check_codec_backend_cfg(struct audio_device* adev, } if (snd_device == SND_DEVICE_OUT_HEADPHONES || snd_device == - SND_DEVICE_OUT_HEADPHONES_44_1) { - if (sample_rate > 48000 || - (bit_width >= 24 && (sample_rate == 48000 || sample_rate == 44100))) { - ALOGI("%s: apply HPH HQ mode\n", __func__); - audio_route_apply_and_update_path(adev->audio_route, "hph-highquality-mode"); + SND_DEVICE_OUT_HEADPHONES_44_1 || snd_device == SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER) { + if (my_data->is_cls_ab_only_supported) { + ALOGI("%s: apply CLS AB HPH power mode\n", __func__); + audio_route_apply_and_update_path(adev->audio_route, "hph-class-ab-mode"); } else { - ALOGI("%s: apply HPH LP mode\n", __func__); - audio_route_apply_and_update_path(adev->audio_route, "hph-lowpower-mode"); + if (sample_rate > 48000 || + (bit_width >= 24 && (sample_rate == 48000 || sample_rate == 44100))) { + ALOGI("%s: apply HPH HQ mode\n", __func__); + audio_route_apply_and_update_path(adev->audio_route, "hph-highquality-mode"); + } else { + ALOGI("%s: apply HPH LP mode\n", __func__); + audio_route_apply_and_update_path(adev->audio_route, "hph-lowpower-mode"); + } } } @@ -10523,7 +10600,6 @@ int platform_set_swap_mixer(struct audio_device *adev, bool swap_channels) { const char *mixer_ctl_name = "Swap channel"; struct mixer_ctl *ctl; - const char *mixer_path; struct platform_data *my_data = (struct platform_data *)adev->platform; // forced to set to swap, but device not rotated ... ignore set @@ -10532,14 +10608,6 @@ int platform_set_swap_mixer(struct audio_device *adev, bool swap_channels) ALOGV("%s:", __func__); - if (swap_channels) { - mixer_path = platform_get_snd_device_name(SND_DEVICE_OUT_SPEAKER_REVERSE); - audio_route_apply_and_update_path(adev->audio_route, mixer_path); - } else { - mixer_path = platform_get_snd_device_name(SND_DEVICE_OUT_SPEAKER); - audio_route_apply_and_update_path(adev->audio_route, mixer_path); - } - 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); diff --git a/hal/msm8974/platform.h b/hal/msm8974/platform.h index f638b44a..dc2dc5cd 100644 --- a/hal/msm8974/platform.h +++ b/hal/msm8974/platform.h @@ -92,8 +92,10 @@ enum { SND_DEVICE_OUT_LINE, SND_DEVICE_OUT_HEADPHONES, SND_DEVICE_OUT_HEADPHONES_DSD, + SND_DEVICE_OUT_HEADPHONES_HIFI_FILTER, SND_DEVICE_OUT_HEADPHONES_44_1, SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES, + SND_DEVICE_OUT_SPEAKER_AND_HEADPHONES_HIFI_FILTER, SND_DEVICE_OUT_SPEAKER_SAFE_AND_HEADPHONES, SND_DEVICE_OUT_SPEAKER_AND_LINE, SND_DEVICE_OUT_SPEAKER_SAFE_AND_LINE, diff --git a/hal/voice_extn/voice_extn.c b/hal/voice_extn/voice_extn.c index e6a4ed65..1d7a2840 100644 --- a/hal/voice_extn/voice_extn.c +++ b/hal/voice_extn/voice_extn.c @@ -753,8 +753,9 @@ int voice_extn_check_and_set_incall_music_usecase(struct audio_device *adev, out->config.rate = out->sample_rate; ALOGV("%s: mode=%d, usecase id=%d", __func__, adev->mode, out->usecase); + return 0; } - return 0; + return -ENOSYS; } |