Commit Graph

394 Commits

Author SHA1 Message Date
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
Mathias Agopian
af0b0f09bb enable HW acceleration for the Dim Surface on 8k devices 2009-08-10 21:13:06 -07:00
Eric Laurent
878c0e1d68 Limit AudioFlinger mixer track sampling rate.
When changing the audio output stream sampling rate with setParameters() make sure that all tracks have a sampling rate less or equal to 2 times the new output sampling rate.
2009-08-10 08:15:12 -07:00
Eric Laurent
efd9ad93ff Test for issue 2041105: CPU pegged after lost of bluetooth connection[WAR ROOM].
Merge change 7419 from master that may help eliminate the problem.
This change was for a different use case (when disabling A2DP to switch output to SCO) but without a repro case it is worth trying.
2009-08-08 06:41:09 -07:00
Mathias Agopian
9fbeb7c6e2 remove unused and confusing comment 2009-08-07 19:08:18 -07:00
Android (Google) Code Review
9cedf4c3f0 Merge changes 20497,20498,20499
* changes:
  minor code clean-up
  added EGLUtils::strerror
  better error handling
2009-08-07 16:39:34 -07:00
Mathias Agopian
0928e31cc7 minor code clean-up 2009-08-07 16:38:10 -07:00
Mathias Agopian
8c12c7aec3 added EGLUtils::strerror 2009-08-07 16:37:21 -07:00
Eric Laurent
f9df24932f AudioService now differentiates BT headsets and car kits.
The BT headset detection now makes the difference between car kits and headsets, which can be used by audio policy manager.
The headset connection is also detected earlier, that is when the headset is connected and not when the SCO socket is connected as it was the case before. This allows the audio policy manager to suspend A2DP output while ringing if a SCO headset is connected.
2009-08-07 10:31:53 -07:00
Eric Laurent
dae20d9b7f Fix problem in AudioFlinger closeOutput and closeInput.
There was no garanty that the corresponding thread destructor had been already called when exiting the closeOutput() or closeInput() functions.
This contructor could be called by the thread after the exit condition is signalled. By way of consequence, closeOutputStream() could be called after
we exited closeOutput() function.

To solve the problem, the call to closeOutputStream() or closeInputStream() is moved to closeOutput() or closeInput().
2009-08-07 10:19:09 -07:00
Eric Laurent
29b9eff418 Improved unit test code for Audioflinger. 2009-08-07 09:32:06 -07:00
Eric Laurent
3464c015ad Fix lockup in audio flinger threadbase setParameters.
The function checkForNewParameters_l() is called with the ThreadBase mutex mLock locked. In the case where the parameter change implies
an audio parameter modification (e.g. sampling rate) the function sendConfigEvent() is called which tries to lock mLock creating a deadlock.

The fix consists in creating a function equivalent to sendConfigEvent() that must be called with mLock locked and does not lock mLock.

Also added the possibility to have more than one set parameter request pending.
2009-08-07 09:28:40 -07:00
Android (Google) Code Review
cf6b2bf469 Merge change 9660
* changes:
  Fix problem in A2DP interface closeOutputStream().
2009-08-07 09:09:10 -07:00
Android (Google) Code Review
dfbea2f397 Merge change 9653
* changes:
  Fix getParameters() default implementation.
2009-08-07 09:08:36 -07:00
Eric Laurent
e0e9ecc0ce Fix issue 2001214: AudioFlinger and AudioPolicyService interfaces should not use pointers as handles to inputs and outputs.
Use integers instead of void* as input/output handles at IAudioFlinger and IAudioPolicyService interfaces.
AudioFlinger maintains an always increasing count of opened inputs or outputs as unique ID.
2009-08-07 00:27:19 -07:00
Mathias Agopian
42db9dcea2 better error handling 2009-08-06 20:46:44 -07:00
Android (Google) Code Review
f9694507ec Merge change 20365
* changes:
  oops, EGLConfig of value zero may be valid
2009-08-06 17:15:11 -07:00
Mathias Agopian
b97603dcf0 oops, EGLConfig of value zero may be valid 2009-08-06 17:14:10 -07:00
Android (Google) Code Review
b2001065b9 Merge changes 20345,20346,20347
* changes:
  update most gl tests to use EGLUtils
  added two EGL helpers for selecting a config matching a certain pixelformat or native window type
  added NATIVE_WINDOW_FORMAT attribute to android_native_window_t
2009-08-06 16:27:47 -07:00
Mathias Agopian
6cf50a770d added two EGL helpers for selecting a config matching a certain pixelformat or native window type 2009-08-06 16:05:39 -07:00
Mathias Agopian
6b1f41004f added NATIVE_WINDOW_FORMAT attribute to android_native_window_t 2009-08-06 16:04:29 -07:00
Iliyan Malchev
34193b3168 EventHub: pass the name of each input device up to Java
Signed-off-by: Iliyan Malchev <malchev@google.com>
2009-08-06 14:52:13 -07:00
Android (Google) Code Review
46078d9978 Merge change 20133
* changes:
  don't crash when SurfaceBuffer::writeToParcel is given a null argument
2009-08-05 12:52:51 -07:00
Mathias Agopian
3eded94924 don't crash when SurfaceBuffer::writeToParcel is given a null argument 2009-08-05 12:22:30 -07:00
Dianne Hackborn
c591736c66 Finish implementation of multiple pointer support for MotionEvent.
The major things going on here:

- The MotionEvent API is now extended to included "pointer ID" information, for
  applications to keep track of individual fingers as they move up and down.
  PointerLocation has been updated to take advantage of this.

- The input system now has logic to generate MotionEvents with the new ID
  information, synthesizing an identifier as new points are down and trying to
  keep pointer ids consistent across events by looking at the distance between
  the last and next set of pointers.

- We now support the new multitouch driver protocol, and will use that instead
  of the old one if it is available.  We do NOT use any finger id information
  coming from the driver, but always synthesize pointer ids in user space.
  (This is simply because we don't yet have a driver reporting this information
  from which to base an implementation on.)

- Increase maximum number of fingers to 10.  This code has only been used
  with a driver that reports up to 2, so no idea how more will actually work.

- Oh and the input system can now detect and report physical DPAD devices.
2009-08-04 20:53:52 -07:00