| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
Suggested in code review for previous change.
Change-Id: Ic3225b240367dc6c9bf56fb4498fb8a0f9f806ec
|
|
|
| |
This reverts commit 2225e4b7049fa3fb9d39a068b8268b63c952d7c1
|
|
|
|
| |
Change-Id: Ifefc708d46874e04fd0d01cb6e2d43b987ee796c
|
|
|
|
|
| |
Change-Id: Ic4c62c4037800802427eb7d3c7f5eb8b25d18876
Signed-off-by: Dima Zavin <dima@android.com>
|
|
|
|
|
| |
Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
| |
Use a Mutex wherever atomic operations were used in AudioTrack,
AudioRecord, AudioFlinger and AudioEffect classes.
Change-Id: I6f55b2cabdcd93d64ef19446735b8f33720f8dbc
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
| |
|
| |
|
|\
| |
| |
| |
| |
| |
| | |
Merge commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8'
* commit 'b5fc8ffcff6b8e1747af5c6ba1176a81986b55a8':
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.
|
| | |
|
|/ |
|
|\
| |
| |
| |
| |
| |
| | |
Merge commit '17c195c8da3470b2e69880e206342f0c2d85f938'
* commit '17c195c8da3470b2e69880e206342f0c2d85f938':
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.
|
| |
| |
| |
| |
| |
| |
| | |
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()
|
|\ \
| |/
| |
| |
| |
| |
| | |
Merge commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09'
* commit '5f2b05ea3dfdaf63088ea3776af43b79c5698f09':
Fix issue 1996218: Disable use of shared memory buffer by SoundPool.
|
| |
| |
| |
| | |
Disabled USE_SHARED_MEM_BUFFER compilation switch in SoundPool.cpp.
|
|\ \
| |/
| |
| |
| |
| |
| | |
Merge commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e'
* commit '450ad31b62af468aa0fb308a5c983b8f8334ae4e':
Limit check on maxChannels for SoundPool.
|
| |
| |
| |
| | |
Bug 1838724
|
|/ |
|
|
|
|
| |
Enabled USE_SHARED_MEM_BUFFER switch in SoundPool.cpp
|
| |
|
| |
|
| |
|
| |
|
| |
|
| |
|
|
|