OSDN Git Service

android-x86/frameworks-av.git
12 years agoaudioflinger: fix regression in attachAuxEffect().
Eric Laurent [Mon, 2 Jul 2012 19:31:03 +0000 (12:31 -0700)]
audioflinger: fix regression in attachAuxEffect().

Commit 717e1286 introduced a regression in PlaybackThread::Track::attachAuxEffect()
when called with an effect ID of 0 to detach the auxiliary effect.

It is normal in this case that AudioFlinger::getEffectThread_l() returns 0.

Bug 6768757.

Change-Id: I7430bd1aad2f68da38f7c3e4794e7ad657bfc6be

12 years agoaudioflinger: fix auxiliary effect attachment
Eric Laurent [Fri, 29 Jun 2012 23:36:52 +0000 (16:36 -0700)]
audioflinger: fix auxiliary effect attachment

Auxiliary effects (Reverb) are global effects and as such follow
the default rule which is to attach them to the output thread that
handles music streams by default. This causes a problem when several
threads are eligible to handle music streams as tracks can be attached
to either thread based on criteria unknown when teh effect is created.

The fix consists in moving the auxiliary effect if necessary when an
AudioTrack is attached to it and this track is not on the same
output thread.

Bug 6608561.

Change-Id: Ib32c3cabc731b2046aba728be1771982999c6069

12 years agoMerge "SurfaceMediaSource: keep refs to current buffers" into jb-dev
Jamie Gennis [Fri, 22 Jun 2012 22:18:26 +0000 (15:18 -0700)]
Merge "SurfaceMediaSource: keep refs to current buffers" into jb-dev

12 years agoSurfaceMediaSource: keep refs to current buffers
Jamie Gennis [Fri, 22 Jun 2012 21:42:00 +0000 (14:42 -0700)]
SurfaceMediaSource: keep refs to current buffers

This change fixes a bug in SurfaceMediaSource where it would not keep a
reference to all of the Gralloc buffers that the video encoder is currently
using.

Bug: 6655597
Change-Id: Ifd99976cc7ae57ed724bbf2bbcff357a39497391

12 years agoRevert input buffer count for the SoftAAC* decoders back to 4.
Andreas Huber [Wed, 20 Jun 2012 19:46:38 +0000 (12:46 -0700)]
Revert input buffer count for the SoftAAC* decoders back to 4.

This improves the netflix bandwidth change responsiveness.
With the old count of 32 the audio decoder running at a higher
priority would starve the video decoder for about 1 sec while
draining the input data.

I haven't been able to break any stream playback using MediaCodec
using the lower count, even though I'm sure I had a good reason
to increase it in the first place (see bug 6478823)

Change-Id: I7fd3e71794b0cc1570ea9d27d1d869ab1e1750c4
related-to-bug: 6685031

12 years agoChange definition of warmup period
Glenn Kasten [Wed, 13 Jun 2012 21:59:07 +0000 (14:59 -0700)]
Change definition of warmup period

Previously, warmup was considered done as soon as any write() took
more than 0.5 nominal cycle time.  In practice, this was always the
first write() that turned on power to the output path, and it didn't
accurately account for filling the full kernel buffer queue, or for
buffering in the HAL sample rate conversion.

Now warmup is considered done when a write() _after_ the first write
takes more than 0.5 nominal cycle time.

This will throttle the initial pull rate after coming out of standby.
When combined with another change to throttle the pull rate for
devices with HAL sample rate conversion, it may help reduce some of the
notification glitches.  The only downside is that it will increase the
warmup time a bit.

Bug: 650831766508466607056
Change-Id: I39f324c5195578170a55308e9601d3a1b41db3e0

12 years agoFastMixer compensates for SRC jitter in audio HAL
Glenn Kasten [Thu, 14 Jun 2012 00:14:03 +0000 (17:14 -0700)]
FastMixer compensates for SRC jitter in audio HAL

Force a sleep if audio HAL write() returns too quickly.

Bug: 6661275
Change-Id: Ie810f5a087b89fb24dab229a0e500af1dee53571

12 years agoMerge "Fix track selection code in AwesomePlayer" into jb-dev
James Dong [Fri, 15 Jun 2012 17:14:04 +0000 (10:14 -0700)]
Merge "Fix track selection code in AwesomePlayer" into jb-dev

12 years agoFix track selection code in AwesomePlayer
Insun Kang [Fri, 15 Jun 2012 04:02:45 +0000 (13:02 +0900)]
Fix track selection code in AwesomePlayer

Change-Id: I1c5a2f13f562a0ba253a93b4346cbe2c60099ddd
related-to-bug: 6671977

12 years agoMake CPU frequency statistics optional
Glenn Kasten [Wed, 13 Jun 2012 21:58:49 +0000 (14:58 -0700)]
Make CPU frequency statistics optional

Certain CPUs with dynamic cluster swapping and hotplug
don't report CPU frequency accurately.  The file descriptors
used to read the frequency become stale and report bogus data.
So make this feature a build time option for debugging only.
This will also improve performance of the fast mixer loop.

Change-Id: I602f81ec3281a37992769208be08084ed1469e8c

12 years agoDO NOT MERGE Remove log spam for fast track denied
Glenn Kasten [Thu, 24 May 2012 15:44:00 +0000 (08:44 -0700)]
DO NOT MERGE Remove log spam for fast track denied

Bug: 6531054
Change-Id: Iedf58e810a157aae88b5900da27c81054c437058

12 years agoMerge "stagefright: set scaling mode for blank frames" into jb-dev
Jamie Gennis [Thu, 14 Jun 2012 20:08:08 +0000 (13:08 -0700)]
Merge "stagefright: set scaling mode for blank frames" into jb-dev

12 years agostagefright: set scaling mode for blank frames
Jamie Gennis [Thu, 14 Jun 2012 02:13:16 +0000 (19:13 -0700)]
stagefright: set scaling mode for blank frames

This change sets the ANativeWindow scaling mode before pushing the blank frames
during decoder tear down.

Bug: 6603254
Change-Id: Ic64011645e2d3671b4a8d302ac7f39e6fd3affcd

12 years agoFix audio track pause.
Eric Laurent [Wed, 13 Jun 2012 15:38:36 +0000 (08:38 -0700)]
Fix audio track pause.

AudioTrack::pause() should signal the control block condition
to release threads waiting for available buffers in obtainBuffer().
Otherwise the behavior relies on the timout on the condition
or the fact that audioflinger will mix a new audio buffer while executing
the pause.

Bug 6653769.

Change-Id: I5f8f73c471fe306070f30b814f32fd4b4dc1d575

12 years agoMerge "Better handle invalid duration in Xing/VBRI tags" into jb-dev
Marco Nelissen [Thu, 14 Jun 2012 16:51:49 +0000 (09:51 -0700)]
Merge "Better handle invalid duration in Xing/VBRI tags" into jb-dev

12 years agoMerge "Shorten dumpsys media.audio_flinger output" into jb-dev
Glenn Kasten [Thu, 14 Jun 2012 15:41:54 +0000 (08:41 -0700)]
Merge "Shorten dumpsys media.audio_flinger output" into jb-dev

12 years agoMerge "Log track name on obtain/releaseBuffer warnings" into jb-dev
Glenn Kasten [Thu, 14 Jun 2012 15:41:38 +0000 (08:41 -0700)]
Merge "Log track name on obtain/releaseBuffer warnings" into jb-dev

12 years agoMerge "Add NOTICE and MODULE_LICENSE_APACH2 to libs build under /frameworks/av/"...
James Dong [Thu, 14 Jun 2012 03:49:34 +0000 (20:49 -0700)]
Merge "Add NOTICE and MODULE_LICENSE_APACH2 to libs build under /frameworks/av/" into jb-dev

12 years agoMerge "Fix one of the potential ANR issues from AwesomePlayer" into jb-dev
James Dong [Wed, 13 Jun 2012 23:59:15 +0000 (16:59 -0700)]
Merge "Fix one of the potential ANR issues from AwesomePlayer" into jb-dev

12 years agoBetter handle invalid duration in Xing/VBRI tags
Marco Nelissen [Wed, 13 Jun 2012 15:51:00 +0000 (08:51 -0700)]
Better handle invalid duration in Xing/VBRI tags

b/6654637

Change-Id: Ie92eddd84ef5914b77dbadaacd80b4de6cd66e1c

12 years agoAdd NOTICE and MODULE_LICENSE_APACH2 to libs build under /frameworks/av/
James Dong [Wed, 13 Jun 2012 01:10:35 +0000 (18:10 -0700)]
Add NOTICE and MODULE_LICENSE_APACH2 to libs build under /frameworks/av/

Change-Id: I0a3af3e2abdedebd5934f3d941d01c32cfc75e26
related-to-bug: 6647465

12 years agoShorten dumpsys media.audio_flinger output
Glenn Kasten [Wed, 13 Jun 2012 21:59:17 +0000 (14:59 -0700)]
Shorten dumpsys media.audio_flinger output

Don't include in FastMixer if it's not present.
This removes confusing clutter especially for devices
with a separate deep buffer output thread, or for the
duplicating thread and A2DP output thread.

Change-Id: I84933f5555593256f11ba0895ec915c09cf16963

12 years agoLog track name on obtain/releaseBuffer warnings
Glenn Kasten [Thu, 31 May 2012 21:35:01 +0000 (14:35 -0700)]
Log track name on obtain/releaseBuffer warnings

This should help diagnose problems by allowing us to correlate
the logs with the dumpsys media.audio_flinger output.

Change-Id: I8c7c592b4f87d13b0f29c66ce7a2f301a0f063c9

12 years agoFix one of the potential ANR issues from AwesomePlayer
James Dong [Wed, 13 Jun 2012 00:18:37 +0000 (17:18 -0700)]
Fix one of the potential ANR issues from AwesomePlayer

Change-Id: I8ac7bbb5fe219f65bdbdd223538fbac0575e2957
related-to-bug: 6565826

12 years agoMerge "stagefright: fix AudioRecord callback buffer size" into jb-dev
Eric Laurent [Wed, 13 Jun 2012 01:33:47 +0000 (18:33 -0700)]
Merge "stagefright: fix AudioRecord callback buffer size" into jb-dev

12 years agoAdd NOTICE and MODULE_LICENSE_APACHE2 for libstagefright_soft_h264dec and libstagefri...
James Dong [Wed, 13 Jun 2012 00:40:43 +0000 (17:40 -0700)]
Add NOTICE and MODULE_LICENSE_APACHE2 for libstagefright_soft_h264dec and libstagefright_soft_vpxdec

Change-Id: Id4f1ef8dfc21731846a9862b8d12940a92fe99bb
related-to-bug: 6647465

12 years agostagefright: fix AudioRecord callback buffer size
Eric Laurent [Wed, 13 Jun 2012 00:09:30 +0000 (17:09 -0700)]
stagefright: fix AudioRecord callback buffer size

Make sure that the maximum number of frames passed to
AudioSource by the AudioRecord callback always fits within
the maximum buffer size defined by kMaxBufferSize.

Also make sure that the total AudioRecord buffer size is more
than the minimum required.

Change-Id: I26a1f998e0cf75ac88b02e67ec9d8db3c0cca193

12 years agoMerge "Add NOTICE and MODULE_LICENSE_APATCH2 to libvideoeditor" into jb-dev
James Dong [Tue, 12 Jun 2012 21:20:44 +0000 (14:20 -0700)]
Merge "Add NOTICE and MODULE_LICENSE_APATCH2 to libvideoeditor" into jb-dev

12 years agoAdd NOTICE and MODULE_LICENSE_APATCH2 to libvideoeditor
James Dong [Tue, 12 Jun 2012 20:51:12 +0000 (13:51 -0700)]
Add NOTICE and MODULE_LICENSE_APATCH2 to libvideoeditor

Change-Id: I19308c5fb0f39f8e696092186f4386e3dad06894
related-to-bug: 6647465

12 years agoMerge "Update make file" into jb-dev
Dave Burke [Tue, 12 Jun 2012 19:23:20 +0000 (12:23 -0700)]
Merge "Update make file" into jb-dev

12 years agoUpdate make file
Dave Burke [Tue, 12 Jun 2012 17:41:14 +0000 (10:41 -0700)]
Update make file

Change-Id: I7dbd128245f584df2689457df0dd12ce888cf8ef

12 years agoMerge "Fix gapless for deep buffers" into jb-dev
Marco Nelissen [Tue, 12 Jun 2012 14:52:30 +0000 (07:52 -0700)]
Merge "Fix gapless for deep buffers" into jb-dev

12 years agoFix gapless for deep buffers
Marco Nelissen [Tue, 12 Jun 2012 00:00:59 +0000 (17:00 -0700)]
Fix gapless for deep buffers

Forward current flags to next output.
b/6645676

Change-Id: I584f7a67472d99cbd6bc38f3fe84763331d115d1

12 years agoMerge "Fix gapless playback" into jb-dev
Marco Nelissen [Mon, 11 Jun 2012 23:04:56 +0000 (16:04 -0700)]
Merge "Fix gapless playback" into jb-dev

12 years agoFix gapless playback
Marco Nelissen [Mon, 11 Jun 2012 21:52:53 +0000 (14:52 -0700)]
Fix gapless playback

On some devices the actual framecount per buffer of an AudioTrack
will be different than what was requested, which prevented the
track from being reused. Now we create a new AudioTrack with the
requested parameters, and then compare it to the track we already
have. If they match, we throw away the new track and reuse the
existing one.
b/6644559

Change-Id: Id3e8c4460436f52e59b98ecaeb01c94f02877c1d

12 years agoMerge "Revert "Added some informational log messages to track down ANR related issues...
James Dong [Mon, 11 Jun 2012 20:35:06 +0000 (13:35 -0700)]
Merge "Revert "Added some informational log messages to track down ANR related issues"" into jb-dev

12 years agoAdd audio watchdog thread
Glenn Kasten [Wed, 30 May 2012 21:52:57 +0000 (14:52 -0700)]
Add audio watchdog thread

Change-Id: I4ed62087bd6554179abb8258d2da606050e762c0

12 years agoRevert "Added some informational log messages to track down ANR related issues"
James Dong [Mon, 11 Jun 2012 17:49:55 +0000 (10:49 -0700)]
Revert "Added some informational log messages to track down ANR related issues"

This reverts commit c558fa89016ba9583049b84dc57e66a913cabde8.

related-to-bug: 6565826

12 years agoMerge "Fix green or corrupted video frames in the exported movies" into jb-dev
James Dong [Fri, 8 Jun 2012 19:37:50 +0000 (12:37 -0700)]
Merge "Fix green or corrupted video frames in the exported movies" into jb-dev

12 years agoReduce underruns in screen off, esp. with EQ
Glenn Kasten [Thu, 7 Jun 2012 17:17:54 +0000 (10:17 -0700)]
Reduce underruns in screen off, esp. with EQ

Add MonoPipe APIs to specify setpoint.
Use screen state to configure pipe setpoint.
Fix a long-standing bug where pipe sleep time was excessive,
  which interacted poorly with governor and low clock frequencies.
  Now it deducts the elapsed time since last write(),
  which was significant when there was EQ and low clock frequency.

Bug: 6618373
Change-Id: I6f3b0072c2244aeb033ef0795ad164491a164ff5

12 years agoFix green or corrupted video frames in the exported movies
James Dong [Tue, 5 Jun 2012 02:07:28 +0000 (19:07 -0700)]
Fix green or corrupted video frames in the exported movies

At least two use cases are affected: trimming and transition clip generation.

If the starting time of the transition or the trimming position is not the same as
that of any existing video frame, the video frame right before the transition
starting position or the trimming position must be encoded as the the first video
frame for the transtion or the trimmed video, and it is encoded as a key frame.
This frame was not saved without the patch.

In the transcoding phrase, since we could not find such a frame, the existing
code did not return an error, and incorrectly used some other frame to serve
as the reference key frame for the remaining video frames of the transition or
the trimmed video. As a result, we may see corrupted or green video frames in
the exported movies.

The fix is to always save the frame right before the trimming position or
the transition starting time, so that a key frame will always be encoded, and
the right reference frame is used for remaining video frames. In addition,
checks are added to prevent from future mistakes to use incorrect reference frames.

Patch was originally contributed by teng.hong@nxp.com

Change-Id: I182784d4c1786224445224634edab3338bf2278f
related-to-bug: 5713461

12 years agoaudioflinger: fix duplicating thread standby
Eric Laurent [Fri, 8 Jun 2012 00:16:09 +0000 (17:16 -0700)]
audioflinger: fix duplicating thread standby

The code that waits for a track presentation to be complete
before disabling it caused a regression for duplicating threads.
Because of the way output tracks activity is managed, the number
of frames output by the duplicating thread would never
reach the target set for a track to be considered presented.
The track would not be removed from active list and the thread would
not go to standby and keep its wakelock held.

Bug 6606922.

Change-Id: I4b46b420ac4cbf79a86b6791ae6589d407b01c92

12 years agoMerge "Take latency and current time into account for visualization" into jb-dev
Marco Nelissen [Thu, 7 Jun 2012 18:08:15 +0000 (11:08 -0700)]
Merge "Take latency and current time into account for visualization" into jb-dev

12 years agoTake latency and current time into account for visualization
Marco Nelissen [Wed, 6 Jun 2012 16:52:31 +0000 (09:52 -0700)]
Take latency and current time into account for visualization

Buffer more data, and return the data that is currently being
output from the audio output, to ensure that visualizations are
smooth and responsive even when the audio output has a large
latency and/or large buffers.
b/6522728

Change-Id: I401637f01be7600b3c594a55c869036c13b206c0

12 years agoaudioflinger: modify fast mixer overrun management
Eric Laurent [Wed, 6 Jun 2012 01:12:11 +0000 (18:12 -0700)]
audioflinger: modify fast mixer overrun management

Do not force sleep when an overrun occurs. This was for non
blocking audio HAL and is unused.
Keep statistics on overruns.

Bug 6605215.

Change-Id: I295455d4562201aa3814c88bdd6e52c9226712af

12 years agoaudioflinger: various fixes on direct output
Eric Laurent [Wed, 2 May 2012 02:31:12 +0000 (19:31 -0700)]
audioflinger: various fixes on direct output

Various fixes in direct output playback thread implementation:
- threadLoop_write() was broken for playback threads that do not
use a pipe sink.
- output buffer size calculation was hard coded for stereo.
- removed software volume that was implemented for PCM stereo
format only: the audio HAL has to implement volume if needed
for direct outputs.

Change-Id: If211b4489be9af395435707b8cf0388cce1347b2

12 years agoaudioflinger: fix active sleep time calculation.
Eric Laurent [Mon, 4 Jun 2012 20:45:29 +0000 (13:45 -0700)]
audioflinger: fix active sleep time calculation.

When an audioTrack underruns, the audioflinger mixer thread
sleeps for a certain time to give the app a chance to recover.
This time is based on the reported audio HAL latency.
Some audio HALs implementing deep buffering have a variable
latency and this creates a problem if the sleep time is cached
when the output stream is opened and not updated afterwards.

This change derives the active sleep time from the mix buffer
framecount instead of the latency. This is more conservative
but works for variable latency.

Bug 6588525.

Change-Id: Ia892fc290fe06f836565c3ae15f7a2ce026c88c6

12 years agoState queue dump
Glenn Kasten [Thu, 31 May 2012 20:40:27 +0000 (13:40 -0700)]
State queue dump

Bug: 6591648
Change-Id: Iac75e5ea64e86640b3d890c46a636641b9733c6d

12 years agoFast track dumpsys
Glenn Kasten [Thu, 31 May 2012 14:43:43 +0000 (07:43 -0700)]
Fast track dumpsys

Bug: 6591648
Change-Id: I696f51c682e7233ba690d97da26012084989b412

12 years agoCount underruns for normal tracks also
Glenn Kasten [Thu, 31 May 2012 21:59:29 +0000 (14:59 -0700)]
Count underruns for normal tracks also

Bug: 6591648
Change-Id: Iff9cabe392bb2ce97062603adb9c9dc7aa4170d5

12 years agoMerge "Was calculating measured warmup time wrong" into jb-dev
Glenn Kasten [Sun, 3 Jun 2012 21:40:55 +0000 (14:40 -0700)]
Merge "Was calculating measured warmup time wrong" into jb-dev

12 years agoMerge "Fix fast track leak if out of normal track names" into jb-dev
Glenn Kasten [Fri, 1 Jun 2012 18:06:28 +0000 (11:06 -0700)]
Merge "Fix fast track leak if out of normal track names" into jb-dev

12 years agoMerge "Pipe throttle based on requested frame count" into jb-dev
Glenn Kasten [Fri, 1 Jun 2012 18:04:43 +0000 (11:04 -0700)]
Merge "Pipe throttle based on requested frame count" into jb-dev

12 years agoWas calculating measured warmup time wrong
Glenn Kasten [Fri, 1 Jun 2012 17:49:51 +0000 (10:49 -0700)]
Was calculating measured warmup time wrong

Bug: 6592923
Change-Id: I980c6fc69d78c569147ea44ce33a7f8a41739c91

12 years agoPart of fix for double spins & faster startup
Jeff Tinker [Fri, 1 Jun 2012 04:48:59 +0000 (21:48 -0700)]
Part of fix for double spins & faster startup

This change alters the way that the media player
interacts with the Widevine adaptive streaming buffer
logic.  It eliminates the reliance on cached buffer
duration to determine pause/play states and instead
only generates buffering events when the widevine
library is not producing data (i.e. when it is
buffering).  This eliminates unnecessary pause and
rebuffer cycles, reducing startup time and the
frequency and duration of spinners.

Multi-repo commit, depends on related changes in vendor/widevine

Change-Id: I387db2decd83841775a8351bddf5a6381fe4104f
related-to-bug:6503294
related-to-bug:6463780

12 years agoMerge "Do not keep audio wake lock when apps underrun." into jb-dev
Eric Laurent [Fri, 1 Jun 2012 02:56:21 +0000 (19:56 -0700)]
Merge "Do not keep audio wake lock when apps underrun." into jb-dev

12 years agoFix another buffer overflow issue
James Dong [Thu, 31 May 2012 20:06:53 +0000 (13:06 -0700)]
Fix another buffer overflow issue

Using hard-coded length value easily leads to buffer overflow.
Refactor the code a bit to make it more readable, and more
extensible, and less subject to the buffer overflow coding error.

Patch originally contributed by teng.hong@nxp.com

Change-Id: Id262915302ccea8ae3b0121bf39890ab463aeeb7
related-to-bug: 6328360

12 years agoFix fast track leak if out of normal track names
Glenn Kasten [Wed, 30 May 2012 17:32:06 +0000 (10:32 -0700)]
Fix fast track leak if out of normal track names

Bug: 6580402
Change-Id: I3ac7f012062c35833147f47ba822eb4bf532a824

12 years agoDo not keep audio wake lock when apps underrun.
Eric Laurent [Thu, 31 May 2012 21:27:14 +0000 (14:27 -0700)]
Do not keep audio wake lock when apps underrun.

Do not automatically restart an AudioTrack after an underrun
if the callback is executed but no data is written by the app.

Bug 6541286.

Change-Id: I11e7ab8dc968d7ff087058fec68f44490d3a7731

12 years agoAvoid prematurely terminating parsing when some track only has a single access unit
James Dong [Thu, 31 May 2012 00:34:24 +0000 (17:34 -0700)]
Avoid prematurely terminating parsing when some track only has a single access unit

Patch was contributed by teng.hong@nxp.com

Change-Id: I0f56361d839f18627e512d18e86f51b58b9b0e05
related-to-bug: 6240789

12 years agoPipe throttle based on requested frame count
Glenn Kasten [Wed, 30 May 2012 23:34:17 +0000 (16:34 -0700)]
Pipe throttle based on requested frame count

Now does throttling based on the requested frame count, but
still permits overfilling pipe up to the rounded-up frame count.
Also still uses the larger frame count for non-blocking arithmetic.

Bug: 6585323
Change-Id: Ic2420a071419905524a14c22ebe1ce0e32d70a9d

12 years agoMerge "audioflinger: fix effect problem during underrun" into jb-dev
Eric Laurent [Wed, 30 May 2012 21:07:38 +0000 (14:07 -0700)]
Merge "audioflinger: fix effect problem during underrun" into jb-dev

12 years agoOnly send port settings changed if the number of channels and sample rate are both...
James Dong [Wed, 30 May 2012 17:26:31 +0000 (10:26 -0700)]
Only send port settings changed if the number of channels and sample rate are both known to be valid.

Change-Id: I9f8813eedc95db202488d8860cf485bdb8e69e11
related-to-bug: 6553089

12 years agoaudioflinger: fix effect problem during underrun
Eric Laurent [Wed, 30 May 2012 19:30:29 +0000 (12:30 -0700)]
audioflinger: fix effect problem during underrun

When an audio track underruns, the input buffer of the
corresponding effect chain (if any) must be cleared, otherwise
audio from previous mixer run will be fed again to the effect process
function.

Bug 6551652.

Change-Id: I5cd02196745f756c85af82d6937e9dc54369b37f

12 years agoMerge "Precautionary logging to identify a potential infinite loop." into jb-dev
Dave Burke [Wed, 30 May 2012 00:29:33 +0000 (17:29 -0700)]
Merge "Precautionary logging to identify  a potential infinite loop." into jb-dev

12 years agoPrecautionary logging to identify a potential infinite loop.
Dave Burke [Tue, 29 May 2012 23:41:49 +0000 (16:41 -0700)]
Precautionary logging to identify  a potential infinite loop.

Bug: 6571063
Change-Id: I433659c6da333d5acd25ad03cb7f4a6ab0b6a4a5

12 years agoAdded some informational log messages to track down ANR related issues
James Dong [Tue, 29 May 2012 21:10:05 +0000 (14:10 -0700)]
Added some informational log messages to track down ANR related issues

Change-Id: Ie991c86e75d58f7eb4c9f524815c4de054d5f262
related-to-bug: 6565826

12 years agoMerge "DO NOT MERGE: Minimal fix for takePicture/previewCallback deadlock" into jb-dev
Eino-Ville Talvala [Tue, 29 May 2012 20:39:41 +0000 (13:39 -0700)]
Merge "DO NOT MERGE: Minimal fix for takePicture/previewCallback deadlock" into jb-dev

12 years agoMerge "Unwedge ACodec if allocating output buffers fails while reconfiguring." into...
Andreas Huber [Tue, 29 May 2012 18:36:08 +0000 (11:36 -0700)]
Merge "Unwedge ACodec if allocating output buffers fails while reconfiguring." into jb-dev

12 years agoUnwedge ACodec if allocating output buffers fails while reconfiguring.
Andreas Huber [Tue, 29 May 2012 18:33:29 +0000 (11:33 -0700)]
Unwedge ACodec if allocating output buffers fails while reconfiguring.

Change-Id: I871cf639167c01860e65c0408d3ce935f8f8f1ea
related-to-bug: 6571060

12 years agoDO NOT MERGE: Minimal fix for takePicture/previewCallback deadlock
Eino-Ville Talvala [Tue, 29 May 2012 18:17:48 +0000 (11:17 -0700)]
DO NOT MERGE: Minimal fix for takePicture/previewCallback deadlock

- Caused by already held lock in camera service

- Introduce one more lock, mICameraLock, to control access to camera
  client through ICamera binder interface.

- mLock is released before calling HAL takePicture, allowing HAL
  callbacks to access camera client during takePicture processing.

Bug: 5804701
Change-Id: Ibcef4857a2c844c964afefa70f9cdccdd0a55fd0

12 years agoForce shutdown of the omx decoder even if it's in a wedged state...
Andreas Huber [Tue, 29 May 2012 17:37:15 +0000 (10:37 -0700)]
Force shutdown of the omx decoder even if it's in a wedged state...

Change-Id: I5899928a3df4bcf7715769992955a0b834db1e2f
related-to-bug: 6571060

12 years agoMerge "Property to enable AAC 5.1 pass-through." into jb-dev
Dave Burke [Fri, 25 May 2012 17:02:32 +0000 (10:02 -0700)]
Merge "Property to enable AAC 5.1 pass-through." into jb-dev

12 years agoProperty to enable AAC 5.1 pass-through.
Dave Burke [Wed, 23 May 2012 07:00:53 +0000 (00:00 -0700)]
Property to enable AAC 5.1 pass-through.

Bug: 6275957
Change-Id: I8debdce872fc8287a4f6340f1790e02c075886e3

12 years agoMerge "Prevent occurences of clipping in loud downmixed scenes" into jb-dev
Jean-Michel Trivi [Fri, 25 May 2012 15:38:53 +0000 (08:38 -0700)]
Merge "Prevent occurences of clipping in loud downmixed scenes" into jb-dev

12 years agoFix an error caused by sample size value by order
James Dong [Thu, 24 May 2012 22:05:12 +0000 (15:05 -0700)]
Fix an error caused by sample size value by order

The sample size was saved in the array in network order, but it was treated as host order when
writeInt32() is called. Calling write(void *, int, int) resolves the issue.

related-to-bug: 6555366

Change-Id: If7ef99911ad65108c61b533673ac4d4cd580a370

12 years agoPrevent occurences of clipping in loud downmixed scenes
Jean-Michel Trivi [Thu, 24 May 2012 17:11:07 +0000 (10:11 -0700)]
Prevent occurences of clipping in loud downmixed scenes

The downmixer effect is a mixer, wich, like the platform mixer,
  hard-clips. To prevent clipping during loud scenes across multiple
  chanels, apply a fixed attenuation on the result of the downmix.
  Note that this attenuation is lower the theoretical required
  attenuation (except for quad and surround) but is adequate for
  most content.

Bug 4280902
Change-Id: Iec520e9f1367284d6102633f532429361717692d

12 years agoaudioflinger: change session check in createTrack.
Eric Laurent [Thu, 24 May 2012 18:07:14 +0000 (11:07 -0700)]
audioflinger: change session check in createTrack.

Do not refuse to create a track on an output thread if the same session
is present on another thread. It is now possible that two tracks
with the same session ID are on different threads if one can use deep
buffering and the other can't.

In this case, move effects attached to this session to the output
thread ion which the new track is created.

Bug 6530324.

Change-Id: I9019b3ee382e374c89d2319033afcfa7f886e4c4

12 years agoaudioflinger: refine latency latency calculation.
Eric Laurent [Wed, 23 May 2012 01:55:44 +0000 (18:55 -0700)]
audioflinger: refine latency latency calculation.

There is an audio pipe between the normal mixer output and the fast
mixer to cope for scheduling delays and buffer size difference.
This pipe depth was not taken into account in latency calculation.

Adding the pipe contribution to the latency significantly improves A/V sync.

Bug 6520569.

Change-Id: I5584908e8aa8a02170eb38b22b4370eea800a235

12 years agoMerge "Tell surface flinger that we want to protect output buffers from being" into...
Andreas Huber [Tue, 22 May 2012 20:48:59 +0000 (13:48 -0700)]
Merge "Tell surface flinger that we want to protect output buffers from being" into jb-dev

12 years agoTell surface flinger that we want to protect output buffers from being
Andreas Huber [Tue, 22 May 2012 19:55:03 +0000 (12:55 -0700)]
Tell surface flinger that we want to protect output buffers from being

sent to HDMI (without HDCP) and push a few black frames on IDLE->LOADED
similar to OMXCodec's behaviour.

Change-Id: Iea6055a115151ca881220a70a31af6ade2c58cb3
related-to-bug: 6537187

12 years agoMerge "Keep a copy of most recent audio played" into jb-dev
Glenn Kasten [Tue, 22 May 2012 19:13:58 +0000 (12:13 -0700)]
Merge "Keep a copy of most recent audio played" into jb-dev

12 years agoOnly mark the audio player as started if it did so successfully.
Andreas Huber [Tue, 22 May 2012 17:51:06 +0000 (10:51 -0700)]
Only mark the audio player as started if it did so successfully.

Change-Id: I4683f5ca243f9f1b80990028d225d0f6c5973899
related-to-bug: 6500580

12 years agoRevert "Stop audio source if AudioPlayer could not be started"
Andreas Huber [Tue, 22 May 2012 17:03:57 +0000 (10:03 -0700)]
Revert "Stop audio source if AudioPlayer could not be started"

This reverts commit 022048e95f3f1d65cb776cf21de2001423fcf7d9.

12 years agoRevert "Revert to PV for AAC codec for FactoryROM."
Dave Burke [Tue, 22 May 2012 04:18:22 +0000 (21:18 -0700)]
Revert "Revert to PV for AAC codec for FactoryROM."

This reverts commit d7d79a2bbf38d1d19ec7cc8d6a514fc999b5c444.

Change-Id: I7076feab31ab64fccd364699280d821011edc099

12 years agoRevert to PV for AAC codec for FactoryROM.
Dave Burke [Sat, 19 May 2012 00:44:51 +0000 (17:44 -0700)]
Revert to PV for AAC codec for FactoryROM.

Change-Id: I72cf856685c0c4bae745646f870a0415d416afb5

12 years agoMerge "Fix a mediaserver crash caused by dereferencing a NULL pointer." into jb-dev
James Dong [Mon, 21 May 2012 20:57:06 +0000 (13:57 -0700)]
Merge "Fix a mediaserver crash caused by dereferencing a NULL pointer." into jb-dev

12 years agoMerge "For an RTSP live stream we won't map rtp time to normal play time," into jb-dev
Andreas Huber [Mon, 21 May 2012 20:56:06 +0000 (13:56 -0700)]
Merge "For an RTSP live stream we won't map rtp time to normal play time," into jb-dev

12 years agoFix a mediaserver crash caused by dereferencing a NULL pointer.
James Dong [Mon, 21 May 2012 20:38:42 +0000 (13:38 -0700)]
Fix a mediaserver crash caused by dereferencing a NULL pointer.

The pointer (info in method drainInputBuffer) in can be null at the point of the dereference,
but it will get updated subsequently. Thus, we should move the logging after the pointer gets updated.

related-to-bug: 6530159

Change-Id: Ifa5f19a694953af6942454e5c28cd3fa024f11d2

12 years agoKeep a copy of most recent audio played
Glenn Kasten [Mon, 21 May 2012 16:17:20 +0000 (09:17 -0700)]
Keep a copy of most recent audio played

Change-Id: I6b2f97881c39998a2fae9ab79d669af6c0a37e94

12 years agoFor an RTSP live stream we won't map rtp time to normal play time,
Andreas Huber [Mon, 21 May 2012 18:12:40 +0000 (11:12 -0700)]
For an RTSP live stream we won't map rtp time to normal play time,

since we don't have the information necessary.

Change-Id: I3119fcc061c4b6756a69c6139ffdf013d806fee1
related-to-bug: 6528548

12 years agoMerge "Add more verbose ADTS error logging to SoftAAC." into jb-dev
Andreas Huber [Mon, 21 May 2012 17:11:52 +0000 (10:11 -0700)]
Merge "Add more verbose ADTS error logging to SoftAAC." into jb-dev

12 years agoAdd more verbose ADTS error logging to SoftAAC.
Andreas Huber [Mon, 21 May 2012 17:02:14 +0000 (10:02 -0700)]
Add more verbose ADTS error logging to SoftAAC.

and fix the corresponding code in SoftAAC2.

Change-Id: I6c745fb6e8e093708fdfe2861963b0a35fa7b912
related-to-bug: 6519161

12 years agoIf we encounter an error during buffer allocation change state back
Andreas Huber [Mon, 21 May 2012 16:51:14 +0000 (09:51 -0700)]
If we encounter an error during buffer allocation change state back

to LOADED instead of remaining in the transitional state LOADED->IDLE
that won't properly handle flush or shutdown requests.

Change-Id: Ica1bf22eb884b220f18ed2a4f7a9c56eec228796
related-to-bug: 6516512

12 years agoInstead of asserting on malformed ADTS headers or insufficient data,
Andreas Huber [Fri, 18 May 2012 20:08:14 +0000 (13:08 -0700)]
Instead of asserting on malformed ADTS headers or insufficient data,

stop decoding and signal a runtime error.

Change-Id: Ib66a17a2908273f65a92999951439cc6f0752164
related-to-bug: 6519161

12 years agoMerge "Add throttle to have pipe fill at more stable rate" into jb-dev
Glenn Kasten [Fri, 18 May 2012 20:04:25 +0000 (13:04 -0700)]
Merge "Add throttle to have pipe fill at more stable rate" into jb-dev

12 years agoAdd throttle to have pipe fill at more stable rate
Glenn Kasten [Fri, 18 May 2012 17:47:28 +0000 (10:47 -0700)]
Add throttle to have pipe fill at more stable rate

Change-Id: Ibff9ab62764e2acd04518a4a00e25f19e28aff4a

12 years agoDon't reconfigure stream after outputing data.
Dave Burke [Fri, 18 May 2012 17:46:11 +0000 (10:46 -0700)]
Don't reconfigure stream after outputing data.

Handle invalid configuration.
Bug: 6519161

Change-Id: Ib2d38bee769e63e627c93d7f3839c3a55de694e9

12 years agoMerge "systrace for audio" into jb-dev
Glenn Kasten [Fri, 18 May 2012 14:23:12 +0000 (07:23 -0700)]
Merge "systrace for audio" into jb-dev

12 years agoRobustness - use defaults if we see bogus sample rate / channels from decoder.
Dave Burke [Fri, 18 May 2012 06:55:34 +0000 (23:55 -0700)]
Robustness - use defaults if we see bogus sample rate / channels from decoder.

Bug: 6498711
Change-Id: I6950d316a292cfd0cb516ee6d95b6af071b08fdc