Loading hal/audio_extn/a2dp.c +6 −4 Original line number Diff line number Diff line Loading @@ -3136,9 +3136,11 @@ int sco_start_configuration() void sco_reset_configuration() { if (a2dp.swb_configured) { ALOGD("sco_reset_configuration start"); reset_codec_config(); a2dp.bt_encoder_format = CODEC_TYPE_INVALID; a2dp.swb_configured = false; } } hal/audio_hw.c +21 −11 Original line number Diff line number Diff line Loading @@ -1301,14 +1301,7 @@ int disable_snd_device(struct audio_device *adev, audio_extn_a2dp_stop_playback(); else if (snd_device == SND_DEVICE_IN_BT_A2DP) audio_extn_a2dp_stop_capture(); else if ((snd_device == SND_DEVICE_OUT_BT_SCO_SWB) || (snd_device == SND_DEVICE_IN_BT_SCO_MIC_SWB_NREC) || (snd_device == SND_DEVICE_IN_BT_SCO_MIC_SWB)) { if ((adev->snd_dev_ref_cnt[SND_DEVICE_OUT_BT_SCO_SWB] == 0) && (adev->snd_dev_ref_cnt[SND_DEVICE_IN_BT_SCO_MIC_SWB_NREC] == 0) && (adev->snd_dev_ref_cnt[SND_DEVICE_IN_BT_SCO_MIC_SWB] == 0)) audio_extn_sco_reset_configuration(); } else if ((snd_device == SND_DEVICE_OUT_HDMI) || else if ((snd_device == SND_DEVICE_OUT_HDMI) || (snd_device == SND_DEVICE_OUT_DISPLAY_PORT)) adev->is_channel_status_set = false; else if ((snd_device == SND_DEVICE_OUT_HEADPHONES) && Loading Loading @@ -7716,6 +7709,8 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) int ret; int status = 0; bool a2dp_reconfig = false; struct listnode *node; struct audio_usecase *usecase = NULL; ALOGD("%s: enter: %s", __func__, kvpairs); parms = str_parms_create_str(kvpairs); Loading @@ -7723,16 +7718,31 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) if (!parms) goto error; pthread_mutex_lock(&adev->lock); ret = str_parms_get_str(parms, "BT_SCO", value, sizeof(value)); if (ret >= 0) { /* When set to false, HAL should disable EC and NS */ if (strcmp(value, AUDIO_PARAMETER_VALUE_ON) == 0) if (strcmp(value, AUDIO_PARAMETER_VALUE_ON) == 0){ adev->bt_sco_on = true; else } else { 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)) usecase->stream.in->device = AUDIO_DEVICE_IN_BUILTIN_MIC; else continue; select_devices(adev, usecase->id); } } } pthread_mutex_lock(&adev->lock); status = voice_set_parameters(adev, parms); if (status != 0) goto done; Loading Loading
hal/audio_extn/a2dp.c +6 −4 Original line number Diff line number Diff line Loading @@ -3136,9 +3136,11 @@ int sco_start_configuration() void sco_reset_configuration() { if (a2dp.swb_configured) { ALOGD("sco_reset_configuration start"); reset_codec_config(); a2dp.bt_encoder_format = CODEC_TYPE_INVALID; a2dp.swb_configured = false; } }
hal/audio_hw.c +21 −11 Original line number Diff line number Diff line Loading @@ -1301,14 +1301,7 @@ int disable_snd_device(struct audio_device *adev, audio_extn_a2dp_stop_playback(); else if (snd_device == SND_DEVICE_IN_BT_A2DP) audio_extn_a2dp_stop_capture(); else if ((snd_device == SND_DEVICE_OUT_BT_SCO_SWB) || (snd_device == SND_DEVICE_IN_BT_SCO_MIC_SWB_NREC) || (snd_device == SND_DEVICE_IN_BT_SCO_MIC_SWB)) { if ((adev->snd_dev_ref_cnt[SND_DEVICE_OUT_BT_SCO_SWB] == 0) && (adev->snd_dev_ref_cnt[SND_DEVICE_IN_BT_SCO_MIC_SWB_NREC] == 0) && (adev->snd_dev_ref_cnt[SND_DEVICE_IN_BT_SCO_MIC_SWB] == 0)) audio_extn_sco_reset_configuration(); } else if ((snd_device == SND_DEVICE_OUT_HDMI) || else if ((snd_device == SND_DEVICE_OUT_HDMI) || (snd_device == SND_DEVICE_OUT_DISPLAY_PORT)) adev->is_channel_status_set = false; else if ((snd_device == SND_DEVICE_OUT_HEADPHONES) && Loading Loading @@ -7716,6 +7709,8 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) int ret; int status = 0; bool a2dp_reconfig = false; struct listnode *node; struct audio_usecase *usecase = NULL; ALOGD("%s: enter: %s", __func__, kvpairs); parms = str_parms_create_str(kvpairs); Loading @@ -7723,16 +7718,31 @@ static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) if (!parms) goto error; pthread_mutex_lock(&adev->lock); ret = str_parms_get_str(parms, "BT_SCO", value, sizeof(value)); if (ret >= 0) { /* When set to false, HAL should disable EC and NS */ if (strcmp(value, AUDIO_PARAMETER_VALUE_ON) == 0) if (strcmp(value, AUDIO_PARAMETER_VALUE_ON) == 0){ adev->bt_sco_on = true; else } else { 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)) usecase->stream.in->device = AUDIO_DEVICE_IN_BUILTIN_MIC; else continue; select_devices(adev, usecase->id); } } } pthread_mutex_lock(&adev->lock); status = voice_set_parameters(adev, parms); if (status != 0) goto done; Loading