Commit Graph

418 Commits

Author SHA1 Message Date
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
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
Mathias Agopian
1c97d2ebe1 fix a bug that caused the PixelFormat viewed by Surface to be wrong.
what happened is that the efective pixel format is calculated by SF but Surface nevew had access to it directly.
in particular this caused query(FORMAT) to return the requested format instead of the effective format.
2009-08-19 17:46:26 -07:00
Mathias Agopian
50517543d8 fix [2063336] Surface.lockSurface throws IllegalArgumentException when out of memory 2009-08-19 17:10:18 -07:00
Andreas Huber
84a6d041e2 Support for marshalling pointers / intptr_t in Parcel.
Some refactoring to eliminate code duplication in Parcel implementation.
2009-08-17 15:31:25 -07:00
Mathias Agopian
ba5972ffdc make sure to update a surface's usage bits when it changes, instead of only the first time.
also fixed a few locking issues in Surface and commented how each member is protected.
2009-08-14 18:52:17 -07:00
Mathias Agopian
d66a97950e fix a bug that could cause a window to be hidden in some cases.
this would happen is the window is made visible but the client didn't render yet into it. This happens often with SurfaceView.
Instead of filling the window with solid black, SF would simply ignore it which could lead to more disturbing artifacts.

in theory the window manager should not display a window before it has been drawn into, but it does happen occasionnaly.
2009-08-13 19:08:00 -07:00
Mathias Agopian
ccde199f7c Surface::GPU and Surface::HARDWARE are now deprecated; they will be set automatically if needed.
this also ripples into the window manager API by making some constant there deprecated as well.
2009-08-13 18:19:32 -07:00
Android (Google) Code Review
5eb77d68b3 Merge change 21059
* changes:
  make sure EGL_ANDROID_swap_rectangle is actually supported before using it
2009-08-12 21:25:15 -07:00
Mathias Agopian
8458a3140f make sure EGL_ANDROID_swap_rectangle is actually supported before using it 2009-08-12 21:24:53 -07:00
Android (Google) Code Review
153e4a4c2a Merge change 21057
* changes:
  Better error handling in EGL extensions
2009-08-12 21:18:35 -07:00
Mathias Agopian
24e5f52901 Better error handling in EGL extensions 2009-08-12 21:18:15 -07:00
Dianne Hackborn
878d647b5b am b8546001: Merge change 20878 into donut
Merge commit 'b8546001701405a76dad7e6235046e592296fac2'

* commit 'b8546001701405a76dad7e6235046e592296fac2':
  Fix issue #2048263: More debugging information
2009-08-12 12:36:12 -07:00
Eric Laurent
11c04c984a Workaround for issue 2046783.
Apparently the problem is caused by the fact that A2dpAudioStreamOut::standby() calls a2dp_stop() after the headset has been powered down.
The workaround consists in indicating to A2DP audio hardware that a close request is pending and that stanby() must be bypassed.
2009-08-12 05:49:58 -07:00
Mathias Agopian
cf70e3301b second take, hopefully this time it doesn't break one of the builds: "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything." 2009-08-11 23:44:13 -07:00
Mathias Agopian
5221271375 second take, hopefully this time it doesn't break one of the builds: "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything." 2009-08-11 23:32:29 -07:00
Fred Quintana
b2fd4665e6 Revert "SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything."
This reverts commit 8b76a0ac6fbf07254629ed1ea86af014d5abe050.
2009-08-11 20:49:35 -07:00
Dianne Hackborn
e868513287 Fix issue #2048263: More debugging information
We now hopefully do better about generating the anr reports, and include
information about the malloc loaded assets in meminfo.
2009-08-11 18:56:41 -07:00
Mathias Agopian
df37b62c62 SurfaceFlinger will now allocate buffers based on the usage specified by the clients. This allows to allocate the right kind of buffer automatically, without having the user to specify anything.
This change makes SurfaceHolder.setType(GPU) obsolete (it's now ignored).
Added an API to android_native_window_t to allow extending the functionality without ever breaking binary compatibility. This is used to implement the new set_usage() API. This API needs to be called by software renderers because the default is to use usage flags suitable for h/w.
2009-08-11 16:12:56 -07:00
Eric Laurent
f5aba82cb7 Fix issue 2046140: master: media_server crash when powering down A2DP headset while a ringtone is playing.
This is because the AudioFlinger duplicating thread is closed while the output tracks are still active. This cause the output tracks objects to be destroyed at a time where they can be in use by the destination output mixer.

The fix consists in adding the OutputTrack to the track list (mTracks) of its destination thread so that a strong reference is help during the mixer processed and the track is detroyed only when safe by destination thread.

Also added detection of problems when creating the output track (e.g. no more tracks in mixer). In this case the output track is not added to output track list of duplicating thread.
2009-08-11 09:43:09 -07:00
Eric Laurent
9e7b81943b Fix issue 2043314: Recorded audio is choppy.
Fixed cut/paste error causing constant reset of current frame index in input buffer.
2009-08-11 09:07:44 -07:00
Android (Google) Code Review
544542bbb9 Merge change 20699
* changes:
  enable HW acceleration for the Dim Surface on 8k devices
2009-08-10 21:22:00 -07:00