diff -Nru android-20140224-0005/debian/changelog android-20140224-0005/debian/changelog --- android-20140224-0005/debian/changelog 2014-02-24 01:06:26.000000000 +0000 +++ android-20140224-0005/debian/changelog 2014-02-28 06:18:54.000000000 +0000 @@ -1,3 +1,11 @@ +android (20140224-0005-0ubuntu2) trusty; urgency=medium + + * audio_hw.c-also-releasing-primary_output-with-output.patch: + - Default output is not related by audioflinger, but in our case we + always start/stop the stream when doing voice calls. + + -- Ricardo Salveti de Araujo Fri, 28 Feb 2014 03:17:49 -0300 + android (20140224-0005-0ubuntu1) trusty; urgency=medium * New upstream snapshot: diff -Nru android-20140224-0005/debian/patches/audio_hw.c-also-releasing-primary_output-with-output.patch android-20140224-0005/debian/patches/audio_hw.c-also-releasing-primary_output-with-output.patch --- android-20140224-0005/debian/patches/audio_hw.c-also-releasing-primary_output-with-output.patch 1970-01-01 00:00:00.000000000 +0000 +++ android-20140224-0005/debian/patches/audio_hw.c-also-releasing-primary_output-with-output.patch 2014-02-28 06:17:22.000000000 +0000 @@ -0,0 +1,123 @@ +From 3b94966f8659c1b29b4deac170ba539a0518d7ea Mon Sep 17 00:00:00 2001 +From: Ricardo Salveti de Araujo +Date: Fri, 28 Feb 2014 03:12:51 -0300 +Subject: [PATCH] audio_hw.c: also releasing primary_output with output stream + +Default output is not related by audioflinger, but in our case we +always start/stop the stream when doing voice calls. + +Also changing some ALOG entries to ALOGI, so we can have a better +logcat trace for debugging. + +Change-Id: I6b75ebab9356abf4aa0edc5a91bcb144685b50d2 +Signed-off-by: Ricardo Salveti de Araujo +--- + hal/audio_hw.c | 21 +++++++++++++++------ + 1 file changed, 15 insertions(+), 6 deletions(-) + +diff --git a/hardware/qcom/audio/hal/audio_hw.c b/hardware/qcom/audio/hal/audio_hw.c +index 48c426d..a74592f 100644 +--- a/hardware/qcom/audio/hal/audio_hw.c ++++ b/hardware/qcom/audio/hal/audio_hw.c +@@ -458,6 +458,7 @@ static int select_devices(struct audio_device *adev, + struct listnode *node; + int status = 0; + ++ ALOGI("%s: enter - uc_id %d", __func__, uc_id); + usecase = get_usecase_from_list(adev, uc_id); + if (usecase == NULL) { + ALOGE("%s: Could not find the usecase(%d)", __func__, uc_id); +@@ -465,6 +466,7 @@ static int select_devices(struct audio_device *adev, + } + + if (usecase->type == VOICE_CALL) { ++ ALOGI("%s: usecase VOICE_CALL", __func__); + out_snd_device = platform_get_output_snd_device(adev->platform, + usecase->stream.out->devices); + in_snd_device = platform_get_input_snd_device(adev->platform, usecase->stream.out->devices); +@@ -477,6 +479,7 @@ static int select_devices(struct audio_device *adev, + * usecase. This is to avoid switching devices for voice call when + * check_usecases_codec_backend() is called below. + */ ++ ALOGI("%s: VOICE_CALL is active", __func__); + if (adev->in_call) { + vc_usecase = get_usecase_from_list(adev, USECASE_VOICE_CALL); + if (vc_usecase->devices & AUDIO_DEVICE_OUT_ALL_CODEC_BACKEND) { +@@ -565,6 +568,7 @@ static int select_devices(struct audio_device *adev, + + enable_audio_route(adev, usecase, true); + ++ ALOGI("%s: exit", __func__); + return status; + } + +@@ -976,7 +980,7 @@ static int stop_voice_call(struct audio_device *adev) + int i, ret = 0; + struct audio_usecase *uc_info; + +- ALOGV("%s: enter", __func__); ++ ALOGI("%s: enter", __func__); + adev->in_call = false; + + ret = platform_stop_voice_call(adev->platform); +@@ -1008,7 +1012,7 @@ static int stop_voice_call(struct audio_device *adev) + list_remove(&uc_info->list); + free(uc_info); + +- ALOGV("%s: exit: status(%d)", __func__, ret); ++ ALOGI("%s: exit: status(%d)", __func__, ret); + return ret; + } + +@@ -1257,7 +1261,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) + int ret, val = 0; + bool select_new_device = false; + +- ALOGD("%s: enter: usecase(%d: %s) kvpairs: %s", ++ ALOGI("%s: enter: usecase(%d: %s) kvpairs: %s", + __func__, out->usecase, use_case_table[out->usecase], kvpairs); + parms = str_parms_create_str(kvpairs); + ret = str_parms_get_str(parms, AUDIO_PARAMETER_STREAM_ROUTING, value, sizeof(value)); +@@ -1325,7 +1329,7 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) + } + + str_parms_destroy(parms); +- ALOGV("%s: exit: code(%d)", __func__, ret); ++ ALOGI("%s: exit: code(%d)", __func__, ret); + return ret; + } + +@@ -2010,7 +2014,7 @@ static void adev_close_output_stream(struct audio_hw_device *dev, + struct stream_out *out = (struct stream_out *)stream; + struct audio_device *adev = out->dev; + +- ALOGV("%s: enter", __func__); ++ ALOGI("%s: enter", __func__); + out_standby(&stream->common); + if (out->usecase == USECASE_AUDIO_PLAYBACK_OFFLOAD) { + destroy_offload_callback_thread(out); +@@ -2020,8 +2024,12 @@ static void adev_close_output_stream(struct audio_hw_device *dev, + } + pthread_cond_destroy(&out->cond); + pthread_mutex_destroy(&out->lock); ++ if (adev->primary_output != NULL) { ++ free(adev->primary_output); ++ adev->primary_output = NULL; ++ } + free(stream); +- ALOGV("%s: exit", __func__); ++ ALOGI("%s: exit", __func__); + } + + static int adev_set_parameters(struct audio_hw_device *dev, const char *kvpairs) +@@ -2190,6 +2198,7 @@ static int adev_get_master_mute(struct audio_hw_device *dev, bool *muted) + static int adev_set_mode(struct audio_hw_device *dev, audio_mode_t mode) + { + struct audio_device *adev = (struct audio_device *)dev; ++ ALOGI("%s: mode %x", __func__, mode); + + pthread_mutex_lock(&adev->lock); + if (adev->mode != mode) { +-- +1.9.rc1 + diff -Nru android-20140224-0005/debian/patches/series android-20140224-0005/debian/patches/series --- android-20140224-0005/debian/patches/series 2014-02-24 01:04:59.000000000 +0000 +++ android-20140224-0005/debian/patches/series 2014-02-28 06:17:34.000000000 +0000 @@ -1,3 +1,4 @@ use_local_kernel.diff disable-tests.patch emulator-disabling-translator-libs-for-64-bits.patch +audio_hw.c-also-releasing-primary_output-with-output.patch