65831 Commits

Author SHA1 Message Date
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
Christopher Tate
96fecb7f6b Merge "Make immersive mode public & imply update locking" into ics-aah 2012-03-22 13:39:21 -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
Joe Fernandez
7d4f7e35bc am 66f1bafb: Merge "docs: Android SDK r17 (RC7) Release Notes (fix for build feature info)" into ics-mr1
* commit '66f1bafb2326e12814df703a4285373e8651a3ce':
  docs: Android SDK r17 (RC7) Release Notes (fix for build feature info)
2012-03-21 16:43:42 -07:00
Joe Fernandez
66f1bafb23 Merge "docs: Android SDK r17 (RC7) Release Notes (fix for build feature info)" into ics-mr1 2012-03-21 16:41:19 -07:00
Joe Fernandez
1e72b34f11 docs: Android SDK r17 (RC7) Release Notes (fix for build feature info)
Change-Id: Id10c2d5eec9f81d1c6ce52067b7e25b7f411d91c
2012-03-21 16:25:21 -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
Jim Miller
5490256b53 am 928d3470: Fix 5960562: Show emergency button on PukUnlock screen
* commit '928d34704b96db9133e28dc77b716518d335b356':
  Fix 5960562: Show emergency button on PukUnlock screen
2012-03-20 16:42:24 -07:00
Jim Miller
928d34704b Fix 5960562: Show emergency button on PukUnlock screen
This fixes an issue where the device doesn't show the emergency button
on the SIM PUK unlock screen. The problem was introduced in I3127bfd5
where we allowed the button to be conditionally shown.

Change-Id: I3e2aae2bce89399a2564c3f8a726a8db99cdec86
2012-03-20 15:30:43 -07:00
Christopher Tate
9ce685b934 Make immersive mode public & imply update locking
Activity.setImmersive(boolean) / android:immersive="bool" are now public.
In addition, if the foreground activity is immersive then an update lock
will be held on its behalf.  This lets applications such as movie players
suppress the display of intrusive notifications, OTA-availability dialogs,
and the like while they are displaying content that ought not to be
rudely interrupted.

The update lock aspect of this mode is *advisory*, not binding -- the
update mechanism is not actually constrained; it simply uses this information
in deciding whether/when to prompt the user.  It's more a guideline than
a rule.

Bug 6154438

Change-Id: Ibd3491fc437077f3fa0d9708ed91955121e8c877
2012-03-19 18:37:57 -07:00
Eric Fischer
23ebe7285c Import translations. DO NOT MERGE
Change-Id: Id9db76785997b8b9e30b96d86e6cb72ae56130fb
2012-03-19 13:41:32 -07:00
Eric Laurent
179239bc6c am 14958e21: Merge "audioflinger: fix issue with camcorder and A2DP" into ics-mr1
* commit '14958e21c12f922d7501d32c3bec05109eb342d5':
  audioflinger: fix issue with camcorder and A2DP
2012-03-19 08:34:03 -07:00
Eric Laurent
14958e21c1 Merge "audioflinger: fix issue with camcorder and A2DP" into ics-mr1 2012-03-19 08:32:35 -07:00
Joe Fernandez
9b815629a3 am dbab18f6: Merge "docs: Android SDK r17 (RC6) Release Notes" into ics-mr1
* commit 'dbab18f64a1b17311a0c865ed43200e9dc239113':
  docs: Android SDK r17 (RC6) Release Notes
2012-03-19 08:27:31 -07:00
Joe Fernandez
dbab18f64a Merge "docs: Android SDK r17 (RC6) Release Notes" into ics-mr1 2012-03-19 08:25:48 -07:00
Justin Ho
f31099f5d6 am 972d12aa: Merge "DO NOT MERGE Revert "Increase line limit for summary text"" into ics-mr1
* commit '972d12aa1e6fba69094c0a9270df645b7db74f3a':
  DO NOT MERGE Revert "Increase line limit for summary text"
2012-03-19 08:11:33 -07:00
Justin Ho
972d12aa1e Merge "DO NOT MERGE Revert "Increase line limit for summary text"" into ics-mr1 2012-03-19 08:08:56 -07:00
Justin Ho
e36f86bce1 DO NOT MERGE Revert "Increase line limit for summary text"
This reverts commit 90e3bcae6771df767c3377ca3bd6c08d99062ca3
2012-03-17 17:09:35 -07:00
Eric Laurent
10c3fc89a4 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
2012-03-16 20:37:59 -07:00
Joe Fernandez
dad557e0cf docs: Android SDK r17 (RC6) Release Notes
Change-Id: I1e58b3827e4fe70310d2154e0f85b16b79d6a0d2
2012-03-16 17:45:20 -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
2a0d685ed6 Merge "MediaPlayerService: fix AudioSink latency" into ics-mr1 2012-03-16 14:58:21 -07:00
Eric Laurent
3fe7ee651d Merge "AudioTrack: relax check on minimum buffer size" into ics-mr1 2012-03-16 14:58:07 -07:00
Amith Yamasani
8e34dc9312 am 90e3bcae: Increase line limit for summary text
* commit '90e3bcae6771df767c3377ca3bd6c08d99062ca3':
  Increase line limit for summary text
2012-03-16 14:14:05 -07:00
Amith Yamasani
90e3bcae67 Increase line limit for summary text
Doing this to accomodate some really long warning text in a
checkbox widget. Needs 5 lines for English. Probably a lot
more for German, etc., so increasing it to 10 lines.

Please don't abuse that. 4 lines is still a reasonable max.

Change-Id: Ife5858f2165cb2bc046ce606f29d31010d26ecc2
2012-03-16 13:13:50 -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
Katie McCormick
8140f3f4f1 am 2b056c6e: Merge "Doc update: DDMS Network Traffic tool." into ics-mr1
* commit '2b056c6e6759d63045c22556c5418a08fcb3f80c':
  Doc update: DDMS Network Traffic tool.
2012-03-16 12:11:31 -07:00
Katie McCormick
2b056c6e67 Merge "Doc update: DDMS Network Traffic tool." into ics-mr1 2012-03-16 12:09:59 -07:00
Katie McCormick
4099e17228 Doc update: DDMS Network Traffic tool.
Change-Id: I9aa0d94e9bdc20681ec7be3f98233223c0e742d8
2012-03-16 11:55:55 -07:00
Dianne Hackborn
5da418d331 am ce06c000: Merge "Debugging code for #6169553: Make Phone launch faster" into ics-mr1
* commit 'ce06c000b4133c63414c3244c3325e25315ab179':
  Debugging code for #6169553: Make Phone launch faster
2012-03-16 11:55:48 -07:00
Dianne Hackborn
ce06c000b4 Merge "Debugging code for #6169553: Make Phone launch faster" into ics-mr1 2012-03-16 11:53:53 -07:00
Joe Fernandez
a1faacd268 am 1f60afc5: docs: Emulator Hardware Acceleration docs for SDK r17
* commit '1f60afc5cbec849054c1787bf3141d6d0d49e4c3':
  docs: Emulator Hardware Acceleration docs for SDK r17
2012-03-16 10:43:58 -07:00
Joe Fernandez
1f60afc5cb docs: Emulator Hardware Acceleration docs for SDK r17
Change-Id: I0714891d14db598f6c4acd29773975bd7754a912
2012-03-16 10:21:32 -07:00
Scott Main
04144b4b38 am eb1d42e4: Merge "docs: Fix a bunch of misc doc issues from external tracker" into ics-mr1
* commit 'eb1d42e4faa34c2acf76200913920fd5ca46a39e':
  docs: Fix a bunch of misc doc issues from external tracker
2012-03-15 15:56:03 -07:00
Scott Main
eb1d42e4fa Merge "docs: Fix a bunch of misc doc issues from external tracker" into ics-mr1 2012-03-15 15:52:56 -07:00
Dianne Hackborn
2a29b3ad13 Debugging code for #6169553: Make Phone launch faster
The activity manager now has a tick when launching an app every
500ms, where it collects the current stack traces of the app if
it hasn't finished launching.  These traces are included as part
of dumpstate.

This is only done on non-user builds.

Change-Id: I7f09ea00aab821ac81795f48c9d68fcca65f89fe
2012-03-15 15:48:38 -07:00
Eric Fischer
3fc7a20efc Merge "Import translations. DO NOT MERGE" into ics-aah 2012-03-15 13:47:27 -07:00
Eric Fischer
ee99a333c8 Import translations. DO NOT MERGE
Change-Id: Ibf2f1c11aeb2a67003a8912d921d05bc761c1e6a
2012-03-15 13:26:36 -07:00
Dianne Hackborn
8b5944b75b am 33ace979: Merge "Remove fade animations from framework drawables." into ics-mr1
* commit '33ace979a452301796694ffd64506f082de42f0d':
  Remove fade animations from framework drawables.
2012-03-15 11:29:24 -07:00
Dianne Hackborn
33ace979a4 Merge "Remove fade animations from framework drawables." into ics-mr1 2012-03-15 11:27:43 -07:00
Scott Main
9c7adc37fd am f32ab914: Merge "docs: update various SDK and AVD Manager screenshots and remove one from the licensing doc that\'s not necessary" into ics-mr1
* commit 'f32ab914147ede0b02302a28cce6fd2f301b0b3e':
  docs: update various SDK and AVD Manager screenshots and remove one from the licensing doc that's not necessary
2012-03-15 10:22:45 -07:00
Scott Main
f32ab91414 Merge "docs: update various SDK and AVD Manager screenshots and remove one from the licensing doc that's not necessary" into ics-mr1 2012-03-15 10:21:00 -07:00