Commit Graph

588 Commits

Author SHA1 Message Date
Eric Laurent
2550f8557f Merge "Fix issue 2285561: New AudioFlinger and audio driver API needed for A/V sync" 2010-01-27 14:21:20 -08:00
Chih-Chung Chang
556a6fed12 Merge "Add support for setting camera display orientation." 2010-01-27 09:20:19 -08:00
Eric Laurent
e9ed2721f4 Fix issue 2285561: New AudioFlinger and audio driver API needed for A/V sync
Added getRenderPosition() API to IAudioFlinger to retreive number of audio frames
written by AudioFlinger to audio HAL and by DSP to DAC.

Added getRenderPosition() API to AudioHardwareInterface to retreive number of audio frames
written by DSP to DAC.

Exposed AudioTrack::getPosition() to AudioSink() to make it available to media player.

Removed excessive log in AudioHardwareGeneric.
2010-01-26 18:40:39 -08:00
Chih-Chung Chang
f091e833d3 Add support for setting camera display orientation. 2010-01-26 11:07:07 -08:00
Nick Pelly
1b5cf329ea Revert "Fix failure to open AVRCP input device due to EPERM."
This reverts commit e6b1bbd8acca3f6e174c24cf4eb23a66db2d08a2.
2010-01-26 10:28:52 -08:00
Nick Pelly
2b2c2e3a35 am 425324e9: am e834722f: Merge "Fix failure to open AVRCP input device due to EPERM." into eclair
Merge commit '425324e97bba75cd69bb6c81de6248529540e6fe'

* commit '425324e97bba75cd69bb6c81de6248529540e6fe':
  Fix failure to open AVRCP input device due to EPERM.
2010-01-25 18:12:47 -08:00
Eric Laurent
43c0b0a1f6 Fix issue 2378022: AudioService should direct volume control to STREAM_VOICE_CALL stream when STREAM_VOICE_CALL stream is active.
Modified AudioService.getActiveStreamType() so that STREAM_VOICE_CALL is selected when a track using this stream
type is playing.

Chanded isMusicActive() for a more generic isStreamActive(stream) method in AudioSystem, IAudioFlinger and AudioFlinger.
2010-01-25 14:00:10 -08:00
Wu-cheng Li
88eeff5270 Change key to KEY_SUPPORTED_JPEG_THUMBNAIL_SIZES for consistency.
bug:2375986
2010-01-25 15:20:23 +08:00
Chih-Chung Chang
703111327e Merge "Add support for 180/270 degrees rotation." 2010-01-22 18:08:23 -08:00
Chih-Chung Chang
5994a330ac Add support for 180/270 degrees rotation. 2010-01-22 16:30:39 -08:00
Mathias Agopian
519f29f5d8 Merge "return an error when Surface::lock() is called while the surface is already locked." 2010-01-22 11:52:08 -08:00
Mathias Agopian
9014726d89 return an error when Surface::lock() is called while the surface is already locked. 2010-01-22 11:47:55 -08:00
Chih-Chung Chang
52e7200b6e Add an orientation parameter for overlay, so we can do camera preview in portrait mode. 2010-01-21 20:20:08 -08:00
Mathias Agopian
edfd97c0f2 fix [2324665] texture leak in surfaceflinger when using camera 2010-01-21 16:29:34 -08:00
Mathias Agopian
8c3b597aa7 fix a texture leak introduced recently.
create the texture name once and for all for a given BufferSource
and make sure to recreate it when we're forced to delete the texture.
2010-01-21 16:27:30 -08:00
Nick Pelly
c81bb207c6 Fix failure to open AVRCP input device due to EPERM.
Sleep for 100us and try to open the input device again if it fails, with a
maximum of 10 attempts.

We need the retry logic because setting permissions on a new input device is
racy. The init process watches for new input device (via uevent) and sets the
permission on them in devices.c:make_device(). However at the same time
EventHub.cpp watches for new input devices from the system_server process, and
immediately tries to open them. I can't see a simple way to avoid this race
condition.

As best as I can tell this race condition has always exisited.
There must have been some timing change that happened recently that causes us
to hit this race condition much more often. See repro notes in referenced bug.

Bug: 2375632
2010-01-20 19:56:24 -08:00
Mathias Agopian
5fdea8d5b0 fix [2363362] [Sapphire] Corrupted raw picture displayed during snapshot
handled all cases where the scale factor of a video is out of bounds of
supported scale factors in copybit.
2010-01-20 14:31:53 -08:00
Mathias Agopian
ecc99c003b part of fix for [2363362] [Sapphire] Corrupted raw picture displayed during snapshot
make sure to fallback properly to software when copybit operation fails.
with this change, the preview image will at least be displayed in b&w
(since GL doesn't support the yuv format). This would also fix
2363506, but that one is now handled more cleanly.
2010-01-20 14:07:44 -08:00
Mathias Agopian
42d095aaa5 Merge "fix [2363506] [Sapphire] Video playback broken" 2010-01-20 13:44:53 -08:00
Mathias Agopian
1faed66086 fix [2363506] [Sapphire] Video playback broken
don't try to use copybit for incompatible buffers
2010-01-20 13:24:14 -08:00
Eric Laurent
da3529b468 Create base class for audio policy manager.
First implementations of audio policy manager in Eclair branch have shown that most code is common to all platforms.
Creating AudioPolicyManagerBase base class will improve code maintainability and readability.

Audio policy manager code for platforms using generic audio previously in AudioPolicyManagerGeneric is replaced by AudioPolicyManagerBase.
Audio policy manager test code previously in AudioPolicyManagerGeneric is moved to AudioPolicyManagerBase.

Also added a wake lock for delayed commands in AudioPolicyService.
2010-01-13 09:25:13 -08:00
Eric Laurent
8a468f2fd6 am 0c5cc224: am d20a55af: Merge change Iccfa50fe into eclair
Merge commit '0c5cc224b052654ee38d39effce427a47697481b'

* commit '0c5cc224b052654ee38d39effce427a47697481b':
  Fix issue 2323920: Notification & A2DP audio stutter.
2009-12-22 10:01:39 -08:00
Eric Laurent
7e2aad1e27 Fix issue 2323920: Notification & A2DP audio stutter.
Modified AudioFlinger duplicating output thread so that audio tracks are not mixed until both outputs (A2DP and hardware) have exited standby mode. This avoids to have one output far ahead of the other and audio frames dropped because the compensation mechanism cannot keep up.
Also calculate the maximum wait time in OutputTrack::write() based the on smallest frame count of all output threads instead of the frame count of the thread the OutputTrack is connected to. This avoids starving the thread with the smallest frame count by waiting too long on the other thread.
Since the frame count was reduced on hardware output to reduce latency the difference between A2DP and hardware outputs frame counts had become problematic.
Also increased the number of overflow buffers to cope with bigger timing differences among outputs.
2009-12-22 09:06:46 -08:00
Mathias Agopian
839604c769 am f9b0e826: fix [2269582] [TOP-10][Passion_1506][APT:Camera]Sometimes camera preview screen is truncated after launching and back to home screen by home key repeatedly
Merge commit 'f9b0e826689cca5ecbd40aa49f3ea7f7c73ad2a2' into eclair-mr2

* commit 'f9b0e826689cca5ecbd40aa49f3ea7f7c73ad2a2':
  fix [2269582] [TOP-10][Passion_1506][APT:Camera]Sometimes camera preview screen is truncated after launching and back to home screen by home key repeatedly
2009-12-11 01:16:08 -08:00
Mathias Agopian
f5430db059 fix [2269582] [TOP-10][Passion_1506][APT:Camera]Sometimes camera preview screen is truncated after launching and back to home screen by home key repeatedly
When a surface is removed from the screen while it holds a "freeze lock", the
release of that lock happens in the destructor as a "safety net". However, it
doesn't trigger an update at that point.

Make sure that "freeze locks" are released from the transaction at the point
a surface is removed from the screen (if it's not on screen, it shouldn't
prevent the screen to redraw, and therefore cannot hold a freeze lock).
The refresh corresponding to that transaction will pick it up as soon as possible.
2009-12-11 00:56:10 -08:00
Mathias Agopian
3fb6f499f8 am 083a557c: fix [2319255] crash in openGL : from the media recorder stress test.
Merge commit '083a557c25e0032bc4900f335b6643d0badd09ce' into eclair-mr2

* commit '083a557c25e0032bc4900f335b6643d0badd09ce':
  fix [2319255] crash in openGL : from the media recorder stress test.
2009-12-10 19:48:05 -08:00
Android (Google) Code Review
2c05ff5518 Merge change I6478884a into eclair-mr2
* changes:
  Add string resource type inspection
2009-12-10 18:05:19 -08:00
Mathias Agopian
b2bf11e389 am 76169da0: fix [2315900] Monochrome camera preview screen after launching camera
Merge commit '76169da0e84b0fcf621aeac6141af3ee85bc7c1e' into eclair-mr2

* commit '76169da0e84b0fcf621aeac6141af3ee85bc7c1e':
  fix [2315900] Monochrome camera preview screen after launching camera
2009-12-10 17:40:41 -08:00
Mathias Agopian
495c1be363 am d8c752ef: Merge change Ib548dbb2 into eclair
Merge commit 'd8c752ef74bc6d8b412defe35caf1a19be15eb8b' into eclair-mr2

* commit 'd8c752ef74bc6d8b412defe35caf1a19be15eb8b':
  improve video performance to minimize the tearing effect seen in 720p movies
2009-12-10 16:43:09 -08:00
Mathias Agopian
8f03b47432 fix [2319255] crash in openGL : from the media recorder stress test.
never call eglCreateImageKHR() with a NULL native buffer, which can
happen in OOM conditions.
2009-12-10 15:59:08 -08:00
Kenny Root
ccb5b89029 Add string resource type inspection
Allows "aapt dump --values resource" to print out whether a string in a
ResStringPool is in UTF-8 or UTF-16 encoding.

Change-Id: I6478884a70a3b46fee862dece6cb33454fc34843
2009-12-10 14:22:08 -08:00
Mathias Agopian
c5e181f8b3 fix [2315900] Monochrome camera preview screen after launching camera
this was introduced by a recent change. when we try to figure out the size of
the yuv->rgb temporary buffer, the output resolution has not been computed yet
and an invalid buffer size is used. most of the time the allocation fails
and the system reverts to "standard" GL will uses onle the Y plane.

the allocation of the temporary buffer is moved to onDraw(), the first
time it is called, by that time, the window is positioned properly.
2009-12-09 15:26:29 -08:00
Dianne Hackborn
d0aeccebe2 Maybe really fix windows build. 2009-12-08 19:45:59 -08:00
Mathias Agopian
69ff5de1b7 improve video performance to minimize the tearing effect seen in 720p movies
always rescale videos to their target size using copybit during yuv->rgb
conversion. this improves performance of the GPU pass and doesn't require
linear filtering to be enabled. Also always use 16-bits buffers.

the average processing time for 720p dropped from ~50ms to ~30ms
2009-12-08 19:29:38 -08:00
Dianne Hackborn
c5b138995e Hopefully fix Windows build 2009-12-08 16:38:01 -08:00
Android (Google) Code Review
eb318fd88d Merge change I129483f8 into eclair-mr2
* changes:
  Optional use of UTF-8 strings in resource bundles
2009-12-08 13:41:38 -08:00
Dianne Hackborn
8c6cedc9bc Propagate background scheduling class across processes.
This is a very simply implementation: upon receiving an IPC, if the handling
thread is at a background priority (the driver will have taken care of
propagating this from the calling thread), then stick it in to the background
scheduling group.  Plus an API to turn this off for the process, which is
used by the system process.

This also pulls some of the code for managing scheduling classes out of
the Process JNI wrappers and in to some convenience methods in thread.h.
2009-12-07 19:11:14 -08:00
Kenny Root
92f5984d2c Optional use of UTF-8 strings in resource bundles
Allows the use of UTF-8 for packing resources instead of the
default of UTF-16 for Java. When strings are extracted from the
ResStringPool, they are converted to UTF-16 and the result is
cached for subsequent calls.

When using aapt to package, add in the "-8" switch to pack the
resources using UTF-8. This will result in the value, key, and
type strings as well as the compiled XML string values taking
significantly less space in the final application package in
most scenarios.

Change-Id: I129483f8b3d3b1c5869dced05cb525e494a6c83a
2009-12-07 15:14:15 -08:00
Eric Laurent
7749a90e1e am 0a08029f: Fix issue 2306779: Runtime restart - Init failed at android.media.ToneGenerator.
Merge commit '0a08029fc9a370c6ef2a2a6fd1d800d9159b61f8' into eclair-mr2

* commit '0a08029fc9a370c6ef2a2a6fd1d800d9159b61f8':
  Fix issue  2306779: Runtime restart - Init failed at android.media.ToneGenerator.
2009-12-07 12:36:30 -08:00
Eric Laurent
fed9382a6a Fix issue 2306779: Runtime restart - Init failed at android.media.ToneGenerator.
The ToneGenerator failed to initialize because no more tracks were available in AudioFlinger mixer.

All tracks were used because the duplicating output was failing to free the tracks on audio hardware output mixer when exiting due to a misplaced test on output activity: output tracks where only freed if the duplicating output was active when exiting.

The fix consists in freeing the output tracks when the duplicating thread is destroyed without condition.
2009-12-07 12:30:22 -08:00
Eric Laurent
8aaf9a21bc am 6d42d806: Merge change I9cc489a2 into eclair
Merge commit '6d42d80653f2c41f3e72a878a1d9a6f9693b89f7' into eclair-mr2

* commit '6d42d80653f2c41f3e72a878a1d9a6f9693b89f7':
  Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search.
2009-12-07 11:03:17 -08:00
Android (Google) Code Review
0aa2563bb7 Merge change I9cc489a2 into eclair
* changes:
  Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search.
2009-12-07 11:00:54 -08:00
Eric Laurent
5291095089 Fix issue 2304669: VoiceIME: starting and canceling voice IME yields persistent "error 8" state on future attempts and breaks voice search.
Fixed AudioFlinger::openInput() broken in change ddb78e7753be03937ad57ce7c3c842c52bdad65e
so that an invalid IO handle (0) is returned in case of failure.
Applied the same correction to openOutput().
Modified RecordThread start procedure so that a failure occuring during the first read from audio input stream is detected and causes
the record start to fail.
Modified RecordThread stop procedure to make sure that audio input stream fd is closed before we exit the stop function.

Fixed AudioRecord JAVA and JNI implementation to take status of native AudioRecord::start() into account
and not change mRecordingState to RECORDSTATE_RECORDING if start fails.
2009-12-07 05:37:47 -08:00
Dima Zavin
0fe8a9bc4b am 0019215f: Revert "When using MDP, we needed to use a texture for diming."
Merge commit '0019215fc395ef12c191049b1903eeabf70859cf' into eclair-mr2

* commit '0019215fc395ef12c191049b1903eeabf70859cf':
  Revert "When using MDP, we needed to use a texture for diming."
2009-12-07 01:36:26 -08:00
Dima Zavin
a9ec9be195 Revert "When using MDP, we needed to use a texture for diming."
This reverts commit bf0c320afbf6bf2441916755ecb443b64afbe73f.
2009-12-07 00:17:06 -08:00
Erik Gilling
19b18d75fe am cef8d031: Merge change I00d0b54a into eclair
Merge commit 'cef8d031e842b773bbd6481b517996a185391e92' into eclair-mr2

* commit 'cef8d031e842b773bbd6481b517996a185391e92':
  surfaceflinger: remove un-cached buffer hack for SGX
2009-12-03 15:35:55 -08:00
Erik Gilling
1bd48776eb surfaceflinger: remove un-cached buffer hack for SGX
Signed-off-by: Erik Gilling <konkers@android.com>
2009-12-03 14:09:31 -08:00
Mathias Agopian
fd70b7f335 am 121a31ac: Merge change Id86beb99 into eclair
Merge commit '121a31ac3901fcb81c808da2b4a9a7cf66c12b7c' into eclair-mr2

* commit '121a31ac3901fcb81c808da2b4a9a7cf66c12b7c':
  fix [2291418] Camera preview cannot work in Emulator
2009-12-02 17:50:45 -08:00
Mathias Agopian
3e8a81e354 fix [2291418] Camera preview cannot work in Emulator
The image buffer used by glTexImage2d() would be uninitialized when no copybit engine
can be found.
We now always initialize images, since the abscence of copybit is not necessarily fatal.
2009-12-02 16:23:11 -08:00
Eric Laurent
b598e9f38d am 1ac56b60: Merge change Iac196e17 into eclair
Merge commit '1ac56b602aa6a1ac54c608e5a8b76f44638db23b' into eclair-mr2

* commit '1ac56b602aa6a1ac54c608e5a8b76f44638db23b':
  Fix issue 2292062: Audio freezes for three seconds when choosing ringtones with a headset connected and music playing.
2009-12-02 09:48:52 -08:00