summaryrefslogtreecommitdiffstats
path: root/audio
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-03-16 18:59:28 -0700
committerEric Laurent <elaurent@google.com>2012-03-16 18:59:28 -0700
commit78a7609d251802da4db864dbbee37967be84514f (patch)
tree254009417b5462b93b520e16a6ec6f63a765ff65 /audio
parent3b50cc6d1c148210fa7b39b1ba48f54f8c5e558d (diff)
downloaddevice_samsung_tuna-78a7609d251802da4db864dbbee37967be84514f.zip
device_samsung_tuna-78a7609d251802da4db864dbbee37967be84514f.tar.gz
device_samsung_tuna-78a7609d251802da4db864dbbee37967be84514f.tar.bz2
audio: fix audio drop when speaker is selected
When changing audio path to speaker while playback is active, several hundred ms of audio are dropped. This is mostly noticeable when a ringtone starts playing. This change is a workaround forcing the output in standby when speaker is selected. The root cause must still be indentified and fixed. Change-Id: Idef8dc1cdbf2da499a414d0b60244f91ef66e73b
Diffstat (limited to 'audio')
-rwxr-xr-xaudio/audio_hw.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/audio/audio_hw.c b/audio/audio_hw.c
index bbd849a..850a1b1 100755
--- a/audio/audio_hw.c
+++ b/audio/audio_hw.c
@@ -1415,12 +1415,24 @@ 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 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
+ * the root cause in audio HAL, driver or ABE.
if (((val & AUDIO_DEVICE_OUT_AUX_DIGITAL) ^
(adev->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)) ||
((val & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET) ^
(adev->devices & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) ||
(adev->devices & (AUDIO_DEVICE_OUT_AUX_DIGITAL |
AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)))
+ */
+ if (((val & AUDIO_DEVICE_OUT_AUX_DIGITAL) ^
+ (adev->devices & AUDIO_DEVICE_OUT_AUX_DIGITAL)) ||
+ ((val & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET) ^
+ (adev->devices & AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) ||
+ (adev->devices & (AUDIO_DEVICE_OUT_AUX_DIGITAL |
+ AUDIO_DEVICE_OUT_DGTL_DOCK_HEADSET)) ||
+ (val == AUDIO_DEVICE_OUT_SPEAKER))
do_output_standby(out);
}
adev->devices &= ~AUDIO_DEVICE_OUT_ALL;