summaryrefslogtreecommitdiffstats
path: root/media/jni/soundpool
Commit message (Collapse)AuthorAgeFilesLines
* Remove unneeded #include <sys/resource.h>Glenn Kasten2011-06-151-1/+0
| | | | | | Suggested in code review for previous change. Change-Id: Ic3225b240367dc6c9bf56fb4498fb8a0f9f806ec
* Revert "Use AudioTrack::event_type not int in callback"Glenn Kasten2011-06-012-4/+4
| | | This reverts commit 2225e4b7049fa3fb9d39a068b8268b63c952d7c1
* Use AudioTrack::event_type not int in callbackGlenn Kasten2011-06-012-4/+4
| | | | Change-Id: Ifefc708d46874e04fd0d01cb6e2d43b987ee796c
* update for new audio.h header locationDima Zavin2011-05-121-1/+1
| | | | | Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876 Signed-off-by: Dima Zavin <dima@android.com>
* audio/media: convert to using the audio HAL and new audio defsDima Zavin2011-04-271-3/+5
| | | | | Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5 Signed-off-by: Dima Zavin <dima@android.com>
* You don't need to poke around inside FileDescriptor manually.Elliott Hughes2011-04-111-1/+1
| | | | | | | | | | 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
* Fix issue 3261656.Eric Laurent2011-01-073-121/+198
| | | | | | | | | | | | | | | | | | | | | | | | 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
* Fix issue 3157123.Eric Laurent2010-11-191-1/+0
| | | | | | | Use a Mutex wherever atomic operations were used in AudioTrack, AudioRecord, AudioFlinger and AudioEffect classes. Change-Id: I6f55b2cabdcd93d64ef19446735b8f33720f8dbc
* Add a name to the previously-unnamed thread created by SoundPoolThread.Steve Howard2010-03-112-3/+2
| | | | | | 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
* Fix logging in SoundPool.Dave Sparks2010-02-171-2/+2
|
* Add SoundPool API to pause and resume all active streams. Bug 2426531.Dave Sparks2010-02-163-1/+76
|
* Fix SoundPool restart problem CheckJNI issue.Dave Sparks2009-12-231-1/+5
|
* Add OnLoadCompleteListener to SoundPool.Dave Sparks2009-12-235-57/+111
|
* am b5fc8ffc: am 91487425: Merge change I0448ef20 into eclairDave Sparks2009-12-151-5/+6
|\ | | | | | | | | | | | | Merge commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8' * commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8': Fix SoundPool buffer size rounding error. Bug 2327620.
| * Fix SoundPool buffer size rounding error. Bug 2327620.Dave Sparks2009-12-141-5/+6
| | | | | | | | | | | | | | | | | | | | | | | | 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.
* | More SoundPool cleanup. Remove mSoundPoolRef and unused notify callback.Dave Sparks2009-12-071-4/+0
| |
* | Remove unused Java object reference in native SoundPool code.Dave Sparks2009-12-073-4/+3
|/
* am 17c195c8: Merge change 9340 into donutAndroid (Google) Code Review2009-07-312-11/+9
|\ | | | | | | | | | | | | Merge commit '17c195c8da3470b2e69880e206342f0c2d85f938' * commit '17c195c8da3470b2e69880e206342f0c2d85f938': Fix issue 2025872: Deadlock in SoundPool.stop
| * Fix issue 2025872: Deadlock in SoundPool.stopEric Laurent2009-07-312-11/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Fix issue 1795088 Improve audio routing codeEric Laurent2009-07-231-2/+3
| | | | | | | | | | | | | | 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()
* | am 5f2b05ea: Merge change 8220 into donutAndroid (Google) Code Review2009-07-221-2/+1
|\ \ | |/ | | | | | | | | | | Merge commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09' * commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09': Fix issue 1996218: Disable use of shared memory buffer by SoundPool.
| * Fix issue 1996218: Disable use of shared memory buffer by SoundPool.Eric Laurent2009-07-221-2/+1
| | | | | | | | Disabled USE_SHARED_MEM_BUFFER compilation switch in SoundPool.cpp.
* | am 450ad31b: Merge change 2774 into donutAndroid (Google) Code Review2009-06-011-6/+10
|\ \ | |/ | | | | | | | | | | Merge commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e' * commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e': Limit check on maxChannels for SoundPool.
| * Limit check on maxChannels for SoundPool.Dave Sparks2009-06-011-6/+10
| | | | | | | | Bug 1838724
* | checkpoint: split libutils into libutils + libbinderMathias Agopian2009-05-201-0/+1
|/
* fix issue 1641535: SoundPool should use AudioTrack with shared memory bufferEric Laurent2009-05-071-1/+4
| | | | Enabled USE_SHARED_MEM_BUFFER switch in SoundPool.cpp
* Automated import from //branches/donutburger/...@140818,140818Dianne Hackborn2009-03-241-0/+190
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-036-0/+1459
|
* auto import from //depot/cupcake/@135843The Android Open Source Project2009-03-036-1459/+0
|
* auto import from //branches/cupcake/...@131421The Android Open Source Project2009-02-131-4/+5
|
* auto import from //branches/cupcake/...@130745The Android Open Source Project2009-02-102-17/+34
|
* Code drop from //branches/cupcake/...@124589The Android Open Source Project2008-12-172-301/+330
|
* Initial ContributionThe Android Open Source Project2008-10-216-0/+1412