5492 Commits

Author SHA1 Message Date
Justin Koh
bff6a514da Merge "Persists the master mute volume setting." into ics-aah 2012-04-04 09:45:27 -07:00
Justin Koh
57978ed862 Persists the master mute volume setting.
Persists the master mute volume setting across reboots.

TESTED = runs on Tungsten.

Change-Id: I9628b9369ca528b22413f62a9e7d697bae61d8ac
2012-04-03 17:37:58 -07:00
Jason Noguchi
f499a0722b am a784b3de: Fix build break introduced by missing parenthesis in camera stress test.
* commit 'a784b3dea15dd0dfedfe25552b87fbb92a5eea52':
  Fix build break introduced by missing parenthesis in camera stress test.
2012-04-03 17:30:55 -07:00
Jason Noguchi
a784b3dea1 Fix build break introduced by missing parenthesis in camera stress test.
Change-Id: I8da9321a7674dbbe48cc0c214c0b043fbce8eeab
2012-04-03 17:01:50 -07:00
Jason Noguchi
e371ed8de5 am 6e6d8df5: Merge "Adding camera zoom test to mediaframework stress suite." into ics-mr1
* commit '6e6d8df5d0ad0f97be8344c78aa4d70dadceb9a8':
  Adding camera zoom test to mediaframework stress suite.
2012-04-03 15:32:30 -07:00
Jason Noguchi
6e6d8df5d0 Merge "Adding camera zoom test to mediaframework stress suite." into ics-mr1 2012-04-03 15:30:22 -07:00
Justin Koh
3caba51725 Broadcast mastervolume regardless of change.
Broadcast mastervolume intents regardless of whether the system changed the
volume. This fixes the bug where the volume LEDs stop getting updates.

TESTED = runs on Tungsten.

Change-Id: Id363da3f825934fd7785ed3d3e436f74e657b7e6
2012-04-02 15:46:56 -07:00
RoboErik
830ad08fe4 Merge "b/6232528 Reduce volume persist delay to 500ms" into ics-aah 2012-03-28 15:04:32 -07:00
RoboErik
45edba1b8b b/6232528 Reduce volume persist delay to 500ms
Change-Id: I45c32da0a1089ce8bc865e12b51c069a6db28fd4
2012-03-27 17:54:36 -07:00
Jason Simmons
be587b52c7 Merge "Do not call stop() on the MediaSource if it hasn't been started." into ics-aah 2012-03-27 09:50:08 -07:00
Jason Simmons
1f763f7c72 Do not call stop() on the MediaSource if it hasn't been started.
The MediaSource's destructor will take care of stopping the source.

Bug: 6232094
Change-Id: Iace6c11ded666e7ac7066aa9d493d1b644e4b92d
2012-03-26 19:12:37 -07:00
John Grossman
0f6cb45002 LibAAH_RTP: Release TX Group on error.
Immedately release any TX group a player is holding upon entering the
error state.  Once in the error state, the only way out for a media
player it to be completely reset (destroying the player at the
tx_player level of things).  There is really no point in holding on to
a tx group once the player is in the error state.

Change-Id: If5442a32e012b5596789078b0790ed73fa842629
2012-03-23 11:24:32 -07:00
John Grossman
2b16bf6bdb LibAAH_RTP: Fix handling of PCM format changes.
When an audio decoder signals a format change, we were destroying our
renderer so that a new one could be created with the new format, but
we were not updating our internal format state variables with the new
format information.

This fixes issues with AAC audio with SBR extensions; in particular
content coming from Pandora.  Pandora audio is currently being
delivered as AAC-LC decoding to 22.05 KHz, but with an SBR layer which
gives 44.1 KHz.  Whether or not you are going to get 22.05 or 44.1
depends on if your decoder supports SBR ("High Efficiency" profile).
Stagefright does not parse the extension sample rate present in the
ESDS; instead it reports the sample rate of the base stream (22050 in
this case).  Its only when the decoder decides it can handle SBR that
you get a chance to discover that the content is actually 44.1,
information it delivers via a format change status code during read.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I78fb89b4356004d7834629ccc82ca99c4cc7954a
2012-03-23 11:00:38 -07:00
Jason Noguchi
41d88d5f58 Adding camera zoom test to mediaframework stress suite.
Change-Id: I3ee72156f42cf189ff1d0bd469f83b938a6b87ff
2012-03-22 17:52:03 -07:00
John Grossman
6becc5a811 LibAAH_RTP: Fix an issue which crept in during code review.
Fix a mistake which came in as part of a merge conflict resolution
during code review of the recent unicast mode refactor of LibAAH_RTP.
Nop packet which were supposed to carry TS transformations for the
pause state accidentally got flagged as Flush operations.  The flush
packet successfully carried the TS transformation, but also had the
undesired side effect of constantly flushing the stream.

Change-Id: I4c6aa0043fc274a1d7e880ed1d19cf277f22194b
Signed-off-by: John Grossman <johngro@google.com>
2012-03-22 11:30:09 -07:00
John Grossman
092bae63f1 LibAAH_RTP: Properly handle EOS conditions.
EOS was being treated as a flush operation which was causing problems.
In particular, the transmitter was delcaring that playback was
complete early (by the clock lead time of the system, which was 1
second in this case).  Also, the receiver was treating the EOS message
just like the flush message, immediately destroying the substreams
associated with the program without letting them play out first.

Change the transmitter to send the EOS message like it always does,
but have it wait until the media time of the last sample has arrived
before reporting playback complete to the app level of things.

On the receiver side of things, don't treat the EOS message like the
flush message.  Instead, have the EOS message simply put the substream
into EOS mode, allowing it to signal EOS to its decoder and shut off
the isAboutToUnderflow hack.

Change-Id: Ibe3ac01044373f83edb7a5f4b70478bd78c16d11
2012-03-21 14:01:47 -07:00
John Grossman
fa9ea48ddf LibAAH_RTP: Get rid of PipeEvent
Bionic/Android support eventfd, so there is really no reason to have
PipeEvent around any more.  This change gets rid of it in LibAAH_RTP
and replaces it with eventfds.

Change-Id: I841fcb71bf5015d521d7517c69f44eac0ea92278
Signed-off-by: John Grossman <johngro@google.com>
2012-03-21 12:12:31 -07:00
John Grossman
2921612dc8 LibAAH_RTP: Add unicast mode support to the RXPlayer
Add support for unicast mode to the AAH RXPlayer.  At the API level,
things should be pretty simple.  To use unicast mode, instead of
passing the multicast address and port in the data source URL, just
pass the unicast address and port of the transmitters command and
control port.  For example, instead of

aahRX://224.128.60.5:8867

one might instead pass

aahRX://192.168.63.5:55476

Change-Id: I7b40716983d7a91def86dcf40f093dda4255aae3
Signed-off-by: John Grossman <johngro@google.com>
2012-03-21 12:12:28 -07:00
John Grossman
06938878d3 LibAAH_RTP: Fix a stuttering audio bug.
Fix a bug discovered while working on adding unicast mode to the TX/RX
players.  Also some general cleanup/consolidation regarding timeout
code.

The bug went like this.  When a TX player had hit EOS, it would send
an EOS command payload to its receivers.  Later, when application
level code shutdown and cleaned up the player, it would send another.
In situations where there is massive packet loss, there is a chance
that not only did both of the EOS packets get dropped, but that they
never got filled in by the retry algorithm because the receiver gave
up on the RTP gap due to an aboutToUnderflow situation in at least one
of its active substreams.

When this happens, there are two major problems.  First, all of the
substreams associated with the TX player which has now gone away have
become effectively leaked.  They will only get cleaned up if the
entire RTP stream (the TX Group) goes away for 10 seconds or more, or
when the RX Player itself is reset by application level code or a
fatal error.  These substreams are holding decoder and renderer
resources which are probably in very short supply, which is a Bad
Thing.

Second, there is now at least one substream in the RX player which is
never going to receive another payload (its TX player source is gone),
but is still considered to be active by the rx player.  Assuming that
this substream's program was in the play state when the track ended,
there is now at least one substream which is always
"aboutToUnderflow".  From here on out, when the retry algorithm is
attempting to decide whether or not it has the time to attempt to fill
in a gap in the muxed RTP sequence, it always decides that it does not
have the time because of the orphaned substream which is stuck in its
about to underflow state.  This effectively means that the retry
algorithm is completely shut off until the rx player gets reset
somehow (something which does not happen during normal operation).
Since the environment had to be extremely lossy to trigger this chain
of events in the first place, and its probably no better now, your
playback is just going to be chock full of gaps which produces
horrible stuttering in the presentation stage of the system.

Two new failsafes have been introduced to keep the double EOS drop
from causing this.  First, a timeout has been introduced on the
substream level, in addition to the already existing RTP level
timeout.  If a substream fails to receive an activity for 10 seconds
(same timeout as the master RTP timeout), it will be automatically
flushed and purged.

Second, the nature of the master RTP timeout on the transmitter side
has been changed.  Instead of just sending an empty NOP command packet
to indicate that the main RTP stream is still alive, the transmitter
now sends a new time of command packet; the Active Program Update
packet.  This packet contains a list of all the active program ID
attached to this TX group.  Upon receiving one of these APU packets,
RX players reset the inactivity timers for all substreams which are
members of the programs listed in the packet, but they also
immediately purge any substreams associated with programs not present
in the APU.

Between the two of these, no matter how nasty and selective the packet
smashing gremlins in your system happen to be, substreams will always
eventually clean up and avoid getting stuck in a perma-stutter
situation.

Also in this CL:
+ Extract some common utility code into a utils.cpp file so that it
  can be shared across the library.
+ Stop using custom timeout logic in the RXPlayer.  Instead, use the
  common Timeout helper class in utils.cpp.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I350869942074f2cae020f719c2911d9092ba8055
2012-03-21 12:10:41 -07:00
John Grossman
42a6382f1e LibAAH_RTP: Refactor TXGroup code, add unicast mode.
Significantly refactor the TXGroup code to allow transmit groups to
operate in a unicast fanout mode in addition to the traditional pure
multicast mode.  Important changes include...

+ Each transmit group active in the system now has its own socket to
  send and receive traffic on.  In the past, this socket was used to
  listen for retry requests from clients.  Now it is also used to
  listen for group membership reports (IGMPv3 style) from unicast
  clients.  Having an individual socket per transmit group allows
  unicast clients to join the group needing only the IP address and
  port of the transmitters socket, and not needing any additional
  "group id" to be sent to the client beforehand.
+ Setup for the transmitter is now slightly different.  As before, to
  setup for multicast mode, a user can call setRetransmitEndpoint
  passing an IPv4 multicast address and specific port to transmit to.
  It used to also be the case that a user could pass a specific
  unicast address and port to transmit to as well.  This is no longer
  allowed.  Instead, to operate in unicast mode, a user passes 0.0.0.0
  (IPADDR_ANY) as the IP address.  In addition, they need to pass
  either 0 for a port to create a new unicast mode TX group, or they
  need to pass a specific port to cause the player to attempt to use
  an existing unicast mode TX group.  The specific port should be the
  command and control port of the TX group which was bound to when the
  group was originally created.
+ A magic invoke was added to allow clients to fetch the command and
  control port on which a TX Player's TX Group is listening.

The API described above is most likely temporary and should eventually
be replaced with one where TX groups are formal top level objects with
their own independent interface and life-cycle management.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: Ib4e9737c10660d36c50f1825c9824fff5390b1c7
2012-03-21 12:02:37 -07:00
John Grossman
79314de091 LibAAH_RTP: Change names to prepare for refactor.
Rename AAH_TXSender to AAH_TXGroup in preparation for refactoring to
support unicast retransmission.

Signed-off-by: John Grossman <johngro@google.com>
Change-Id: I3984db27d1c61c6155d5d7cb9c38eead421b9249
2012-03-21 09:52:04 -07:00
Eric Laurent
c182e36c8c am 2a0d685e: Merge "MediaPlayerService: fix AudioSink latency" into ics-mr1
* commit '2a0d685ed62ff7a5e5a40be0748860c092165984':
  MediaPlayerService: fix AudioSink latency
2012-03-16 15:01:44 -07:00
Eric Laurent
0615baffd3 am 3fe7ee65: Merge "AudioTrack: relax check on minimum buffer size" into ics-mr1
* commit '3fe7ee651db0aae9485ead227c89db1e24b9e245':
  AudioTrack: relax check on minimum buffer size
2012-03-16 15:01:42 -07:00
Eric Laurent
dc63f3fe40 MediaPlayerService: fix AudioSink latency
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

Conflicts:

	media/libmediaplayerservice/MediaPlayerService.cpp
2012-03-16 12:25:31 -07:00
Eric Laurent
0df689495a AudioTrack: relax check on minimum buffer size
Current AudioTrack implementation enforces that the requested audio
buffer size is at least corresponding the audio latency.
This requirement is too strong and leads to problems with current
stagefright and AudioSink implementations when playing over output
streams with long latency.

Ultimately, the AudioSink design should be changed to specify a minimum
buffer size in time or frames units but not in buffer count units.

Change-Id: I8ba603956f92ac49143a8249572665aa548f2f0f

Conflicts:

	media/libmedia/AudioTrack.cpp
2012-03-16 12:22:07 -07:00
Dirk Dougherty
cd83bf9420 am 4d7bc655: Doc change: String changes for Android Market
* commit '4d7bc65538c7cd9fbb1fbbcf22d1da47fcee1219':
  Doc change: String changes for Android Market
2012-03-05 22:55:39 -08:00
Dirk Dougherty
4d7bc65538 Doc change: String changes for Android Market
Change-Id: I823812a4fd24021bec906ad856479c92a8d2a759
2012-03-05 22:02:35 -08:00
Lei Zhang
d674dd50b7 Add batch volume adjust support to adjustMasterVolume() in AudioManager and
AudioService.

Change-Id: I34382839622a5cc5f2a8768aed011e8224cadff9
2012-03-02 11:48:28 -08:00
Yu Shan Emily Lau
e5feb487dc am eb4f3256: Set the video encoding bit rate for the media recorder stress test.
* commit 'eb4f3256b77fe7fd783297a550a64ea441c41169':
  Set the video encoding bit rate for the media recorder stress test.
2012-02-29 19:00:07 -08:00
Yu Shan Emily Lau
eb4f3256b7 Set the video encoding bit rate for the media
recorder stress test.

Change-Id: I1fa5965d2ba0e17be97ff3b9bd8df3df4e438087
2012-02-29 15:57:21 -08:00
Jason Noguchi
365a4ca780 am ee329930: Merge "Adding time lapse test to mediaframework stress suite." into ics-mr1
* commit 'ee329930956c88d3c2cbcbb6da01abde4b40b2e8':
  Adding time lapse test to mediaframework stress suite.
2012-02-28 11:49:36 -08:00
RoboErik
1918d4353c Fix Audio ramping code
The audio ramping was being ignored and we were always adjusting
by the same amount.

Change-Id: I1dc122e033c382f556844c5acadcfb698c8d2092
2012-02-24 17:44:27 -08:00
John Grossman
4aea858564 Switch the way we configure for MediaPlayer retransmission.
Move in the direction of a more publishable API for configuring a
media player for retransmission.  It used to be that we used a custom
invoke and a modified URL (prefixed with aahTX://).  There are many
issues with this technique and it was never meant to stand the test of
time.

This CL gets rid of all that.  A new (but currently hidden) method was
introduced to the java level MediaPlayer API, called
setRetransmitTarget(InetSocketAddress), which allows an app writer to
set the retransmit target.  For now, this method needs to be called
before a call to setDataSource (which is pretty unusual for the
MediaPlayer API) because this mid level code uses this as a cue to
instantiate an aahTX player instead of relying on the data source to
select a player.  When retranmit functionality becomes part of the
existing android player implemenation, this
set-retrans-before-set-data-source behavior can go away, along with
the aahTX player itself.

Change-Id: I6ab07d89b2eeb0650e634b8c3b7a0b36aba4e7dd
2012-02-23 12:02:04 -08:00
John Grossman
fa4a191d0d Revert "Add a way to play file descriptor data sources using the A@H transmitter media player."
This reverts commit 64006cb1642b2ec0ee74c66007d869b884391fd1.

Back out this change in order to get ready to implement a longer term,
more media-team approved way of selecting a retransmit player.

Change-Id: I97b68b9859a174eab858598cb00d4445a14fbc17
2012-02-23 09:29:51 -08:00
Jason Noguchi
27c8d9ba16 Adding time lapse test to mediaframework stress suite.
Change-Id: Ia244352cd16f77c090c4f1dad6f9b09a8b3e8f47
2012-02-22 16:46:37 -08:00
John Grossman
13bca89cd5 LibAAH_RTP: Add support for AAC in MP4.
Change-Id: Ie8298eb9d253fc6ede448da87660a60d23170987
2012-02-21 11:13:32 -08:00
Scott Main
dfa926f54b am 52bfc243: docs: fix misc doc bugs from external issue tracker
* commit '52bfc243684b2f340da326aaa38e9021e4e3b2e6':
  docs: fix misc doc bugs from external issue tracker
2012-02-09 12:48:18 -08:00
Scott Main
52bfc24368 docs: fix misc doc bugs from external issue tracker
Change-Id: If6ff3476670e42b321d56d4a1482ccff96d4d500
2012-02-09 12:45:16 -08:00
Mike Lockwood
0e8392e1dc Add support for non-linear ramping of master volume adjustment
Bug: 5472584

Change-Id: Id75f8835f6693ae3fcb7ca451ada01f22faba1aa
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-02-09 11:24:10 -08:00
John Grossman
36d372fb6a Explicitly manage common clock client lifetimes.
Change the CCHelper class to be an instanced instead of a static
pattern.  The CCHelper instances all share an interface to the common
clock service and register/unregister a callback handler in response
to there being CCHelper instance in the system or not.  This brings
usage of the CCHelper into like with the new auto-disable
functionality of the common time service.  For any given process,
whenever there are CCHelper instances active, the process will
maintain a callback target to the common clock service and will be
considered to be an active client.

Also change all of the users of the CCHelper interface to manage the
lifecycle of their new CCHelper instances.

Change-Id: I7c28c5d70d9b07ba7407b4ac706e7e7d7253001b
2012-02-06 18:02:33 -08:00
John Grossman
232f869c99 De-AAH-ify the common time service.
Bulk name change to remove references to Android@Home from the common time
service in preparation for cleanup and up-integration into the master
branch.  Basically, aah_timesrv is now common_time.

Change-Id: I3d3db212f96e8ba171aa36b9c58e27e4a336cb0a
2012-02-03 17:43:21 -08:00
Jason Simmons
a477bab9c3 Only send master volume or mute updates if the settings have changed
Change-Id: If12ec3b7a4b4bf5165d7538013759f07a845d8c4
2012-02-02 13:00:17 -08:00
Jason Simmons
64006cb164 Add a way to play file descriptor data sources using the A@H transmitter media player.
* Added a MediaPlayer.setMediaPlayerType API that be called to specify the
  desired media player implementation before calling setDataSource
* Implemented setDataSource(fd) in the AAH_TxPlayer

Change-Id: I359075d9c7d6fd699dda14eb85ec50da19307639
2012-01-29 18:03:02 -08:00
Jason Simmons
db8b292b6d Make AudioManager.adjustMasterVolume public and hidden
Change-Id: Ied4d07c2f67f24d1e1963f4ff30650042334d563
2012-01-24 16:27:19 -08:00
John Grossman
881186c322 Enhance Visualizer behavior in the case of mediaserver death.
Bring the Visualizer class into line with the SDK documentation by
returning ERROR_DEAD_OBJECT instead of ERROR_INVALID_OPERATION when
the Visualizer loses its binder connection to the mediaserver because
of a mediaserver restart.

Also add a new callback interface to allow clients to be
asynchronously notified in the case of server death.  Right now, the
interface definition and the registration method are flagged as hidden
pending API council review/approval.

See http://b/issue?id=5717519 for details.

Change-Id: Id428fb946d6d7676bffd2a597366e8444ebe24f2
Signed-off-by: John Grossman <johngro@google.com>
2012-01-12 14:36:16 -08:00
John Grossman
595d76ee82 Reuse callback buffers in the Visualizer.
Don't re-allocate buffers used by Visualizer callbacks as this causes an
unacceptable amount of GC thrash.  Instead, lazily allocate the buffers and only
reallocate them when the required size changes.

See http://b/issue?id=5717519 for details.

Change-Id: I50458961992a64d9b3c46db7e5e8e6414a92228f
Signed-off-by: John Grossman <johngro@google.com>
2012-01-12 11:52:39 -08:00
Eric Laurent
87ebdf6e01 am c15cf3d2: Merge "stagefright: limit audio gap for looped playback" into ics-mr1
* commit 'c15cf3d286f3d63d141b73f639a5a61ddb028029':
  stagefright: limit audio gap for looped playback
2012-01-11 11:12:55 -08:00
Eric Laurent
577d6ccb7b stagefright: limit audio gap for looped playback
The audio gap when looping audio is mostly due to
a delay requested by the audio player when executing
the end of stream message. This is to allow the audio
to be drained out of the pipe before actually stopping the
AudioTrack.
This delay is not needed when looping as the AudioTrack
is not stopped.

The fix consists in ignoring the requested delay when the
looping flag is set in awesome player.

Issue 5800981.

Change-Id: Ib32d2930c53ecebc21ca8440e6e054c7e20db4a5
2012-01-09 13:48:25 -08:00
John Grossman
625d40a920 libaah_rtp: address http://b/issue?id=5755419
Introduce a heartbeat timeout for TX senders.  If none of the TX
sender's clients send any packets for this timeout period (10 minutes
right now), then the sender will stop sending keep-alive heartbeats.
This should cause RX clients to release any held media resources,
including any timed audio track.  Releasing timeed audio tracks allows
the audio system to go into its idle state, which allows the power amp
in Tungsten to power all of the way down, saving both heat and power.

Change-Id: Ib7a96d334e1064ddea3f07a6b21e6efedefc549a
Signed-off-by: John Grossman <johngro@google.com>
2012-01-09 12:23:37 -08:00
Mike Lockwood
0b8afdac73 Restore persisted master volume if the media server restarts
Bug: 5755071

Change-Id: I6934276049b4a9d713bb4754aa3bb2cd3b898604
Signed-off-by: Mike Lockwood <lockwood@google.com>
2012-01-06 11:58:54 -05:00