24 Commits

Author SHA1 Message Date
Dave Sparks
7bef5a58f1 Fix logging in SoundPool. 2010-02-17 09:09:24 -08:00
Dave Sparks
f992cbb9aa Add SoundPool API to pause and resume all active streams. Bug 2426531. 2010-02-16 16:19:32 -08:00
Dave Sparks
3c56221af7 Fix SoundPool restart problem CheckJNI issue. 2009-12-23 17:22:57 -08:00
Dave Sparks
f6e43bf290 Add OnLoadCompleteListener to SoundPool. 2009-12-23 09:11:29 -08:00
Dave Sparks
c333133107 am b5fc8ffc: am 91487425: Merge change I0448ef20 into eclair
Merge commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8'

* commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8':
  Fix SoundPool buffer size rounding error. Bug 2327620.
2009-12-15 15:05:37 -08:00
Dave Sparks
66d28cedd9 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.
2009-12-14 21:48:17 -08:00
Dave Sparks
3c256cf321 More SoundPool cleanup. Remove mSoundPoolRef and unused notify callback. 2009-12-07 13:01:01 -08:00
Dave Sparks
c0e3ddf8f2 Remove unused Java object reference in native SoundPool code. 2009-12-07 12:36:20 -08:00
Android (Google) Code Review
1b0efec347 am 17c195c8: Merge change 9340 into donut
Merge commit '17c195c8da3470b2e69880e206342f0c2d85f938'

* commit '17c195c8da3470b2e69880e206342f0c2d85f938':
  Fix issue 2025872: Deadlock in SoundPool.stop
2009-07-31 08:55:51 -07:00
Eric Laurent
fd8c0e1ff8 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.
2009-07-31 06:29:13 -07:00
Eric Laurent
a553c25b33 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()
2009-07-23 06:03:39 -07:00
Android (Google) Code Review
c7bebd1537 am 5f2b05ea: Merge change 8220 into donut
Merge commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09'

* commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09':
  Fix issue 1996218: Disable use of shared memory buffer by SoundPool.
2009-07-22 13:20:05 -07:00
Eric Laurent
45fce58ca1 Fix issue 1996218: Disable use of shared memory buffer by SoundPool.
Disabled USE_SHARED_MEM_BUFFER compilation switch in SoundPool.cpp.
2009-07-22 11:12:31 -07:00
Android (Google) Code Review
4599184a1c am 450ad31b: Merge change 2774 into donut
Merge commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e'

* commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e':
  Limit check on maxChannels for SoundPool.
2009-06-01 09:58:43 -07:00
Dave Sparks
3c8704b171 Limit check on maxChannels for SoundPool.
Bug 1838724
2009-06-01 08:16:19 -07:00
Mathias Agopian
25ba5b6564 checkpoint: split libutils into libutils + libbinder 2009-05-20 12:55:02 -07:00
Eric Laurent
9648e4b677 fix issue 1641535: SoundPool should use AudioTrack with shared memory buffer
Enabled USE_SHARED_MEM_BUFFER switch in SoundPool.cpp
2009-05-07 03:14:31 -07:00
Dianne Hackborn
08905cc336 Automated import from //branches/donutburger/...@140818,140818 2009-03-24 18:36:53 -07:00
The Android Open Source Project
9066cfe988 auto import from //depot/cupcake/@135843 2009-03-03 19:31:44 -08:00
The Android Open Source Project
d83a98f4ce auto import from //depot/cupcake/@135843 2009-03-03 18:28:45 -08:00
The Android Open Source Project
da996f390e auto import from //branches/cupcake/...@131421 2009-02-13 12:57:50 -08:00
The Android Open Source Project
d24b8183b9 auto import from //branches/cupcake/...@130745 2009-02-10 15:44:00 -08:00
The Android Open Source Project
f013e1afd1 Code drop from //branches/cupcake/...@124589 2008-12-17 18:05:43 -08:00
The Android Open Source Project
54b6cfa9a9 Initial Contribution 2008-10-21 07:00:00 -07:00