| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
AudioPlayer must read the sampling rate from offloaded audio sinks
whenever a new time position is computed as the decoder can update
the sampling rate on the fly.
Change-Id: I997e5248cfd4017aeceb4e11689324ded2a5bc88
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
After switching from offloaded track to PCM track
while paused (e.g. when connecting A2DP), playback
restarts from the beginning of the song when resuming.
Save current position before recreating an AudioPlayer
in AwesomePlayer::play_l() and seek to the saved position before
starting playback.
Also fix a problem where the position is not reported properly
by AudioPlayer if a seek is pending and queried just after start
and before the first buffer is read from the MediaSource.
Bug: 8174034.
Change-Id: I254e65418ff903a9bf2e2111b89a00e2e54876c5
|
|
|
|
|
|
|
| |
Use realtime queried from AudioTrack as the only time for compress
offload playback.
Change-Id: I314447637715c4864690c94173260165369146cb
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Offloading of compressed audio decoding to audio DSP
is implemented for audio only, non streamed content.
when the datasource is
AudioPlayer:
- Create an offloaded sink when playing a compressed
source
- Send metadata to audio HAL
- Return sink start error to AwesomePlayer so that a
new player for PCM audio can be created in case of problem.
- Forward stream end and tear down callback events to AwesomePlayer
- Stop the sink and wait for stream end callback when EOS is reached.
- Pause and restart the sink if needed before flushing when seeking
(otherwise flush is a no op).
- For current media time, directly query the render position from the
sink and offset by the start position (seek to time)
AwesomePlayer:
- When initializing the audio decoder, check with audio policy manager
if offloading is supported. If yes, create the software decoder in
case a reconfiguration is needed but connect the audio track directly
to the AudioPlayer.
- In case of error when starting the AudioPlayer, reconnect the software
decoder (OMXSource) and recreate a PCM AudioPlayer.
- Handle AudioPlayer tear down event by detroying and recreating the
AudioPlayer to allow transitions between situations were offloading
is supported or not.
- Force tear down of offloaded AudioPlayer when paused for a certain time:
This will close the sink and allow the DSP to power down.
Utils:
- Added helper methods:
- send meta data to audio ia sink setParameters
- query audio policy manager if offloading is supported for a
given audio content
Change-Id: I115842ce424f947b966d45e253a74d3fd5df9aae
Signed-off-by: Eric Laurent <elaurent@google.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This change prepares for the new implementation of AudioTrack client, which
will require clients to use only sp<AudioTrack>, not raw AudioTrack *.
A raw delete will cause a race condition during AudioTrack destruction.
AudioTrack was made a RefBase by commit b68a91a70bc8d0d18e7404e14443d4e4020b3635
on 2011/11/15, when it was needed by OpenSL ES (for the callback protector).
At that time, the only other client that was also converted from
AudioTrack * to sp<AudioTrack> was android.media.AudioTrack JNI in
project frameworks/base (file android_media_AudioTrack.cpp).
Details:
* Use .clear() instead of delete followed by = NULL.
* ALOG %p need .get().
* sp<> don't need to be listed in constructor initializer, if initially 0.
* Use == 0 for sp<> vs == NULL for raw pointers.
* Use if (sp != 0) instead of if (raw).
Change-Id: Ic7cad25795d6e862e112abdc227b6d33afdfce17
|
|
|
|
| |
This reverts commit 022048e95f3f1d65cb776cf21de2001423fcf7d9.
|
|
|
|
|
|
| |
related-to-bug: 6500580
Change-Id: If47e442db2f1ea400e9b598502bb48513f28cd6d
|
|
|
|
|
| |
Change-Id: I55903ba625d9c075a9a6e7bcd5ff95d450b915b2
related-to-bug: 6479613
|
|
|
|
|
|
|
| |
for the delay since the last buffer submission to the audio sink.
Change-Id: Ib1a8672f96ba8bbef07d23372f1076fbb1f0bdcc
related-to-bug: 6479613
|
|
|
|
|
| |
This reverts commit 887c5d2ac34d81bde66dadbd7b2ff07501744778, reversing
changes made to 5aaeb0d64fc98f9b019a4378eb39f0ee49ee6ec4.
|
|
|
|
|
|
|
|
| |
Don't log a warning when an AudioPlayer derives a channel mask
from the channel count, only info-log when channel count is
higher than 2.
Change-Id: Ia1cbced660903483654eede300ef72f7f17dcf78
|
|
|
|
|
|
|
|
|
|
| |
Allow AudioSink to use deep audio buffering when the
source is audio only and its duration is more than
a certain threshold.
This helps improve battery life but implies higher
audio latency.
Change-Id: Ie79915b61c370292f05aabda9779356570e03cbb
|
|
|
|
| |
Change-Id: I27c46bd1d1b2b5f96b87af7d05b951fef18a1312
|
|
|
|
|
|
|
| |
and avoid ambiguous term "channels" where it might be confusing
as to whether it is a channel mask or channel count
Change-Id: I744fa08ccb6001a98c97bd638d2c9d56836c4234
|
|\ |
|
| |
| |
| |
| |
| |
| |
| | |
Currently able to play Ogg Vorbis, PCM WAV and other lossless files seamlessly
by reusing the initial AudioTrack for subsequent players.
Change-Id: Ie7cf6b9076bdf4f9211574456d192c02c04fecc7
|
|/
|
|
|
|
|
|
|
|
| |
This affects:
- IAudioFlinger::openOutput
- AudioTrack::AudioTrack
- AudioTrack::set
- apps that call these
Change-Id: I26fb281bac6cb87593d17697bc9cb37a835af205
|
|
|
|
|
|
|
|
|
|
|
|
| |
The latency was not taken into account when updating mPositionTimeRealUs
inside of the fillBuffer hook, contrary to what the getRealTimeUsLocked()
method does. This caused the realTimeOffset calculated in the
getMediaTimeUs to always be negative, causing the reported position to
always be equal to mPositionTimeMediaUs, which is updated infrequently.
With this change, the reported position is updated more frequently, allowing
apps to perform smoother UI updates.
Change-Id: I61e05c1a8b53d46b9091afb0d18a6289d13a7a5e
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The AudioSink latency is currently cached when the associated AudioTrack
is created. However, the AudioTrack latency can change if the AudioTrack is moved
from one output stream to another.
The AudioPlayer must also periodically update its view of the latency
as it is needed to compensate the real audio time used for A/V sync.
This fixes an A/V sync problem seen when switching A2DP on and off while
playing a video.
Change-Id: I28b24049ca114e1af3e24791dcc900f463536ba4
|
|/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Add support for specifying a channel mask when opening an AudioSink.
This parameter does not replace the channel count parameter in order
to not have to duplicate the logic to derive a mask from the
channel count everywhere an AudioSink is used without a known mask.
A mask of 0 (CHANNEL_MASK_USE_CHANNEL_ORDER) means a mask will
be automatically derived from the number of channels.
Update existing AudioSink implementations to use the channel mask,
and users of AudioSink to specify the mask if available, and
CHANNEL_MASK_USE_CHANNEL_ORDER otherwise.
Change-Id: Ifa9bd259874816dbc25ead2b03ea52e873cff474
|
|
|
|
|
|
|
|
|
| |
Add support for modifying the playback rate of a MediaPlayer
by altering the sample rate of its AudioTrack.
The playback rate is expressed in permille, where 1000 is the
playback at normal speed.
Change-Id: I981d060ab32f7bae7a767e82c60c88ae635dceed
|
|
|
|
|
|
|
| |
See https://android-git.corp.google.com/g/#/c/143865
Bug: 5449033
Change-Id: I0122812ed6ff6f5b59fe4a43ab8bff0577adde0a
|
|
|
|
|
| |
Change-Id: I0cda94646a71757fa113a199d29235e13efd7ac3
related-to-bug: 5331470
|
|
|
|
|
|
|
|
| |
Otherwise it'll trigger a division-by-zero exception since the audio sample rate
is as yet unknown.
Change-Id: I0793aa7c1c348ffa2611272bb646eff6ecf6ff53
related-to-bug: 5242451
|
|
|
|
|
|
|
| |
in order to compute the final delay before posting end-of-stream correctly.
Change-Id: I4ff6d7142fdf1ea2d19d12ec78c1e84322d22e5f
related-to-bug: 5216930
|
|
|
| |
This reverts commit 2225e4b7049fa3fb9d39a068b8268b63c952d7c1
|
|
|
|
| |
Change-Id: Ifefc708d46874e04fd0d01cb6e2d43b987ee796c
|
|
|
|
|
|
| |
starting the audio player.
Change-Id: Ibedc1804a8c444e4d0f5be4eb87b22ed5d2c367d
|
|
|
|
|
| |
Change-Id: Ibc637918637329e4f2b62f4ac7781102fbc269f5
Signed-off-by: Dima Zavin <dima@android.com>
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Instead of returning 0-filled buffers after EOS from AudioTrack we do this
work in AudioOutput instead. That way the EOS signal (0 frames returned)
is preserved in AudioCache which otherwise would lead to a heap size overflow
filling everything with zeroes.
Change-Id: I7e07429ba887957a4340dd4b21eef4bba76248cd
related-to-bug: 3514073
|
|/
|
|
|
|
|
| |
the lock.
Change-Id: Idfea452ff661b264e013fe515bcd2a2762bd959c
related-to-bug: 4193552
|
|\
| |
| |
| |
| |
| |
| | |
period where audio time isn\'t reestablished." into honeycomb-mr1
* commit 'a4a81aef39b15649bda146476d98f23ac554887f':
After a seek there's a brief period where audio time isn't reestablished.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Don't use audio time to trigger a "we're very late, skipping ahead" action
until it's reestablished.
Change-Id: Ia8534e5bed60203d49a457d14b2e55eb972b5fa1
related-to-bug: 4173683
|
|/
|
|
|
| |
Change-Id: I1fa07358a885a818fd0a5d7da425740f86095e10
related-to-bug: 3404000
|
|
|
|
|
| |
Change-Id: I9aa797cf5bb58eefed51d732f4e5d09450551158
related-to-bug: 3347428
|
|
|
|
|
|
| |
submitting all samples to AudioTrack to make sure those remaining samples are actually played out.
Change-Id: Id574a0203efcb5e565f1b0fe77869fc33b9a9d56
|
|
|
|
|
|
|
| |
both the mp3 decoder and aac software decoders start fresh after a seek without any dependency on previously decoded content.
Change-Id: I4909fdf19518dbabb6c340e2a31b50dfe6c5b067
related-to-bug: 3029947
|
|
|
|
|
|
|
| |
finished seeking, initiate the notification from the AudioPlayer when the event happens.
Change-Id: I43875b6adaf96d4e982ef3dfc3d6c8f7034ac51d
related-to-bug: 3036592
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
commit 4abf16bb04dc9695fedf4007a84f903074312ccd
Author: Andreas Huber <andih@google.com>
Date: Tue Jul 20 09:21:17 2010 -0700
Support a single format change at the beginning of audio playback. This way the AAC+ decoder may change its output format from what is originally encoded in the audio stream and we'll still play it back correctly.
Change-Id: Icc790122744745e9a88099788d4818ca1e265a82
related-to-bug: 2826841
commit 09c74da63e6ad5cb5dafb70f62696d75d2978967
Author: James Dong <jdong@google.com>
Date: Sun Jul 18 17:57:01 2010 -0700
Fix MPEG4Extractor to extract sampling frequency correctly when SBR is enabled.
Change-Id: I883c81dad3ea465e71cb5590e89d763671a90ff8
commit f672bf2a782dc7d5fb6325d611a7fe17045dfe9a
Author: James Dong <jdong@google.com>
Date: Thu Jul 8 20:56:13 2010 -0700
Enable the support for decoding audio with AAC+ and eAAC+ features
bug - 282684
Change-Id: I73c8377af3cc4edd3ee7cea86dc3b1c369fbd78b
Change-Id: I012f1179e933b6d1345d2368f357576c722485f7
|
|
|
|
|
|
|
| |
sine-tones using a filename of "sine:[samplingrate]", i.e. sine:44100. Support for playing audio through to the speakers by using "-o" in addition to "-a".
related-to-bug: 2553359
Change-Id: Ic49eb89feb62474d9513bc21571e0e8fe3a15e0b
|
|
|
|
|
|
|
| |
wasn't started at the time prepare() was called. Also, properly report the cached duration even near the end when the source has no more data to fetch.
Change-Id: I66a92fec24c9bfb25f1c186f1c877127bae2b4f9
related-to-bug: 2444425
|
|
|
|
| |
attempt to instantiate another one, otherwise we might end up with the software codec even though the hardware codec would have been available shortly.
|
|
|
|
|
|
| |
MEDIA_PLAYBACK_COMPLETE or MEDIA_ERROR depending on the final reason for running out of buffers to play back.
related-to-bug: 2463749
|
|
|
|
|
|
|
| |
Store AudioTrack->initCheck()'s return value so we can return it after
the AudioTrack is deleted.
Change-Id: Ie042a7d6a54d7f9afd8a5767cfd167dbeb2e5c04
|
|
|
|
| |
related-to-bug: 2359268
|
| |
|
|
|
|
|
|
| |
negative media positions.
related-to-bug: 2414900
|