diff options
| author | Ravi Kumar Alamanda <ralama@codeaurora.org> | 2013-11-11 21:09:07 -0800 |
|---|---|---|
| committer | Vineeta Srivastava <vsrivastava@google.com> | 2013-11-12 11:29:40 -0800 |
| commit | 8bba9e957f56100d4e1464d576121273ffa434eb (patch) | |
| tree | 933031f9a8ccd105540ae352dfb1ccd11257bb44 /hal | |
| parent | a16217ce0f296f69110ebd2cd773a2751c883c7d (diff) | |
| download | android_hardware_qcom_audio-8bba9e957f56100d4e1464d576121273ffa434eb.tar.gz android_hardware_qcom_audio-8bba9e957f56100d4e1464d576121273ffa434eb.tar.bz2 android_hardware_qcom_audio-8bba9e957f56100d4e1464d576121273ffa434eb.zip | |
hal: Fix the audio loss issue on codec back end
- Start music playback, plug in and plug out headset and press
'Next' button in the Music app immediately. Repeating these steps
result complete loss of audio on HW codec.
- When headset is pluged out and Next is pressed immediately, the
audio HAL triggers audio routing change from Headset to Speaker,
and closure of compress playback driver. The later is not lock
protected which result un protected access of back end information
in the ALSA framework. This leads to incorrect routing and hence
loss of audio. It is also observed that sometimes it could lead
to crash in kernel and phone reboots.
- Fix by ensuring that the kernel driver close is also lock protected
along with other routing events.
Bug: 11088400
Change-Id: I785effb09e5cef7ba20ee43e0ef91dc296d4e58a
Diffstat (limited to 'hal')
| -rw-r--r-- | hal/audio_hw.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hal/audio_hw.c b/hal/audio_hw.c index 0b603d7d..48c426da 100644 --- a/hal/audio_hw.c +++ b/hal/audio_hw.c @@ -1184,6 +1184,7 @@ static int out_standby(struct audio_stream *stream) pthread_mutex_lock(&out->lock); if (!out->standby) { + pthread_mutex_lock(&adev->lock); out->standby = true; if (out->usecase != USECASE_AUDIO_PLAYBACK_OFFLOAD) { if (out->pcm) { @@ -1199,7 +1200,6 @@ static int out_standby(struct audio_stream *stream) out->compr = NULL; } } - pthread_mutex_lock(&adev->lock); stop_output_stream(out); pthread_mutex_unlock(&adev->lock); } @@ -1673,12 +1673,12 @@ static int in_standby(struct audio_stream *stream) ALOGV("%s: enter", __func__); pthread_mutex_lock(&in->lock); if (!in->standby) { + pthread_mutex_lock(&adev->lock); in->standby = true; if (in->pcm) { pcm_close(in->pcm); in->pcm = NULL; } - pthread_mutex_lock(&adev->lock); status = stop_input_stream(in); pthread_mutex_unlock(&adev->lock); } |
