| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
There were two causes for the slowness:
When thread was paused, it used nanosleep and sleep. These usually
run to completion (except for POSIX signal, which we avoid because it
is low-level). Instead, replace the nanosleep and sleep by condition
timed wait, as that can be made to return early by a condition signal.
Another advantage of condition timed wait is that a condition wait was
already being used at top of thread loop, so it is a simpler change.
The AudioRecord destructor was missing a proxy interrupt that was correct
in AudioTrack. This proxy interrupt is needed in case another thread
is blocked in proxy obtainBuffer.
Does not address the 1 second polling for NS_WHENEVER.
Bug: 10822765
Change-Id: Id665994551e87e4d7da9c7b015f424fd7a0b5560
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The audio input handle is ultimately owned by the audio recorder
object but it could be dropped on the floor if an error occurred
before that object was fully initialized.
Rearranged some of the argument validation and merged getInput_l
with openRecord_l to simplify the code and prevent such a leak
from occurring.
Bug: 10265163
Change-Id: I124dce344b1d11c2dd66ca5e2c9aec0c52c230e2
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| | |
There was some obsolete and incomplete text left over
after the new control block code was submitted.
This cleans up all those comments to be accurate again.
Change-Id: Ic52f5869cb723cde25d709514d6deea6aa6f20aa
|
|\ \ |
|
| | |
| | |
| | |
| | | |
Change-Id: I76ec536d1504eb9a558178b62bf225aace4b40d1
|
|\ \ \
| |/ / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new parameter 'flags' of type audio_input_flags_t will be used for
requesting a fast track, but is currently ignored.
Change-Id: If68dfda8b2d4eaaca42927d721b4630c47f71f3b
|
|\ \ \
| |/ / |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The new optional parameter 'flags' of type audio_input_flags_t will be
used for requesting a fast track.
Change-Id: Ia7e070cb57c833e608352da354fb30dc26df6918
|
|\ \ \ |
|
| | |/
| |/|
| | |
| | | |
Change-Id: I122a7cf7bfc162090cb27f37c325db7a23985bc7
|
|\ \ \
| | |/
| |/| |
|
| |/
| |
| |
| | |
Change-Id: Iae38fa4ac20a45751566169213a08a15deb0a2f6
|
|/
|
|
| |
Change-Id: I72feefdd6f3a623fd3669b80d4b264518fdc0929
|
|
|
|
| |
Change-Id: I22ad4ba8777842bf6705e79c6ad796fdb9a4104c
|
|
|
|
|
| |
Bug: 9423855
Change-Id: I78ba8228c60dff11fb466156bb632c5dda45cdaf
|
|
|
|
|
|
|
|
| |
Main differences between old and new control block:
- removes the mutex, which was a potential source of priority inversion
- circular indices into shared buffer, which is now always a power-of-2 size
Change-Id: I4e9b7fa99858b488ac98a441fa70e31dbba1b865
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The proxy object will eventually be the only code that understands the
details of the control block. This should make it easier to change the
control block in the future.
Initial set of control block fields that are isolated:
- sample rate
- send level
- volume
Prepare for streaming/static separation by adding a union to the control
block for the new fields.
Fix bug in handling of max sample rate on a track. It was only checking
at re-configuration, not at each mix.
Simplify OutputTrack::obtainBuffer.
Change-Id: I2249f9d04f73a911a922ad1d7f6197292c74cd92
|
|
|
|
|
|
|
|
| |
Channel count is uint32_t.
Remove redundant mask parameter to AudioTrack::createTrack_l()
and AudioRecord::openRecord_l().
Change-Id: I5dc2b18eb609b2c0dc3091994cbaa4628062c17f
|
|
|
|
|
|
| |
Also fix typo: bufferCount should be frameCount.
Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
|
|
|
|
|
|
| |
This is part of a series to clean up the control block.
Change-Id: Ifab1c42ac0f8be704e571b292713cd2250d12a3f
|
|
|
|
|
|
| |
This is part of a series to clean up the control block.
Change-Id: Ie474557db7cb360f2d9a0f11600a68f5a3d46f07
|
|
|
|
| |
Change-Id: I89fc6d8f695b48516d956b0a9a4a43d408f369f9
|
|
|
|
| |
Change-Id: Ibec910608948d778dc655d900255a80384e9b06f
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Fix race conditions for EVENT_MARKER and EVENT_NEW_POS callbacks.
Marker and new position update fields are protected by lock.
getSampleRate() doesn't need a lock because it reads from shared memory
control block.
Enforce that the parameter passed with EVENT_MARKER and EVENT_NEW_POS
cannot not be changed by the callback handler, and will not change during
the call by another thread.
Session ID should never change; log if it does.
Change-Id: Ia2c63cf1a71b10bb06c37981bd76437f83fffa91
|
|
|
|
|
|
| |
like AudioTrack::stop()
Change-Id: Iab62f4665151345f1ad5874c97a21d1a331f0154
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Rename ClientRecordThread to AudioRecordThread to be more similar to
AudioTrack naming.
Only create the thread once, and use resume() and pause() for start()
and stop(). This will allow us to have a known client callback thread
tid that we can pass to AudioFlinger before start().
mActive:
Made mActive a bool not int.
mActive is protected by mLock; volatile is meaningless.
Fixed a few places where mActive was accessed without a lock:
- stopped()
- processAudioBuffer()
These aren't used internally, so no need for _l() versions.
Change-Id: I4b8a5c90f3a22d3894b344564cb1c5aef4f1fda2
|
|
|
|
| |
Change-Id: I7d8201590cda29c9fa99662a4fdba222091febfe
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In IAudioFlinger::createTrack() and IAudioFlinger::openRecord(),
declare input parameter to use correct type audio_channel_mask_t.
In IAudioFlinger::getInputBufferSize(), input parameter is now channel mask
instead of channel count.
Remove unused IAudioFlinger::channelCount(audio_io_handle_t).
In AudioRecord::getMinFrameCount() and AudioSystem::getInputBufferSize(),
input parameter is channel mask instead of channel count.
Change-Id: Ib2f1c29bea70f016b3cfce83942ba292190ac965
|
|
|
|
|
|
| |
Group the private fields according to how they are used
Change-Id: I7ce3d0939510c10f34bd91a55f6e03afc8e7d43c
|
|
|
|
| |
Change-Id: I9e1b918b2635d961604a4a9d88eb1c7179a167a7
|
|
|
|
|
|
| |
It was declared but never implemented or called.
Change-Id: If5846147fcbd7f6d4187971e2044dd6fd3252b42
|
|
|
|
| |
Change-Id: I12ef9367d05dbe069c037b1b4acd6347a8cf3ece
|
|
|
|
| |
Change-Id: I021ddcc1bcb63132a4597d13e3d09db2a5f2c628
|
|
|
|
|
|
|
|
|
| |
The C++ APIs are going away.
Note: we use tid == 0 which is not supported yet by the C APIs,
do not submit this until that is added.
Change-Id: I0e90789e6c81c69f2544e899c52421ea5d1342be
|
|
|
|
|
|
|
|
|
| |
Made AudioRecord a subclass of RefBase to allow using strong
references and solve concurrency issues.
Issue 6254582.
Change-Id: Ic1f3845958f477e8b2d23d3d25bf0f666addcb3b
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Added the infrastructure to support the synchronization of playback and
capture actions on specific events.
The first requirement for this feature is to synchronize the audio capture
start with the full rendering of a given audio content.
The applications can further be extended to other use cases
(synchronized playback start...) by adding new synchronization events and
new synchronous control methods on player or recorders.
Also added a method to query the audio session from a ToneGenerator.
Change-Id: I51f1167290d9cafdf2fbcdf9e4785156973af44c
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
createTrack and openRecord don't need the "old" flags parameter,
which was either audio_policy_output_t or audio_in_acoustics_t
shifted left by 16 bits. But they do need "new" flags, which
are defined by the application use case. Initially, the only
application use case flag is timed output, but others are planned.
For output, the audio_policy_output_t flags are passed to
AudioSystem::getOutput, which returns an audio_io_handle_t, and that
handle is then passed to createTrack. So createTrack doesn't need the
old flags parameter.
For input, the audio_in_acoustics_t flags are passed to
AudioSystem::getInput, which returns an audio_io_handle_t, and that
handle is then passed to openRecord. So openRecord doesn't need the
old flags parameter.
Change-Id: I18a9870911846cca69d420c19fe6a9face2fe8c4
|
|
|
|
| |
Change-Id: I6f369a2b99eb515603bc7d5629a07db2b96783fe
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I85cfb9a2b9b3ade098161aa7687b4d4f7eb226ea
|
|/
|
|
| |
Change-Id: Ifae4fd7820b650aaca2b13c8658c292db1c46c0f
|
|
|
|
|
|
| |
Inform AudioFlinger of the tid of the callback thread.
Change-Id: I670df92dd06749b057238b48ed1094b13aab720b
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The client callback threads had mutexes called AudioTrackThread::mLock
and ClientRecordThread::mLock. These mutexes were only used by start()
and stop(), and were unused by the thread itself. But start() and
stop() already have their own protection provided by AudioTrack::mLock
and AudioRecord::mLock. So the thread mutexes can be removed.
Change-Id: I098406d381645d77fba06a15511e179a327848ef
|
|/
|
|
|
|
| |
Use if (p != NULL) instead of if (ptr)
Change-Id: Iaec3413a59ccbf233c98fcd918cc7d70ac5da9fa
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Was a mix of audio_source_t, uint8_t, and int.
Related fixes:
- fix comments in MediaRecorder.java
- AudioPolicyService server side was not checking source parameter at
all, so if the client wrapper was bypassed, invalid values could be
passed into audio HAL
- JNI android_media_AudioRecord_setup was checking source for positive
values, but not negative values. This test is redundant, since already
checked at Java and now checked by AudioPolicyService also, but might
as well make it correct.
Change-Id: Ie5e25d646dcd59a86d7985aa46cfcb4a1ba64a4a
|
|
|
|
|
|
|
|
|
|
|
|
| |
Was int or uint32_t.
When AudioFlinger::format can't determine the correct format,
return INVALID rather than DEFAULT.
Init mFormat to INVALID rather than DEFAULT in the constructor.
Subclass constructors will set mFormat to the correct value.
Change-Id: I9b62640aa107d24d2d27925f5563d0d7407d1b73
|
|
|
|
|
|
|
| |
Remove unnecessary includes of AudioTrack.h.
Use forward declaration of class names in preference to #include when possible.
Change-Id: I12982811fa75c2c7695d8bbfa595a7aaec047dc0
|