| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
forgot to upload final fixup during merge. sry about that
Change-Id: I2ddd2c08d8efa83c0a8d1e378ae4c28686145154
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a manual merge from ics-aah
> TimedAudio: Track of the number of pending frames.
>
> Keep track of the number of frames pending in the timed audio queue so
> we can implement framesReady in O(1) time instead of O(N). This
> change partially addresses bug 6020970; the bug will be completely
> addressed once this change has been up-integrated into master.
>
> Change-Id: I599eb15ea1f6d715b97b30e65214fb6fadd169df
> Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I6cbbbc3afc8efd066fe94865326ede0c6b3db2bd
Signed-off-by: John Grossman <johngro@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This is a manual merge from ics-aah
> TimedAudio: Fix a cause of audio popping.
>
> Fix an issue with buffer lifecycle management which could cause audio
> pops on timed outputs. There were two issues at work here.
>
> 1) During trim operations for the queued timed audio data, buffers
> were being trimmed based on their starting PTS instead of when the
> chunk of audio data actually ended. This means that if you have a
> very large chunk of audio data (larger than the mixer lead time),
> then a buffer at the head of the queue could be eligible to be
> trimmed before its data had been completely mixed into the output
> stream, even though the output stream was fully buffered and in no
> danger of underflow.
> 2) The implementation of getNextBuffer and releaseBuffer for timed
> audio tracks was not keeping anything like a reference to the data
> that it handed out to the mixer. The original architecture here
> seemed to be expecting a ring buffer design, but timed audio tracks
> use a packet based design. Pieces of packets are handed out to the
> mixer which then frequently will hold onto that chunk of data
> across two mix operations, using the first part of the chunk to
> finish a mix buffer and then using the end of the chunk for the
> start of the next mix buffer. If the buffer that the mixer is
> holding a piece of got trimmed before the start of the next mix
> operation, it would return to its heap and could be filled with who
> knows what by the time it actually got mixed. On debug builds,
> they seem to get zero'ed out as they go back to the heap causing
> obvious pops in presentation.
>
> This change addresses both issues. Trim operations are now based on
> ending presentation time for a chunk of audio, not the start. Also,
> when the head of the queue is in flight to the mixer, it can no longer
> be trimmed immediately, merely flagged for trim by the mixer when the
> mixer finally does call releaseBuffer.
>
> Signed-off-by: John Grossman <johngro@google.com>
> Change-Id: Ia1ba08cb9dea35a698723ab2d9bcbf804f1682fe
Change-Id: I2c5e2f0375c410f0de075886aac56ff6317b144c
Signed-off-by: John Grossman <johngro@google.com>
|
|
|
|
|
|
|
|
|
| |
Added functional test code to validate effect API for
multi mic simplementations.
Also fixed warning in AudioFlinger.
Change-Id: I07be4d2e4d17791d3626c804ba3e9f87ff26d05a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
In the AudioMixer structure associated with each track, add an object
that acts as the buffer provider when the track has more than two
channels of input in the mixer. This object, DownmixerBufferProvider,
gets audio from the actual buffer provider of the track, and applies
a downmix effect on it.
The downmix effect is created and configured when the track gets
created in AudioFlinger, which causes AudioMixer::getTrackName()
to be called with the new track's channel mask. It is released
when the track is disabled in the mixer.
Change-Id: I05281ed5f61bef663a8af7ca7d5ceac3517c82db
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Yet another abstraction similar to AudioTrack::Buffer and AudioBufferProvider,
but with support for streaming, non-blocking, and eventually PTS.
This is intended to be used as follows:
- primary HAL output stream implements a Sink
- primary HAL input stream implements a Source
- Pipe implements a Sink
- PipeReader implements a Source or TimedSource (not shown yet),
which supports "read at PTS"
- fast AudioTrack on server side will implement a Source using cblk
- normal AudioTrack on server side will not be changed initially
- fast AudioRecord on server side will implement a Sink using cblk
- normal AudioRecord on server side will not be changed initially
- fast mixer thread will read from Sources and write to a Sink,
or (unlikely) implement a Source and multiple Sinks
- Visualization and PCM logger will read from Source or TimedSource
- A2DP normal mixer will be connected directly to its output stream
and there will be a kind of OutputTrack for duplication that will
read from a Sink with non-blocking write fed by the fast mixer.
Patch set 3 changes:
- Add more implementations of NBAIO interfaces:
added SourceAudioBufferProvider, MonoPipe, MonoPipeReader.
- Added Format_sampleRate and Format_channelCount.
- Extract out the roundUp() method.
- Respond to most comments from previous code review.
- The new classes are untested.
Patch set 4 changes:
- Fix bugs in MonoPipe::write() and MonoPipeReader::read()
- Fix bug initializing mFrameBitShift too early
- renamed roundUp() to roundup()
- Fix Android.mk
- Add LOG_TAG an LOG_NDEBUG, use ALOG_ASSERT and utils/Log.h instead of assert
- Fix build warnings
- Move constructor and destructor bodies from .h to .cpp
- Line length 100
- Following naming conventions for #include double-include protector macros
- Include what you use
- More NBAIO logging
- MonoPipe write can be blocking
Patch set 5 changes:
- Address code review comments
- Use a static library so unused implementations don't take memory
- Comment out libsndfile dependency
- Remove debugging LOGV and LOG_NDEBUG
Patch set 6 changes (would be 6 at old location, actually 2 at new location):
- Address code review comments on patchset 5
- For MonoPipe, allow the full pipe to be used, no need to omit one slot
- Don't do atomic releasing stores unless needed
Still to do:
- I'm not happy with the Pipe class names
- Update build/ for new static library?
Change-Id: Ie6c61f05ce06b676b033be448a8ef9025a2ffcfd
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Audio HW modules are now loaded upon request from audio policy manager
according to the configuration in audio_policy.conf.
Removed hard coded HW module loading by AudioFlinger at init time.
Added methods to IAudioFlinger and AudioPolicyInterface
to control the loading of audio HW modules.
Added methods to open an output or input stream on a specific hw module.
Change-Id: I361b294ece1a9b56b2fb39cc64259dbb73b804f4
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
removed outputs to stream mapping cache in audio system: the output for a
given stream type must always be queried from audio policy manager as the cache
is not always updated fast enough by audioflinger callback.
removed AudioFlinger::PlaybackThread::setStreamValid() not used anymore if
stream to output mapping is not cached.
Change-Id: Ieca720c0b292181f81247259c8a44359bc74c66b
|
| |
| |
| |
| | |
Change-Id: I72358c8e6829d173b3e60ced8a8babc089869fac
|
| |
| |
| |
| | |
Change-Id: Ifd16750174fdb15b72507787502b587562ffc99e
|
|/
|
|
|
|
|
|
|
|
| |
Move the default initialization of track parameters from the AudioMixer
constructor to getTrackName(). This fixes a bug where the defaults were
only valid the first time a name was allocated.
Also added a switch case for parameter FORMAT.
Change-Id: I07abd3aaf7f4efe9825a761d2bc662aaee2c6db0
|
|
|
|
|
| |
b/6160363
Change-Id: I471815012c6a113ec2c4dd7676e8fa288a70bc76
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* why deadlock happened: when an app (CTS camera test) crashes while using
camera, its binder is closed and reference counter is decreased. If camera
is inside callback, sp<Client> inside callback will hold the Client instance,
and Client instance is destroyed when the callback ends as sp<Client> to hold
it no longer exists. The destructor of Client instance tries to clean up
camera H/W which tries to stop threads created by camera HAL including the
thread context where the callback is running. This causes deadlock where the
callback thread itself is waiting for itself to terminate.
Note that the deadlock will not happen if camera callback is not active. In
that case, closing of binder will force the destruction of Client instance,
and the destruction happens in binder thread.
* Fix: Forces Client descruction in binder thread
- remove sp<Client> from callbacks to prevent destruction in callback context
- add client lock to allow callback to use raw pointer safely. This prevents
the destructor from deleting the instance while callback is using it.
- add status change inside destructor with client lock to safely destroy Client
Bug: 6214383
Change-Id: Ic6d6396d4d95ce9e72a16ec2480ae65c100fe806
|
|
|
|
|
|
|
| |
o plus a few file relocation: ActivityManager.cpp/h, SoundPool.h, etc
o remove some runtime dependencies to libandroid, libandroid_runtime, etc
Change-Id: I047a47c5fb361dd5cf85cd98798c39f629a75d10
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| | |
This reverts commit c920dee060ac69684be33210ee44b99a5fc3e8b2
|
| |
| |
| |
| | |
Change-Id: Ifd2c61882109ec36ca68072a2bf6506e08c8cf34
|
|\ \ |
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
The 'thread' parameter can never be NULL.
Use constructor initialization list when possible.
Make more members const.
Only put the relevant code under "if (mCblk != NULL)".
Add comment about track name leak.
Change-Id: Ib963390a69bed1999638cc982a759edd1d5f4712
|
|\ \ \ |
|
| |/ /
| | |
| | |
| | | |
Change-Id: I371b17cef071d083eecf35cd3627a3adff907a33
|
| |/
| |
| |
| | |
Change-Id: Ib8cff8abd73723b793f08da99ad59549f219e0e7
|
|\ \ |
|
| |/
| |
| |
| | |
Change-Id: I327663a020670d0a72ff57bd0b682e2ce0528650
|
|\ \ |
|
| |/
| |
| |
| |
| |
| | |
Fix indentation, and add blank lines in key places for clarity
Change-Id: I57a0a8142394f83203161aa9b8aa9276abf3ed7c
|
|\ \ |
|
| |/
| |
| |
| | |
Change-Id: I5079a3bf31097dd0807b2d806d5f8d3cff2077ab
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
camcorder and A2DP" into ics-mr1
* commit 'a48285c4f22ffc43f1771ebd1ff35dcec48db2c7':
audioflinger: fix issue with camcorder and A2DP
|
| |\ \
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
ics-mr1
* commit '14958e21c12f922d7501d32c3bec05109eb342d5':
audioflinger: fix issue with camcorder and A2DP
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Some audio HALs do not support well a device selection of 0 (no device)
received on an input stream.
This can happen because of a problem in the audioflinger code that handles
the forwarding of the output device selection to the record thread for use by
the pre processing modules that need it. If the output device is 0 (meaning
no op, which happens when stopping playback over A2DP) audioflinger could not
detect it was an output device selection and would forward it to the input
stream (see AudioFlinger::setParameters() and RecordThread::checkForNewParameters_l().
Issue 6179641.
Change-Id: Idae534521866538e0d12ba259a2834f402a922e2
|
| |_|/
|/| |
| | |
| | | |
Change-Id: I3ac357c78fb89f108d15c6e5b9fa317de0e9fb9a
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The purpose is to let face unlock always get the camera
successfully. What happened was the camera applications may
have opened the camera in onResume under the lock screen.
This API lets face unlock take the camera from the camera
application. A new permission will be added, so other
applicatoins won't be able to take the camera from the face
unlock.
bug:5584464
Change-Id: Ib3d9dcbc2161815b68db42327dc01148453704c6
|
|/ / /
| | |
| | |
| | | |
Change-Id: I4bc66115fcb9ba22b057bd72db3f561dcb18a0d8
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Log statistics on CPU usage in Hz in addition to wall clock time
Use CPU statistics for all playback threads, not just MIXER
(but they are disabled by default by a compile-time debug macro).
ThreadCpuUsage library:
- Move statistics out of the library and leave that up to the caller
- Add API to determine a CPU's frequency
Change-Id: Ia1011123146e641fcf210ef26e78ae2b4d3b64ad
|
|\ \ \ \ |
|
| |/ / /
| | | |
| | | |
| | | |
| | | |
| | | | |
Added TID and io handle to AudioFlinger threads dump.
Change-Id: Ib1a856f3bad55c73e4c395b5e59d57435f4b9a4c
|
|/ / /
| | |
| | |
| | |
| | | |
Bug: 6165157
Change-Id: I3c85bbcaf31f3cb9a009e273f7b6284015eb3bd8
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Fix indentation to be multiple of 4.
Make it easier to search:
sp< not sp < to
"switch (...)" instead of "switch(...)" (also "if" and "while")
Remove redundant blank line at start or EOF.
Remove whitespace at end of line.
Remove extra blank lines where they don't add value.
Use git diff -b or -w to verify.
Change-Id: I966b7ba852faa5474be6907fb212f5e267c2874e
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Use ALOG_ASSERT instead of assert.
Use compile-time asserts where appropriate.
Fix typo in an ALOGV.
Change-Id: I58f1c1ffc14319a022c88b5a88b8d0368660da8b
|
|/ / /
| | |
| | |
| | | |
Change-Id: I55df1738fb7ba17ba6caeea6a17557526eac17a7
|
| | |
| | |
| | |
| | |
| | |
| | | |
Also the declaration of applyVolume in PlaybackThread was dead.
Change-Id: I4b1a9848d07d3d7f340baea05b17f667c78df868
|
|\ \ \ |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Add comments to the remaining friends, so we know what is left if we
decide to remove them later.
Change-Id: I1de929257dc4700960f77902cda3d303177c72cf
|