This is a second attempt to fix the audio routed to earpiece syndrom.
The root cause identified this time is the crash of an application having an active AudioTrack playing on the VOICE_CALL stream type.
When this happens, the AudioTrack destructor is not called and the audio policy manager is not notified of the track stop.
Results a situation where the VOICE_CALL stream is considered as always in use by audio policy manager which makes that audio is routed to earpiece.
The fix consists in moving the track start/stop/close notification to audio policiy manager from AudioTrack to AudioFlinger Track objet.
The net result is that in the case of a client application crash, the AudioFlinger TrackHandle object (which implements the remote side of the IAudioTrack binder interface) destructor is called which in turn destroys the Track object and we can notify the audio policy manager of the track stop and removal.
The same modification is made for AudioRecord although no bug related to record has been reported yet.
Also fixed a potential problem if record stop is called while the record thread is exiting.
Merge commit 'f854e0770207e93ef9d1bf6d50ed18537a107ca4' into eclair-plus-aosp
* commit 'f854e0770207e93ef9d1bf6d50ed18537a107ca4':
DO NOT MERGE: Instead of inserting semi-random delays after submission to surface flinger, delay releasing buffers to the next display time to avoid flickering.
Merge commit '2c7664989f7388c0c6cf0ec7d80ffa2704c8c2be' into eclair-mr2-plus-aosp
* commit '2c7664989f7388c0c6cf0ec7d80ffa2704c8c2be':
Squashed commit of the following:
Merge commit '744043fcbf48c32c2051f222eca552fa2df5dfcb' into eclair-mr2-plus-aosp
* commit '744043fcbf48c32c2051f222eca552fa2df5dfcb':
Update FileSource to also accept a file descriptor and a range.
commit 333057b355f8c260c549553b9a0634755c838b6a
Author: Andreas Huber <andih@google.com>
Date: Fri Nov 13 15:35:48 2009 -0800
Some more tweaks to AVC encoding on sholes.
commit 9981d0ee52ec5b8b0182aae733d1571e3ebb8390
Author: Andreas Huber <andih@google.com>
Date: Thu Nov 12 16:36:57 2009 -0800
Support for avc encoding, including sholes specific tweaks to pick the right colorspace for the camera to not require transcoding.
commit 5ba0ebbbd4efca51f3ae1f60e2ca31e7d2cf136d
Author: Andreas Huber <andih@google.com>
Date: Wed Nov 11 09:50:03 2009 -0800
Enable actual (camera) video-only recording using h.263 or mpeg4 encoding.
commit 3fd59c3526a37fe7c696f4a978925d1831c09313
Author: Andreas Huber <andih@google.com>
Date: Tue Nov 10 14:57:48 2009 -0800
Allow switching between the PV recorder implementation and one supported by stagefright.
This is controlled through the property "media.stagefright.enable-record".
The headset state indicated by HeadsetObserver in the broadcast intent ACTION_HEADSET_PLUG was not 0 or 1 as specified in the java doc but contained a bit field indicating the type of headset connected.
Modified HeadsetObserver to broacast a state conforming to java doc.
Added an extra to intent ACTION_HEADSET_PLUG to indicate if headset has a microphone or not.
Removed handling of non standard headset indications from HeadsetObserver.
Removed platform specific devices from output devices defined in AudioSystem.
Modified AudioService to use new ACTION_HEADSET_PLUG intent extra instead of bitfield in state.
Merge commit 'd0f3228daa9ea26ec959cb79451e6f150648bce8' into eclair-mr2-plus-aosp
* commit 'd0f3228daa9ea26ec959cb79451e6f150648bce8':
Delegate the platform dependent hardware renderer implementation to a shared library provided by the vendor.
Merge commit 'c66d53f97b1fe635f576642d5720dcd441e34cce' into eclair-plus-aosp
* commit 'c66d53f97b1fe635f576642d5720dcd441e34cce':
Delegate the platform dependent hardware renderer implementation to a shared library provided by the vendor.
Merge commit '05eca1d46a45723a57899dabad698537b7faef82' into eclair-plus-aosp
* commit '05eca1d46a45723a57899dabad698537b7faef82':
DO NOT MERGE: Squashed commit of the following:
commit 08259dd3dc9026887f9bbfedaf45866eb56ea9bc
Author: Andreas Huber <andih@google.com>
Date: Thu Nov 5 12:02:31 2009 -0800
DO NOT MERGE: Use PV for metadata extraction even if stagefright is used for playback.
commit 991832fe4dc012e51d3d9ed8d647c7f09991858f
Author: Andreas Huber <andih@google.com>
Date: Thu Nov 5 11:24:11 2009 -0800
DO NOT MERGE: Do not assert if we encounter OMX_StateInvalid. All bets are off though.
commit cec45cf302d9218fe79956cbe8a462d7ca3a10bb
Author: Andreas Huber <andih@google.com>
Date: Mon Oct 26 16:11:54 2009 -0700
DO NOT MERGE: When freeing an OMX node, attempt to transition it from its current state all the way to "Loaded" in order to properly free any allocated buffers.
commit 34a1e885ef9113d68acbc26d36fcc47fdebbed84
Author: Andreas Huber <andih@google.com>
Date: Thu Nov 5 11:10:49 2009 -0800
DO NOT MERGE: Fix heap corruptin in OMXNodeInstance.
commit 5a47f7439a1298b330541a7e4e647a8b44487388
Author: Andreas Huber <andih@google.com>
Date: Thu Nov 5 11:08:19 2009 -0800
DO NOT MERGE: Fix seek-on-initial-read behaviour of OMXCodec.
commit 45bed64722501b9f411a2940aff5aff4cc4d2e98
Author: Andreas Huber <andih@google.com>
Date: Thu Nov 5 11:02:23 2009 -0800
DO NOT MERGE: Renaming string.h to stagefright_string.h to avoid conflicts.
commit 6738e306a50196f31a73d4fc7b7c45faff639903
Author: Andreas Huber <andih@google.com>
Date: Thu Oct 15 13:46:54 2009 -0700
DO NOT MERGE: Reimplement the OMX backend for stagefright.
Besides a major cleanup and refactoring, OMX is now a singleton living in the media server, it listens for death notifications of node observers/clients that allocated OMX nodes and performs/attempts cleanup.
Changed APIs to conform to the rest of the system.
Merge commit 'fcae6c71794696a074cabf20beeb02fd87853e30' into eclair-mr2-plus-aosp
* commit 'fcae6c71794696a074cabf20beeb02fd87853e30':
Fix issue 2203561: Sholes: audio playing out of earpiece.
Merge commit '67b692920c18f99b096dce285adc6f7439fa866c' into eclair-plus-aosp
* commit '67b692920c18f99b096dce285adc6f7439fa866c':
Fix issue 2203561: Sholes: audio playing out of earpiece.
Merge commit '67b692920c18f99b096dce285adc6f7439fa866c' into eclair-mr2
* commit '67b692920c18f99b096dce285adc6f7439fa866c':
Fix issue 2203561: Sholes: audio playing out of earpiece.
Create a new IAudioTrack interface to AudioFlinger when start() fails due to a broken pipe error.
Do the same if start fails due to the same error after time out in obtainBuffer().
Do not indicate that the AudioTrack is started to AudioPolicyManager if IAudioTrack start fails.
This avoids that an AudioTrack keeps a dead IAudioTrack after a media server crash.
Same modifications for AudioRecord.
Add a flag to ToneGenerator indicating that the callback thread can call Java. Without it, when the media server crashes and restarts, the AudioSystem error callback will crash in JNI if the IAudiotrack is created from AudioTrack callback thread.
Merge commit '3d2d155a87cdd3038a2e6df8741181431cb250e1' into eclair-mr2-plus-aosp
* commit '3d2d155a87cdd3038a2e6df8741181431cb250e1':
Add new audio sources to support the A1026 recording configurations.
Merge commit '7ed0ceeba54712f76e9a4f2dd4c9197d76813488' into eclair-plus-aosp
* commit '7ed0ceeba54712f76e9a4f2dd4c9197d76813488':
Add new audio sources to support the A1026 recording configurations.
Merge commit '7ed0ceeba54712f76e9a4f2dd4c9197d76813488' into eclair-mr2
* commit '7ed0ceeba54712f76e9a4f2dd4c9197d76813488':
Add new audio sources to support the A1026 recording configurations.
Merge commit 'ad278f2276de23197571e486ad387dacc7f346ee' into eclair-mr2-plus-aosp
* commit 'ad278f2276de23197571e486ad387dacc7f346ee':
Adds a WAVExtractor for 16-bit signed PCM audio wave files.
Merge commit '9dba1f928021450f101013e03deacc9a0506772e' into eclair-mr2-plus-aosp
* commit '9dba1f928021450f101013e03deacc9a0506772e':
Revive support for video encoding in OMXCodec.
Merge commit '7ed70c9515fe3df6eb1796717d73f23e7286b3e6' into eclair-mr2-plus-aosp
* commit '7ed70c9515fe3df6eb1796717d73f23e7286b3e6':
Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
Merge commit 'bf96aaadd46fb5b0884070177faa16ec4f22e2ba' into eclair-mr2
* commit 'bf96aaadd46fb5b0884070177faa16ec4f22e2ba':
Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
Merge commit 'bf96aaadd46fb5b0884070177faa16ec4f22e2ba' into eclair-plus-aosp
* commit 'bf96aaadd46fb5b0884070177faa16ec4f22e2ba':
Fix issue 2192181: AudioFlinger must provide separated methods to set VOICE_CALL stream volume and down link audio volume.
Merge commit 'd9f3d60df9317f15a7f26bc050f51b53b46898ff' into eclair-mr2-plus-aosp
* commit 'd9f3d60df9317f15a7f26bc050f51b53b46898ff':
New API to instantiate a MediaExtractor given a URI and optional MIME type.
Also DataSources now must provide a method initCheck()
and DataSource::reat_at has been renamed to readAt to conform to
standard API naming guidelines.
Merge commit '9069aa31accee9c23a4cf228ca27fe8fa8506a56' into eclair-mr2-plus-aosp
* commit '9069aa31accee9c23a4cf228ca27fe8fa8506a56':
Moving the individual extractor headers files to the private include directory.
While our hardware decoders clearly outperform the software decoders in terms
of raw throughput, their startup latency makes them less suitable for thumbnail
extraction.
Merge commit 'e981c33446a98d5ccc0d73c1a840696d77cf0732' into eclair-mr2-plus-aosp
* commit 'e981c33446a98d5ccc0d73c1a840696d77cf0732':
Extract video thumbnails from the largest sync sample among the first 20.