Commit Graph

438 Commits

Author SHA1 Message Date
Mathias Agopian
86f7329080 add basic time stats for surfaces lock time 2009-09-17 01:35:28 -07:00
Benny Wong
5643261a25 Overlay could not set position or rotation immediately after created, it should be triggered by signalEvent().
Originally from: https://partner.source.android.com/g/#change,1074
2009-09-16 20:24:21 -07:00
Mathias Agopian
0928bee979 disable backbuffer preservation when possible, which may improve performance a bit 2009-09-16 20:15:42 -07:00
Mathias Agopian
caa600c4a1 fix [2119400] sholes: artifacting when switching orientation 2009-09-16 18:27:24 -07:00
Mathias Agopian
378532fdb0 fix again [2102410] Home Screen is not displayed in the background in Landscape Mode 2009-09-16 17:00:19 -07:00
Eric Laurent
bdc0f84793 Fix issue 2123668: Class scope typo in AudioFlinger.cpp. 2009-09-16 06:02:45 -07:00
Mathias Agopian
b8cfc0f9e1 revert to black video background, since we don't need the color-key anylonger 2009-09-15 19:31:28 -07:00
Mathias Agopian
68a6afeb26 fix [2122448] android_native_window_t::setUsage() only reallocates the first buffer
Take 2. We needed to check that the usage flags are "good enough" as opposed to "the same".

This reverts commit 8f17a762fe9e9f31e4e86cb60ff2bfb6b10fdee6.
2009-09-15 19:21:31 -07:00
Mathias Agopian
3910f5467a Revert "fix [2122448] android_native_window_t::setUsage() only reallocates the first buffer"
This reverts commit 486aa963b63e20b7910e1004cebb4f0afabbd80f.
2009-09-15 18:57:06 -07:00
Mathias Agopian
d18afab9d6 fix [2122448] android_native_window_t::setUsage() only reallocates the first buffer 2009-09-15 17:34:04 -07:00
Android (Google) Code Review
e5b0c94708 Merge change 25050 into eclair
* changes:
  Fix issue 2118464: cannot play ring tones and notifications after disconnecting BT headset while in call.
2009-09-15 11:29:23 -04:00
Eric Laurent
b3687ae925 Fix issue 2118464: cannot play ring tones and notifications after disconnecting BT headset while in call.
The problem comes from the fact that when the duplicated output is closed after BT headset disconnection, the OUTPUT_CLOSED notification is not sent to AudioSystem. Then the mapping between notification stream and duplicated output cached in AudioSystem is not cleared and next time a notification is played, the duplicated output is selected and the createTrack() request is refused by AudioFlinger as the selected output doesn't exist.
The notification is ignored by AudioFlinger because when it is sent by the terminating playback thread, the thread has already been removed from the playback thread list.

The fix consists in sending the notification in closeOutput() and not when exiting the playback thread.
The same fix is applied to record threads.
2009-09-15 07:10:12 -07:00
Chih-Chung Chang
00900eb354 Fix 2083478: Camera needs an auto-focus cancel API
Change-Id: I13bda991b32aee47e82b5cf9d43b3021c416a9a2
2009-09-15 18:29:03 +08:00
Android (Google) Code Review
f5733b2938 Merge change 24872 into eclair
* changes:
  Fix issue 2115450: a2dp thread is started, even though we are only connected to headset and not playing music.
2009-09-15 02:26:19 -04:00
Mathias Agopian
816d7d0268 add support for RGBX_8888 surfaces in SurfaceFlinger 2009-09-14 18:10:30 -07:00
Mathias Agopian
4790a3c1a2 fix [2117464] SF can crash when calling dumpsys 2009-09-14 15:59:16 -07:00
Mathias Agopian
c7d5601081 make sure to update the tail pointer when undoing a dequeue 2009-09-14 15:48:42 -07:00
Eric Laurent
a6e58fe316 Fix issue 2115450: a2dp thread is started, even though we are only connected to headset and not playing music.
This is due to a regression introduced by change 24114: when no audio tracks are ready for mixing, 0s are written to audio hardware. However this should only happen if tracks have already been mixed since the audio flinger thread woke up.
Also do not write 0s to audio hardware in direct output threads when audio format is not linear PCM.
2009-09-14 02:37:15 -07:00
Android (Google) Code Review
f79cbd93e6 Merge change 24337 into eclair
* changes:
  Fix issue 2107584: media server crash when AudioFlinger fails to allocate memory for track control block.
2009-09-14 02:43:52 -04:00
Mathias Agopian
40d5799622 fix [2111536] [FAST BLOCKER] Device is soft rebooted after ending the call through voice dialer 2009-09-11 19:18:20 -07:00
Mathias Agopian
48d819a131 fix [2112575] stuck on DequeueCondition for a surface that doesn't exist anymore
this also fixes part of [2111536] Device is soft rebooted after ending the call through voice dialer
2009-09-10 19:41:18 -07:00
Mathias Agopian
b58b5d72d6 make sure conditions will return when the status of a surface is not NO_ERROR 2009-09-10 16:55:13 -07:00
Mathias Agopian
a5b02e0b4d add a debug property to disable h/w composition. debug.sf.hw, when set to 0 will disable h/w composition 2009-09-09 19:20:10 -07:00
Mathias Agopian
b6a5daa3ab fix [2102410] Home Screen is not displayed in the background in Landscape Mode
the blurring code now handles NPOT textures.
2009-09-09 17:47:15 -07:00
Andy McFadden
e0a963b72e Fix sim-eng build.
Appears to have been broken by:

commit 9779b221e999583ff89e0dfc40e56398737adbb3
Author: Mathias Agopian <mathias@google.com>
Date:   Mon Sep 7 16:32:45 2009 -0700

    fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly

For some reason we don't like to have "-lpthread" globally -- it's a no-op
on device builds, but required for many host tools and all sim binaries --
so adding the use of pthread calls requires adding the library explicitly.
2009-09-09 08:02:54 -07:00
Eric Laurent
6ad8c64ce9 Fix issue 2107584: media server crash when AudioFlinger fails to allocate memory for track control block.
AudioFlinger: verify that mCblk is not null before using it in Track and RecordTrack contructors.
IAudioFlinger: check result of remote transaction before reading IAudioTrack and IAudioRecord.
IAudioTrack and IAudioRecord: check result of remote transaction before reading IMemory.
2009-09-09 05:16:08 -07:00
Android (Google) Code Review
1f5105cf53 Merge change 24335 into eclair
* changes:
  use broadcast() instead of signal() when signaling the condition-variable Thread::RequestExitAndWait() is waiting for
2009-09-09 03:29:19 -07:00
Android (Google) Code Review
42c3c9a8d1 Merge change 24334 into eclair
* changes:
  fix [2037525] Fail to start camera after adb sync new Camera
2009-09-09 03:29:08 -07:00
Android (Google) Code Review
0ee8522ffa Merge change 24333 into eclair
* changes:
  rename Mutexes to make the code easier to follow
2009-09-09 03:28:47 -07:00
Mathias Agopian
4de4ebf6a2 use broadcast() instead of signal() when signaling the condition-variable Thread::RequestExitAndWait() is waiting for
we could have several thread waiting on the condition and they all need to wake-up.
also added a debug "mTid" field in the class, which contains the tid of the thread (as opposed to pthread_t), this
is useful when debugging under gdb for instance.
2009-09-09 02:45:26 -07:00
Mathias Agopian
454ea68139 fix [2037525] Fail to start camera after adb sync new Camera
we ended-up locking a Mutex that had been destroyed.
This happened because we gave an sp<Source> to the outside world,
and were called after LayerBuffer had been destroyed.

Instead we now give a wp<LayerBuffer> to the outside and have it
do the destruction.
2009-09-09 00:50:29 -07:00
Eric Laurent
3522c80819 Fix issue 1992233: DTMF tones on Sholes is really long.
Add a parameter to ToneGenerator.startTone() allowing the caller to specify the tone duration. This is used by the phone application to have a precise control on the DTMF tone duration which was not possible with the use of delayed messaged.
Also modified AudioFlinger output threads so that 0s are written to the audio output stream when no more tracks are ready to mix instead of just sleeping. This avoids an issue where the end of a previous DTMF tone could stay in audio hardware buffers and be played just before the beginning of the next DTMF tone.
2009-09-08 22:56:07 -07:00
Mathias Agopian
4d2de2c769 rename Mutexes to make the code easier to follow 2009-09-08 22:48:24 -07:00
Mathias Agopian
8837e2f2e6 delete old and unused source files 2009-09-07 16:33:36 -07:00
Mathias Agopian
cbb288bfe8 fix [2068105] implement queueBuffer/lockBuffer/dequeueBuffer properly
Rewrote SurfaceFlinger's buffer management from the ground-up.
The design now support an arbitrary number of buffers per surface, however the current implementation is limited to four. Currently only 2 buffers are used in practice.

The main new feature is to be able to dequeue all buffers at once (very important when there are only two). 

A client can dequeue all buffers until there are none available, it can lock all buffers except the last one that is used for composition. The client will block then, until a new buffer is enqueued.

The current implementation requires that buffers are locked in the same order they are dequeued and enqueued in the same order they are locked. Only one buffer can be locked at a time.

eg. Allowed sequence:   DQ, DQ, LOCK, Q, LOCK, Q
eg. Forbidden sequence: DQ, DQ, LOCK, LOCK, Q, Q
2009-09-07 16:32:45 -07:00
Mathias Agopian
0852e67412 attempt to fix [2099362] Possible SurfaceFlinger crash 2009-09-04 19:50:23 -07:00
Mathias Agopian
888eee68db fix [2098939] Smooth gradients show banding on Sholes 2009-09-04 17:27:16 -07:00
Eric Laurent
08d3d1d001 fix issue 2096657: Sholes: residue shutter sound heard ONCE while taking a picture AFTER the volume is turned off.
Do not ramp volume if the first frame of a track is processed after the track was stopped.
In the case of very short sounds, the track stop request can be received by AudioFlinger just after the start request before the first frame is mixed by AudioMixer. In this case, the track is already in stopped state and initial volume is applied with a ramp for the first frame processed which should not be the case: initial volume change is always applied immediatelly.
2009-09-03 04:11:18 -07:00
Android (Google) Code Review
36c8e9848d Merge change 23568 into eclair
* changes:
  Work on issue #2079167: Flickering issue across multiple UI
2009-09-02 17:21:35 -07:00
Dianne Hackborn
39bf918e21 Work on issue #2079167: Flickering issue across multiple UI
This addresses a few parts of the bug:

- There was a small issue in the window manager where we could show a window
  too early before the transition animation starts, which was introduced
  by the recent wallpaper work.  This was the cause of the flicker when
  starting the dialer for the first time.

- There was a much larger problem that has existing forever where moving
  an application token to the front or back was not synchronized with the
  application animation transaction.  This was the cause of the flicker
  when hanging up (now that the in-call screen moves to the back instead
  of closing and we always have a wallpaper visible).  The approach to
  solving this is to have the window manager go ahead and move the app
  tokens (it must in order to keep in sync with the activity manager), but
  to delay the actual window movement: perform the movement to front when
  the animation starts, and to back when it ends.  Actually, when the
  animation ends, we just go and completely rebuild the window list to
  ensure it is correct, because there can be ways people can add windows
  while in this intermediate state where they could end up at the wrong
  place once we do the delayed movement to the front or back.  And it is
  simply reasuring to know that every time we finish a full app transition,
  we re-evaluate the world and put everything in its proper place.

Also included in this change are a few little tweaks to the input system,
to perform better logging, and completely ignore input devices that do not
have any of our input classes.  There is also a little cleanup of evaluating
configuration changes to not do more work than needed when an input
devices appears or disappears, and to only log a config change message when
the config is truly changing.

Change-Id: Ifb2db77f8867435121722a6abeb946ec7c3ea9d3
2009-09-02 17:20:25 -07:00
Android (Google) Code Review
dfcfc67381 Merge change 23720 into eclair
* changes:
  Add colorkey to gl clear operation
2009-09-02 17:05:31 -07:00
Rebecca Schultz Zavin
29aa74c546 Add colorkey to gl clear operation
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
2009-09-02 15:57:42 -07:00
Eric Fischer
75a3d0a215 Make it an error to use a bare apostrophe in aapt, and adjust warnings/errors.
In practice, no one ever writes an apostrophe in an aapt string with the
intent of using it to quote whitespace -- they always mean to include a
literal apostrophe in the string and then are surprised when they find
the apostrophe missing.  Make this an error so that it is discovered
right away instead of waiting until late in QA or after the strings have
already been sent for translation.  (And fix a recently-introduced string
that has exactly this problem.)

Silence the warning about an empty span in a string, since this seems to
annoy people instead of finding any real problems.

Make the error about having a translated string with no base string into
a warning, since this is a big pain when making changes to an application
that has already had some translations done, and the dead translations
should be removed by a later translation import anyway.
2009-09-01 15:20:30 -07:00
Eric Laurent
0643771ad0 Fix issue 2091594: music chirp after disconnecting A2DP.
In AudioFlinger::MixerThread::putTracks(), change the mFillingUpStatus flag to FS_FILLING for active tracks so that mute request is executed without ramping volume down when the track is moved from A2DP to hardware output.
Also modified AudioFlinger::setStreamOutput() so that the notification of the change is sent only once to AudioSystem.
2009-09-01 05:56:26 -07:00
Eric Laurent
c80b1a0034 Fix issue 2085690: AudioFlinger must properly terminate the input and output threads when destroyed.
Call closeInput() for all inputs and closeOutput() for all outputs before deleting audio hardware in AudioFlinger destructor.
2009-08-31 02:10:20 -07:00
Mike Lockwood
07549f984d EventHub: Fix file descriptor leak.
Signed-off-by: Mike Lockwood <lockwood@android.com>
2009-08-28 13:30:03 -07:00
Eric Laurent
23490efd8e Fix issue 2045911: Camera Shutter tone does not play correctly while listening to music.
Add the possibility to delay routing and volume commands in AudioPolicyClientInterface. The delay is not blocking for the caller.
2009-08-27 05:58:10 -07:00
Mathias Agopian
9795c42e55 dumpsys SurfaceFlinger will now always dump SF's state, even if SF is deadlocked
(in this case the state is dumped without the proper locks held which could result to a crash)

in addition, the last transaction and swap times are printed to the dump as well as the time spent
*currently* in these function. For instance, if SF is unresponsive because eglSwapBuffers() is stuck,
this will show up here.
2009-08-26 16:55:50 -07:00
Mathias Agopian
04bc12bd43 fix [2070341] [FAST BLOCKER] can't successfully setup erc52 2009-08-21 15:44:17 -07:00
Benny Wong
d4851d74ac Add offset handling in MemoryHeapBase class 2009-08-20 03:55:20 -07:00