diff options
author | Iliyan Malchev <malchev@google.com> | 2010-10-13 19:25:45 -0700 |
---|---|---|
committer | Iliyan Malchev <malchev@google.com> | 2010-10-13 19:25:45 -0700 |
commit | b508a4857b07898fb8322a858c4ee9624bcf1180 (patch) | |
tree | 50d0276618b0d99c700aa7eac266a51453575614 | |
parent | 15a9e53fbeaf765bfa6ed795d270e5968b30acb8 (diff) | |
download | msm7k-b508a4857b07898fb8322a858c4ee9624bcf1180.tar.gz |
libaudio-qsd8k: acquire wakelock before starting playback
This fixes issue 2410711.
Change-Id: I01161b3febc02914f2c7a9ed3c4c9ae121ce181a
Signed-off-by: Iliyan Malchev <malchev@google.com>
-rw-r--r-- | libaudio-qsd8k/AudioHardware.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libaudio-qsd8k/AudioHardware.cpp b/libaudio-qsd8k/AudioHardware.cpp index e5108e7..db39d9e 100644 --- a/libaudio-qsd8k/AudioHardware.cpp +++ b/libaudio-qsd8k/AudioHardware.cpp @@ -1587,6 +1587,9 @@ ssize_t AudioHardware::AudioStreamOutMSM72xx::write(const void* buffer, size_t b if (mStandby) { + LOGV("acquire output wakelock"); + acquire_wake_lock(PARTIAL_WAKE_LOCK, kOutputWakelockStr); + // open driver LOGV("open pcm_out driver"); status = ::open("/dev/msm_pcm_out", O_RDWR); @@ -1637,8 +1640,6 @@ ssize_t AudioHardware::AudioStreamOutMSM72xx::write(const void* buffer, size_t b goto Error; } - LOGV("acquire output wakelock"); - acquire_wake_lock(PARTIAL_WAKE_LOCK, kOutputWakelockStr); mStandby = false; } @@ -1663,7 +1664,7 @@ Error: } // Simulate audio output timing in case of error usleep(bytes * 1000000 / frameSize() / sampleRate()); - + release_wake_lock(kOutputWakelockStr); return status; } |