OSDN Git Service

Issue 5247986: Battery drain due to audio wakelock
authorEric Laurent <elaurent@google.com>
Tue, 6 Sep 2011 19:36:15 +0000 (12:36 -0700)
committerEric Laurent <elaurent@google.com>
Tue, 6 Sep 2011 21:37:20 +0000 (14:37 -0700)
commit408b8dc3c0a364c6f6b4991d15da9e6bcc2b8008
treef5f9885d8b86fc8073678962a8d38eec4ebef2a4
parent3a13fad63af40a8364fce796b1a54a8f0a2fbf32
Issue 5247986: Battery drain due to audio wakelock

The problem occurs when activating or deactivating A2DP connection
while SoudPool has a channel active. This can happen quite frequently now
that the UI sound effects are enabled by default.
If PCM data is remaining in the AudioTrack buffer when it is restroyed and
re-created on the new AudioFlinger output thread, this data is flushed.
As a consequence, no underrun or request for new data callback is sent to
SoundPool and the sound channel remains active for ever as the end of the
sample is never detected.

Change-Id: I13e0c11e4ce3f83bff7f58d347ca814b6a86712b
media/libmedia/AudioTrack.cpp