• Home
  • History
  • Annotate
  • only in /frameworks/base/media/jni/soundpool/
History log of /frameworks/base/media/jni/soundpool/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
ba4d0433319393d626d2169683209e4956a087e2 28-Mar-2012 James Dong <jdong@google.com> frameworks base Android.mk file changes

Change-Id: I7459b9e959a60751b8fa6e0d893cb2c820c064ce
ndroid.mk
ndroid_media_SoundPool.cpp
f5e18125498b768d4528e4d1c19533c2b16f338b 26-Mar-2012 Eric Laurent <elaurent@google.com> reorganize SoundPool and JetPlayer code.

Reorganize SoundPool and JetPlayer code to be ready for the
creation of libmedia_native.

Split SoundPool between libsoundpool (JNI) and libmedia(sound pool implementation).
Remove dependencies on nativehelper/jni.h from JetPlayer.

Change-Id: I130c6014173b714329929dd82c5dfb70b757a610
ndroid.mk
oundPool.cpp
oundPool.h
oundPoolThread.cpp
oundPoolThread.h
ndroid_media_SoundPool.cpp
ae75f994cc50837afe79d3bfbc576811e3602fef 16-Mar-2012 Glenn Kasten <gkasten@google.com> Add libmedia_native

Change-Id: Ib8cff8abd73723b793f08da99ad59549f219e0e7
ndroid.mk
28b269f3418c27275bbf635e524ed501bfac6518 07-Mar-2012 Glenn Kasten <gkasten@google.com> Use audio_policy_output_flags_t consistently

This affects:
- IAudioFlinger::openOutput
- AudioTrack::AudioTrack
- AudioTrack::set
- apps that call these

Change-Id: I26fb281bac6cb87593d17697bc9cb37a835af205
oundPool.cpp
b3db213eb55acb661e4b9ea40bcc00af4b76fab9 19-Jan-2012 Glenn Kasten <gkasten@google.com> Update comments

We no longer put the filename at start of file.

Change-Id: Ic435b159a23105681e3d4a6cb1ac097bc853302e
oundPool.cpp
1137be1a686fdfc9f02c3aca7c33f28006df4742 09-Feb-2012 Glenn Kasten <gkasten@google.com> Follow raw pointer and sp<> conventions

Unconditional delete for raw pointers.
Use "if (sp != 0)" not "if (sp.get() != 0)" or "if (sp != NULL)".
Use "if (raw != NULL)" not "if (raw)".

Change-Id: I531a8da7c37149261ed2f34b862ec4896a4b785b
oundPool.cpp
oundPool.h
bc1d77b6cbce23fbe25f7231651037ae195bc90e 13-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_stream_type_t consistently

At native level it was a mixture of audio_stream_type_t, int, uint32_t,
and uint8_t. Java is still int. Also fixed a couple of hard-coded -1
instead of AUDIO_STREAM_DEFAULT, and in startToneCommand a hard-coded 0
instead of AUDIO_STREAM_VOICE_CALL.

Change-Id: Ia33bfd70edca8c2daec9052984b369cd8eee2a83
oundPool.cpp
oundPool.h
ndroid_media_SoundPool.cpp
1c66547ba25be6a1893df0ae26857f649474843a 12-Jan-2012 Glenn Kasten <gkasten@google.com> Merge "Use audio_format_t consistently"
3762c311729fe9f3af085c14c5c1fb471d994c03 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGE(_IF) to (IF_)ALOGE(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/157220

Bug: 5449033
Change-Id: Ic9c19d30693bd56755f55906127cd6bd7126096c
oundPool.cpp
ndroid_media_SoundPool.cpp
8564c8da817a845353d213acd8636b76f567b234 06-Jan-2012 Steve Block <steveblock@google.com> Rename (IF_)LOGW(_IF) to (IF_)ALOGW(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/157065

Bug: 5449033
Change-Id: I00a4b904f9449e6f93b7fd35eac28640d7929e69
oundPool.cpp
oundPoolThread.cpp
1c5a89d4af193e3ce9be9992ffee0ab0a4d8da5a 04-Jan-2012 Glenn Kasten <gkasten@google.com> Use audio_format_t consistently

Was int, uint32_t, uint16_t, and uint8_t with 2-bit bitfield.
Also replace 0 by AUDIO_FORMAT_DEFAULT and replace 1 by
AUDIO_FORMAT_PCM_16_BIT.

Change-Id: Ia8804f53f1725669e368857d5bb2044917e17975
oundPool.cpp
oundPool.h
71f2cf116aab893e224056c38ab146bd1538dd3e 20-Oct-2011 Steve Block <steveblock@google.com> Rename (IF_)LOGV(_IF) to (IF_)ALOGV(_IF) DO NOT MERGE

See https://android-git.corp.google.com/g/#/c/143865

Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
oundPool.cpp
oundPoolThread.cpp
ndroid_media_SoundPool.cpp
79cd8ba46b1ac15f75174beebc1411edea32c05b 15-Jun-2011 Glenn Kasten <gkasten@google.com> Remove unneeded #include <sys/resource.h>

Suggested in code review for previous change.

Change-Id: Ic3225b240367dc6c9bf56fb4498fb8a0f9f806ec
oundPool.cpp
e46a86fcb6a0849fc05c4cade6cb94aad0325295 02-Jun-2011 Glenn Kasten <gkasten@google.com> Revert "Use AudioTrack::event_type not int in callback"

This reverts commit 2225e4b7049fa3fb9d39a068b8268b63c952d7c1
oundPool.cpp
oundPool.h
2225e4b7049fa3fb9d39a068b8268b63c952d7c1 05-May-2011 Glenn Kasten <gkasten@google.com> Use AudioTrack::event_type not int in callback

Change-Id: Ifefc708d46874e04fd0d01cb6e2d43b987ee796c
oundPool.cpp
oundPool.h
34bb419e5946ab28112e9e27a4d1b3928d31e0e2 11-May-2011 Dima Zavin <dima@android.com> update for new audio.h header location

Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876
Signed-off-by: Dima Zavin <dima@android.com>
oundPool.cpp
24fc2fb1c541e954b83fd31ea9f786a5e9b45501 20-Apr-2011 Dima Zavin <dima@android.com> audio/media: convert to using the audio HAL and new audio defs

Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
oundPool.cpp
a3804cf77f0edd93f6247a055cdafb856b117eec 12-Apr-2011 Elliott Hughes <enh@google.com> You don't need to poke around inside FileDescriptor manually.

We can help you with that.

Note also that getParcelFileDescriptorFD did no such thing. All its callers
were passing in a regular java.io.FileDescriptor and expecting the int. No
ParcelFileDescriptors involved.

Change-Id: Idc233626f20c092e719f152562601f406cc1b64a
ndroid_media_SoundPool.cpp
a60e212d0dda7d2a748180ce77405f2463c9cf53 29-Dec-2010 Eric Laurent <elaurent@google.com> Fix issue 3261656.

The problem can occur if a sample is started at the same time as the last AudioTrack callback
for a playing sample is called. At this time, allocateChannel() can be called concurrently with moveToFront()
which can cause an entry in mChannels being used by moveToFront() to be erased temporarily by allocateChannel().

The fix consists in making sure that the SoundPool mutex is held whenever play(), stop() or done() are called.

In addition, other potential weaknesses have been removed by making sure that the channel mutex is held while
starting, stopping and processing the AudioTrack call back.

To that purpose, a mechanism similar to the channel restart method is implemented to avoid stopping channels
from the AudioTrack call back but do it from the restart thread instead.

The sound effects SounPool management in AudioService has also been improved to make sure that the samples have
been loaded when a playback request is received and also to immediately release the SoundPool when the effects are
unloaded without waiting for the GC to occur.
The SoundPool.java class was modified to allow the use of a looper attached to the thread in which the sample
loaded listener is running and not to the thread in which the SoundPool is created.

The maximum number of samples that can be loaded in a SoundPool lifetime as been increased from 255 to 65535.

Change-Id: I368a3bdfda4239f807f857c3e97b70f6b31b0af3
oundPool.cpp
oundPool.h
oundPoolThread.h
f3d6dd0782e3135885efdc26cb86cf0bf811749f 18-Nov-2010 Eric Laurent <elaurent@google.com> Fix issue 3157123.

Use a Mutex wherever atomic operations were used in AudioTrack,
AudioRecord, AudioFlinger and AudioEffect classes.

Change-Id: I6f55b2cabdcd93d64ef19446735b8f33720f8dbc
oundPool.h
09468dbbe9d91214a171a2b2f43bd37795f0b8c1 11-Mar-2010 Steve Howard <showard@google.com> Add a name to the previously-unnamed thread created by SoundPoolThread.

SoundPool itself also creates a thread, which was called "SoundPoolThread", unrelated to the SoundPoolThread class. The SoundPoolThread class then created an unnamed thread, which showed up as "android:unnamed_thread". That's confusing, so this change renames the SoundPool thread to "SoundPool" and then names the SoundPoolThread thread as "SoundPoolThread". Say that ten times fast :)

Change-Id: I67b7e644a30c94b6eda44bf970764a52a1c2958b
oundPool.cpp
oundPoolThread.cpp
7bef5a58f1166c0e2509e27ace07c7af7c5d1d20 17-Feb-2010 Dave Sparks <davidsparks@android.com> Fix logging in SoundPool.
oundPool.cpp
f992cbb9aae593c7787ac9c5f6b475e7bb0a92c5 09-Feb-2010 Dave Sparks <davidsparks@android.com> Add SoundPool API to pause and resume all active streams. Bug 2426531.
oundPool.cpp
oundPool.h
ndroid_media_SoundPool.cpp
3c56221af7160355f5265bc2dc14322636d945fc 24-Dec-2009 Dave Sparks <davidsparks@android.com> Fix SoundPool restart problem CheckJNI issue.
ndroid_media_SoundPool.cpp
f6e43bf29084760b39257b2273e0f04c2815fdc5 08-Dec-2009 Dave Sparks <davidsparks@android.com> Add OnLoadCompleteListener to SoundPool.
oundPool.cpp
oundPool.h
oundPoolThread.cpp
oundPoolThread.h
ndroid_media_SoundPool.cpp
c333133107fb492de481a96ed1277e71daf2dd8c 16-Dec-2009 Dave Sparks <davidsparks@android.com> am b5fc8ffc: am 91487425: Merge change I0448ef20 into eclair

Merge commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8'

* commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8':
Fix SoundPool buffer size rounding error. Bug 2327620.
66d28cedd92dcc1669ace23231da1b8c1374ff2f 15-Dec-2009 Dave Sparks <davidsparks@android.com> Fix SoundPool buffer size rounding error. Bug 2327620.

AudioTrack was modified earlier to calculate minimum buffer size
based on the hardware reported latency. Previously, it was a
hard-coded value. As a result of this change, the minimum buffer
size is now variable based on hardware latency. On Passion, this
brought out a subtle rounding error in the buffer size calculation
in SoundPool. This can cause AudioTrack creation to fail based on
the requested sample rate. This fix calculates the total buffer
size first, and then does rounding before dividing by the number
of buffers.
oundPool.cpp
3c256cf321f820f9d87399b9e254e4400c354c31 07-Dec-2009 Dave Sparks <davidsparks@android.com> More SoundPool cleanup. Remove mSoundPoolRef and unused notify callback.
oundPool.h
c0e3ddf8f2f30dc9593f0a1bfd46335823e25d65 07-Dec-2009 Dave Sparks <davidsparks@android.com> Remove unused Java object reference in native SoundPool code.
oundPool.cpp
oundPool.h
ndroid_media_SoundPool.cpp
1b0efec3473134fb7de226f3e1fdade5b3529ad9 31-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 17c195c8: Merge change 9340 into donut

Merge commit '17c195c8da3470b2e69880e206342f0c2d85f938'

* commit '17c195c8da3470b2e69880e206342f0c2d85f938':
Fix issue 2025872: Deadlock in SoundPool.stop
fd8c0e1ff8ef781ba169c0164458ec1ce95ee35c 31-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 2025872: Deadlock in SoundPool.stop

There were 2 problems in SoundPool:

1 If not using the shared memory buffer mode, there was a problem when a sound channel was stolen. The new channel could sometimes not be added to the restart
list if the AudioTrack callback thread was stopped before the underrun callback was called.

The SoundChannel::play() method is modified so that SoundPool::done() is called immediately after stopping the channel. There is a possibility that done() is called a second time by the callback; in this case it will be added 2 times to the restart list but the second start request will be ignored as the first one will have reset the next chennel ID when processed.

2 There was a deadlock on SoundPool::mLock if SoundPool::stop() was called while a channel restart was pending:
SoundPool::stop() lock mLock -> SoundChannel::stop() -> SoundPool::done() -> SoundPool::addToRestartList() -> try to lock mLock == deadlock

A second mutex mRestartLock is added to protect the restart list mRestart. mLock is still used to protect mChannels list but mRestart is now used to
protect access to mRestart by restart thread and client thread.
oundPool.cpp
oundPool.h
a553c25b33c99b345cf1c8688f8df0ed8df14e5a 17-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 1795088 Improve audio routing code

Initial commit for review.
Integrated comments after patch set 1 review.
Fixed lockup in AudioFlinger::ThreadBase::exit()
Fixed lockup when playing tone with AudioPlocyService startTone()
oundPool.cpp
c7bebd15378d98104e6cd32666665fd60eaa8043 22-Jul-2009 Android (Google) Code Review <android-gerrit@google.com> am 5f2b05ea: Merge change 8220 into donut

Merge commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09'

* commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09':
Fix issue 1996218: Disable use of shared memory buffer by SoundPool.
45fce58ca1f8d967bdca574e79837ae2fcfed741 22-Jul-2009 Eric Laurent <elaurent@google.com> Fix issue 1996218: Disable use of shared memory buffer by SoundPool.

Disabled USE_SHARED_MEM_BUFFER compilation switch in SoundPool.cpp.
oundPool.cpp
4599184a1c1c3f54b396c49b5728e4031e559e18 01-Jun-2009 Android (Google) Code Review <android-gerrit@google.com> am 450ad31b: Merge change 2774 into donut

Merge commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e'

* commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e':
Limit check on maxChannels for SoundPool.
3c8704b171c812dde6f48e5416ba0b336470dd4a 30-May-2009 Dave Sparks <davidsparks@android.com> Limit check on maxChannels for SoundPool.
Bug 1838724
oundPool.cpp
25ba5b6564224dceefa086b5c439ef28dad530ca 19-May-2009 Mathias Agopian <mathias@google.com> checkpoint: split libutils into libutils + libbinder
ndroid.mk
9648e4b6774910afde095be94b8359ae80cd3dcb 07-May-2009 Eric Laurent <elaurent@google.com> fix issue 1641535: SoundPool should use AudioTrack with shared memory buffer

Enabled USE_SHARED_MEM_BUFFER switch in SoundPool.cpp
oundPool.cpp
08905cc3362d8737290ceba96077aa2d234ab378 25-Mar-2009 Dianne Hackborn <> Automated import from //branches/donutburger/...@140818,140818
OTICE
9066cfe9886ac131c34d59ed0e2d287b0e3c0087 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
ndroid.mk
oundPool.cpp
oundPool.h
oundPoolThread.cpp
oundPoolThread.h
ndroid_media_SoundPool.cpp
d83a98f4ce9cfa908f5c54bbd70f03eec07e7553 04-Mar-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //depot/cupcake/@135843
ndroid.mk
oundPool.cpp
oundPool.h
oundPoolThread.cpp
oundPoolThread.h
ndroid_media_SoundPool.cpp
da996f390e17e16f2dfa60e972e7ebc4f868f37e 13-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@131421
oundPool.cpp
d24b8183b93e781080b2c16c487e60d51c12da31 11-Feb-2009 The Android Open Source Project <initial-contribution@android.com> auto import from //branches/cupcake/...@130745
oundPool.cpp
oundPool.h
f013e1afd1e68af5e3b868c26a653bbfb39538f8 18-Dec-2008 The Android Open Source Project <initial-contribution@android.com> Code drop from //branches/cupcake/...@124589
oundPool.cpp
oundPool.h
54b6cfa9a9e5b861a9930af873580d6dc20f773c 21-Oct-2008 The Android Open Source Project <initial-contribution@android.com> Initial Contribution
ndroid.mk
oundPool.cpp
oundPool.h
oundPoolThread.cpp
oundPoolThread.h
ndroid_media_SoundPool.cpp