From 2cbfd06d4970a05ce26cb39cecffbf0cb3b66436 Mon Sep 17 00:00:00 2001 From: Eric Laurent Date: Mon, 18 Jun 2012 11:46:41 -0700 Subject: audio: fix in call audio path switch issue Switching from BT SCO to earpiece does not seem to work when in call and an output stream is active. This change modifies out_set_parameters() to force the output stream into standby when a new audio path is selected while in call. Bug 6676684. Change-Id: I2817f80ea3fa3a0e00e9705fdb6d9a7e3183549b --- audio/audio_hw.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'audio') diff --git a/audio/audio_hw.c b/audio/audio_hw.c index 85cfc7b..74f2383 100644 --- a/audio/audio_hw.c +++ b/audio/audio_hw.c @@ -1797,6 +1797,8 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) } /* force standby if moving to/from HDMI/SPDIF or if the output * device changes when in HDMI/SPDIF mode */ + /* FIXME also force standby when in call as some audio path switches do not work + * while in call and an output stream is active (e.g BT SCO => earpiece) */ /* FIXME workaround for audio being dropped when switching path without forcing standby * (several hundred ms of audio can be lost: e.g beginning of a ringtone. We must understand @@ -1815,7 +1817,8 @@ static int out_set_parameters(struct audio_stream *stream, const char *kvpairs) (adev->devices & (AUDIO_DEVICE_OUT_AUX_DIGITAL | AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) || ((val & AUDIO_DEVICE_OUT_SPEAKER) ^ - (adev->devices & AUDIO_DEVICE_OUT_SPEAKER))) + (adev->devices & AUDIO_DEVICE_OUT_SPEAKER)) || + (adev->mode == AUDIO_MODE_IN_CALL)) do_output_standby(out); } if (out != adev->outputs[OUTPUT_HDMI]) { -- cgit v1.1