| Commit message (Collapse) | Author | Age | Files | Lines |
|\ |
|
| |
| |
| |
| |
| | |
Bug: 11148722
Change-Id: Iec88f00c8510363d4418e4b8d5b34feb06ecf04d
|
|/
|
|
|
|
|
|
|
|
| |
The head position transfered to the new track
by restoreTrack_l() must take into account the frames that
are dropped from the old track to avoid a non recoverable
offset in the playback head position returned to applications.
Bug: 11230062.
Change-Id: I51143a08b95e8f264ed709ae2054360315f2b8b1
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Volume: add a method to wake up the mediaserver playback
thread when a volume command is received on an offloaded track.
Effects: call effect chain process on offloaded playback threads
asynchronously from writes to allow effect state updates while
waiting for async write callback.
Bug: 10796540.
Change-Id: Id2747ae88783575d1d7ffd6fc86fbd054ab2c739
|
|
|
|
|
|
|
|
| |
Fix regression introduced by commit 5a6cd22 in AudioTrack resume:
the callback thread was not signaled if paused internaly.
Bug: 10895013.
Change-Id: Ic356b115132d6fccbcee2d9bb855e92671dc20c5
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
OpenSL ES requests a fast track. If sample rate conversion is needed,
the request is denied by server, and a larger client buffer is used
to handle the higher latency of a normal track. However the client
notification period was calculated based on buffer being divided into
2 sub-buffers. That resulted in the notification period being too long.
The server pulls chunks that are smaller than half the total buffer.
So now the client uses 3 sub-buffers when there is SRC.
Also removed the 'defer wake' optimization because it was incorrect.
This optimization attempted to reduce the number of wakeups of client,
when server releaseBuffer knows that another releaseBuffer will be
following. But there is no way for the first releaseBuffer to predict
how soon the second releaseBuffer will occur. In some cases it was
a long time, and the client underran. So now the client is woken up
immediately if the total number of available frames to client is >=
the minimum number the client wants to see (the notification period).
Also fix bug where minimum frame count was not being used in the
calculation of notification period.
Bug: 10342804
Change-Id: I3c246f4e7bc3684a344f2cf08268dc082e338e2a
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Check that get_presentation_position is non-NULL before calling.
AudioTrack::getTimestamp not implemented for fast tracks.
Fix typo in Track::getTimestamp().
Fix bugs in AudioTrack::getTimestamp after stop:
- getTimestamp while stopped is not allowed.
- stop, start, getTimestamp now returns the correct value.
Change-Id: Ie8d9dc1f28d8927634e04175a68b147ffc2ea8eb
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
with dummy implementation in AudioFlinger::TrackHandle, and
implement AudioTrack::getTimestamp() using IAudioTrack.
Also document invariant that mAudioTrack and control block are always
non-0 after successful initialization.
Change-Id: I9861d1454cff7decf795d5d5898ac7999a9f3b7e
|
|\ \
| |/ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This new API is intended to replace latency(), especially for A/V sync.
The application will receive periodic timestamp notifications. The period
is unspecified, but will likely be more frequent after a pause or stop,
set position, underrun, display on/off change, route change, or when audio
framework notices drift. It will be up to the higher level application
(e.g. Stagefright) to reconstruct a clock that updates more frequently.
The current latency() method doesn't indicate when latency changes
due to screen on/off state, route changes, etc.
Includes squahsed change-Id: I2082f8752040be0c234b1a6f1be2e269abf2ce7c
Dummy implementation of AudioTrack:getTimestamp()
Rename AudioTrack::Timestamp to AudioTimestamp.
Renaming and pulling up to a higher level allows more modules to use it.
Change-Id: Ibf7f6a207c3f8d8697f25ede2cd5200697fadb86
(cherry picked from commit dd69eb893867634fd169c03204a6ad7c74b351e7)
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
When the amount of frames that can be written to the buffer
is less than requested, AudioTrack::processAudioBuffer() estimates
the time needed to free the missing amount of frames and asks the
callback thread to sleep.
This behavior is not possible for compressed audio and should not
be enabled for offloaded tracks.
Change-Id: I5b657283cfba06254c9ac0ea9b447467cce7eb61
|
|/
|
|
|
|
|
|
|
|
|
| |
When restarting an AudioTrack from stopped state, it is necessary
to force refresh of mRemainingFrames by processAudioBuffer() as
the last write before stop() could be partial. No doing so will lead
into unnecessary sleep before filling the non contiguous part
of the buffer returned by obtainBuffer() when processAudioBuffer()
is executed for the first time after start().
Change-Id: Id703f8dc092a6f07c905eee194054b4a978f979d
|
|
|
|
|
|
|
| |
This is part of a series of CLs to clean up the shared memory
control block, by removing any fields that don't have to be there.
Change-Id: I6e51003a1293b6800258c31b22cff2eba42162e7
|
|
|
|
| |
Change-Id: I7b6d31e24531954ab1ecdf3ed56c19433700bd89
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- start() returns a status so that upper layers can
recreate a non offloaded track in case of error.
- Added states to handle offloaded tracks specific:
- waiting for stream end (drain) notification by
audio flinger
- allow pause while waiting for stream end notification
- getPosition() queries the render position directly from
audio HAL.
- disable APIs not applicable to offloaded tracks
- Modified track restoring behavior for invalidated
offloaded tracks: just send the callback and wait for
upper layers to create a new track.
- Added wait for stream end management in audio track client
proxy. Similar to obtainBuffer and should be factored in.
Change-Id: I0fc48117946364cb255afd653195498891f622bd
Signed-off-by: Eric Laurent <elaurent@google.com>
|
|\ |
|
| |
| |
| |
| | |
Change-Id: Ifbf3a46a4183c8abc0feee1c588953ab10303cc1
|
|/
|
|
|
|
| |
It returned a bool instead of nsecs_t
Change-Id: If0c096dac411afc0a4142ec1e59c1fdd36d4867c
|
|
|
|
|
|
|
| |
Remove old includes.
Header files only include other header files that they directly need themselves.
Change-Id: Ic471386808d9f42ea19ccbd59cb50a5f83a89dd0
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
NOTE: this does _not_ include all private member variables added
to classes as part of offload support. Only public/protected functions
and stubs functions/variables needed to make the changes buildable.
- isOffloadSupported() added to audio policy service
A stub implementation is required to build, this always returns false
- setParameters() added to IAudioTrack
A stub implementation is required to build, this always returns
INVALID_OPERATION
- CBlk flag for stream end
- Change AudioSystem::getRenderPosition() to take an audio_output_t
so caller can specify which output to query
- Add AudioSystem::isOffloadSupported()
This is fully implemented down to the AudioFlinger function
AudioPolicyServer::isOffloadSupported() which is just a stub
that always returns false.
- Add EVENT_STREAM_END to AudioTrack interface.
STREAM_END is used to signal when the hardware has actually finished
playing all the data it was sent.
- Add event type enumeration to media player interface AudioSink callbacks
so that the same callback can be used to handle multiple types of
event. For offloaded tracks we also have to handle STREAM_END and
TEAR_DOWN events
- Pass audio_offload_info_t to various functions used for opening outputs,
tracks and audio players. This passes additional information about the
compressed stream down to the HAL when using offload.
For publicly-available APIs this is an optional parameter (for some of
the internal and low-level APIs around the HAL interface it is mandatory)
- Add getParameters() and setParameters() API to AudioTrack
Currently dummy implementations.
- Change AudioPlayer contructor so that it takes a set of bitflags defining what
options are required. This replaces the original bool which only specified
whether to use deep buffering.
- Changes to StageFright class definition related to handling tearing-down of
an offloaded track when we need to switch back to software decode
- Define new StageFright utility functions used for offloaded tracks
Currently dummy implementations.
- AudioFlinger changes to use extended audio_config_t.
Fills in audio_offload_info_t member if this info is passed in when
opening an output.
- libvideoeditor changes required to add the new event type parameter
to AudioSink callback functions
- libmediaplayerservice changes required to add the new event type parameter
to AudioSink callback functions
Change-Id: I3ab41138aa1083d81fe83b886a9b1021ec7320f1
Signed-off-by: Richard Fitzgerald <rf@opensource.wolfsonmicro.com>
Signed-off-by: Eric Laurent <elaurent@google.com>
|
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This forces a minimum of 3 application buffers when the sample rates
don't match, using the normal mixer and low latency HAL.
There is still an issue that the latency() varies depending on whether
screen was off or on at the time of creating the AudioTrack.
With screen on:
I/AudioTrack( 2028): afFrameCount=960, minBufCount=2, afSampleRate=48000, afLatency=50
I/AudioTrack( 2028): minFrameCount: 2646, afFrameCount=960, minBufCount=3, sampleRate=44100, afSampleRate=48000, afLatency=50
With screen off:
I/AudioTrack( 2817): afFrameCount=960, minBufCount=4, afSampleRate=48000, afLatency=84
I/AudioTrack( 2817): minFrameCount: 3528, afFrameCount=960, minBufCount=4, sampleRate=44100, afSampleRate=48000, afLatency=84
Change-Id: Ib45515edff2afcd672dda34881b658c800ffc25a
|
|
|
|
| |
Change-Id: I118cce68d3b777f9ec9b6bfb70367496422a40f2
|
|\
| |
| |
| |
| |
| |
| | |
audio" into jb-mr2-dev
* commit '1641f328d4de3b2b61481607dc482ccaefe808a9':
Remove timing jitter during startup of audio
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes a regression introduced recently, that increased timing jitter
during the startup of the FastMixer and AudioTrack callback threads.
The regression was to make requestPriority() asynchronous as a way to
avoid an apparent priority inversion in system_server. This means that
the target thread could run briefly with the initial priority, before
the new priority takes effect.
This change removes the startup jitter for FastMixer, by making the
requestPriority() synchronous again for that case. It doesn't matter
that this restores the priority inversion involving normal mixer thread,
because it happens during startup of both threads.
The change also removes the startup jitter for the AudioTrack callback
thread, by having the target thread check whether the requestPriority()
has completed yet. If not, the target thread blocks with a timeout
until the priority boost finishes.
Finally, we now log an error message if the expected priority boost
doesn't happen.
Bug: 8698989
Change-Id: Id590e9a274b70ec1ba85b44a585ee37a22e41cbc
|
|/
|
|
|
|
|
| |
Add new API getBufferPosition to return position relative
to start of fixed buffer.
Change-Id: I7aca8e392d45b988545f07b36b5032691057b03e
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
|/
|
|
|
|
| |
Just get the parameter on server side
Change-Id: I433a63104dbb257e0d862be2ab61847cb36d1c15
|
|
|
|
|
|
| |
Prepare for a new implementation of step() etc.
Change-Id: I268421976ba577aa1fb5d7015de5441c05861190
|
|
|
|
|
|
| |
Update comments and improve error checks to match
Change-Id: I7370d6e59a7ef26dfb284a8b058d5ab2e0a42ccf
|
|
|
|
|
|
|
| |
flush() is only useful for streaming mode.
It is a no-op if track is active or uses a static buffer.
Change-Id: I918ac181ffae3d16a0d67d8a7208f4aec61b5bd6
|
|
|
|
|
|
|
| |
If ever needed again, it could be implemented on client side by forcing
a track volume of 0.
Change-Id: I88a9b4f675b6dca2948549414f9ec2c192d29269
|
|
|
|
| |
Change-Id: I142917edb454d510bbe545e94e6eaea30b650fae
|
|
|
|
|
|
|
|
| |
Channel count is uint32_t.
Remove redundant mask parameter to AudioTrack::createTrack_l()
and AudioRecord::openRecord_l().
Change-Id: I5dc2b18eb609b2c0dc3091994cbaa4628062c17f
|
|\ |
|
| |
| |
| |
| | |
Change-Id: I130e7849fd1da7a0b7fe56c3c53919d26e3843b8
|
|\ \ |
|
| |/
| |
| |
| |
| |
| | |
This is part of a series to clean up the control block.
Change-Id: I7f4cb05aef63053f8e2ab05b286d302260ef4758
|
|/
|
|
|
|
| |
If needed, it can be obtained with adb logcat -v threadtime
Change-Id: I91b3911d20f7bcfc3361db4052db21ff9181f1cf
|
|
|
|
|
|
| |
Also fix typo: bufferCount should be frameCount.
Change-Id: Ibed539504db75ef99dc21c8ff1bf2987122063a5
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
TrackBase::mFrameSize, mChannelMask, and mChannelCount are now const.
Use TrackBase::mFrameSize instead of re-calculating frame size.
AudioFlinger only sees 16-bit PCM format, conversion from 8-bit is
now entirely on the client side. Previously a small part of the
responsibility was on server side also.
size_t is unsigned, so use %u in logs.
Fix theoretical bug where TrackBase constructor was over-allocating space
for non-linear AudioTrack or 8-bit PCM AudioRecord (probably benign).
Change-Id: I7cbbba0bf4dba29ea751d8af341ab8e5cbbdc206
|
|
|
|
| |
Change-Id: Ie240b48fb54b08359f69ecd4e5f8bda3d15cbe80
|
|
|
|
| |
Change-Id: I85d7d2f6381b251db5695202fec75128883a8662
|
|
|
|
|
|
| |
This is part of a series to clean up the control block.
Change-Id: Ifab1c42ac0f8be704e571b292713cd2250d12a3f
|
|
|
|
|
| |
Bug: 7526532
Change-Id: I8ddd1f0e9d035b54401788dcc422591281dcd97a
|
|
|
|
|
|
| |
This is part of a series to clean up the control block.
Change-Id: Ie474557db7cb360f2d9a0f11600a68f5a3d46f07
|
|
|
|
|
|
|
|
|
| |
Remove CBLK_RESTORING and CBLK_RESTORED from control block flags,
for AudioTrack only. They are still used by AudioRecord.
This is part of a series to clean up the control block.
Change-Id: Iae4798f5b527c492bdaf789987ff3a1dadd0cb37
|