History log of /frameworks/av/services/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
1b4d229ee6b2abef871bcfcd30e0f1d7a1e42afb 31-Mar-2015 Eric Laurent <elaurent@google.com> DO NOT MERGE - audio policy: fix DeviceVector::getDevicesFromType()

Fix device type comparison in DeviceVector::getDevicesFromType():
AUDIO_DEVICE_BIT_IN bit must be excluded from type comparison
and used as an orthogonal match criterium.

Manual cherry-pick from master 4c91f90

Bug: 19957479

Change-Id: Ica9f440384bcb85e669864bd29504a4fda862ce7
udiopolicy/AudioPolicyManager.cpp
3ae5f31393609b7fa92f24132c66e9a8c9244a45 04-Feb-2015 Eric Laurent <elaurent@google.com> audiopolicy: send device connect notification to HALs

Device disconnect notifications are sent from audiopolicy to
the HALs. Send connect notifications as well.

Bug: 19249796.
Bug: 17785277.

Change-Id: Ia823ed154d6a0c7ceb84b0a94f0c3b78392faaf6
udiopolicy/AudioPolicyManager.cpp
1bf8a21018cc1d95dc3c28b5044aeda327c7b54e 30-Jan-2015 Eric Laurent <elaurent@google.com> Merge "audio policy: add fallback for output selection" into lmp-mr1-dev
a82797faddb37adb2d441737884576684c8515cb 30-Jan-2015 Eric Laurent <elaurent@google.com> audio policy: add fallback for output selection

When getOutputForDevice() finds a matching direct output profile
but fails to open it, try to fallback to downmix on mixer output
when format is PCM and sampling rate allows it.

Bug: 19197137.
Change-Id: I197b9b202504265b6928e69740875cb7aba5c2c5
udiopolicy/AudioPolicyManager.cpp
d99c6855901e4b2625aaad3fc24cff5ecf675fa3 30-Jan-2015 Eric Laurent <elaurent@google.com> Merge "audio policy: match attached device to declared devices" into lmp-mr1-dev
a1d525fbf2c1e0b2c61e5d29f338b0a0d8823436 29-Jan-2015 Eric Laurent <elaurent@google.com> audio policy: match attached device to declared devices

Make sure that when a new audio device is connected,
and a specific profile for this device is listed in
audio_policy.conf, this particular profile is used instead
of a default generic profile.

Bug: 19188567.
Change-Id: I5f576fcd697adc041b2cfbd2bac7a51bcc2143b9
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
0d84ba3fd82038cb721ffae234a99e6751ed7fbe 29-Jan-2015 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix FLAG_BEACON regression" into lmp-mr1-dev
79ad438ed25c59a37244a48899263bbc4bc92f5d 29-Jan-2015 Jean-Michel Trivi <jmtrivi@google.com> Fix FLAG_BEACON regression

Fix regression where FLAG_BEACON is not honored anymore in terms
of routing and muting behavior
When converting from AudioAttributes to stream types, also look
at FLAG_BEACON for mapping to STREAM_TTS

Bug 19185342

Change-Id: I5871c1b94480ae3da544aef99ea9ab4dff97443d
udiopolicy/AudioPolicyManager.cpp
1db89b9c2692fd70eb1cc98b7db2f9beed81e66e 28-Jan-2015 Eric Laurent <elaurent@google.com> Audio policy: fix device gain initialization

Fix initilization of default gain configuration for
audio devices loaded from audio_policy.conf.

Initialization cannot be done in constructor as the possible
gain configurations are not loaded yet.

Bug: 19120566.
Change-Id: I78f057ecfa1a121365ac3d8f317912a6f1647627
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
0c4e56d0baaa19fcf17234b38d634b7281e2ae37 10-Jan-2015 Yin-Chia Yeh <yinchiayeh@google.com> Camera: make sure jpeg buffer size isn't too small

Assuming the jpeg header can take up to 256KB, make sure we always
allocate enough size for the image data.

Bug: 18962703
Change-Id: I08eb3d198d12f71f3ab7266324e80fe7410bdc89
amera/libcameraservice/device3/Camera3Device.cpp
7ccc6b9baf2f568a0a8c6e27dcd4195645a6361d 20-Jan-2015 Eric Laurent <elaurent@google.com> Merge "fix audio patch leak." into lmp-mr1-dev
aa79befb301bc3451a19021b3fc9e9e6a1f231e8 15-Jan-2015 Eric Laurent <elaurent@google.com> fix audio patch leak.

Always wait for status when executing a create audio patch
command in audio policy service command thread.
The returned patch handle must be passed back to audio policy manager
so that the patch can be modified later.
Failing to do so causes a leak of patch descriptors in audio flinger.

Bug: 19032387.
Change-Id: I5462d1437fac244d9c5e38f2c7b8e1a4c01d2b75
udiopolicy/AudioPolicyService.cpp
21291a420e11ccdf23e955c3dc390304230ddce3 16-Jan-2015 Eric Laurent <elaurent@google.com> Merge "fix leak in audio policy effect config parser" into lmp-mr1-dev
182c2f5e48f46c11dbcb5eecb46268dff4ad4797 15-Jan-2015 Eric Laurent <elaurent@google.com> fix leak in audio policy effect config parser

Free temporary effect descriptors created in
loadAudioEffectConfig().

Bug 19021726.

Change-Id: Icd44216e25df3fe683a01763d7e8a7b84f367a1a
udiopolicy/AudioPolicyEffects.cpp
e6b8b27088f461957b4cbc51adbc8b01c41e9de2 13-Jan-2015 Hochi Huang <hochi.huang@mediatek.com> [FM]There is no sound output from BT earphone while BT earphone is connected

Bug: 18847131

Review: https://partner-android-review.git.corp.google.com/#/c/193318

Signed-off-by: Hochi Huang <hochi.huang@mediatek.com>

Change-Id: I79703ba4ceb67ca3b95fbc71444dd3b116ba4131
udiopolicy/AudioPolicyManager.h
cfa5bf04ff250a14b11a75bcfa35ee2d6dbab4e9 07-Jan-2015 Chong Zhang <chz@google.com> Merge "make libserviceutility a shared lib" into lmp-mr1-dev
5db7897ddd32e3ec3ab45ecdb6f21b6265e7e14a 07-Jan-2015 Chong Zhang <chz@google.com> make libserviceutility a shared lib

so that we have only one getpid_cached in mediaserver process

bug: 18919657

Change-Id: Iff3cd932c9110e874b3885f79705f49bf3e3f1fc
udioflinger/Android.mk
udiopolicy/Android.mk
oundtrigger/Android.mk
610255e8f2d02cb3513695eacf1c37d66b3553d6 07-Jan-2015 Eric Laurent <elaurent@google.com> Merge "audioflinger: pause HW A/V sync output when AudioTrack underruns" into lmp-mr1-dev
7ae3dfabb40d061aa613b255cba65ee35567f323 07-Jan-2015 Eric Laurent <elaurent@google.com> Merge "fix record from default input source" into lmp-mr1-dev
aee1c89f3d1868e77208bc64f9f1b2fc5c4a3514 07-Jan-2015 Eric Laurent <elaurent@google.com> Merge "DO NOT MERGE - fix memory leak in PatchPanel" into lmp-mr1-dev
c447ded04f11169e9b96b31cd196b2c4ffa9f31c 06-Jan-2015 Eric Laurent <elaurent@google.com> fix record from default input source

Commit caf7f48a0e broke capture from default
input source on some devices: the input source is now specified as part of
the audio attributes and the default source was not remapped to mic source.

Bug: 18736417.
Change-Id: I3f5da33cdb56f959aaef68ed1952342babc63aa0
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyManager.cpp
e443ffac2a09b69470c4663ee031a527c53738d9 05-Jan-2015 soon1.choi <soon1.choi@lge.com> DO NOT MERGE - fix memory leak in PatchPanel

Before the audio patch is created, audio patch with same handle is
removed from vector for patches. At this time, Patch allocated in the
heap is not freed. This causes memory leaks in the mediaserver.

Bug: 18904322.

Change-Id: Id0d28c36a7e7fbf473753bf4ead7518f28c1b998
udioflinger/PatchPanel.cpp
3190e67d5c80c1e39e3be91784110af1180cd182 30-Dec-2014 keunyoung <keunyoung@google.com> close remote submix's output when device is not available.

- change output close logic to find the device from IOProfile rather than
AudioPatch as AudioPatch handle can be cleared before disconnect.
- Otherwise, remote submix can be stuck as output is never closed and does not
work any more as subsequent open fails as output is already taken.

bug: 18733215

Change-Id: Iddb481c91e81070e6be18996a4c8837dabd7ebdb
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
0f7b5f2b231caf87da9b20b74d086e5a9d6f4a9d 19-Dec-2014 Eric Laurent <elaurent@google.com> audioflinger: pause HW A/V sync output when AudioTrack underruns

Do not standby, starve or feed 0s to the audio HAL on direct
output using HW A/V sync mode.

Bug: 17883772.

Change-Id: I11e6c97ec24360d75f9b602814d40a54b60cb7a7
udioflinger/Threads.cpp
udioflinger/Threads.h
a34c9ce292ea984e92d8f70d2c056e5372c4f452 19-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: fix isSourceActive() for hotword

Only condider AUDIO_SOURCE_HOTWORD equivalent to
AUDIO_SOURCE_VOICE_RECOGNITION if the active capture
was triggered by a hardware hotword recognition.

Also fix activeInputsCount().

Bug: 18802896.
Change-Id: I471aafcae29a76e9c323c6c0c314ef083991476b
udiopolicy/AudioPolicyManager.cpp
2cbe89a82d4167c5d5bcf3024edc22ab6874143a 19-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: improve accessibility routing

Force re-evaluating accessibility use case routing
when a condition affecting it (ringtone, alarm, call state)
is changing.

Bug: 18761698.
Change-Id: I42ac3a9fdc80bce11cf0a7fc76f680af4271abc9
udiopolicy/AudioPolicyManager.cpp
145cf5d885c238b690ab8240137934327b85c427 17-Dec-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: implement pause/resume for direct outputs" into lmp-mr1-dev
71b52b5bb3be81bffa320241ca486fbf964d743e 17-Dec-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix routing not happening after change in output device list" into lmp-mr1-dev
277c7b8c41436125742339d8c80bccf0f2b086d9 17-Dec-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "Fix permission check for audio recording" into lmp-mr1-dev
045e710f8ce7ce1679b9b5f0adbd3290c4cc6f54 10-Dec-2014 Hochi Huang <hochi.huang@mediatek.com> [FM] Fix notification routing when FM enable

https://partner-android-review.git.corp.google.com/#/c/188454/

Bug: 18727227

Change-Id: I74856ede5999cfc8a6932a99855d468cccd6f51c
Signed-off-by: Hochi Huang <hochi.huang@mediatek.com>
udiopolicy/AudioPolicyManager.h
fe472e292ab50c121ff93dffa3b54c96feedcfef 16-Dec-2014 Jean-Michel Trivi <jmtrivi@google.com> Fix routing not happening after change in output device list

If an output stream is active while rerouting rules are installed
and recording starts, the list of outputs is not updated and
therefore the stream is not rerouted to the new virtual device.
The fix consists in also taking into account all the policy-related
outputs when evaluating the before and after list of outputs
following a connection state event.

Bug 18736417

Change-Id: I6697976b3f89e2c0995e888e9046a2273361bb97
udiopolicy/AudioPolicyManager.cpp
be845fce36a65139eb353ba7442eba951b1ebee3 16-Dec-2014 Eric Laurent <elaurent@google.com> Merge "audiopolicy : Fix for incorrect input device selection" into lmp-mr1-dev
dc136ffee31f21da3b31240f8a22d4d08a658d0d 16-Dec-2014 Eric Laurent <elaurent@google.com> audiopolicy : Fix for incorrect input device selection

Some VoIP applications do not use source as VOICE_COMM
but MIC and policy manager ignores the force usage in that
case and selects handset-mic as input device even when
BT-SCO headset is connected.
Check the force usage for the AUDIO_SOURCE_MIC as well.

Bug: 18606571

Change-Id: I5d5010ab396f85bf58573943c91fd815f39f57c1
udiopolicy/AudioPolicyManager.cpp
cd71a69d922eab2929faf8f5652fcd1b9a29cbe8 16-Dec-2014 Eric Laurent <elaurent@google.com> audio: Force audio to Speaker if requested during VOIP call

getDeviceForStrategy is returning AUDIO_DEVICE_OUT_USB even
when setForceUse is called with Speaker during VOIP call.
Actual Intention is to route audio for phone strategy to USB
device even after setForceUse is called with Speaker when not
in voice call. It is supposed to exclude VOIP call too

Added additional check for MODE_IN_COMMUNICATION so that
it returns SPEAKER when setForceUse is called with speaker

Bug: 18758599

Change-Id: I1c51128cc1c7bfce1cf6f1fde60b428d3a9379fc
udiopolicy/AudioPolicyManager.cpp
97bb33f58d742539f3382583d7978fca71ffa2d5 13-Dec-2014 Jean-Michel Trivi <jmtrivi@google.com> Fix permission check for audio recording

Define input types covering the different usecases for audio
recording, and check the corresponding permissions when
starting to record.
Move the permission check from audio flinger to audio policy,
as only the policy has the information to determine which
permission to enforce.
Fix missing permission when an application records audio
and the audio is injected by an external policy.

Bug 18736417

Change-Id: If7ec040502242c990ac8ea464db484339bdce573
udioflinger/AudioFlinger.cpp
udiopolicy/AudioPolicyClientImplLegacy.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
d1f69b0b17acbd96987ecb2f3378abd394d05903 15-Dec-2014 Eric Laurent <elaurent@google.com> audioflinger: implement pause/resume for direct outputs

Extend pause/resume support to direct output threads
(was only for offload threads).

If the HAL implements pause/resume, track pause/resume is forwarded to
the HAL.

Pause, flush, resume sequence is respected by executing the HAL
calls in the playback thread (same as offload).

Make sure the track flags on client side are consistent with the
flags on server side.

Bug: 17883772.
Change-Id: I89b360d69818f7a9204bd36e3ec63a79e106ecf1
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
2cec0dfa9f97b87733b8b250b49729fc6bb3a60a 20-Aug-2014 Ruchit Sharma <ruchits@nvidia.com> Camera2Client: flush requests in stopPreviewL

Requests queued in the pipeline have little meaning after the app
calls stopPreview(). Flushing will help improve the switch KPI.

bug 17340914

Change-Id: I899d69aa3b0fd41f028760290a81013297712fed
amera/libcameraservice/api1/Camera2Client.cpp
c73ca6ef04136f28306784ad35f444538f081957 12-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: fix remote mic capture

commit 275e8e9de introduced a regression for platforms
overriding AudioPolicyManager::getDeviceForInputSource() method.

Fixed by defining specific non virtual methods when overiding would
break remote submix implementation.

Bug: 18736417.

Change-Id: Id4d0a6c48da987e6fb24422f2d61c7ab0fbfc921
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
8cffa91a76d3fa4c96268fc40fc8722a0d33dc8d 11-Dec-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: suppport for dynamic source" into lmp-mr1-dev
c722f30eef03e77054395ae122470cf8dba93937 10-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: suppport for dynamic source

Completed support for dynamic sources:
- remote submix input device is dynamically connected/disconnected
when corresponding AudioTrack starts/stops.

Also do not create a duplicated output for mixes used by dynamic policies.

Bug: 16006090.
Change-Id: Ib5b5a2159fcac9d9f410a5a2f1c64d7ebad79f72
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
94a92c69af528edf6ec17d7978a0c3bb6ab51e63 11-Dec-2014 Phil Burk <philburk@google.com> Merge "[audio][audioflinger] Consume all frames when a DirectThread is done." into lmp-mr1-dev
99adee3c3d9cde6819741a38163954808fea270a 11-Dec-2014 Phil Burk <philburk@google.com> [audio][audioflinger] Consume all frames when a DirectThread is done.

This bug was causing movies to think there was still data left to play so they never finished.

Bug: 18360054
Change-Id: If7aee81d62b7af8532abd14579677848a06fe2b1
Signed-off-by: Phil Burk <philburk@google.com>
udioflinger/Threads.cpp
1767df778e20c1395afc63b3a0479bd903e7b9f0 10-Dec-2014 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicyManager: distinguish between mirroring and rerouting

In the screen mirroring case, the notification manager queries
the policy to see if media "is playing remotely": if yes, it
will not request audio focus before playing a notification.
This is the correct behavior for screen mirroring, but doesn't
work when audio is rerouted to an external policy.
This change consists in not reporting "remote" activity when
playing to a mix of an external policy by looking at the address
of the output on which playback is active for the given stream
type.

Bug 16009464

Change-Id: Iebbf5a8c738ab36c1cf2055e921c0a3472503125
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
1487d270e86845e93a9abd1af020b45d6799b257 10-Dec-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: binder calls for dynamic audio policy mixes" into lmp-mr1-dev
2dda40d638138c426cf4a66ddd0da8794c87f5c7 10-Dec-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: add support for custom mixes" into lmp-mr1-dev
baac183f3808d7b68f184647a97bd381620415fe 02-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: binder calls for dynamic audio policy mixes

Add binder calls to register and unregister dynamic mixes
to AudioPolicyManager.

Bug: 16009464.

Change-Id: I4ef38166d0cfc88c984970969380d0cd6eb083ac
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.h
275e8e9de2e11b4b344f5a201f1f0e51fda02d9c 01-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: add support for custom mixes

Add support for custom mixes in AudioPolicyManager.

Two methods are added to register or unregister a list of custom mixes
with their attributes and format.

getOutputForAttr() and getInputForAttr() first look for a match in
registered mixes before defaulting to normal output/input selection

Remote submix device connection disconnection now takes address into
account to identify the correspnoding custom mix.

Bug: 16009464.

Change-Id: I3f1c2a485a0fb71b1f984ed0adc9b68aa971e408
udioflinger/Threads.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
9cea7aa494f6f93a473cab936af79868fc8efea6 10-Dec-2014 Chien-Yu Chen <cychen@google.com> Merge "Camera3Device: support shutter after result" into lmp-mr1-dev
6533dc1c576af241c9c1753f29d6777802d4c496 10-Dec-2014 Ruben Brunk <rubenbrunk@google.com> Merge "Camera2: Round unsupported surface sizes in configure." into lmp-mr1-dev
43e69a6792f01b86b4aaf2314534f637e11c5843 26-Nov-2014 Chien-Yu Chen <cychen@google.com> Camera3Device: support shutter after result

Move the code to remove in-flight requests from processCaptureResult
to a separate function so it can be called when the framework
receives a result or a shutter event. An in-flight request will only
be removed when both results and the shutter event arrive in the
case of a successful request.

Also send out results only after the shutter event receives.

Bug: 18135776
Change-Id: I340db1a495c711b0913784d43fd0f144871e4420
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
18265202049bfa53fe5b18a95d956325acca9c7b 06-Dec-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix inifinite loop in clearAudioPatches()" into lmp-mr1-dev
0add0fd07401c507a77b37868f46a2ae587c30df 05-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: fix inifinite loop in clearAudioPatches()

releaseAudioPatch() does not necessarily remove the audio patch
from the list.
Scan the list from the top down to avoid adjusting the index.

Bug: 18621514.
Change-Id: I58787154680f7cb1818509017835b1693d62190f
udiopolicy/AudioPolicyManager.cpp
bba75576c3bc5a90cd8e14bd053ab2d74a6c7e9d 21-Nov-2014 Ruben Brunk <rubenbrunk@google.com> Camera2: Round unsupported surface sizes in configure.

Bug: 16030677
Change-Id: Ida04e04f41983b9126609522dd12064a7bf9645f
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api2/CameraDeviceClient.h
cbbe1ccc41a86fbf009767bbdab43232e6c369c0 06-Dec-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix AudioPort parameter checks" into lmp-mr1-dev
597ce69a77636eab073fc83ded01e8af51e887e2 05-Dec-2014 Eino-Ville Talvala <etalvala@google.com> Merge "Camera: Add support for SCENE_MODE_HDR for newer HALs" into lmp-mr1-dev
af2645a679a61c8e8199d43d29b8b5ead5723b25 05-Dec-2014 Eino-Ville Talvala <etalvala@google.com> Camera: Add support for SCENE_MODE_HDR for newer HALs

Bug: 18640480
Change-Id: I7b772d10b2bd136c78395fd2816114b27bb48d00
amera/libcameraservice/api1/client2/Parameters.cpp
9257000c453c1a6f6bf073ff0bf3ba7ef9baf183 04-Nov-2014 Ruchit Sharma <ruchits@nvidia.com> camera: fix logging in ZslProcessor to avoid spam

AF state mismatch while selecting ZSL candidate should not be treated
as a warning. This results into undesriable spam in the logs.

ALso, using ALOGVV is consistent with how AE state mismatch is handled
in ZslProcessor3.cpp

Bug: 18634318
Change-Id: Ia9d7f2bb98f784990b1a6f923983c35f622c3791
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
0daea39f02fb1ba60a7b351bb5859e407f9f090b 05-Dec-2014 Eric Laurent <elaurent@google.com> audio policy: fix AudioPort parameter checks

Accept any value for sampling rate, format or channel mask
if the list of supported values is empty in the AudioPort.

Bug: 18575607.
Change-Id: I93e1942b89c630e3fee490799a8f8d79f7831ab7
udiopolicy/AudioPolicyManager.cpp
db995fe3239276be9dfd9e446b10417e07948acc 05-Dec-2014 Andy Hung <hunga@google.com> Merge "Fix getTimestamp if offload thread is not initialized." into lmp-mr1-dev
18f2f90cff65c384a4e8292cc3296dafafb43d52 03-Dec-2014 Hochi Huang <hochi.huang@mediatek.com> [FM] Fix Buganizer ID: 18456930 - FM radio audio got routed to loudspeaker unexpectedly

https://partner-android-review.git.corp.google.com/#/c/187894/

Change-Id: I3f9175bbc302e382155e568e66b88400ec05ffa5
Signed-off-by: Hochi Huang <hochi.huang@mediatek.com>
udiopolicy/AudioPolicyManager.h
9a1c8892f6835325db6931529dc74bf98cf0aee8 03-Dec-2014 Andy Hung <hunga@google.com> Fix getTimestamp if offload thread is not initialized.

Returns INVALID_OPERATION.

Bug: 18605649
Change-Id: I440fb687fbf9249098e049982fa83bcd1515fd80
udioflinger/Threads.cpp
caf7f48a0ef558689d39aafd187c1571ff4128b4 26-Nov-2014 Eric Laurent <elaurent@google.com> AudioRecord: use audio attributes instead of audio source.

Added AudioRecord constructor with audio attributes.
Replaced AudioPolicymanager::getInput() by getInputForAttr().

No new functionality for now.

Also:

- Fixed warnings in AudioPolicyManager
- Allocate audio session ID before calling getOutputForAttr() in
AudioTrack.

Bug: 16006090.
Change-Id: I15df21e4411db688e3096dd801cf579d76d81711
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.h
087eb332cdd64026de27c914194127f8fda1a846 26-Nov-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: do not route accessibility prompts to compressed output" into lmp-mr1-dev
72bf901ca905ce154fe7866f06d25a01aadcf974 26-Nov-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: new getOutputForAttr() prototype." into lmp-mr1-dev
512dd849d0ef9e9988fedfbaf951b4b82523957c 25-Nov-2014 Zhijun He <zhijunhe@google.com> Merge "camera: fix frame deletion logic in mInFlightMap" into lmp-mr1-dev
066ceecf4c6ed5ce26c5ddf00d7d9097d560b7a2 25-Nov-2014 Eric Laurent <elaurent@google.com> audio policy: do not route accessibility prompts to compressed output

When a digital output (HDMI or S/PDIF) is configured with
a non linear PCM audio format it is likely that the audio HAL
or HW will not be able to mix other sounds with the main
media stream being played.

In this case, do not condider HDMI or S/PDIF as a valid route for
accessibilty strategy so that accessibility prompts are always audible.

Bug: 18067208.
Change-Id: If20603a1dc1dc470f206f841308bed2b87daf21c
udiopolicy/AudioPolicyManager.cpp
e83b55dc29ca16092ba02f36f55fa6e0e37fd78c 14-Nov-2014 Eric Laurent <elaurent@google.com> audio policy: new getOutputForAttr() prototype.

Update getOutputForAttr() prototype and group all logic
dealing with audio attributes to stream type conversion in
audio policy manager.

getOutputForAttr():
- specifies the audio session (for future use)
- returns a status code
- receives either stream type (for legacy) or audio attributes
- returns an updated streamtype

Remove logic dealing with legacy stream types to attributes conversion
from AudioTrack.

Use correct type for audio sessions in other APIs (startOutput() ...).

releaseOutput() specifies the audio session (for future use).

Bug: 18067208.

Change-Id: I1bfbe9626c04c7955d77f8a70aecfad2cb204817
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
0f78eabb733e1413d7febd00c0bad0f0add02314 25-Nov-2014 Eric Laurent <elaurent@google.com> fix the build.

Change-Id: Iab6b65327ae1adbf0b3a6da5a23b8107468f533e
udiopolicy/AudioPolicyManager.cpp
31867b30d3144decd42de0214d8b71c45a2c8cc1 14-Nov-2014 Ruchit Sharma <ruchits@nvidia.com> camera: fix frame deletion logic in mInFlightMap

For per-frame error notifications, camera3.h requirements state that all the
buffer handles for a failed frame capture must be returned via
process_capture_result() call(s). Hence, Camera3Device needs to ensure that
the frame entry is not deleted from mInFlightMap until all buffers for that
frame have been returned by HAL.

Bug: 17757940

Change-Id: I2579ca7980d2fd67d53abc530e2706538f7d3d3a
amera/libcameraservice/device3/Camera3Device.cpp
223fd5c9738e9665e495904d37d4632414b68c1e 11-Nov-2014 Eric Laurent <elaurent@google.com> audio: new routing strategies and stream types

Added new routing strategies and stream type for internal use
by audio policy manager and audio flinger:
- One for accessibility to allow different routing than media
- One for re-routing (remote submix) in preparation of dynamic
policies
- Added stream type for "internal" audio flinger tracks used
for audio patches and duplication.

Bug: 18067208.
Change-Id: I88f884b552e51e4a49c29125e5a1204cf58ff434
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
udiopolicy/AudioPolicyEffects.cpp
udiopolicy/AudioPolicyEffects.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
bc0f452b9a76dd8c8244e775bc9c5aa85cae3ddf 21-Nov-2014 Ruben Brunk <rubenbrunk@google.com> Merge "Camera2: Fix CameraParameters parse segfault." into lmp-mr1-dev
8052d933822e51dec3b096cb5fc8a9fbdc076bdc 21-Nov-2014 Eric Laurent <elaurent@google.com> Merge "SoundTrigger: allow sound model reloading" into lmp-mr1-dev
02eb47cf18793effe9fc7ab34e1b0fe9ea6635bc 20-Nov-2014 Eric Laurent <elaurent@google.com> SoundTrigger: allow sound model reloading

Allow reloading a sound model without unloading it before.

Bug: 18308781.
Change-Id: I31c83b81a03ee1c1e80f4339ca62e6d06fb1a33b
oundtrigger/SoundTriggerHwService.cpp
oundtrigger/SoundTriggerHwService.h
5fc9d902510ccd04db80e0bc6aa679a4317a51b2 20-Nov-2014 Ruben Brunk <rubenbrunk@google.com> Camera2: Fix CameraParameters parse segfault.

Bug: 18331142
Change-Id: I41feec93f753f97b3e6bf963deb4a42b73406421
amera/libcameraservice/CameraService.cpp
ec0eeafa8a7fd882e8206e9cf8c4c7e1db81857b 20-Nov-2014 Haynes Mathew George <hgeorge@codeaurora.org> Fix format conversion in DuplicatingThread

DuplicatingThread converts PCM data from the format of the source thread
to PCM_16BIT before writing to all connected output tracks.
This needs to be done just once before writing to all tracks.

Bug: 18461844
Change-Id: If05254f87f9198e09a0fa3c4e857afbb53ae7073
udioflinger/Threads.cpp
0ebd5f95b68a3a5c9e5509f21938c9e51e74d71b 20-Nov-2014 Eric Laurent <elaurent@google.com> AudioSystem: fix cross deadlock

Do not hold gLockAPS when calling
AudioPolicyService::registerClient() in get_audio_policy_service().
registerClient() will need to acquire the AudioPolicyService mutex and
if at the same time a method called from AudioPolicyService
(with mutex held) calls back into AudioSystem and get_audio_policy_service()
a cross deadlock occurs.

Same preventive fix for get_audio_flinger().

Use a separate mutex for notification client list in AudioPolicyService.
This prevents deadlocking if registerClient() is called as a consequence of
AudioFlinger calling back into AudioPolicyManager while executing a method
with AudioPolicyService locked

Bug: 18403952.
Bug: 18450065.
Change-Id: Ia832e41aede8bc6c843fc615508fbdd74e0863b5
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
03181012beab17e145ca8b9bedbcc08d117df1cb 19-Nov-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera2Client: remove recording stream if necessary" into lmp-mr1-dev
092d49c26d77fafad5170bf709c2a716ec335855 07-Nov-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2Client: remove recording stream if necessary

Bug: 17495165
Change-Id: I11b763fde8f9448f4bddec3fe6c81581e7699edb
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
8cd37d677f10a7718c9247830652a588ea4600de 18-Nov-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: do not prevent routing to A2DP when suspended." into lmp-mr1-dev
29e6cecdd8562700ab625c5645ddd6a7753789f1 14-Nov-2014 Eric Laurent <elaurent@google.com> audio policy: do not prevent routing to A2DP when suspended.

Allow A2DP sink selection even if A2DP is suspended.
It is not because use of A2DP is temporarily disabled by SCO
selection that the policy rule routing a given use case
to A2DP should be altered. The source will be routed to A2DP
but it will remain silent until suspend condition is cleared
which is the purpose of suspend mode.

Also make sure that accessibility prompts are audible while in call
by forcing stream type to STREAM_VOICE_CALL.
Fix inconsistent logic between AudioTrack::setStreamTypeFromAttributes()
and AudioPolicyManager::getStrategyForAttr()

Bug: 18095151.
Change-Id: I1c75dd8288ed3dd494eb942060eac9c9660dca50
udiopolicy/AudioPolicyManager.cpp
4d0a5985fb5e7ea5a1f9a605afea2b7534ebc16b 18-Nov-2014 Andy Hung <hunga@google.com> Merge "Prevent stopped audio tracks from mixing data" into lmp-mr1-dev
27876c02c21cd3ab7ef01bdd1fc5400c5143584a 10-Sep-2014 Andy Hung <hunga@google.com> Prevent stopped audio tracks from mixing data

Static tracks should have zero framesReady when stopping or stopped,
to prevent mixer from running potentially indefinitely with loop mode.

Bug: 16070883

Change-Id: Iab9968044d1a6f8543bbcbfb246f49f27d68cace
udioflinger/Tracks.cpp
f89f2ff4df0855eb56d95a02ab29d856e0ffa858 17-Nov-2014 Eric Laurent <elaurent@google.com> Merge "audiopolicy: Update input device check in checkInputsForDevice" into lmp-mr1-dev
3171f4e12e5cabb2b496be6aa660aaa83e8fe77d 17-Nov-2014 Chien-Yu Chen <cychen@google.com> Merge "CameraService: normalize face rectangles properly" into lmp-mr1-dev
ddbc6657fa0c55166148ca597980edbaafc418bf 14-Nov-2014 Eric Laurent <elaurent@google.com> audiopolicy: Update input device check in checkInputsForDevice

- When an input device is disconnected, checkInputsForDevice clears
dynamic fields of input profiles that are supporting the disconnected
device. AUDIO_DEVICE_BIT_IN mask is missing while comparing with the
supported input devices of a profile which is resulting in clearing
wrong fields

- Fix is to include AUDIO_DEVICE_BIT_IN in this comparison

- also fix two other places where comparison with input device was not
masked with AUDIO_DEVICE_BIT_IN.

Bug: 18367045

Change-Id: Icc94b8353bc49567d8a6d6a75293c3b0dd42d83c
udiopolicy/AudioPolicyManager.cpp
5e15b80e801a0110bc1bad1190f02cb9c7d22e37 13-Nov-2014 Chien-Yu Chen <cychen@google.com> CameraService: normalize face rectangles properly

Use android.scaler.cropRegion reported in the capture result to
normalize face rectangles instead of using the one in current capture
request.

Bug: 11460393
Change-Id: Id21834bf6ae1f7cc106b4dffb98f9f249a75034b
amera/libcameraservice/api1/client2/FrameProcessor.cpp
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
7c77c75d43ac2a40f2b5ce98085ef68f8ba3b4f2 12-Nov-2014 Chien-Yu Chen <cychen@google.com> Merge "Camera2Device: fix camera metadata leaks" into lmp-mr1-dev
80de5dca0b8e04f81da0d15dff957f82551eaafc 08-Nov-2014 Chien-Yu Chen <cychen@google.com> Camera2Device: fix camera metadata leaks

bug 11132653

Change-Id: I5445b020c3aeaac9a556c023568adac635834356
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
02b5708776ba2a9b4ff8c09008483aef7dbe38c7 08-Nov-2014 Eric Laurent <elaurent@google.com> audioflinger: fix duplicating thread output buffers clear

Also clear mix buffer in DuplicatingThread::threadLoop_mix()
instead of just sink buffer when output threads are not
ready.

Bug: 18262127.
Change-Id: I4c22bbeaccdcc8d7c10c5882dde3439eb73d6ede
udioflinger/Threads.cpp
1609e451cf6101efe6aeaaa2da61db2cb095c9e8 07-Nov-2014 Dan Stoza <stoza@google.com> Merge "Add a BufferItem parameter to onFrameAvailable" into lmp-mr1-dev
04f101c35eaa90b1f95939afac30674ec1611e6f 04-Nov-2014 Dan Stoza <stoza@google.com> Add a BufferItem parameter to onFrameAvailable

Passes the BufferItem for the queued buffer to the onFrameAvailable
callback so the consumer can track the BufferQueue's contents.

Bug: 18111837
Change-Id: If9d07229c9b586c668e5f99074e9b63b0468feb0
amera/libcameraservice/api1/client2/BurstCapture.cpp
amera/libcameraservice/api1/client2/BurstCapture.h
amera/libcameraservice/api1/client2/CallbackProcessor.cpp
amera/libcameraservice/api1/client2/CallbackProcessor.h
amera/libcameraservice/api1/client2/JpegProcessor.cpp
amera/libcameraservice/api1/client2/JpegProcessor.h
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.h
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.h
amera/libcameraservice/gui/RingBufferConsumer.cpp
amera/libcameraservice/gui/RingBufferConsumer.h
ed1e55c5276a1c031e9b2f016387c7d2fe7bc47f 04-Nov-2014 Eric Laurent <elaurent@google.com> Merge "remove some restrictions on effect output channels" into lmp-mr1-dev
b10352f4bc11ae6f3d93e464074709555ecf9e06 04-Nov-2014 Eric Laurent <elaurent@google.com> remove some restrictions on effect output channels

Do not prevent from attaching effects to a non stereo
output thread, unless the output thread is a mixer thread.

Bug: 18157592.
Change-Id: I6ac3187187a1b8aade7db04ea6dfbc47dacc25c3
udioflinger/AudioFlinger.cpp
3736dbc5c4ef7c0e0cf81ff3fc73579527cad50a 03-Nov-2014 Chien-Yu Chen <cychen@google.com> Merge "CameraService: API1: fix picture FOV" into lmp-mr1-dev
d9cfeb447356cb6334379eaf5da1e49424eb5979 23-Sep-2014 Jean-Michel Trivi <jmtrivi@google.com> Support speaker routing for FLAG_BEACON

Add support for routing audio stream to the speaker when audio
attributes carry the FLAG_BEACON value:
- associate streams with FLAG_BEACON to the up-to-now unused
STREAM_TTS ("Transmitted Through Speaker").
The remapping happens in AudioTrack.
- AudioPolicyManager: define new strategy for handling the Beacon
behavior, that only goes to speaker. Define new volume curves
for STREAM_TTS that are not silence only for the speaker device
category. Keep ref count of other streams and never play Beacon
streams when anything else is playing: either don't start playback
if something else is playing, or unmute STREAM_TTS when it's
allowed to play and mute when it's done.
- Take into account muting latency when starting an output.

Bug 15415971

Change-Id: I26539c7ec1a486accd85bbeb1623e9c7d3a1192f
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
b1322c78b035c9f47ebe57a39799d7a0e13bf57f 30-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: fix commit dea1541f

Fix return types in early returns added by
commit dea1541f in AudioPolicy binder call methods.

Also fix former similar mistakes found nearby.

Bug: 18001784.
Bug: 18002005.

Change-Id: I088c6029ca04e2c2c2f78e560c9cb6b9576dd88f
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
8e05b5f5f45b8d6931ff830969125a42428c6830 30-Oct-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: validate stream type received from binder calls." into lmp-mr1-dev
dea1541fc0042abf05674b19c2f94ca086945dfd 28-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: validate stream type received from binder calls.

Bug: 18001784.
Bug: 18002005.
Change-Id: I8efa674dceff5a6e10251b1c7a55e9bb2d532395
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
6e8212b2a02685e50d0c093a6f44d9af636261d9 28-Oct-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "Always use an address for remote submix" into lmp-mr1-dev
1bbc1c93b5db545e503dc27c262eef38685d0726 24-Oct-2014 Chien-Yu Chen <cychen@google.com> CameraService: API1: fix picture FOV

Fix the wrong assumption that active array size equals to pixel array
size.

bug 17918247

Change-Id: Ic308f281fb677332a74e95abb473c5b13063eeca
amera/libcameraservice/api1/client2/Parameters.cpp
b80a2a8871d3af8619bf774a0c9ddbac8d598bf9 28-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: fix output device command after clearing audio patch

Make sure that a valid audio patch is created again on an output stream
following the disconneciton and reconnection of the same output device.

Bug: 18144611.
Change-Id: I72387ad8e93f8fb2571da2a6c58a6e167ac7fc4d
udiopolicy/AudioPolicyManager.cpp
fd4c14883b268a0bc5514da135fe6b7d1ce2071b 07-Aug-2014 Jean-Michel Trivi <jmtrivi@google.com> Always use an address for remote submix

Usage of remote submix device for audio rerouting (e.g. wifi display)
didn't mandate the use of addresses. Use "0" as the default address
when none is specificed.
In logs, only use hex format for audio devices

Bug 16009464

Change-Id: Ibfb1ce6881eba8b7e34420293b8a7077a6e659e6
udioflinger/AudioFlinger.cpp
udiopolicy/AudioPolicyManager.cpp
31551f8dd625b8d40961e141d2913b0073f852ab 11-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: fix multiple device volume

Whem multiple devices are selected by a strategy,
apply volume to all these devices when one of them is changed by
setStreamVolumeIndex() API.

Also only consider devices supported by current output profile
in checkDeviceMuteStrategies() to avoid muting a stream because of
devices connected to another output stream.

Bug: 17507571.

Change-Id: I83ef9fb7f294214d30f7f890db44c64ece3be387
udiopolicy/AudioPolicyManager.cpp
ee94675469f67c3fe25428b87fc9a2d468f908c6 24-Oct-2014 Eino-Ville Talvala <etalvala@google.com> am 4d8ae211: am 661c21da: CameraService: Disconnect: Release mutex while waiting for joins.

* commit '4d8ae211ae2e2a5ae464931ce41ec5b1d6e6d51f':
CameraService: Disconnect: Release mutex while waiting for joins.
4d8ae211ae2e2a5ae464931ce41ec5b1d6e6d51f 23-Oct-2014 Eino-Ville Talvala <etalvala@google.com> am 661c21da: CameraService: Disconnect: Release mutex while waiting for joins.

* commit '661c21da5592ca48256747ec220efb2e599eeb72':
CameraService: Disconnect: Release mutex while waiting for joins.
661c21da5592ca48256747ec220efb2e599eeb72 22-Oct-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Disconnect: Release mutex while waiting for joins.

The threads shutting down may have callpaths that require taking the
binder interface mutex, so waiting to join them with that mutex held
can lead to deadlocks.

A specific instance is StreamingProcessor calling dataCallbackTimestamp,
which can immediately lead to a Camera2Client::releaseRecordingFrame call,
which requires the binder interface mutex. If this call happens right when
shutdown is occurring, and Camera2Client::disconnect is holding the mutex,
deadlock ensues.

Bug: 17997578
Change-Id: I71253cd5542b5920ad205976d315110ca0043d94
amera/libcameraservice/api1/Camera2Client.cpp
9d0d5958969cffae5d4305025bc20d05f32e6ff2 22-Oct-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: new HW A/V sync ID allocation flow" into lmp-mr1-dev
fa90e84ed0cb2abdc0e0873a06d10ccf2b3c34f6 18-Oct-2014 Eric Laurent <elaurent@google.com> audioflinger: new HW A/V sync ID allocation flow

The HW A/V sync ID is now allocated by the audio HAL before the
output stream is created by a call to global get_parameters() with
key AUDIO_PARAMETER_HW_AV_SYNC.

When the AudioTrack is created, the HW A/V sync ID is communicated
to the output stream by stream set_parameters() with key
AUDIO_PARAMETER_STREAM_HW_AV_SYNC.

Bug: 17112525.
Change-Id: Ia8bc6f3bf9f358aa89f3f56ac554e893a19811ad
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
964b73121a634921f000ef3f877a7546f65bb700 21-Oct-2014 Eric Laurent <elaurent@google.com> am 7de5ac1f: audio policy: fix effect handle leak

* commit '7de5ac1f067ec61f7ea424d5534cfd40987b11fa':
audio policy: fix effect handle leak
7de5ac1f067ec61f7ea424d5534cfd40987b11fa 21-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: fix effect handle leak

Fix ref counting error in AudioPolicyEffect::addInputEffects()
and addOutputSessionEffects()

Bug: 17675112.
Change-Id: I5267d1024a585919f66ead83662e57b78ba53540
udiopolicy/AudioPolicyEffects.cpp
36d9256f956b2ed4d7a221d84ad05bf4ba482958 20-Oct-2014 Marco Nelissen <marcone@google.com> am ac302143: Fix the fix

* commit 'ac302143551a8b964f026385a524dda9ff8ea5ba':
Fix the fix
ac302143551a8b964f026385a524dda9ff8ea5ba 20-Oct-2014 Marco Nelissen <marcone@google.com> Fix the fix

We need to clear the buffer a little more often.

Bug: 18023017
Change-Id: If8a522b9133a4269e2435af8958f6ced322e71e9
udioflinger/Threads.cpp
145a4c679a9ab27aceaa1d386ea9aca1c0cd4d33 20-Oct-2014 Marco Nelissen <marcone@google.com> am 22bc10a3: Merge "Clear effect buffer before sending to chain" into lmp-dev

* commit '22bc10a347569a0ab2980c24783e31aba4d7414d':
Clear effect buffer before sending to chain
22bc10a347569a0ab2980c24783e31aba4d7414d 20-Oct-2014 Marco Nelissen <marcone@google.com> Merge "Clear effect buffer before sending to chain" into lmp-dev
57088b5c8e76855b99b3e6b3e410de5b6382670e 18-Oct-2014 Marco Nelissen <marcone@google.com> Clear effect buffer before sending to chain

otherwise the effect might get a buffer with previous data instead
of silence.

Bug: 18023017
Change-Id: Ic6be5ce0e74552aac2a0cce9c660893f9ad27f5c
udioflinger/Threads.cpp
f4c58707b511af4c9f55c25781304172964107cb 16-Oct-2014 Haynes Mathew George <hgeorge@codeaurora.org> am a2d4a6da: audio policy: Fix for voice call audio loss

* commit 'a2d4a6dac432f0c4f543d79b9a63c55ae91f81d6':
audio policy: Fix for voice call audio loss
a2d4a6dac432f0c4f543d79b9a63c55ae91f81d6 13-Oct-2014 Haynes Mathew George <hgeorge@codeaurora.org> audio policy: Fix for voice call audio loss

Audio Policy service filters out one of the create patch
commands when it finds two pending commands with the same
patch handles. Due to this routing command is not received
to audio HAL and the voice call set up fails.
Fix this by filtering create patch commands only when
they are issued on the same output.

authored-by: Karthik Reddy Katta <a_katta@codeaurora.org>

Bug: 17787282
Change-Id: If36f0ab71e9b72d6a8eb61d31f762bc5e1683b89
udiopolicy/AudioPolicyService.cpp
62c456f02d3f1071d18644fb3a1de354d6e4ee7f 15-Oct-2014 Zhijun He <zhijunhe@google.com> am 9d2189ff: Merge "Camera2Client: avoid two consecutive sets of configure_streams calls" into lmp-dev

* commit '9d2189ffcf1142b2948ce3065c32521ed7d966c4':
Camera2Client: avoid two consecutive sets of configure_streams calls
96ff5c48a81f3f45c384113480bf5e28620a72ae 14-Oct-2014 Zhijun He <zhijunhe@google.com> Camera2Client: avoid two consecutive sets of configure_streams calls

When mediaRecorder starts without an active preview stream, Camera2Client
starts preview then immediately start recording, which could cause the second
configure_streams to call into HAL before any preview request is sent. This
could cause HAL to run into bad state. This change work around this issue
by making sure the first preview request is submitted to the HAL before
start recording.

Bug: 17915062
Change-Id: I94ae64ee76487603695a469240da601ddcb29a66
amera/libcameraservice/api1/Camera2Client.cpp
f53eaf49df1e1e1c01708919e9e0a046543de9b6 09-Oct-2014 Hochi Huang <hochi.huang@mediatek.com> fix FM no sound issue

Review: https://partner-android-review.git.corp.google.com/#/c/184276

Signed-off-by: Carson Liao <carson.liao@mediatek.com>

Change-Id: I0847c8a6e6d054a9258b52402c914105d902c573
udioflinger/ServiceUtilities.cpp
udioflinger/ServiceUtilities.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
fa845267f7cb5aede69ff1f62db99e8478db170d 12-Oct-2014 Dave Burke <daveburke@google.com> am 9286354c: Merge "Revert "audio policy: add support for ro.audio.media_deep_buffer"" into lmp-dev

* commit '9286354c0a864ce2348cc7dfc6ca81e84a15f8e2':
Revert "audio policy: add support for ro.audio.media_deep_buffer"
f2ab2191387ce7902c730cc68314ea5fdc4a9237 11-Oct-2014 Vineeta Srivastava <vsrivastava@google.com> Revert "audio policy: add support for ro.audio.media_deep_buffer"

This reverts commit 95511add8ad4d440c67272503559f5042c4e6f1f.

Change-Id: I76a8b86790b06b08d8ca0f8d374e585f964ffba8
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
6337f6032e7bdbf0b4654fb07512a00bd33ef696 11-Oct-2014 Eric Laurent <elaurent@google.com> am ffd5cdbd: Merge "audio policy: add support for ro.audio.media_deep_buffer" into lmp-dev

* commit 'ffd5cdbd3e3faa203539e26adc755f860c8cac80':
audio policy: add support for ro.audio.media_deep_buffer
95511add8ad4d440c67272503559f5042c4e6f1f 11-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: add support for ro.audio.media_deep_buffer

Bug: 17931716.
Change-Id: Ife170f20f5d02b71059fbd384bd29759fafee826
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
733ee8aaf2a91ac98cc7cfae5b98164d3aefab2a 10-Oct-2014 Eric Laurent <elaurent@google.com> am f5ada6ed: audio policy: move intializations to onFirstRef()

* commit 'f5ada6edcc83bb1b313abcd4c4fbdc4f7724f04d':
audio policy: move intializations to onFirstRef()
f5ada6edcc83bb1b313abcd4c4fbdc4f7724f04d 10-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: move intializations to onFirstRef()

Bug: 17896324.

Change-Id: I3bb74f5397142ac354bd815eb362e5ddacdcb463
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
7c6977c42da29bf47e44aab55d3b2044bf9b442d 07-Oct-2014 Eric Laurent <elaurent@google.com> am 07811789: Merge "audio policy: fix build with USE_LEGACY_AUDIO_POLICY" into lmp-dev

* commit '07811789ebf31f5317403356f624d04282e666aa':
audio policy: fix build with USE_LEGACY_AUDIO_POLICY
8610f49c1a14c91550c8abde27bda59ac6526b23 07-Oct-2014 Eric Laurent <elaurent@google.com> am 5bee844f: Merge "audio policy: fix lockup during mediaserver restart" into lmp-dev

* commit '5bee844fd8c2f6d9fa78ed5e063a8e3df9f2f7b6':
audio policy: fix lockup during mediaserver restart
f380677f21240ffb78bcdf7c804fe0a7807fb08d 07-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: fix build with USE_LEGACY_AUDIO_POLICY

Bug: 17894512.
Change-Id: I6431c0b03ba02cf561413c34848a334caa0261fa
udiopolicy/AudioPolicyClientImplLegacy.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
8b1e80bf1e9f214feea219cfe981ba533b806003 07-Oct-2014 Eric Laurent <elaurent@google.com> audio policy: fix lockup during mediaserver restart

When pre or post processing effects are applied by audio policy service
automatically there is a potential lockup if the first call into
AudioPolicyService is made while creating one of those effects.
This is because effects are created with AudioPolicyService mutex held and
effect creation calls into methods (e.g registerClient()) which also acquire
the mutex.

The fix consists in adding a new mutex to AudioPolicyEffects class and not
hold the AudioPolicyService mutex when calling methods in of class.

Bug: 17830596.
Change-Id: Ie61c3671d3147f46e99ba208f39c1a3bf180779f
udiopolicy/AudioPolicyEffects.cpp
udiopolicy/AudioPolicyEffects.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.cpp
23fe3c0a05fcb619eeb5b0c2ece02cdadab2df6e 03-Oct-2014 Hochi Huang <hochi.huang@mediatek.com> [AU] Import gain setting into ports

Review: https://partner-android-review.git.corp.google.com/#/c/183780

Signed-off-by: Hochi Huang <hochi.huang@mediatek.com>

Change-Id: I415d0b494b9bfadf783280aeea6ad46e0a242cfb
udiopolicy/AudioPolicyManager.cpp
10b464cf2a193f1a5d4b70db052d36eee227916e 03-Oct-2014 Eric Laurent <elaurent@google.com> am 2b217bb3: Merge "audioflinger: fix pre processing transfer between record threads." into lmp-dev

* commit '2b217bb3aee87ce8486014f261c0f498f6209e80':
audioflinger: fix pre processing transfer between record threads.
2b217bb3aee87ce8486014f261c0f498f6209e80 03-Oct-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: fix pre processing transfer between record threads." into lmp-dev
3a8bad2ed0b463d1401c33b92ff30951fc0df3a4 03-Oct-2014 Glenn Kasten <gkasten@google.com> am be9ebd46: Merge "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp" into lmp-dev

* commit 'be9ebd46c1ec366dca5f142a36a71015b048c037':
Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp
1b92868010b5c1409692a86f6b27e4a265b64c1a 03-Oct-2014 Eric Laurent <elaurent@google.com> audioflinger: fix pre processing transfer between record threads.

Fix two problems remaining with pre processing effects transfer from
one record thread to the next in case of tear down due to device connection:
1 - the enabled state of the effects was not communicated to the new HAL
input stream.
2 - the effects saved in orphan chains list were not transfered to the
new thread when a AudioRecord was created.

Bug: 17757378.
Change-Id: I0923c98470db3b51154dc89846157780a4c21e86
udioflinger/AudioFlinger.cpp
udioflinger/Effects.cpp
udioflinger/Effects.h
udioflinger/Threads.cpp
4c053ea158b29fa2cdd4c6f39d3c8da4ee5a7a02 28-Sep-2014 Glenn Kasten <gkasten@google.com> Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp

The per-thread timestamp latch was not synchronized with the per-track
released frames. Now the value of each track's released frames is
latched along with the timestamp.

Bug: 17531839
Bug: 17669342
Change-Id: I9d50c8c6a5de55a3f4561ac40e20d497376c1257
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
92a69cde5f53a916c8c26a64d0dd610284161555 02-Oct-2014 Eric Laurent <elaurent@google.com> am cb4b6e9f: audioflinger: fix failure to indicate volume to effect

* commit 'cb4b6e9f05d1c0b3fcc5be5ebe3f7d6f32669b1a':
audioflinger: fix failure to indicate volume to effect
cb4b6e9f05d1c0b3fcc5be5ebe3f7d6f32669b1a 01-Oct-2014 Eric Laurent <elaurent@google.com> audioflinger: fix failure to indicate volume to effect

If an effect is added and enabled after a track is started
it will not receive current volume information because volume
is indicated only to active effects and if there is a volume change.

Add a flag to force EffectChain::setVolume_l() to pass volume indication
to all effects each time an effect is enabled.

Bug: 17572556.

Change-Id: I6b68488c9aca8b2095fb210aa124d02e4f759660
udioflinger/Effects.cpp
udioflinger/Effects.h
e5095be17c623de8e4b97829d33e8a16b1b7164a 02-Oct-2014 Glenn Kasten <gkasten@google.com> am a49c94ea: Merge "Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"" into lmp-dev

* commit 'a49c94ea49c8329a1bdefe980e1f7d335c0d1ec5':
Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"
a49c94ea49c8329a1bdefe980e1f7d335c0d1ec5 02-Oct-2014 Glenn Kasten <gkasten@google.com> Merge "Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"" into lmp-dev
6954127b7ace022677ac407ff943c2793f8a11be 02-Oct-2014 Glenn Kasten <gkasten@google.com> Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"

This reverts commit 54464ba861aaafd11ee5645f5d1ecd1171c6e9fe.

Bug: 17733142.

Change-Id: I9886d40032b2f7d96bee03e600e14f78943d8052
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
79e687edb9bd7e2fcc60e06dd779f98c75511045 01-Oct-2014 Nicholas Sauer <nicksauer@google.com> Merge "[AU] Update volume setting and Audio Device API 3.0" into lmp-sprout-dev
327cb70dcbf3a1f1679aeafaaa62d8532abea86d 21-Sep-2014 Hochi Huang <hochi.huang@mediatek.com> [AU] Update volume setting and Audio Device API 3.0

Signed-off-by: Hochi Huang <hochi.huang@mediatek.com>
Review: https://partner-android-review.git.corp.google.com/#/c/182522

Change-Id: Ida2dfedc6eaa3204354cdc182e0ee13a35472661
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
955e24d3a8e218d4711cabc6558781e095011132 30-Sep-2014 Glenn Kasten <gkasten@google.com> Merge "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp" into lmp-dev
6c7ae72f0eccf456744474785afd25f9e205881c 30-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix HW A/V sync output selection" into lmp-dev
f71224ce266abb39f83ecba87783c2347631654a 30-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: forward flush to direct output streams" into lmp-dev
54464ba861aaafd11ee5645f5d1ecd1171c6e9fe 28-Sep-2014 Glenn Kasten <gkasten@google.com> Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp

The per-thread timestamp latch was not synchronized with the per-track
released frames. Now the value of each track's released frames is
latched along with the timestamp.

Bug: 17531839
Bug: 17669342
Change-Id: I96252782911bd42a2534cc4030521b7eeb99a7b9
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
c260784e37dea73a2090d4ccd91472d61d3b6230 29-Sep-2014 Eric Laurent <elaurent@google.com> audio policy: fix HW A/V sync output selection

commit b732cf5a broke the selection mechanism for the
HW A/V sync direct output.
Add a rule to only select a mixed output for basic PCM
stereo content when a direct output is not explicitly requested.

Bug: 17702382.

Change-Id: I1387690ace77cd4d6a8faf0b525c3d1008fba3f1
udiopolicy/AudioPolicyManager.cpp
e659ef420dae0caae84ab78f9df8952acb9ad3a0 29-Sep-2014 Eric Laurent <elaurent@google.com> audioflinger: forward flush to direct output streams

Track flush should be forwarded to the audio HAL when playing
on a direct output stream.

Bug: 17704953.
Change-Id: Iafc94327fe9aebf1d4eaa97b76c6767b7ac5babe
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
c8c05d6a5821dd56209e160066314a03d2f2ca06 30-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Merge "CameraService: API1: Reallocate JPEG ashmem heap if size changes" into lmp-dev
2d077d0acdbb26eeb1357489c999ec875f6ce297 29-Sep-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: API1: Reallocate JPEG ashmem heap if size changes

Bug: 17682603
Change-Id: I7cba3365d00c33cf4267b1b59a94bd7d0bba08df
amera/libcameraservice/api1/client2/JpegProcessor.cpp
4379c03433e4613c417998ca7917059ef17dc3a9 29-Sep-2014 Glenn Kasten <gkasten@google.com> Merge "Fix tee sink" into lmp-dev
ba0b34c18da93681c0813ecdab19b0e215b6d261 28-Sep-2014 Glenn Kasten <gkasten@google.com> Fix tee sink

Note: this does not fix the bug below, but it helps to investigate the bug.

Bug: 17578238
Change-Id: I0fd27a477b73ba0e1c5a658bdfad17c500f5dc67
udioflinger/Threads.cpp
dc2e6ddc933e40632e79a866d9ece870db1a975e 26-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Camera2Client: Revert HALv2 device behavior back to MR2

- Do not idle device before video snapshot stream configuration, to
avoid deadlock during waiting.
- Do not tear down ZSL stream
- Don't refresh ZSL stream after deletion was requested.
The v2 HAL implementations really don't like the ZSL stream being
touched ever.

Bug: 17634430
Bug: 17628507

Change-Id: I36b44a395e697be9802c4bd917a82b77c8d04be2
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/ZslProcessor.cpp
a67ced9746e6f0d4e03ff8007682091afea71f6c 28-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Merge "CameraService: API1: Fix flash mode" into lmp-dev
248f9ce1b6052889dd55e7701f908477d16d6ff4 27-Sep-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: API1: Fix flash mode

Sometimes it's useful to ensure variables are initialized in
all code paths.

Bug: 17680416
Change-Id: I9bed8a3bcb94417384bf0551fe1c0eee6cc49577
amera/libcameraservice/api1/client2/Parameters.cpp
a8a4eeb95988e6bb73f7a742c8dd238c1f96c5c4 27-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: favor mixed over direct output for PCM format" into lmp-dev
b732cf5af93c33fa183769210ce9954521fb68cd 25-Sep-2014 Eric Laurent <elaurent@google.com> audio policy: favor mixed over direct output for PCM format

modify getOutputForDevice() to skip direct output selection
if the request can obviously be attached to a mixed output
This prevents from selecting a direct output profile that
can manage stereo PCM format if a mixer output is available
to reach the same device.

Bug: 17628413.
Change-Id: I02e9a0b02c9ae5f44ff5768ac4ed02ce84d521c5
udiopolicy/AudioPolicyManager.cpp
504de531a08facd130fa00f64fdc00521a975175 27-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audio: fix stream type for accessibility usage" into lmp-dev
bb6c9a05840d924b502ce0f1868fca4881ada1ed 25-Sep-2014 Eric Laurent <elaurent@google.com> audio: fix stream type for accessibility usage

Make sure that accessibility prompts are heard when
a ringtone is active by forcing stream type
to AUDIO_STREAM_RING when phone state is AUDIO_MODE_RINGTONE.

Bug: 17558149.
Change-Id: Ia3bead8052fca5cbf282c267f7b9b06014fef628
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
b5bd1df2d6c78f8db5e7f6b416353ca8a93b7119 25-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Camera1 shim: If there's no flash, the keys need to be null.

Previously, we set FLASH_MODE_OFF for FLASH_MODE when a flash unit
isn't available. However, per the API documentation, the key has to
be null instead.

- Make sure that the flash mode and supported flash mode keys are null
if there's no flash unit on start
- Don't set flash mode in later setParameters calls if there is no
flash unit
- Map NULL value for flash mode key to FLASH_MODE_OFF for internal
consistency.

Bug: 17660716
Change-Id: I3033682f0b882b8c2004114e2afef31662caebda
amera/libcameraservice/api1/client2/Parameters.cpp
e0711f2651121754a10c784e3b149024d17fa4d5 18-Aug-2014 Ruchit Sharma <ruchits@nvidia.com> camera: add traces for KPI measurement

Bug: 17658101
Change-Id: I1d8035c4a8fba7b88a87f205ce57c13d812e9df5
amera/libcameraservice/device3/Camera3OutputStream.cpp
amera/libcameraservice/device3/Camera3OutputStream.h
a4b0894425c0e2a2ebd54b002b6bafa5f1ce0445 24-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: add hw hotword flag for inputs" into lmp-dev
f79f8ca07f9130d67ba575748cf3481f32dcad9f 23-Sep-2014 Zhijun He <zhijunhe@google.com> Camera2Client: log an error when autoFocus is called in wrong state

Bug: 17555612
Change-Id: Ife33da712fbc8dc44d81e1e869fc75fb21026204
amera/libcameraservice/api1/Camera2Client.cpp
5dbe47139713292bf45bbf4f1a7af0835a5ff368 20-Sep-2014 Eric Laurent <elaurent@google.com> audio policy: add hw hotword flag for inputs

Audio input profiles can indicate flag AUDIO_INPUT_FLAG_HW_HOTWORD
meaning they allow capture from the same source as HW hotword
detection.

When a client requests capture with this flag, the policy will
try to find an input profile matching this request first and
fallback to a regular input if not found.

Bug: 17575019.
Change-Id: Ia463211597d7fa363527d776389f2257f0ced9a2
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
d3b7327c38964773453a861099c74f547aab9662 20-Sep-2014 Zhijun He <zhijunhe@google.com> Merge "API1: ZSL buffers should be skipped for manual AF mode" into lmp-dev
43e2418e30c360cdd43052fb3471433161cc161e 20-Sep-2014 Zhijun He <zhijunhe@google.com> API1: ZSL buffers should be skipped for manual AF mode

ZSL counts on good auto focus (CAF). It is really tricky to enable ZSL for
manual focus mode. as it is bascically a locked focus mode, you can not tell
if the focus is good or not by reading the afstate.

Bug: 17577928
Change-Id: I68ff7d143e7d56f942bb00a8da6a9faea57b52a0
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
4f62441d36ad9e9e3f993b6f03ce68fcecf4f83b 19-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Merge "CameraService: Add client name/pid to device open/close logging." into lmp-dev
b9d2f3333369183344aa89c7be1e643a44296d48 19-Sep-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Add client name/pid to device open/close logging.

Bug: 15672812
Change-Id: I1162c6d9d0a1eea1dd32949a04c295b4941d2602
amera/libcameraservice/common/Camera2ClientBase.cpp
amera/libcameraservice/common/Camera2ClientBase.h
0fb7b51f6e2a123b2414f4a4daf73ce465c9d8b6 19-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Merge "CameraService: Fix dump methods for two clients" into lmp-dev
67489d2f5668441a36cb1f1157e80ec8684023bf 19-Sep-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Fix dump methods for two clients

Actually write dump text into the provided FD, and add a bit more
dump data into CameraDeviceClient.

Bug: 17570762
Change-Id: I37b1db85188855d4e89c8050c4b13f0d22e07e0c
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api_pro/ProCamera2Client.cpp
2720c8c45a0040d7007239c100591b9f092b780f 18-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: remove debug log." into lmp-dev
80b617cf82e0030deef4f968a6341e2867166135 17-Sep-2014 Eric Laurent <elaurent@google.com> audioflinger: remove debug log.

Remove debug log left by commit ab5cdbaf.

bug: 17537746.
Change-Id: I10f672f607f8e87caaa8228fc05eff8aee7dfa15
udioflinger/Threads.cpp
d78f153a21868d870b14169a6928d991e4b82e73 17-Sep-2014 Eric Laurent <elaurent@google.com> audio policy: fix attached devices validation

Consider all supported devices in an io profile and
not only the first one when looking for a match with attached
devices.
Failing to do so would cause the device validation to fail
if supported devices are not declared in a specific order
in the io profile descriptor in audio_policy.conf

Bug: 17532764.
Change-Id: Id27c9192e21de7f075076e17eb8c48e7e42847f6
udiopolicy/AudioPolicyManager.cpp
47e89d7dcb4406b197c13764897fb28ac1e0b09b 16-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera2: handle one more videosnapshot failure" into lmp-dev
d3c5b081863ad5930971d90aee2f3a61f8424d88 15-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: handle one more videosnapshot failure

Handle one more corner case.
Also remove redundant re-try path.

Bug: 17484683
Change-Id: I0b3e1223f4f28022e7ec6abe028ca3c2623829de
amera/libcameraservice/api1/Camera2Client.cpp
cf7863ea8d9137aadf6bfd9756eb07ebd1c81b5c 15-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: fix pre processing effect leak" into lmp-dev
dd5f7dc1a870877c2f0cbe0b595c42b77035f9ec 15-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Merge "Camera3Device: Treat failure to idle as an error" into lmp-dev
2a6074c4f7dd6f5b85ea8d858199d4970ff404ac 15-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: send mic mute command to all audio HALs" into lmp-dev
aaa44478a373232d8416657035a9020f9c7aa7c3 13-Sep-2014 Eric Laurent <elaurent@google.com> audioflinger: fix pre processing effect leak

When a capture thread was closed, the effects attached to this thread
were left dangling and the associated effect chain destroyed.
When their last client was disconnected, the effects were not released
properly from the effect library because the destruction process could
not be completed without the effect being attached to a thread.

A similar problem prevented a RecordTrack to be properly released if
its client was destroyed after the capture thread.

The fix consists in allowing the effect or record track to be properly
released even if its parent thread cannot be promoted.

Also save any effect chain still present on a closed capture thread
in case a new client wants to reuse the effects on the same session later.

Bug: 17110064.
Change-Id: I5cd644daa357afd1f3548f9bcb28e6152d95fdb8
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Effects.cpp
udioflinger/Effects.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
2f035f59d1e28728d38d18a7f0f7a9c6e8b0c11b 14-Sep-2014 Eric Laurent <elaurent@google.com> audioflinger: send mic mute command to all audio HALs

Mic mute should be sent to all audio HALs, not
only the primary HAL as telephony can use
capture devices on other HALs (e.g USB)

Bug: 17321604.
Change-Id: I658f6084d5b5cdc5a70784661d5cea0b6f81c3a9
udioflinger/AudioFlinger.cpp
83a23e1e1e45d9e2f5497e214796250f74aad1d4 15-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Merge "Camera1: Validate scene mode override AF mode" into lmp-dev
9c8a091436052fb0f3290356abe1ac55b7bae8a2 14-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Camera3Device: Treat failure to idle as an error

Bug: 16899526
Change-Id: Ia995aac6360c9c41ed654af5a7052480f23903d8
amera/libcameraservice/device3/Camera3Device.cpp
a1530f1b16f093a91edbbbaf7dac9f9809867817 14-Sep-2014 Zhijun He <zhijunhe@google.com> Camera3: Update ZSL post-processing tags

Update ZSL processing tags according the still capture template
Also cache the request template to avoid extra cost of querying
into HAL every time.

Bug: 17463102
Change-Id: I2eeffefb0a4131c99a85dd3e4484cc6f0f025efa
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
2b9530a7287f4f470d5f2aecea4da043b7af98a7 14-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix relative priorities of PHONE and ENFORCED_AUDIBLE" into lmp-dev
176e4c253a63d581af6b21f3182d71b3026ef516 13-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Camera1: Validate scene mode override AF mode

Don't allow uncalibrated cameras to list a fixed focus mode for
variable-focus cameras, since uncalibrated cameras cannot do INFINITY
focus.

Bug: 17492043
Change-Id: I5835efd6f21be0ebb74a9b7ea3ef5b2e7cf63e7a
amera/libcameraservice/api1/client2/Parameters.cpp
f0b31e6333839972afb2e374f6d8824180d29fc2 13-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Merge "Camera: Allow larger preview resolutions in API1 for >= HALv2 devices" into lmp-dev
a4c95a6bc3b801bf41ca841440e9124f947e53fe 13-Sep-2014 Eino-Ville Talvala <etalvala@google.com> Camera: Allow larger preview resolutions in API1 for >= HALv2 devices

Limit preview resolutions to a max of 1920x1920 instead of 1920x1080p,
so that any aspect ratio with a 1920 as the larger dimension can be used.

Also improve the initial preview/video size selection logic, to ensure
that the selected size is both a valid preview and video size, and not
too large.

Bug: 17458832
Change-Id: Iea006fadb5fbf0f03d23c3c5babb5b3611469688
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
0e40a83936d42a34788bbce1c113c404d727fe47 13-Sep-2014 Zhijun He <zhijunhe@google.com> Merge "Camera2: fix 4K recording" into lmp-dev
a53021f776d0c82271727e5817388936513feb92 12-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: fix 4K recording

Bug: 17484683
Change-Id: I09bb12698057555329286c777102b9b310452fb3
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/Camera2Client.h
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.h
966095ea014bc0f6ae9f523ee7f37f2fed2faeb5 09-Sep-2014 Jon Eklund <jeklund@motorola.com> audio policy: fix relative priorities of PHONE and ENFORCED_AUDIBLE

ENFORCED_AUDIBLE should only be highest priority if system tones
are being forced. Otherwise it should behave like SONIFICATION.

Bug: 17474485.

Change-Id: Ia651779870d51100cc3179c96fa09694bc691ba7
udiopolicy/AudioPolicyManager.cpp
61cd63a51c87dde24c9b163033937fa304864512 13-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix check in creaateAudioPatch()" into lmp-dev
58f8eb7ae0ee400585bce6682a7212575115e758 13-Sep-2014 Eric Laurent <elaurent@google.com> audio policy: fix check in creaateAudioPatch()

Bug: 17488759.
Change-Id: I9dd2c3ca7f83de4b3573f4fb0e9934e1bc37c3bc
udiopolicy/AudioPolicyManager.cpp
e293c71cee0d00cda005baf5d0c2faa034812b7a 13-Sep-2014 Igor Murashkin <iam@google.com> Merge "camera: add latest parameters to dumpsys for api1 cameras" into lmp-dev
f2a74aad5efc01e5b9939c7cbbfde058ce64bfec 12-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera2: improve ZSL candidate selection logic" into lmp-dev
095da43dfe840f28d8c026710644a97d9b7805bf 12-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "camera2: skip capture result after clearZslQueue" into lmp-dev
6b7a2294b9e4da784cfe4b562ee1720ad606c852 09-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> camera2: skip capture result after clearZslQueue

After ZSL queue is cleared, don't add capture result to ZSL queue
if its corresponding buffer has been cleared.

Bug: 17185356
Change-Id: Iddac39ab09b2560e2ce9390895927217c1736d5a
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.h
amera/libcameraservice/device3/Camera3ZslStream.cpp
amera/libcameraservice/device3/Camera3ZslStream.h
amera/libcameraservice/gui/RingBufferConsumer.cpp
amera/libcameraservice/gui/RingBufferConsumer.h
fcf5fea2ac99e6359998078d09fd7e21269dca4a 11-Sep-2014 Igor Murashkin <iam@google.com> camera: add latest parameters to dumpsys for api1 cameras

Bug: 17290106
Change-Id: I08ac1659d0367613c37669d5bf6e6bf7b2b63bc2
amera/libcameraservice/api1/CameraClient.cpp
amera/libcameraservice/api1/CameraClient.h
dec84fb1c687509c3125acac76e0af80e4e0afbd 11-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: improve ZSL candidate selection logic

1. Clear ZSL queue when focus mode is changed and autoFocus is
cancelled.
2. Do not check focus state is focus mode is fixed.

Bug: 17185356
Change-Id: I2cb10fb457b080f0db950c894e56995f638e147b
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.h
11c9fb1f90cc786485a53aeb1d31ec1ad1dbf840 23-Jun-2014 Jon Eklund <jeklund@motorola.com> AudioPolicyManager: Use "safe" speaker for notifications if available

On particularly loud devices, unexpected audio bursts can be harmful.
For longer audio events, the conventional mitigation strategy is to
somehow soft-start (ramp) the loudspeaker volume, but this strategy
can severely impact the audibility of short audio events.

Use of the "safe" speaker path hints to AudioHAL to immediately output
at best allowable level for transient audio events.

SPEAKER_SAFE is aliased to SPEAKER for purposes of volume control.

Bug: 17319721
Change-Id: I75187c23f3d1f18e9f638c5d14e7b0bf805a67bc
udiopolicy/AudioPolicyManager.cpp
4bcbb07be57947ea1421519094f73577b1e263e6 10-Sep-2014 Ruben Brunk <rubenbrunk@google.com> Merge "camera2: Fix video snapshot for HAL 2.* devices." into lmp-dev
f8fd8d6daab5ced86ce950be68070d27c24d487f 10-Sep-2014 Eric Laurent <elaurent@google.com> audioflinger: fix audio patch release

Fix error in PatchPanel:releaseAudioPatch() causing
the wrong patch handle to be passed to the audio HAL.

Bug: 17368621.
Change-Id: I037fd2e6273508c830414b5900d07c0178b96dae
udioflinger/PatchPanel.cpp
6551e1ede59f4a3043fb141159ca67bd2c85a911 10-Sep-2014 Ruben Brunk <rubenbrunk@google.com> camera2: Fix video snapshot for HAL 2.* devices.

Bug: 15408128

- Lazily destroy ZSL stream when ZslProcessor is updated, or
when the camera client is disconnected, allowing HAL 2.*
devices that rely on the ZSL stream to capture video snapshots
to function correctly.

Change-Id: Ia5cf14c62acda4d9c640440dc5b8e0796dc0b3fa
amera/libcameraservice/Android.mk
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.h
amera/libcameraservice/api1/client2/ZslProcessorInterface.cpp
amera/libcameraservice/api1/client2/ZslProcessorInterface.h
9f8551ffa967bd8a4d0a52487a183dcf8b22d91f 09-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix output stream selection" into lmp-dev
8838a3895c365d443ee22e169ccf45956780c081 09-Sep-2014 Eric Laurent <elaurent@google.com> audio policy: fix output stream selection

Make sure that all outputs considered by selectOutput()
when called from AudioPolicyManager::getOutputForDevice()
support the requested audio format.

Bug: 17340382.
Change-Id: I76520ce60e9a8fe4d2d23125d6143bb016522754
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
6d61a4f8a2fd63a5b906572e586a3e1c6ebfa8af 08-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera2: reconfigure video snapshot size if needed" into lmp-dev
62ce207291353a13dd722855102e99684259a517 08-Sep-2014 Glenn Kasten <gkasten@google.com> Merge "Make IPowerManager native conform to .aidl for oneway" into lmp-dev
3ea3fcd0822b2f43d87f1d8f67d7bf145864b201 05-Sep-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: reconfigure video snapshot size if needed

When recording fails to start due to stream configuration failed,
try configure stream again by setting jpeg stream to video size.

Bug: 16162133
Change-Id: Ib20271e787ae07719ce419f0b15c7f86434f7ebb
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Stream.cpp
2e97b01cecec65e690ac7da5df9433c52ff75bd8 08-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audiopolicy: fix direct output profile probing" into lmp-dev
828bcffa0d5f73461c6c1ba4ef6d3da704c27b7e 07-Sep-2014 Eric Laurent <elaurent@google.com> audiopolicy: fix direct output profile probing

Do not select maximum sampling rate and channel count
when opening a direct output for the first time
to make sure that the combination of sampling rate
and channel count is supported by the connected sink.

Bug: 17047809.
Change-Id: I077a3c1436158378f2762343469ceb39fab9775e
udiopolicy/AudioPolicyManager.cpp
cb16968f593e4d58857c693c8ec6f2d2337f5512 06-Sep-2014 Jungshik Jang <jayjang@google.com> Merge "Fix "invalid device combination" in system audio mode." into lmp-dev
3abc2ded40066f3b1df23aceb553f22d569c5cd3 06-Sep-2014 Glenn Kasten <gkasten@google.com> Make IPowerManager native conform to .aidl for oneway

But provide a temporary escape hatch for AudioFlinger.
This oneway option will be removed as soon as possible.

Bug: 16408906
Change-Id: I058a50906af810787e444a96819cb781b7f639ad
udioflinger/Threads.cpp
3c15d9b12394c62b58ab101c958e354f2c2bea19 05-Sep-2014 Zhijun He <zhijunhe@google.com> Merge "Camera API1: fix AE state check in precapture state" into lmp-dev
f2a2d0d6731174f5ce2a7b9d6dfd96dd7f1727a4 05-Sep-2014 Eric Laurent <elaurent@google.com> Merge "audio policy service: filter out delayed audio patch commands if needed." into lmp-dev
e45b48aba115f4daf4a4aad31b6a95df9b79f463 05-Sep-2014 Eric Laurent <elaurent@google.com> audio policy service: filter out delayed audio patch commands if needed.

As for set parameters commands, create or release audio patch commands
modifying the same patch handle should be filtered by the audio policy service
command thread so that an immediate command is not overridden by
a pending delayed command.

Bug: 17379728.

Change-Id: I6aa4652b4bfec59eebd3c3cb7d1d9ac1bc1d6e49
udiopolicy/AudioPolicyService.cpp
a1f9917243caafd1da5fa743c6fda1d0614ed167 05-Sep-2014 Jungshik Jang <jayjang@google.com> Fix "invalid device combination" in system audio mode.

HDMI-CEC system audio mode removes speaker from output
list. It also has multiple outputs by connected outputs.
However, getDeviceForVolume() doesn't cover multiple
output with no speaker or bluetooth case.
This change picks one of system audio outputs in order.

Bug: 17400026
Change-Id: I102fd0052c9c4c9543f9e8f3b16ec6815d7485d8
udiopolicy/AudioPolicyManager.cpp
e8339fb87364469feb1f2cbda92889efecb79a7c 03-Sep-2014 Zhijun He <zhijunhe@google.com> Camera API1: fix AE state check in precapture state

It is legal to transit to CONVERGED or FLASH_REQUIRED after a AE precapture
trigger.

Bug: 17365185
Change-Id: Id041eff5eac564c32d09b547a0139d24807336f4
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
23c8cf958b1a756d5e0c78c46eac676676be4fdd 03-Sep-2014 Glenn Kasten <gkasten@google.com> Merge "Restore the ability to build tee sink for debugging" into lmp-dev
97d547da43c9c41711d1ed1e3f4fa87c2ee3cb9a 02-Sep-2014 Eric Laurent <elaurent@google.com> audio flinger: fix use of global effect buffer

When float mixing format is enabled, audio effects use a specific
buffer in 16 bit format. This buffer was not enabled when only
global effects were present resulting in the mixer accumulating directly
to the output sink buffer.

Bug: 16202259.
Change-Id: I3537d36c63196d97772f0ab22dd31d04dfa7fdd6
udioflinger/Threads.cpp
329f6511ee4e03a4605c70bbda8d3a96d2544884 29-Aug-2014 Glenn Kasten <gkasten@google.com> Restore the ability to build tee sink for debugging

This changelist does not enable tee sink, but makes it possible to do so.
Tee sink had suffered some bit rot since it is not built by default.

Also fixes a crash for > 2 byte per sample or > 2 channels.
Still does not write correct header for floating-point;
that will be best solved by moving to libsndfile.

Bug: 16990102
Change-Id: I8e92c588ccc513d7802d696fcfb324e815772df6
udioflinger/AudioFlinger.cpp
udioflinger/FastMixer.cpp
udioflinger/Tracks.cpp
b72726bad6c9253c26c82fea76bdf99e18b8ba6d 02-Sep-2014 Ruben Brunk <rubenbrunk@google.com> Merge "camera1: Ensure MemoryHeap buffers are mmapped before copying." into lmp-dev
65e01f763571b779fbc759e6f96d0a195b94c6da 30-Aug-2014 Ruben Brunk <rubenbrunk@google.com> camera1: Ensure MemoryHeap buffers are mmapped before copying.

Bug: 16986293
Change-Id: Icb68254d7ed1812fa9e60342749a2746d6fcfb17
amera/libcameraservice/api1/CameraClient.cpp
4030b56153b398a96269522344e5be485f821b95 29-Aug-2014 Eric Laurent <elaurent@google.com> Merge "sound trigger: fix cross deadlock between service and client" into lmp-dev
9a63396f70880772e551e1e4c38f27c635612083 29-Aug-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix input source passed to openInput()" into lmp-dev
886561f06ddaea86a51def1e918367430240b5ac 29-Aug-2014 Eric Laurent <elaurent@google.com> sound trigger: fix cross deadlock between service and client

Do not call callback methods on ISoundTriggerClient with the service mutex
locked: the client implementation will lock its mutex to process
the callback and if a request from the same client with client
mutex locked was waiting for the service mutex a deadlock occurs.

Bug: 16873049.
Change-Id: Ifc3b31fdfaed525981fa59876c041478f38b42e8
oundtrigger/SoundTriggerHwService.cpp
1c9c2cc4b170b79a83433749808e286eb0fcc449 29-Aug-2014 Eric Laurent <elaurent@google.com> audio policy: fix input source passed to openInput()

The input source passed to openInput() must be
modified from HOTWORD to VOICE_RECOGNITION if the capture does not
correspond to a sound trigger session.

Bug: 16731718.
Change-Id: I48aa4180e75dd5335cd096b48da1c15f2236e6ed
udiopolicy/AudioPolicyManager.cpp
f5e7e79bf88b0c08c73262e7992634797a4f81a1 19-Aug-2014 bryant_liu <bryant_liu@htc.com> audiopolicy: Indicate output device change to all input threads for pre-processing

Bug: 17129715

Change-Id: I1fd938cce0b85241c80ea00f3d013a98948d3975
udiopolicy/AudioPolicyManager.cpp
890a5637b3e3eb197fd2c7f5deec816c7feb13fc 20-Aug-2014 bryant_liu <bryant_liu@htc.com> frameworks: av: AudioPolicyEffect: Add refCount for each session

Audio framework stops and restarts AudioTracks on same audio session.
Sometimes the AudioTrack start() comes before a stop(). As effects
are linked to the session, they should only be created on the last
stop() related to that session.

Bug: 17201117

Change-Id: I19343e293d6b7b6b794fe05ebd0dd239ed3b075c
udiopolicy/AudioPolicyEffects.cpp
udiopolicy/AudioPolicyEffects.h
8b250cb67d0cab6234c0e8e0e21342d03c1eca5d 29-Aug-2014 Eino-Ville Talvala <etalvala@google.com> Merge "CameraService: Create a dummy stream when 0 streams are requested." into lmp-dev
16a2ada049447c156648812b94d25be07869f284 27-Aug-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Create a dummy stream when 0 streams are requested.

A workaround for a camera device HAL v3.2 or older specification hole - it's
not acceptable to configure_streams with 0 output streams. However, we allow for
this at the public API level, to allow an application to release all output streams.

So in this case, create a dummy stream that doesn't actually do anything as a placeholder.

Bug: 17220694
Change-Id: Ib25242ffc2c9f2b2f619fd5fe6d652266579da85
amera/libcameraservice/Android.mk
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
amera/libcameraservice/device3/Camera3DummyStream.cpp
amera/libcameraservice/device3/Camera3DummyStream.h
8962e08c4989368d2c821b64f42632b6f5fb016e 28-Aug-2014 Paul McLean <pmclean@google.com> Merge "Fix audio dropouts with multiple playback streams." into lmp-dev
47f64f2ed14839a00b3b148d490dc0394282eb54 28-Aug-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: remove audio patch when closing input or output" into lmp-dev
05b90f833337ab5f7b16509e5f1d339a04eb5bf6 28-Aug-2014 Eric Laurent <elaurent@google.com> audio policy: remove audio patch when closing input or output

Make sure that an audio patch having an output as source or input as sink
is removed when this input or output is closed.

Bug: 17303725.

Change-Id: I234d54a25ce0b579eeeafdcfda3a0594f048768c
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
01b9256a1358110ed718c1a83c2a1808d4afbb92 28-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "cameraservice: decrease zsl metadata queue size by 1" into lmp-dev
13d98f419c614c5d389b06232ff99f7fe00dabf7 28-Aug-2014 Zhijun He <zhijunhe@google.com> Merge "Camera API1: Fix ZSLProcessor3 deadlock" into lmp-dev
5487fd54f344c422be089217e62098545704bb03 28-Aug-2014 Zhijun He <zhijunhe@google.com> Camera API1: Fix ZSLProcessor3 deadlock

ZSLProcessor3 shouldn't acquire mInputMutex in onBufferReleased call for output
buffers, because the caller (Camera3Stream::returnBuffer) holds the camera3
stream lock already. This could cause deadlock for ZSL reprocess request as it
holds the ZSLProcessor3 input lock and try to acquire camera3 stream lock to
submit the request.

Bug: 17299038
Change-Id: I6a7bf8ebd7c2064852358c655f3a3e9a67769213
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
5c477aa6205e2ebafec237411900d89a510cc105 21-Aug-2014 Paul McLean <pmclean@google.com> Fix audio dropouts with multiple playback streams.

Bug 17136569

Change-Id: I7f69cb24168c7d27ce28679735f53c1ece4014c1
udiopolicy/AudioPolicyManager.cpp
690895cfe0f128ee3fc375a357ab99b0b98394b6 27-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> cameraservice: decrease zsl metadata queue size by 1

Zsl buffer needs to be longer than metadata queue to ensure that
oldest metadata can always find a match in buffer queue.
Since we don't want to add memory overhead, decrease metadata
queue size by one serves the same purpose.

bug 17264283

Change-Id: Ic53441cc29c98e57d3345f5845d92839d0ce6faf
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
1754351d9199721e7e7943461689e399ef015260 06-Aug-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Correct API2 error handling

- Add more error codes to the binder camera2 callbacks
- Translate HAL errors to callback errors
- When flushing, report failures for queued requests
- Treat stream config failure as nonfatal
- Send request errors when buffers aren't available for captures

Bug: 15524101
Bug: 14448494
Bug: 11272459
Bug: 17160301
Change-Id: I81aa54e805a9cce1cb8a6a9374549daa7666deb2
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
amera/libcameraservice/device3/Camera3Stream.cpp
amera/libcameraservice/device3/Camera3Stream.h
amera/libcameraservice/device3/Camera3StreamInterface.h
60ffbe05857b7583f4c70c31914947476a908b5b 27-Aug-2014 Marco Nelissen <marcone@google.com> Merge "Fix memory leak in getConnectionState" into lmp-dev
9dd4a2ddd7caf8cbe50d8a76e0ec3e0274d2bce6 27-Aug-2014 Andy Hung <hunga@google.com> Merge "Fix AudioMixer MONO muted track handling" into lmp-dev
961ec21a5878517ce6db27bad8da269637c45a44 26-Aug-2014 Marco Nelissen <marcone@google.com> Fix memory leak in getConnectionState

Turns out having an sp<> point at the containing object doesn't really
work so well.

Bug: 17210991
Change-Id: I4bcb0c38adffc574d661f0772583357868f6c5b4
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
395db4bfa5b43a839f95632676d59cde99a9840d 26-Aug-2014 Andy Hung <hunga@google.com> Fix AudioMixer MONO muted track handling

Incorrect handling caused "stereo" mode to be used.
Augmented error handling to print more debug info.

Bug: 17208475
Change-Id: I5bcaf0ba5bd5a4f7d4885f8cce43bbf42e5f1e6b
udioflinger/AudioMixer.cpp
61deb78a8a608955e120469ea7a5d39e652b2ae8 22-Aug-2014 Zhijun He <zhijunhe@google.com> Camera API1: remove unnecessary buffer count check

This check doesn't work with ZSL use case. Since the ZSL is both an input and
output stream, When an input buffer is acquired, checking the handout buffer
count for that stream could trigger false alarm when all the output buffers
are sent to hal, instead, we should wait for an output buffer to return.

Bug: 17188380
Change-Id: I7eb166eb49d2f063189d993195ef389d2cf4f2b4
amera/libcameraservice/device3/Camera3IOStreamBase.cpp
fa1fc7086313f2f1868cae4c1a5698e592a437cb 22-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera: fix triggerId logic" into lmp-dev
1da8c89a9d4a2319bb939771e43960c118445329 22-Aug-2014 Igor Murashkin <iam@google.com> Merge "camera: Configure streams immediately when API2 does configuration" into lmp-dev
c00a25ccce0734bf5627cf02d0c4fb3cf051ce15 21-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera: fix triggerId logic

Fix missing triggerId introduced by previous cleanup change.

bug 17108154
bug 17053130

Change-Id: Ifda55d5fbe992d98f335a8427aa256d78a856586
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
0e522ed229053c7d0238425e407431fc08cd7c63 21-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "camera: zsl: remove AF check if no focser presents" into lmp-dev
754fb0225369123ef6e369fd91c48071dcf6057c 21-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> camera: zsl: remove AF check if no focser presents

If there is no focuser, don't check AF state while picking ZSL
candidate frames.

bug 17164077

Change-Id: Ib56e260249dcfb1b3bafea22abeb3abeae4e2c1a
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.h
e2d167eb689d7a536805f950c31f11b9e9c578ae 20-Aug-2014 Igor Murashkin <iam@google.com> camera: Configure streams immediately when API2 does configuration

This makes the configuration more eager (no more waiting until the first
request) and also allows any errors to immediately be sent back to the
client.

Bug: 16629195
Change-Id: I0c365bc8f760466916dcc089217a43c43f9f4c9d
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
97c7fa1b1596a062147f034a2b44781193c052cf 19-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "cameraservice: update supportedFocusModes for api1" into lmp-dev
1b786a35ddd072765348eee2bffa2009c1b14da3 19-Aug-2014 Eino-Ville Talvala <etalvala@google.com> Merge "camera: Fix setParameters for Preview FPS single/range values" into lmp-dev
0b88a62d4d5ac1e515721e587cdf9bcec191812b 19-Mar-2014 Igor Murashkin <iam@google.com> camera: Fix setParameters for Preview FPS single/range values

As a workaround, duplicate CameraParameters into CameraParameters2 to
prevent ABI break for some camera HALs that directly link into
CameraParameters.

CameraParameters2 implements the real fixes needed in the framework,
while CameraParameters is left in to satisfy older camera HALs.

Bug: 12609188
Bug: 16654949
Change-Id: I82ea6f5de2183dd046d4bf5683600c97f37ab4da
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
735f45fbc37d7905ffb722f40727edbed82319b7 19-Aug-2014 Glenn Kasten <gkasten@google.com> Fix memory access error due to race during fast track removal

Bug: 16205169
Change-Id: Ie15ec2a737b6ddd16b2d26030d01564ff70177f5
udioflinger/Threads.cpp
c758f2276f9f9fca9ea24a6647361726acb03646 20-Aug-2014 Igor Murashkin <iam@google.com> camera: hal3: Remove register_stream setprop check

camera3_device_t::register_stream must always be NULL in HAL3.2+ cameras

Bug: 13914251
Change-Id: I116ee71135a827c8b4db61cd91f56ba56da3f0ef
amera/libcameraservice/device3/Camera3Stream.cpp
a858ea0495c887621a2fd9c0afc13780deccb597 19-Aug-2014 Igor Murashkin <iam@google.com> camera: Allow shutter sounds to be disabled from camera2 api

When using the connectLegacy binder interface (available only
through an @hide java api), then consider the camera to be in the
camera2 api legacy mode.

In legacy mode, allow disabling the shutter sound unconditionally.

Bug: 17109582
Change-Id: Ieb3fc61ff111d792cc657c018e278349c25472cf
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/Camera2Client.h
amera/libcameraservice/api1/CameraClient.cpp
amera/libcameraservice/api1/CameraClient.h
80ef94b5a7daa2d48ca72501e335a648dc67bc1d 14-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> cameraservice: update supportedFocusModes for api1

Do not list infinity focus mode if the focuser is not calibrated.

bug 13933979

Change-Id: I677ed22305703ac09eeaf986f5bc2a680cececd8
amera/libcameraservice/api1/client2/Parameters.cpp
47bf8d8f0242bbe9cfa777c96e41e5fcd5294ee4 13-Aug-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "audiopolicy: add dump for audio patches" into lmp-dev
49d00ad9164ea5ce48c85765a2b6460d9b457d38 21-Jul-2014 Glenn Kasten <gkasten@google.com> Fix overruns when capturing with resampling

Bug: 16658148
Change-Id: I2dd04b23a143e0948b299d408790e7a46b5a53b0
udioflinger/Threads.cpp
ca05eb4b0194bb9b37a5261fa91f89add7a6df53 12-Aug-2014 Zhijun He <zhijunhe@google.com> Merge "Camera API1: Ignore the video size change during recording" into lmp-dev
c572362427cdfda53142ad0b44818c269c1d9db1 11-Aug-2014 Zhijun He <zhijunhe@google.com> Camera API1: Ignore the video size change during recording

Ignore the video size parameter change when recording is active.

Bug: 16524513
Change-Id: I55b7c961c06199764486f48bc2187838c2279606
amera/libcameraservice/api1/client2/Parameters.cpp
e7a1737c92cf2e84754ffbc52cfec8edeffcbc75 12-Aug-2014 Ricardo Garcia <rago@google.com> Merge "Fix to support mono in effect buffer allocation." into lmp-dev
726b6a7540ac997928df1a14dfede872a82f6210 11-Aug-2014 Ricardo Garcia <rago@google.com> Fix to support mono in effect buffer allocation.

Since effects are now enabled for recording, mono cases are possible
and needed to be correctly allocated.

Bug: 16917961
Change-Id: I760fc421f9f90fabb3f0deadd5f9dc61cd284371
udioflinger/Effects.cpp
306c92dabc524f408445f7da2524c7a5e77ade63 11-Aug-2014 Andy Hung <hunga@google.com> Merge "Extend downsampling ratios greater than 2:1" into lmp-dev
de975ca87c3dbdf9b7d92dae54b3446670b2a50e 11-Aug-2014 Igor Murashkin <iam@google.com> Merge "camera: Allow Camera#getParameters to be called by mediaserver anytime" into lmp-dev
cd04484f4837b8ca0041d118286ab6a98e84fc75 07-Aug-2014 Andy Hung <hunga@google.com> Extend downsampling ratios greater than 2:1

Also improve robustness to choice of sampling rate or buffer size
such that increasing either by 10x does not cause overflow.

Bug: 12979141
Bug: 15933066
Change-Id: If7989bd745d1bee3bdf811b8b7c978543ccafb65
udioflinger/AudioResamplerDyn.cpp
udioflinger/Threads.cpp
088308a685ee54a476c96649af48ca3eca0bdd9c 11-Aug-2014 Zhijun He <zhijunhe@google.com> Merge "Camera2/3: Cleanup the jpeg buffer size calcaulation logic" into lmp-dev
edf103987d71f09dc2acb0a971cb40ff6608f1a5 11-Aug-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "Update audio ports with profile capabilities" into lmp-dev
28c9b6f298134624cb52b1af4ed8716dddb983d3 08-Aug-2014 Zhijun He <zhijunhe@google.com> Camera2/3: Cleanup the jpeg buffer size calcaulation logic

- Only one place calculating the jpeg size-the device layer, Camera2Device and
Camera3Device.
- Remove size argument for CameraDeviceBase and cleanup related code.

Bug: 14327010
Change-Id: I45d2ab4859ee0cc9273e579254f0569108c748f1
amera/libcameraservice/api1/client2/CallbackProcessor.cpp
amera/libcameraservice/api1/client2/JpegProcessor.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api_pro/ProCamera2Client.cpp
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
f17026dfef596cf1c8008fda20f1f2ad23a3df3a 10-Aug-2014 Jean-Michel Trivi <jmtrivi@google.com> Update audio ports with profile capabilities

When opening an output, import the profile capabilities associated
with the device into the AudioPort.

Bug 10549017

Change-Id: If102f5623457542d2c1407ada303c71e43d19a08
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
4d41695d45e2c7211899afa94b20e32120b2b7e0 10-Aug-2014 Eric Laurent <elaurent@google.com> audiopolicy: add dump for audio patches

Bug: 10549017.
Change-Id: I896c8e16c8cf7490bab75295903620a76236f571
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
874c4287a4e49c59ac88767751dce00fcd3edb73 09-Aug-2014 Eric Laurent <elaurent@google.com> audio policy: enable more than one sink per audio patch.

Allow creation of audio patches with more than one sink.
More than one sink is enabled when:
- Connecting an input device to output devices on the same audio HW module.
- Connecting an output mix to output devices on the same audio HA module.

All other patches are limited to one sink.

Bug: 16879363.
Change-Id: I95be6948ef29df64e51e5b8ace38c2db7f3e89f2
udioflinger/PatchPanel.cpp
udiopolicy/AudioPolicyManager.cpp
ebe865b175b3f1b2a9212cea7b008937c919d8f3 08-Aug-2014 Igor Murashkin <iam@google.com> camera: Allow Camera#getParameters to be called by mediaserver anytime

This fixes a crash if the camera was locked by the media recorder and
another process tried to get the legacy parameters (for the camera
characteristics).

Bug: 16695955
Change-Id: I945a16a686a6987150c8754b5296353e76e5afa0
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/CameraClient.cpp
0912a5738d6baf2df7cd62e877240e3807b4b21f 08-Aug-2014 Andy Hung <hunga@google.com> Merge "Fix effect and mono sink handling." into lmp-dev
389cfdbb9a92a438a0d7710321c2964c7ad55eca 08-Aug-2014 Andy Hung <hunga@google.com> Fix effect and mono sink handling.

Do not permit mixing to mono sink in AudioFlinger.
Allow effects on mono sink if not Mixer thread (e.g. Record).

Bug: 16863095
Change-Id: I8b232fc1fb3f07bf017020c5d4f9ace644dec6d8
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
3659445a8b71afba9927b9d0d8ac41782278bde5 07-Aug-2014 Zhijun He <zhijunhe@google.com> Merge "Camera: Need consider AF state for ZSL buffer selection" into lmp-dev
7e4c0033c5d2f9d5f53f520a9b0a2fcb8023c810 07-Aug-2014 Zhijun He <zhijunhe@google.com> Camera: Need consider AF state for ZSL buffer selection

Bug: 16569983
Change-Id: I65e604e382ac0b98777155ad480ec3f6071e1a76
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
7f04ec2a4ec94ada7ef89db8c50fd1e5c3a93a3b 07-Aug-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: add support for USB devices for voice call" into lmp-dev
c2730ba7c5e9559b7499ef5e0d7742deb18c5110 21-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: add support for USB devices for voice call

Add possibility to use sink and source devices not on
the primary HW module for voice calls (e.g. USB headsets).

Bug: 15520724.

Change-Id: Ib27db4ba759b6d91ea1104dc2e35c87733517b30
udioflinger/Tracks.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
0a0e5f02037f396237461a9840b2fc7271812bdc 06-Aug-2014 Eric Laurent <elaurent@google.com> Merge "AudioSystem: add API to query audio HW sync source" into lmp-dev
7f3f2fa386b8dd917022663bcb01f10ea67061be 06-Aug-2014 Ricardo Garcia <rago@google.com> Merge "MediaServer crashing and audio effects not applied to TTS." into lmp-dev
322bab26dc3fe9bd9c1cbb829dc62ff44f1ae810 06-Aug-2014 Ricardo Garcia <rago@google.com> MediaServer crashing and audio effects not applied to TTS.

A memclear in the EffectChain was out of bounds.

Bug 15432115
Bug 16845751

Change-Id: Ib0adc7fa730d630bb71fb87d51163a26149b16e2
udioflinger/Effects.cpp
93c3d41bdb15e39dac0faea9c5b60f1637cd477c 01-Aug-2014 Eric Laurent <elaurent@google.com> AudioSystem: add API to query audio HW sync source

Add a method to query from the audio HAL the HW sync
source used for a given audio session.
Modify audio policy to select a direct output with HW sync
when requested.

Bug: 16132368.

Change-Id: I03038f9188f2d389f8a5fd76a671854013a4513e
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udiopolicy/AudioPolicyManager.cpp
92ce4715315bddd158c7d4028556632f0547e3b9 06-Aug-2014 Eric Laurent <elaurent@google.com> Merge "audio: fix crashes upon USB device connection" into lmp-dev
cf817a2330936947df94c11859f48771f5596a59 05-Aug-2014 Eric Laurent <elaurent@google.com> audio: fix crashes upon USB device connection

- Audio policy:
Replace unknown device assertion by debug log in setDeviceConnectionState().
It is possible that some kernels indicate connection of a legacy device type
when a USB audio device is connected.
We should just ignore this device.

- Audio flinger:
Make sure FastMixer thread is idle before exiting the normal mixer thread and
closing the output stream.

Change-Id: Ia10a20176a60a8aa56765538093a555fc998508a
udioflinger/Threads.cpp
udiopolicy/AudioPolicyManager.cpp
1c8d1e4079f2b8efd71423158e7f298cf1dc2c31 06-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "cameraservice: disallow zsl/recording coexistentce" into lmp-dev
a57ab8da6fe56fdb91dfc95ebd0282eb879dde53 30-Jul-2014 Eric Laurent <elaurent@google.com> policy manager: recognize AUDIO_DEVICE_IN_AMBIENT from policy.conf

Change-Id: If46b8d13f216bad4aa62598531d406d3303134f5
udiopolicy/AudioPolicyManager.cpp
ca05ebd4c666322e754ac63236c8b329dbb53b00 05-Aug-2014 Yin-Chia Yeh <yinchiayeh@google.com> cameraservice: disallow zsl/recording coexistentce

Make sure ZSL and recording stream does not exist at the same
time.

Change-Id: I19e28dedd9dd5cc5118449860b612a5c950fdaec
amera/libcameraservice/api1/Camera2Client.cpp
ac29afacbb34b92f1948188e5353fce5a252ccb3 28-Jul-2014 Jon Eklund <jeklund@motorola.com> audio policy: support line output device

Change-Id: Iddf1b6486430270d871a45c75615e54339a818e9
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
85c3773092cad9f2c6130ee83e8a78222bac6a0b 05-Aug-2014 Eric Laurent <elaurent@google.com> Merge "Add sound trigger control by audio policy" into lmp-dev
df3dc7e2fe6c639529b70e3f3a7d2bf0f4c6e871 28-Jul-2014 Eric Laurent <elaurent@google.com> Add sound trigger control by audio policy

Audio policy:
- Added active capture indication to sound trigger service:
recognition stops if concurrent capture is not supported.
- Added generation of reserved I/O handle and session ID for
utterance capture.

Sound trigger service
- Added sound model update callback handling.
- Added service state callback
- Simplified callback shared memory allocation.

Bug: 12378680.

Change-Id: Ib0292c2733e6df90fdae480633dd9953d0016ef1
udiopolicy/Android.mk
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.h
oundtrigger/Android.mk
oundtrigger/SoundTriggerHwService.cpp
oundtrigger/SoundTriggerHwService.h
7a9b25940309e2967820daa13a7f71e41293d165 05-Aug-2014 Andy Hung <hunga@google.com> Merge "Remove unused TwoTrack process mode from AudioMixer" into lmp-dev
5241b8cacee86e17223695190959f4752910680f 05-Aug-2014 Andy Hung <hunga@google.com> Remove unused TwoTrack process mode from AudioMixer

Legacy code that has not been hooked up.

Change-Id: Ic01a4eddfa1020089d5bc42f58b6a4697698c27a
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
77cce80fa9d44f1e2a6bc486ad957fbbebfce3b2 05-Aug-2014 Phil Burk <philburk@google.com> [audio][policy] fix crash when offloadInfo is NULL

Added check for NULL pointer to avoid crash
in AudioPolicyManager when playing AC3 data.

Change-Id: Ie56788f6277be6da47d4218b1b4a6b359fce6473
Signed-off-by: Phil Burk <philburk@google.com>
udiopolicy/AudioPolicyManager.cpp
44622db93a24219123facbbe14259000f90de728 02-Aug-2014 Eric Laurent <elaurent@google.com> audio flinger: fix service fuzz test crash

Bug: 13744704.
Change-Id: I572c89f88dcab2b8b612ec6860983306f9f159ab
udioflinger/AudioFlinger.cpp
678792e362c4cd70640934049491d9f21560c63b 03-Aug-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix service fuzz test crash" into lmp-dev
222260168c144cca5a4e8f1c79df8c8baa22b591 02-Aug-2014 Eric Laurent <elaurent@google.com> audio policy: fix service fuzz test crash

Bug: 13744391.
Change-Id: I2430e09ad00476b9ac28dc55466942c61fb0531d
udiopolicy/AudioPolicyManager.cpp
facd8cf2651f7fcf7225e735cae5f5d4ef3a334e 02-Aug-2014 Eric Laurent <elaurent@google.com> Merge "Revert "Revert "sound trigger: added permission checks""" into lmp-dev
8ba53d87a2d311ff4b3f04e30b2e09309ae7421c 02-Aug-2014 Eric Laurent <elaurent@google.com> Revert "Revert "sound trigger: added permission checks""

This reverts commit 936c84a5b743dce2a2572fdf54b37b187bc88b60.

Bug: 16374803.
Change-Id: I9d3137faeddf119b13f9cdb73c14ca49e1ee3d1c
oundtrigger/Android.mk
oundtrigger/SoundTriggerHwService.cpp
e6fa1b7fdc74bec3292d6a10c99f25f9fd989d3f 16-Jul-2014 Hans Boehm <hboehm@google.com> Remove 64-bit android_atomic uses from StateQueue.

Use stdatomic.h instead. We're trying to remove android_atomic use
wherever possible. The 64-bit uses seem easiest to remove first.
This cleans up the code, though not as much as C++ <atomic> would,
if it worked everywhere.

(cherry picked from commit f39b560952d3706a7ff47ef0d82c1a836daeea42)
Change-Id: I3c29bdbd5915cb9d47118834a3a742fe296cf87f
udioflinger/StateQueue.cpp
udioflinger/StateQueue.h
a6d28be0be0fa813080a021bd6a5920a8cb4fbb1 30-Jul-2014 Andy Hung <hunga@google.com> Merge "Add Quad channel output to AudioPolicyManager" into lmp-dev
e1d37b784f3970e44a7331c189cbfdca15404648 29-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: add missing enums in config file parsing

Change-Id: I4edd6cde11de62c9c19dfa623d08cddf42c953db
udiopolicy/AudioPolicyManager.cpp
3a0fe12fbd08b13e9f57d79b0391186be05072f5 30-Jul-2014 Andy Hung <hunga@google.com> Add Quad channel output to AudioPolicyManager

Matches some USB device configurations.

Change-Id: I2429f9de87816b4ad1d39516e3821562617c76ee
udiopolicy/AudioPolicyManager.cpp
318be3e7d245aea99efa194a16002395b609ab90 30-Jul-2014 Andy Hung <hunga@google.com> Merge "Enable multichannel in AudioFlinger" into lmp-dev
8b685b9e56cc207d44b08d124148e7d752ef2241 30-Jul-2014 Andy Hung <hunga@google.com> Merge "Update multichannel audio policy handling" into lmp-dev
a4daf0b4f934b800a49f199fb8c09409391c8fc0 29-Jul-2014 Glenn Kasten <gkasten@google.com> Fix build warnings

Change-Id: Ife5e40264f43fb3ccb40830228701003fe106bf5
udioflinger/AudioMixerOps.h
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerFirProcess.h
udioflinger/tests/resampler_tests.cpp
udioflinger/tests/test-mixer.cpp
udioflinger/tests/test_utils.h
b1ee3954153e9c40280f68d278526ca43c31fdcf 29-Jul-2014 Andy Hung <hunga@google.com> Enable multichannel in AudioFlinger

Change-Id: Ibdbdc6ea0b87cdcd15432257a3455b11b3ce14b7
udioflinger/AudioFlinger.h
9a60538b9ee2b097770dcd378281b31f4218ae56 29-Jul-2014 Andy Hung <hunga@google.com> Update multichannel audio policy handling

Ensure AUDIO_FORMAT_PCM_FLOAT and AUDIO_FORMAT_PCM_32_BIT
have proper precedence.
Allow more mixer channels than 2.

Change-Id: I02af97dad6218b25cbada4d93077a213314c6725
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
4dc680607181e6a76f4e91a39366c4f5dfb7b03e 29-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: pass session ID to capture activity methods

Indicate the audio session ID when calling getInput(),
startInput(), stopInput(), releaseInput().

Bug: 12378680.
Change-Id: I763793752f93e2f4e1445a5ab217c895af011038
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.h
d530d415e60373caf875a37d2d747a51470ee45c 29-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Fix rounding in RecordThread resampler buffer computation" into lmp-dev
8661aaff9e9a4d4c1b57f6a68cdbcab006354ab2 28-Jul-2014 Andy Hung <hunga@google.com> Fix rounding in RecordThread resampler buffer computation

Bug: 16525305
Change-Id: Ie010822b0fa9dec74adde1d1b091ee44c183fc94
udioflinger/Threads.cpp
de3f8392fbf380ba6f09d009b00d7172477389a2 28-Jul-2014 Eric Laurent <elaurent@google.com> rename AudioSystem::newAudioSessionId()

Rename AudioSystem::newAudioSessionId() to
AudioSystem::newAudioUniqueId() as it can be used
also for I/O handles.

Bug: 12378680.
Change-Id: I611ea3b5eb57a4b0774437f477ee87dc4ccc2cc2
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyService.h
03524dcc1215b2c468f5c8c8abe6f1c26239fd71 28-Jul-2014 Eric Laurent <elaurent@google.com> Merge "AudioFlinger: update openInput() and openOutput()" into lmp-dev
7d70c5e5fe787ae5d7af8830864d208749d6337f 25-Jul-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Replace deprecated native_window methods

Change-Id: I3be5a720ac8b488d1e507c606a9146480faeef63
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device3/Camera3OutputStream.cpp
f67e23ef637d0b53a0d4bebb68c654234df3da94 24-Jul-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Clean up availability listeners and HAL error codes

- Refactor where availability listeners are called to centralize behavior,
ensuring that all client creation/destruction invokes the listeners
- Clean up some of the client hierarchy
- Filter error codes from key HAL calls to ensure proper reporting

Bug: 16514157
Bug: 16483222
Change-Id: I59875a865b6a508b47423946c78862da8df34cd1
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
amera/libcameraservice/common/Camera2ClientBase.cpp
amera/libcameraservice/device1/CameraHardwareInterface.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device3/Camera3Device.cpp
cf2c0210c8afbe7d0661ccbbae3835b5ce73c0bf 26-Jul-2014 Eric Laurent <elaurent@google.com> AudioFlinger: update openInput() and openOutput()

Add parameters to openInput() and openOutput(): device address,
input source.
Allow caller to specify a given I/O handle
Group parameters in a struct audio_config.

Bug: 12378680.
Change-Id: I7e9af74c0d996561cc13cbee7d9012d2daf33025
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/PatchPanel.cpp
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyClientImplLegacy.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.h
141670d465d7673dfa6ad712ad100f84882dfa95 28-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Enable lower latency audio capture on more devices" into lmp-dev
9f81de3452dfb2385bd57dc05456a045174a1ab1 28-Jul-2014 Glenn Kasten <gkasten@google.com> Enable lower latency audio capture on more devices

Bug: 16601366
Change-Id: I573b98631f81b7768f7cc00aa09e560008dea587
udioflinger/Threads.cpp
0fb47759256ecdaedbc34c880238bc9d102ef160 23-Jul-2014 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicyManager: handle outputs for different addresses

Add the notion of device types that cause the device address
to be taken into account, i.e. multiple devices of the
same type but with a different address can be connected/
disconnected.
AUDIO_DEVICE_OUT_REMOTE_SUBMIX is such a device type.
When making those devices available / unavailable, look for
all outputs with a matching address.

Bug 16009464

Change-Id: I260f8248b7794c4932094e876afdf29fdea007a3
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
97117153a0d681be70bfa9dc9876541375355c47 28-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "audio policy: compatible sample rates and channel masks" into lmp-dev
d8622371d5ac5b98abcc5d388bd952bb3dd4fda9 27-Jul-2014 Eric Laurent <elaurent@google.com> audiopolicy: fix output audio format selection

Fix two problems in output stream audio format selection
added by commit 1e693b55:
- flags must be set before picking the format.
- fix logic error in best format selection.

Change-Id: I6458b32725f771da5a08108932d64e71964ae9f1
udiopolicy/AudioPolicyManager.cpp
cbd48023d0a0e3fd59955011538c0087a439f905 24-Jul-2014 Glenn Kasten <gkasten@google.com> audio policy: compatible sample rates and channel masks

Change-Id: I50d068a968aa6bd9e53e5b3111a1b09a6c2d219c
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
0f036bec92eca4c972f566355196acc3f4cbf804 25-Jul-2014 Andy Hung <hunga@google.com> Merge "Add multichannel capability to AudioFlinger" into lmp-dev
9a59276fb465e492138e0576523b54079671e8f4 22-Jul-2014 Andy Hung <hunga@google.com> Add multichannel capability to AudioFlinger

But not enabled (kEnableExtendedChannels == false).

Change-Id: I62f7e31fbd29ad703a9a02f5d1a280b6972dd423
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/FastMixer.cpp
udioflinger/FastMixer.h
udioflinger/Threads.cpp
e93b6b7347a7846c8fd746542364ec11b0cd5124 18-Jul-2014 Andy Hung <hunga@google.com> Add multichannel capability to AudioMixer

tests/test-mixer updated to handle multichannel.
New mixer path is still disabled (kUseNewMixer = false).
Subsequent CL will enable multichannel capability.

Change-Id: I71dafa94cc1d9af567c285e0ded7c5c94e3ff926
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/AudioMixerOps.h
udioflinger/tests/mixer_to_wav_tests.sh
udioflinger/tests/test-mixer.cpp
udioflinger/tests/test_utils.h
3eb54c30def7f626c5e2d73ab418c78616dc53db 25-Jul-2014 Andy Hung <hunga@google.com> Merge "Add multichannel capability to AudioMixer" into lmp-dev
9e62beeeb307a098be9c72bbd23188a7731b72bb 25-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "audio policy: clean up checking for active input" into lmp-dev
0a234ea24a9b03da571150c464c6670fba9d224f 25-Jul-2014 Ricardo Garcia <rago@google.com> Merge "-Making sure mAudioCommands list is empty before going to sleep. -Wake_lock release before sleeping or quitting threadLoop()." into lmp-dev
05f2fdc1070c1c07af9e21760d4d2e06bebde55a 25-Jul-2014 Ricardo Garcia <rago@google.com> -Making sure mAudioCommands list is empty before going to sleep.
-Wake_lock release before sleeping or quitting threadLoop().

Change-Id: Icab53d7984a3ba3eaf13e514667b4d60f40cbcd6
udiopolicy/AudioPolicyService.cpp
74a8e2533561f04029873446206ab407cd2e033b 24-Jul-2014 Glenn Kasten <gkasten@google.com> audio policy: clean up checking for active input

Change-Id: I85cc089df32e6d469e8aef307599f1021ea5b835
udiopolicy/AudioPolicyManager.cpp
6a8ab05f0598f4ebdd5ef82e93cf32fde0598189 24-Jul-2014 Glenn Kasten <gkasten@google.com> audio policy: add audio_input_flags_t and mOpenRefCount

Change-Id: I5f9c7b5ebf03b9bc94efe70d3677edfabb99c194
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
319b09d0cf6ae5bc21d8fd1e14e7a9df915514cf 25-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "audio policy: add audio_input_flags_t and mOpenRefCount" into lmp-dev
0a21051b91c2e07e49eb6fa568c505aee967ab9d 24-Jul-2014 Zhijun He <zhijunhe@google.com> Camera3: tear down Camera3 streams when they are deleted.

Also override the disconnectLocked method in Camera3ZslStream to make sure the
Camera3ZslStream specific buffer queue is cleaned up properly.

Also revert 0be123df1897fd3fe1b7ba30f24d8ae4c91b4dc7, as it was not the right
fix.
Change-Id: I89bdcb2e206379ae1f2602421e7fdbcde9a31399
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3OutputStream.h
amera/libcameraservice/device3/Camera3ZslStream.cpp
amera/libcameraservice/device3/Camera3ZslStream.h
83b8808faad1e91690c64d7007348be8d9ebde73 21-Jun-2014 Eric Laurent <elaurent@google.com> audio flinger: add patch connection between hw modules

Add support for audio device connections between different audio
hw modules.
The patch is performed by creating a bridge between the playback
thread connected to the sink device and the record thread connected
to the source device using a pair of specialized PlaybackTrack and
RecordTrack.
- Added PatchTrack and PatchRecord classes.
- Added TrackBase type to indicate more clearly the track behavior.
- A TrackBase can allocate the buffer or reuse an existing one.
- Factored some code in openOutput() and openInput() for internal use
by PatchPanel.

Bug: 14815883.

Change-Id: Ib9515fcda864610458a4bc81fa8f59096ff4d7db
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/PatchPanel.cpp
udioflinger/PatchPanel.h
udioflinger/PlaybackTracks.h
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
udiopolicy/AudioPolicyManager.cpp
c15c265676da2226a18a5373812608b19d4719d7 23-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: remove redundant fixed volume management

Remove code handling fixed device volume in
AudioPolicyManager::computeVolume() as this is already
managed by AudioService.

Change-Id: Ib2be7578e40652c85a7d44c685ff9cc703d0c969
udiopolicy/AudioPolicyManager.cpp
17d0842cf33464a79a81b0e78e49514c3419d1cf 23-Jul-2014 Andy Hung <hunga@google.com> Merge "Fix multichannel integer resampling and add tests" into lmp-dev
f78cd5e5e6af5d06de15e6f91b98e648d89fc409 23-Jul-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: only append partial result to partial result collection" into lmp-dev
5d76e1a639c1bae9ea7d9af1124abf1c94353344 23-Jul-2014 Zhijun He <zhijunhe@google.com> Camera3: only append partial result to partial result collection

Otherwise, the metadata entries will be duplicated.

Change-Id: If0cd96e09960fdf746a70913d380e9036745a944
amera/libcameraservice/device3/Camera3Device.cpp
daf92cc876a1952059794e6d0f558f0f6dd9ac8c 23-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: fix hotword capture

commit 1c333e2 introduced a regression causing the
wrong input source type to be communicated to
the audio HAL when starting hotword (background) capture.

Change-Id: Iec6b3c58cbc15b9988793077232ff3e7e72a4d6d
udiopolicy/AudioPolicyManager.cpp
0be123df1897fd3fe1b7ba30f24d8ae4c91b4dc7 22-Jul-2014 Ruchit Sharma <ruchits@nvidia.com> camera: clear ZSLQueue when switching modes

not clearing the queue here will eat up unnecessary memory every time
we switch from video to still mode.

Change-Id: I279ec709b485ca0dab672464e5b829be849bcaa5
amera/libcameraservice/api1/Camera2Client.cpp
e80b229a80a992cb14647bcc7bfa8c926dc65fe6 22-Jul-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "cameraservice: remove record stream in stopPreview" into lmp-dev
42b011166ece30969667e0ff9dcf4832568c9c1a 20-Jul-2014 Andy Hung <hunga@google.com> Fix multichannel integer resampling and add tests

Change-Id: I384bf8317d4f03616bf9f2b458a8700965d5cf56
udioflinger/AudioResamplerFirProcess.h
udioflinger/tests/resampler_tests.cpp
eeaf40a8e413780bd2aacde172ac820e2ce12eb3 22-Jul-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: add missing formats to audio_policy.conf parser." into lmp-dev
a204994e7dd7dab931297176c66b5d3b82e2c90b 22-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: add missing formats to audio_policy.conf parser.

Change-Id: I872c11d080c505abe3025e7bbb554ca9711de9af
udiopolicy/AudioPolicyManager.cpp
a7e04803ffa0d8d4cc51a122f68bf5038422aabb 21-Jul-2014 Glenn Kasten <gkasten@google.com> Remove execute bit

Change-Id: I1cf0c0d9375779b3074af12f4cbf9c1ec07bf4ff
udioflinger/Threads.cpp
udiopolicy/Android.mk
udiopolicy/AudioPolicyEffects.cpp
udiopolicy/AudioPolicyEffects.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
28d0327bc80e1e424c3db34c62e8f73cd5ffab1e 18-Jul-2014 Yin-Chia Yeh <yinchiayeh@google.com> cameraservice: remove record stream in stopPreview

Remove recording stream every time stopPreview is called.

Change-Id: Iabb783a75418aa41ddc2693cfdfd5a2131109070
amera/libcameraservice/api1/Camera2Client.cpp
8bce84142802ecdc1794d59488ede629801a5cba 20-Jul-2014 Andy Hung <hunga@google.com> Merge "Add RemixBufferProvider to AudioMixer" into lmp-dev
a08810b2feafeec88870c7c1f01efc39ee8e0d78 17-Jul-2014 Andy Hung <hunga@google.com> Add RemixBufferProvider to AudioMixer

This is used to convert between channel masks for input AudioTrack
data.

Change-Id: Iedffaeccb99c7053992152e7b1cb6b2d33b12eef
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
34803d594232af5604d893eff7ee40bb57d459a4 17-Jul-2014 Andy Hung <hunga@google.com> Update DownmixerBufferProvider to use CopyBufferProvider

Change-Id: I6b1a8755a1e6c29b916662fd376e9509cda5df55
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
1b2fdcb005f9fbe5ad465cec46ec5992b718b5e3 17-Jul-2014 Andy Hung <hunga@google.com> Add CopyBufferProvider class for AudioMixer

AudioMixer::ReformatBufferProvider now uses it as a base class.

Fix ReformatBufferProvider object leak.

Change-Id: If196f844eaaa124a173ffa27afe88098023c2ff9
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
4287942b0d6fabe5f99e15cd70c470b04f345de8 19-Jul-2014 Andy Hung <hunga@google.com> Merge "Update DownmixerBufferProvider to use CopyBufferProvider" into lmp-dev
c60780517a882e0905fd36a06b1c45da12e49557 19-Jul-2014 Andy Hung <hunga@google.com> Merge "Add CopyBufferProvider class for AudioMixer" into lmp-dev
529c61b7e4468a3e21f302f2a92a660249daa722 19-Jul-2014 Glenn Kasten <gkasten@google.com> Fix copy/paste bug

introduced by Change-Id: I4e9b7fa99858b488ac98a441fa70e31dbba1b865

Change-Id: I9a0c8800f5cf3767cc259776f95c96cad972e392
udioflinger/Tracks.cpp
91be1fbc424035e70688e60306b755893e0fb0ae 17-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Move AudioRecord frame count calculations to server" into lmp-dev
e94754c9601d132354e5db2079762c7d1a0bddda 17-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Add audio_input_flags_t to IAudioPolicyService::getInput" into lmp-dev
2e8186a258c934798129847f66171df36e95d23e 17-Jul-2014 Andy Hung <hunga@google.com> Merge "Fix initial audio glitch on startup" into lmp-dev
d1a4f35ec10f36c33cf7391e800910da8fdebb6e 17-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Add audio_input_flags_t to IAudioFlinger::openInput" into lmp-dev
e1a8112edec713ff1d84f67145f22cca3a401951 17-Jul-2014 Andy Hung <hunga@google.com> Merge "Revert "Revert "Enable extended precision PCM output in AudioFlinger""" into lmp-dev
7025b5bf189092015df97b0952d33ee76db165c7 17-Jul-2014 Andy Hung <hunga@google.com> Revert "Revert "Enable extended precision PCM output in AudioFlinger""

This reverts commit ce83432a922e55d68625aad854f8f6520db395bc.

Change-Id: I2d005bfe091beef810c9ddfb53e308fa0e47b355
udioflinger/AudioFlinger.h
5567aaf4818007cd8e77329683a91c0f5d7a8837 17-Jul-2014 Andy Hung <hunga@google.com> Fix initial audio glitch on startup

Also happens when restarting AudioFlinger.

Bug: 16322824
Change-Id: I382b20174cb0639e04316130141f2094d7dd0cb3
udioflinger/Threads.cpp
7410591dad836434c72ddee66680802708b70c10 03-Jul-2014 Glenn Kasten <gkasten@google.com> Move AudioRecord frame count calculations to server

Buffer frame count and notification frame count
are now calculated by server instead of by client.
The server has more information and can do a better job.

Also fix a few bugs:

- If a fast track was re-created, even with same pipe depth, it would fail.
Now it can correctly re-create a fast track provided the pipe depth is same.

- Notification frame count for fast tracks was calculated by client
as 1/2 of the total frame count, which is a large value due to the pipe.
Now the notification frame count is set by server to the HAL frame count.
This should reduce latency for fast tracks.

- EVENT_OVERRUN were happening frequently when there was sample rate conversion,
because the client didn't know about the sample rate conversion,
and under-estimated the necessary buffer size. Now since server
calculates the buffer sizes, EVENT_OVERRUN is unlikely.

- RecordThread::createRecordTrack_l was checking for mono and stereo
for fast tracks. This is not necessary, and now we can handle a
multi-channel fast track.

Bug: 7498763
Change-Id: I0c581618e8db33084d5ff9ed50a592990c9749e8
udioflinger/Threads.cpp
b3b1660ecb67f61f9da54efced8677fa3a6f4863 16-Jul-2014 Glenn Kasten <gkasten@google.com> Add audio_input_flags_t to IAudioPolicyService::getInput

Change-Id: I9f37be05f8dc7b85a8827a94e76ca0f45453e170
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.h
ec40d284218466d8f0e832e7eb88e6ea6c479c88 16-Jul-2014 Glenn Kasten <gkasten@google.com> Add audio_input_flags_t to IAudioFlinger::openInput

For backward compatibility, until flags are correctly calculated,
we will assume that the request is for a low latency input stream.

Change-Id: I76746834e870df00833dc77cbdaa2edd2ffeec95
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyClientImplLegacy.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyService.h
6e6704c06d61bc356e30c164081e5bcffb37920c 03-Jul-2014 Glenn Kasten <gkasten@google.com> Improve dumpsys for capture threads

Show per-track sample rate, and whether there is a fast capture thread

Change-Id: If6a08a40d1eeba0690aa8da3c541f845ec101b7f
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
693dd7e252529be98acd2e2585b44a6a10fa4233 17-Jul-2014 Zhijun He <zhijunhe@google.com> Merge "Camera HAL3: migrate from partial quirks to partial result" into lmp-dev
ce83432a922e55d68625aad854f8f6520db395bc 17-Jul-2014 Andy Hung <hunga@google.com> Revert "Enable extended precision PCM output in AudioFlinger"

This reverts commit a494e82c3c73508b4d3cfe89e9134de94e12fd31.
udioflinger/AudioFlinger.h
936c84a5b743dce2a2572fdf54b37b187bc88b60 17-Jul-2014 Eric Laurent <elaurent@google.com> Revert "sound trigger: added permission checks"

This reverts commit dcb162f3aed807d1e51f29e2454ade584439992e.
oundtrigger/Android.mk
oundtrigger/SoundTriggerHwService.cpp
ca4805b607a6abce38abf05c09d3fb8bab521ee8 17-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Improve dumpsys for capture threads" into lmp-dev
b84bc80c952b888d2134e467835b7e9facd17805 17-Jul-2014 Andy Hung <hunga@google.com> Merge "Revert "Enable extended precision PCM output in AudioFlinger"" into lmp-dev
7b24ee381e806dcb53308c1cafc8a45f4e2d8300 15-Jul-2014 Jungshik Jang <jayjang@google.com> Revisit HDMI-CEC system audio mode in AudioService.

From recent feedback on HDMI-CEC system audio mode,
it would be unnecessary to enforce output from AudioService.
Instead, it would follow audio policy according to status
of HDMI-CEC system audio mode.
For that removed two params of setHdmiSystemAudioModeSupported
api of AudioManager.

In terms of speaker mute, it will be handled by removing speaker
from audio ouput instead of changing gain control. For that
added new force usage type, FOR_HDMI_SYSTEM_AUDIO_MODE and
new force config type, FORCE_HDMI_SYSTEM_AUDIO_ENFORCED.
This is used to notify change of system audio mode to
audio policy manager.

Bug: 16305986
Bug: 16002150
Change-Id: I702e0f9ce7c7887d5f5dd02b06a40d20e4c950df
udiopolicy/AudioPolicyManager.cpp
204e3295e2814052aef7e45ee9edd60128efbbd0 15-Jul-2014 Zhijun He <zhijunhe@google.com> Camera HAL3: migrate from partial quirks to partial result

- Enable the normal partial result path for HAL3.2, the quirk is only used
for the HAL version lower than HAL3.2. The partial quirks is no longer supported
for HAL3.2 or higher versions.
- Add CameraDeviceBase getDeviceVersion API.
- Fix some build warnings

Change-Id: I7a1b03d4d5fd5258d2addfba4368bee2ba691337
amera/libcameraservice/api1/client2/FrameProcessor.cpp
amera/libcameraservice/api1/client2/FrameProcessor.h
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/common/FrameProcessorBase.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
d81d48961da30f657fb095ed00a697bd50266269 16-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Add audio_input_flags_t to HAL open_input_stream" into lmp-dev
dcb162f3aed807d1e51f29e2454ade584439992e 11-Jul-2014 Eric Laurent <elaurent@google.com> sound trigger: added permission checks

Add check for android.permission.CAPTURE_AUDIO_HOTWORD
to all sound trigger binder calls on server side.

Bug: 12378680.
Change-Id: Ic3fd70e947882cdf5f4d4a4fe609a2c5a8236fd5
oundtrigger/Android.mk
oundtrigger/SoundTriggerHwService.cpp
da3bd9f12883f8344d2db00ce2fa47511ed9bef6 16-Jul-2014 Glenn Kasten <gkasten@google.com> Add audio_input_flags_t to HAL open_input_stream

For backward compatibility, until flags are added to openInput(),
we will assume that the request is for a low latency input stream.

Change-Id: I5e6f7e574418917ff1b41b0a47199203c69cb40f
udioflinger/AudioFlinger.cpp
efebe3974d4ad5870f957b77450c26a499fc467e 15-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "const correctness on downmix and upmix" into lmp-dev
cd704219d22ec51660103684a680caf2c3a12dad 15-Jul-2014 Glenn Kasten <gkasten@google.com> const correctness on downmix and upmix

Change-Id: I0f51470a6d58a22310ce7cda80afc55e9d6df1dc
udioflinger/Threads.cpp
7c5b60ae8b8793b2d601ecf459807c974120331b 15-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: build with USE_LEGACY_AUDIO_POLICY

Change-Id: I9def12ea689b00c0295c670c07373dacfb186799
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
5698d4461a260dbf208484383f692b03c6473e74 18-Jun-2014 Ruben Brunk <rubenbrunk@google.com> camera2: Set orientation flags for hardware composer.

Bug: 15116722
Change-Id: I3fcc9aea38afcbd665f86c511a9929fe9a6a3a8f
amera/libcameraservice/api2/CameraDeviceClient.cpp
388742df51084f02a362818a884f3bde71b7ef8d 12-Jul-2014 Eric Laurent <elaurent@google.com> Merge "audiopolicy: remove debug log in AudioPolicyEffects.cpp"
897a408b3f9c893776d67214257ca6a6bc1751bd 12-Jul-2014 Eric Laurent <elaurent@google.com> audiopolicy: remove debug log in AudioPolicyEffects.cpp

Change-Id: Ia037807a91d6649c3f47baccf8c107df496e934e
udiopolicy/AudioPolicyEffects.cpp
1e693b55d888b9d3e0a2ce770ae2b72b59c1a317 10-Jul-2014 Eric Laurent <elaurent@google.com> audio policy: add rules to select audio parameters

Added rules to select most appropriate sampling rate, format and
channel mask from an input or output profile.
Moved mFlags from IOProfile to its base class AudioPort.
Removed bogus mChannelMask member in DeviceDescriptor class.
Improveed dump of dynamic parameters in AudioPort.

Change-Id: Ic09d320386002a8bafee4a28db00b1001a386678
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.cpp
2829edccd7d2bb8244246f316face82b650b8949 18-Jun-2014 aarti jadhav-gaikwad <agaikwad@nvidia.com> stagefright: Pass audio aac sub formats in offloadinfo

Pass audio aac sub formats in offloadinfo according to
aac profile. Audio HAL can take decision about offload
using DSP capabilities

Change-Id: If269a3654b5d2b09c183212b0646ef03e06f2d8f
udioflinger/AudioFlinger.cpp
udiopolicy/AudioPolicyManager.cpp
8346bf5c2dd059c5451706ef1b906cb34d5175cd 11-Jul-2014 Andy Hung <hunga@google.com> Merge "Return negotiated format with HAL in AudioFlinger"
463be250de73907965faa6a216c00312bf81e049 11-Jul-2014 Andy Hung <hunga@google.com> Return negotiated format with HAL in AudioFlinger

Fixes an issue caused by extended precision and the FastMixer
when the format to the FastMixer was returned instead of the
HAL format.

Change-Id: I2be9d55d5c87d82e46b5200b07fcdd986ebde08a
udioflinger/Threads.cpp
udioflinger/Threads.h
0c94309d3c6db555b57f2e2e2dc3a0a2676ac6b7 08-Jul-2014 Jungshik Jang <jayjang@google.com> Revamp HDMI-CEC system audio mode integration with audio service.

In previous change we use setForceUse(FORCE_MEDIA, XXX) method
in order to set specific audio output type, such as LINE, HDMI_ARC,
and SPDIF. But it turns out that it conflicts with bluetooth
a2dp which uses the same setForceUse(FORCE_MEDIA, yyy).

This change is based on several conditions.

1. When other non-speaker devices are on, prevent system audio
from turing on.
2. In order to keep track of other devices' connectivity and to
turn off system audio if other device like bluetooth or
headphone preempts current output, register OnAudioPortChangeListner
to audio manager.
3. All possible system audio outputs can be merged with other
outputs without priority.

Change-Id: Ic5ccc80f9b48fb77433c347de7969837c69e58c1
udiopolicy/AudioPolicyManager.cpp
0dba9b1719a598f5d78cbcef4b0b9e47313f1037 09-Jul-2014 Andy Hung <hunga@google.com> Merge "Add floating point volume handling to AudioMixer"
91848a568e6ef4d6b214b81d3f82b6d49d00ffb6 09-Jul-2014 Andy Hung <hunga@google.com> Merge "Enable extended precision PCM output in AudioFlinger"
817d3356b5c23f01620105141633616b48002779 09-Jul-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "Revise speaker volume curve for media on devices with speaker DRC"
98c6043e089743355bb6686176877f2ba5125213 09-Jul-2014 Jean-Michel Trivi <jmtrivi@google.com> Revise speaker volume curve for media on devices with speaker DRC

Bug 15318604

Change-Id: I14b451e2d8d4439fe286dd98c45d09b9dadbb4f6
udiopolicy/AudioPolicyManager.cpp
5e58b0abe5b6c8f5bd96a8f78bbeeeb4d3892020 24-Jun-2014 Andy Hung <hunga@google.com> Add floating point volume handling to AudioMixer

Use floating point volume in AudioMixer mixing when floating
point input is used with the new mixer engine.
AudioResampler is updated to take floating point volume to match.
Both legacy integer and floating point mixer engines work.

For now, integer volume is used when the new mixer engine
runs in integer input mode, for backward compatibility with
the legacy mixer. The new mixer engine will generally run in
floating point input mode. When the legacy path is removed,
the integer volumes will be removed.

Change-Id: I79e80c292ae7c8b8bdd0aa371a1b2c3a1b618290
udioflinger/Android.mk
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/AudioMixerOps.h
udioflinger/AudioResampler.cpp
udioflinger/AudioResampler.h
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerDyn.h
udioflinger/AudioResamplerSinc.cpp
udioflinger/AudioResamplerSinc.h
udioflinger/Tracks.cpp
udioflinger/test-resample.cpp
udioflinger/tests/resampler_tests.cpp
a494e82c3c73508b4d3cfe89e9134de94e12fd31 09-Jul-2014 Andy Hung <hunga@google.com> Enable extended precision PCM output in AudioFlinger

Change-Id: I7c0907c7b2369681975d8ea0192b722d7ed7a867
udioflinger/AudioFlinger.h
2e8863b31e987f9bb54e52645e03e75120863a2e 08-Jul-2014 Eino-Ville Talvala <etalvala@google.com> Merge "av: native_window_set_buffers_geometry is deprecated."
c09cec7ba6df108b91d9d9583b340580bafa5d0b 03-Jul-2014 Pierre Couillaud <pierre@broadcom.com> av: native_window_set_buffers_geometry is deprecated.

native_window_set_buffers_geometry is deprecated, but
__set_buffers_geometry is still used for device1 camera
support.

replace deprecated call with its equivalent combination of
native_window_set_buffers_dimensions and
native_window_set_buffers_format.

Change-Id: I4940367dcae6049451508bfdfc11c16907ec1afc
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
amera/libcameraservice/device1/CameraHardwareInterface.h
c98bd8d9bf81663b5cd9c79e79d6e7869c1146e6 07-Jul-2014 Zhijun He <zhijunhe@google.com> Camera3: only return input buffer when it is sent in request

This is to WAR the case where HAL sends non-NULL input_buffer in capture
result even capture framework doesn't send input buffer in the request.
It's very likely the input_buffer is uninitialized, and we shouldn't
use it. Log a warning for such case as well.

Bug: 16115675
Bug: 16117312
Change-Id: Ib299b45fbfe084059a9f546ded239c8094b039e2
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
0d3679e21146bfa497c38842c80ae1f9906a042a 03-Jul-2014 Andy Hung <hunga@google.com> Merge "Add and enable multichannel for audio resampler"
075abae2a954bf3edf18ad1705c2c0f188454ae0 10-Apr-2014 Andy Hung <hunga@google.com> Add and enable multichannel for audio resampler

Change-Id: I2b86fb73d70abc4c456f7567270a888086b301d4
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResampler.cpp
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerDyn.h
udioflinger/tests/resampler_tests.cpp
68ffa200de7c4662c088851a328923be715c6c24 10-Apr-2014 Andy Hung <hunga@google.com> Add multichannel to audio resample processing

Change-Id: If6bfbf74000520713f9ba19488a475fc2eefc271
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResamplerFirProcess.h
72d039f007722c92ee5ea7ffd03ece19d2781103 09-Jul-2014 Terry Heo <terryheo@google.com> Merge "audio policy: add new input audio device"
0832b2d7d190f4fbe6f134446b2610df0cccdbbb 07-Jul-2014 Eric Laurent <elaurent@google.com> sound trigger: update HAL

New start_recognition() prototype with recognition
configuration structure.
New recognition event format.

Bug: 12378680.
Change-Id: I57b430eb076e6baa58118a0ed45ce4afaacb998c
oundtrigger/SoundTriggerHwService.cpp
3d638b30dcc67ef9eaa389160ef285cda055ed64 08-Jul-2014 Andy Hung <hunga@google.com> Merge "Replace int bitDepth with audio_format_t in Resampler"
0ea8fa4ccbf9b2b179370b983f3887d3daf2381f 08-Jul-2014 Zhijun He <zhijunhe@google.com> Camera3: Add capture intent for ZSL capture

Also fix the warning condition in input buffer return path.

Change-Id: I90e9edc1db9f1de87bc8936000b00c3306160c71
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/device3/Camera3Device.cpp
3348e36c51e91e78020bcc6578eda83d97c31bec 07-Jul-2014 Andy Hung <hunga@google.com> Replace int bitDepth with audio_format_t in Resampler

Remove mBitDepth from class (not used).
Replace with audio_format_t in factory method to distinguish
between float and pcm 16-bit.

Change-Id: I166860796c68285077ef4458d8758d19b82523f9
udioflinger/AudioMixer.cpp
udioflinger/AudioResampler.cpp
udioflinger/AudioResampler.h
udioflinger/AudioResamplerCubic.h
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerDyn.h
udioflinger/AudioResamplerSinc.cpp
udioflinger/AudioResamplerSinc.h
udioflinger/Tracks.cpp
udioflinger/test-resample.cpp
udioflinger/tests/resampler_tests.cpp
7999a2236cb641dc1d7bf7bd8d2499d40d0a806d 27-Jun-2014 Terry Heo <terryheo@google.com> audio policy: add new input audio device

Add entry for AUDIO_DEVICE_IN_LOOPBACK to string to enum table.

Bug: 15437484
Change-Id: I552df0969c745bdf66ff9e5d7bd864ef9e3f438d
udiopolicy/AudioPolicyManager.cpp
3c643073650f469574498c68a6c30e5098350c33 03-Jul-2014 Jungshik Jang <jayjang@google.com> Merge "Add force usage and category for System Audio Control."
6a3eb6a1b1bf59ebc8c7aba8a0a3542d60d2fcfa 03-Jul-2014 Andy Hung <hunga@google.com> Merge "Add multichannel to audio resample processing"
5c68f959eaa2e02fed5643c78e281fff42bcc0a2 07-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "IAudioFlinger::openRecord now suggests notificationFrames"
7df8c0b799d8f52d6386e03313286dbd7d5cdc7c 03-Jul-2014 Glenn Kasten <gkasten@google.com> IAudioFlinger::openRecord now suggests notificationFrames

Change-Id: I08885cc381d03c522a23289e74f0e1ed46563863
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
udioflinger/Threads.h
665470b36f202bcc8ee2f7417f68fd2608dd07c1 04-Jul-2014 Eric Laurent <elaurent@google.com> audio: deprecate audio_stream_frame_size()

Bug: 15000850.
Change-Id: I955a6efa620b8f70fa5193c7853cbe88e879c9c3
udioflinger/Threads.cpp
8382a0da75fd65ceaf4c27b3ec4dedc8721b1b78 03-Jul-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: fix ZSL processor3 issues"
f0d962a6737eb8eec002d6804d9ffbe7bee672a0 30-Jun-2014 Zhijun He <zhijunhe@google.com> Camera3: fix ZSL processor3 issues

- Return input buffer in capture result. Per hal3.2 spec, we should return the
input buffer in process capture result rather than immediately after process
capture request.
- Make the depths of mZslQueue and mFrameList the same. It doesn't make sense
mFrameList depth is larger than mZslQueue depth.
- Set the depths of mZslQueue and mFrameList based on pipelineMaxDepth.
- Clear result queue while clearing zsl buffer queue.
- Hook up camera3 buffer listener with ZslProcessor3, make sure that adding the
same listener multiple times has no effect.
- Remove flush call in pushToReprocess, it is a guaranteed deadlock once
camera3 buffer listener is hooked up.

Change-Id: I285155ab4241e827145855d628f8e98b881c01d5
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
amera/libcameraservice/device3/Camera3Stream.cpp
amera/libcameraservice/device3/Camera3Stream.h
amera/libcameraservice/device3/Camera3ZslStream.cpp
5ba4440c11eb975ec0e104e0af1981838f42f57c 04-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Remove obsolete IAudioFlinger::channelCount()"
839e4f33906b650140b578d42d6a51300f26703c 26-Jun-2014 Jungshik Jang <jayjang@google.com> Add force usage and category for System Audio Control.

System Audio Control in HDMI-CEC delegate audio control
to audio receiver. When system audio control is selected
in audio settings as audio output it should select one of ARC, SPDIF,
and LINE as audio output.
Whenever user select System Audio as audio output, audio
setting should call
setForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM_AUDIO, AUDIO_POLICY_FORCE_XXX);
and if other output is selected it should call
setForceUse(AUDIO_POLICY_FORCE_FOR_SYSTEM_AUDIO, AUDIO_POLICY_FORCE_NONE);

Change-Id: I1c237ee9291a4e0acf01a86aff3176edce5c14e0
udiopolicy/AudioPolicyManager.cpp
b647abc0959b07c7568d9eeaf6b177aac3b20b60 01-Jul-2014 Eric Laurent <elaurent@google.com> Merge "frameworks: av: services: audiopolicy: Added AudioPolicyEffects"
ba2b43990a7b4f0f2c425cf6cdfc63376a45772c 11-Jun-2014 bryant_liu <bryant_liu@htc.com> frameworks: av: services: audiopolicy: Added AudioPolicyEffects

Manage pre- and postprocessing effects defined in audio_effects.conf

Change-Id: Idea1478e3d434f8ff66907adb3c77663db78d583
udiopolicy/Android.mk
udiopolicy/AudioPolicyEffects.cpp
udiopolicy/AudioPolicyEffects.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
296b741e8eb38e749e3202182f703a2e30ee5f1f 18-Jun-2014 Andy Hung <hunga@google.com> Add new AudioMixer processing hooks

This change adds new process and thread hooks for
multi-format handling.
It is enabled by setting kUseNewMixer = true.

Change-Id: I262a3d2e4411f8cef7370a497b77a34eb55f1f86
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/AudioMixerOps.h
954d248e02e19f8ecd165804b7d063d346154f4c 20-Jun-2014 Gaurav Batra <gbatra@nvidia.com> Camera API1/2: don't register the same listener multiple times

FrameProcessorBase allows register the same metadata result listener multiple
times with the same range IDs, which causes the same metadata result is
delivered multiple times for the same listener. This is problematic as client
like ZslProcessor's updateStream is called multiple times between captures, and
each updateStream calls registerListener unconditionally. The the ZSL metadata
result queue will be flooded with same metadata result multiple times and the
number of same result will keep growing until the queue is full.

Change-Id: I2ff7808e5dce61068a7111e7fbbce2aba95198cd
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/common/FrameProcessorBase.h
f92f22becdf7fce1f55d5ebd80ac2caa2ad55602 30-Jun-2014 Andy Hung <hunga@google.com> Merge "Add enabling variable for extended precision audio"
0b5003b7d80f70af20f387b1d0d990972a5570da 28-Jun-2014 Zhijun He <zhijunhe@google.com> Merge "Camera1: Don't send partial results to ZSL clients"
25a0aef19e170d2695f64b4c48296e7914155a88 25-Jun-2014 Zhijun He <zhijunhe@google.com> Camera1: Don't send partial results to ZSL clients

ZSL clients expect each received result as a complete result, and send back to
HAL as a reprocess capture request. CaptureSequencer client assumes results to
be non-partial too, it need look into some metadata that may not be present in
partial results.

Change-Id: Id716913fd6e1c914726abd6610fddf91141783c2
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/Camera2Client.h
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/common/FrameProcessorBase.h
7b428d51a711b493090a2be4d27699215761a64e 27-Jun-2014 Paul McLean <pmclean@google.com> Merge "Enabling USB Device and Android Device Vol inc/dec functionality for USB Audio Output"
b919dd3334fed73e16ebac7b7e10cf2add34c338 26-Jun-2014 Paul McLean <pmclean@google.com> Enabling USB Device and Android Device Vol inc/dec functionality for USB Audio Output

Bug: 13747844
Change-Id: Ied5bb44f63a4e7183c52f8111e9a389b60ffe75f
udiopolicy/AudioPolicyManager.cpp
6146c08f0c3dd8b9e5788063aa433f304a810602 18-Mar-2014 Andy Hung <hunga@google.com> Add enabling variable for extended precision audio

Set AudioFlinger::kEnableExtendedPrecision = true to enable
extended precision. Enabling will be required for devices (such as
USB) which report 24 bit or 32 bit sink formats.

Change-Id: I0dc1d7a4f7607086d7b536ea0e43aef0e696f2ee
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
ff17990df24913df9267c9c8b938178716298114 25-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "cameraservice: Deprecate triggerId tags"
1760291cf87005f18605a32a35aed9cae09988f7 25-Jun-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: fix several issues on routing APIs."
84c70244bfea51b3413a8d8ffbf74ca737436251 23-Jun-2014 Eric Laurent <elaurent@google.com> audio policy: fix several issues on routing APIs.

- Do not list duplicated outputs in listAudioPorts(): duplicated
outputs are not valid sources for audio patches.
Also add asserts to make sure that an audio port with no valid profile
is never used by audio routing APIs.
- Fix typos causing the wrong device type to be used
when creating an audio patch.
- Fix error in building config mask in toAudioPortConfig().

Change-Id: I4505891dbed2c2fa92804d45505c3c2deb921f3e
udiopolicy/AudioPolicyManager.cpp
741ace8776f052245e33a47a0b99400f75996f45 23-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> cameraservice: Deprecate triggerId tags

The following two tags are deprecated from HAL 3.2:
ANDROID_CONTROL_AF_TRIGGER_ID
ANDROID_CONTROL_AE_PRECAPTURE_ID

Trigger IDs are now internal to camera service.

Change-Id: Iaebd62ecb0905a811fa37fe7850e0221c38a0006
amera/libcameraservice/api1/client2/FrameProcessor.cpp
amera/libcameraservice/api1/client2/FrameProcessor.h
amera/libcameraservice/device3/Camera3Device.cpp
0e88703fce53453382b33a6462f21e67019ae3fa 25-Jun-2014 Glenn Kasten <gkasten@google.com> Merge "Use sp<> instead of raw pointer for FastMixer"
4d23ca370dd0ce584f49a80ef9dfcdbb75ba2c8e 13-May-2014 Glenn Kasten <gkasten@google.com> Use sp<> instead of raw pointer for FastMixer

This avoids worry about the thread lifetime during tear-down.

Bug: 15858655
Change-Id: I896d24317bd6f53a574645cdf4cd514eaa205dd5
udioflinger/Threads.cpp
udioflinger/Threads.h
d5d08c57fab3b8ccbdb5df206b579e51308dd3e7 24-Jun-2014 Zhijun He <zhijunhe@google.com> Merge "Camera: Clear ZSL buffer queue when jpeg size is changed"
e2d83756cb088db15fda73616ca097b8d190e1a1 23-Jun-2014 Zhijun He <zhijunhe@google.com> Camera: Clear ZSL buffer queue when jpeg size is changed

Bug: 15284653
Change-Id: I4778e8443945d918801102ba600874568bde12dc
amera/libcameraservice/api1/Camera2Client.cpp
eaf07697a9146d27ca863db5c43da64af4f8c94a 23-Jun-2014 Andy Hung <hunga@google.com> Merge "Add test-mixer AudioMixer test program"
e4fc42359cdd9786e521054a3a0491d6bc3a9e1c 18-Jun-2014 Andy Hung <hunga@google.com> Add test-mixer AudioMixer test program

The shell script mixer_to_wav_tests.sh shows how to use
test-mixer.

Change-Id: Ia7f1a368972c9c33fadc96df4cb1fc8b22446c8c
udioflinger/tests/Android.mk
udioflinger/tests/mixer_to_wav_tests.sh
udioflinger/tests/test-mixer.cpp
cd8fce8fbe0f515e53a0ea0f50b739cf42ee57a4 18-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: get stream configs by device verison

Starting from device version 3.2, the following tags:
ANDROID_SCALER_AVAILABLE_FORMATS
ANDROID_SCALER_AVAILABLE_JPEG_MIN_DURATIONS
ANDROID_SCALER_AVAILABLE_JPEG_SIZES
ANDROID_SCALER_AVAILABLE_PROCESSED_MIN_DURATIONS
ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES
ANDROID_SCALER_AVAILABLE_RAW_MIN_DURATIONS
ANDROID_SCALER_AVAILABLE_RAW_SIZES

are deprecated and replaced by:
ANDROID_SCALER_AVAILABLE_STREAM_CONFIGURATIONS

Change-Id: Iadc34af0ea985a16a25759d7a9a3eb4845c486fd
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/Camera2Client.h
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
amera/libcameraservice/common/Camera2ClientBase.cpp
amera/libcameraservice/common/Camera2ClientBase.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
fc2aa4c228aa3f2d85fe15faa959dbacc85b731a 20-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> Merge "Camera2: Fix lastFrameNumber counter in flush case"
8684b7f7977f535260367040931c1fd994cca3b4 13-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: Fix lastFrameNumber counter in flush case

Decrement the counter for those repeating requests never
sent to device.

Change-Id: I2064e51cb5d509d86dbde4a89e8157de33f574b0
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
fcd58351b6d7fcd62a0fe65b425723dd53d10e5e 20-Jun-2014 Zhijun He <zhijunhe@google.com> Merge "Camera2/3: Don't release recording buffer when stream is active"
50468413251bd92a1cdf9de8275a994dab8648d1 19-Jun-2014 Mark Salyzyn <salyzyn@google.com> libcameraservice: 64-bit compile warnings

Change-Id: I168332a0d4699f6f5597d4883342aa7af7ed92c6
amera/libcameraservice/api2/CameraDeviceClient.cpp
beb9e30471701d7b76bc14fd0d5dd1de95edd680 19-Jun-2014 Mark Salyzyn <salyzyn@google.com> audiopolicy: 64-bit compile warnings

Change-Id: I71db11499c4b0c434df8144c633d42282f5823c2
udiopolicy/AudioPolicyManager.cpp
7e4082ff105f5b2d8fe889b04703f9b828304fbd 20-Jun-2014 Igor Murashkin <iam@google.com> Merge "camera: Let #connectLegacy calls through with unspecified HAL version"
3d07d1ad0e60fd2b9a25563a0c24faf7f1fb1afc 20-Jun-2014 Igor Murashkin <iam@google.com> camera: Let #connectLegacy calls through with unspecified HAL version

This enables the camera2 shim to open a camera1 device without
turning the error codes into a RuntimeException.

Change-Id: I08d9d1e30e72025c41bd54b702d7ae95b32257be
amera/libcameraservice/CameraService.cpp
9b3cd171710991625a94dea645248f708cb957fb 20-Jun-2014 Andy Hung <hunga@google.com> Merge "Extract out test utility functions from resampler_tests"
b10cdadf0fb945e23ca77008d4af76584bd0e39a 17-Jun-2014 Zhijun He <zhijunhe@google.com> cameraservice: Implement HAL1 and higher HAL API coexistence

A higher hal version device like HAL3.2 can be opened as HAL1.0 device
if HAL supports it. This only applies to camera API1.

Change-Id: I4ae9f59f4317158cc1bd7ed7726e4032cdd1fa07
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
amera/libcameraservice/api1/CameraClient.cpp
amera/libcameraservice/device1/CameraHardwareInterface.h
ab5cdbaf65ca509681d2726aacdf3ac8bfb6b3fa 10-Jun-2014 Eric Laurent <elaurent@google.com> AudioTrack: add support for compressed audio

Add support for compressed audio playback by use
of an AudioTrack attached to a direct output thread.

Bug: 9428304.

Change-Id: I4a61be9cf0e31003ca85935d6e0ee38ca8192e03
udioflinger/PlaybackTracks.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
udiopolicy/AudioPolicyManager.cpp
c0e5ec8e2d8db15b97094374d0a248e041304b62 17-Jun-2014 Andy Hung <hunga@google.com> Extract out test utility functions from resampler_tests

These will be used for mixer tests later.

Change-Id: I22b1c89857058cfb2450afe15e80d6c9306a31f1
udioflinger/tests/Android.mk
udioflinger/tests/resampler_tests.cpp
udioflinger/tests/test_utils.h
60800208d31bc5a0770c3acb4f7df53c6bb1ac39 18-Jun-2014 Zhijun He <zhijunhe@google.com> Camera2/3: Don't release recording buffer when stream is active

It is dangerous to release all recording buffers when recording stream is
actively sending buffer to encoder. This change only releases all buffers when
recording stream is idle and recording stream is about to start.

Bug: 15667833
Change-Id: Ia4a84cac84a2062c13333467c66698273ffb0e23
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
29a8b2fe294a34ac7f004203426961a599e725ea 19-Jun-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge changes I0fef0584,I322b91fa

* changes:
AudioPolicyManager: return output for audio attributes
AudioTrack construction with audio attributes
5bd3f38638acab633d181359cc9ec27b80f84d43 14-Jun-2014 Jean-Michel Trivi <jmtrivi@google.com> AudioPolicyManager: return output for audio attributes

In AudioPolicyManager, support querying an output
or playback strategy for audio attributes,
instead of a stream type,
In AudioTrack creation, use the output returned
for the track's attributes.

Change-Id: I0fef05845ba676404775e2e338c10e6a96237268
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.h
07b56676694b01825df2375e4c2ead4e55fe2d98 18-Jun-2014 Igor Murashkin <iam@google.com> Merge "camera: Add #getLegacyParameters, #supportsCameraApi to ICameraService"
65d14b9825311f9d1847cf282bd0419e71bac666 17-Jun-2014 Igor Murashkin <iam@google.com> camera: Add #getLegacyParameters, #supportsCameraApi to ICameraService

Change-Id: Ic86c8df3d703e7cf89caa856387e2c0a1b977401
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
63d877fe4138a95c27f1020b34e81bfa0430d2b8 17-Jun-2014 Eino-Ville Talvala <etalvala@google.com> CameraService: Fix permissions check issues

Bug: 15677063
Change-Id: I012c111fff90fefd9eb0fef7c9d6034f00c9c6df
amera/libcameraservice/CameraService.cpp
5094675aa55458414e8b00a86a104a32ea1d55c0 16-Jun-2014 Glenn Kasten <gkasten@google.com> am a3603693: Merge "Fix deadlock" into lmp-preview-dev

* commit 'a3603693fb784d7e1a820ee4629a69730a0bb424':
Fix deadlock
a3603693fb784d7e1a820ee4629a69730a0bb424 16-Jun-2014 Glenn Kasten <gkasten@google.com> Merge "Fix deadlock" into lmp-preview-dev
3d61bc1ffc8afc8d7be3b0d4205c9b5ba6daf2e8 16-Jun-2014 Glenn Kasten <gkasten@google.com> Fix deadlock

Bug: 15591052
Change-Id: I76154e1640646d2ae8fae65e163e1f3ed1be17dc
udioflinger/Threads.cpp
1555a9882179a26ce116dffc920ab0be338db4b8 16-Jun-2014 Ruben Brunk <rubenbrunk@google.com> Merge "camera2: Add jpeg sizes to legacy mode static characteristics."
3bcffa136909c1fb6e88ee4efd12ccac18360a85 13-Jun-2014 Eric Laurent <elaurent@google.com> force command flush after releasing a reference to shared memory

After releasing a reference to a shared memory interface,
IPCThreadState::self()->flushCommands() must be called to ensure
that the corresponding reference is also cleared immediately in the
remote process. Otherwise the binder implementaiton will not
push the clear systematically causing the memory region not to be freed.

See issues 10711502 and 2801375.

Bug: 14057166.
Change-Id: If55f36f00d452d6cf00cf83bd2fba1c8f3abcb57
udioflinger/Tracks.cpp
152dbcf2e0d8a46691e22b102972540640f054ec 13-Jun-2014 Ruben Brunk <rubenbrunk@google.com> camera2: Add jpeg sizes to legacy mode static characteristics.

Bug: 15116722

- Adds jpeg size mapping to available output formats.

Change-Id: I73e46dd4309767ba41156d9ba03c4724bf234758
amera/libcameraservice/CameraService.cpp
20d16a8af2dc95e827be693edabde4f09eb90c32 13-Jun-2014 Eric Laurent <elaurent@google.com> am 3bcffa13: force command flush after releasing a reference to shared memory

* commit '3bcffa136909c1fb6e88ee4efd12ccac18360a85':
force command flush after releasing a reference to shared memory
b6be7f22a82ee3bad8bcc709d21e72fc4727da09 12-Jun-2014 Bryant Liu <bryant_liu@htc.com> frameworks: av: fix bug in the volume management

which can cause volume levels to be applied twice. After applying volume
in the effect chain, the remaining volume needs to be converted back to
floating point before providing to mAudioMixer.

Bug: 15583440
Change-Id: I3c884f95b0fa9ad1b554285b069601c850c54776
Signed-off-by: Glenn Kasten <gkasten@google.com>
udioflinger/Threads.cpp
14c403fbab456a4a63586a767fbae498f5f8c260 12-Jun-2014 Glenn Kasten <gkasten@google.com> am 0ac53364: Merge "Fix non-monotonic AudioTrack::getTimestamp after pause" into lmp-preview-dev

* commit '0ac53364b79dc72ee0c09f0efc46a22ab4374dbf':
Fix non-monotonic AudioTrack::getTimestamp after pause
2c79bf19fc6622e757794eb835798d7ce00eac2e 11-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> am 3416f9ac: Merge "Camera2: Add null check to createStream" into lmp-preview-dev

* commit '3416f9ac471f97e9544ee821a97a101cbdd25b11':
Camera2: Add null check to createStream
0ac53364b79dc72ee0c09f0efc46a22ab4374dbf 11-Jun-2014 Glenn Kasten <gkasten@google.com> Merge "Fix non-monotonic AudioTrack::getTimestamp after pause" into lmp-preview-dev
ced6e74215937182fe2f9f6b0867f7c28ccd02c1 10-Jun-2014 Glenn Kasten <gkasten@google.com> Fix non-monotonic AudioTrack::getTimestamp after pause

Bug: 15523502
Change-Id: Ifd4aa7fca197bc041c1620fc3f7d953a8902551a
udioflinger/PlaybackTracks.h
udioflinger/Tracks.cpp
89f14dacfadea1b14149510d4dfbc75dc79b23bb 11-Jun-2014 Yin-Chia Yeh <yinchiayeh@google.com> Camera2: Add null check to createStream

Prevent a native null dereference crash.

bug: 15332257
Change-Id: I10c4053a0b4f07fbf52c37dd2f2853b501def669
amera/libcameraservice/api2/CameraDeviceClient.cpp
421c34ef58f89f4cc39737118bb58b762e84e1c9 11-Jun-2014 Andy Hung <hunga@google.com> Merge "Update resampler to fetch exactly the frames needed" into lmp-preview-dev
54188de28dc7766ba578a7ce01c61151c6febdc0 03-Jun-2014 Andy Hung <hunga@google.com> Update resampler to fetch exactly the frames needed

This avoids unnecessary overfetching/releasing, which
could cause problems with the upstream AudioBufferProvider.
A one input sample delay is placed on the stream compared
with the previous implementation.

This change only affects the Dynamic resampler.

Bug: 15548547
Change-Id: Ic7fcff130e0081b4724cfb5a00dc8e8b4a8b1af3
(cherry picked from commit 717007429a50c02d2acc704a8c1ebbe6760a2c22)
udioflinger/AudioResamplerDyn.cpp
42092d7015b078a09c36de107d924fc8139ccf50 11-Jun-2014 Ruben Brunk <rubenbrunk@google.com> Merge "DO NOT MERGE: camera2: Disallow connectDevice for all old HALs." into lmp-preview-dev
9bbfb139ff95752b22ca0f73521f97c6262787d7 12-Jun-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: Separate the video and preview size filtering"
eb4b03cb98e38bf76ee6e6debb74e76c30cbc228 11-Jun-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: use factory to create audio policy manager"
8129e799f2774235c8cce3bf25fd98ef4ca2471b 10-Jun-2014 Ruben Brunk <rubenbrunk@google.com> DO NOT MERGE: camera2: Disallow connectDevice for all old HALs.

(preview only)

Bug: 15515564

Change-Id: I14ab73b130ee5355d9cc8b3602738022a5a18710
amera/libcameraservice/CameraService.cpp
f269b8e0e9ab950fc6652b9594b7a3431c81630c 10-Jun-2014 Eric Laurent <elaurent@google.com> audio policy: use factory to create audio policy manager

Use the class factory to create the audio policy mamager
instead of AudioPolicyManager class constructor and
use a pointer to an AudioPolicyInterface.

Change-Id: Ibb5a8eee5d597db67cf13f279c909181cfee9949
udiopolicy/Android.mk
udiopolicy/AudioPolicyFactory.cpp
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
0cbfbf3624c67cf40a18d5405a46d002aa12a048 28-May-2014 Zhijun He <zhijunhe@google.com> Camera3: Separate the video and preview size filtering

Supported video sizes were generated from supported preview sizes, which
effectively filtered out sizes larger than 1080p. This change filters the
supported video sizes based on the media profiles supported h.264 max video
frame width and height.

Bug: 15287656

Change-Id: Ifbd9d37fb775371e2a4ee5cf80abbf83a75ffd65
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
6d1c8480c61c168e798876c0a3ef44ae17eb7630 10-Jun-2014 Eric Laurent <elaurent@google.com> Merge "sound trigger: stop recognition on sound model unload"
d8754e07e23eecb68068c0c392aeb0428c529e4e 10-Jun-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - AudioFlinger: increase per client memory pool

Temporary workaround for issue 14057166 allowing
AudioTracks from a given client to use up to 4MB
of shared memory.

Bug: 14057166.
Change-Id: I19adb8d424ed170df61c1cd706be3d10788edfc1
udioflinger/AudioFlinger.cpp
1a1cba8f9a93db188b09d9754987354029129113 10-Jun-2014 Eric Laurent <elaurent@google.com> sound trigger: stop recognition on sound model unload

Force a stop recognition command to the HAL when
unloading a sound model and recognition is still active.

Change-Id: I7379a64a37bbc3eeea08e0e1d59e427de9544a10
oundtrigger/SoundTriggerHwService.cpp
51fabcd581f293db52997b0d43b2ef606d5759ff 09-Jun-2014 Andy Hung <hunga@google.com> Merge "Add tests directory for AudioFlinger"
59a8923027d2d6a155c0fa434ae65559318da4b6 08-Jun-2014 Eric Laurent <elaurent@google.com> audio policy service: fix potential deadlock in destructor

In the AudioCommandThread loop, release mLock before releasing
the strong reference on the service as AudioPolicyService destructor
calls AudioCommandThread::exit() which acquires mLock.

Also check exiPending in thread loop before processing pending
commands or sleeping.

Bug: 15449050.

Change-Id: I148bf21bd67ef721b5b5ee2c1a6afb185c59daa3
udiopolicy/AudioPolicyService.cpp
7e45ef9db7446d33c941961c14555413641e444b 07-Jun-2014 Eric Laurent <elaurent@google.com> am 318cd78e: Merge "audio policy: added audio HAL version in audio_policy.conf" into lmp-preview-dev

* commit '318cd78e3b8503113919191b3711eb8be5d23d35':
audio policy: added audio HAL version in audio_policy.conf
eb108a4622825688b02d7afc981014d149913cd8 06-Jun-2014 Eric Laurent <elaurent@google.com> audio policy: added audio HAL version in audio_policy.conf

Each hardware module section in audio_policy.conf indicates
the audio HAL version it implements.

Also added a template audio_policy.conf file with examples
of device and gain descriptors added for audio HAL version3.0.

Bug: 14815883.
Change-Id: Id219d121f81f687363f6c18f2d1684b2448dcdf4
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/audio_policy.conf
udiopolicy/audio_policy_conf.h
6f264ac08317a27958f2b0d3c35133b368dd9f3c 06-Jun-2014 Jean-Michel Trivi <jmtrivi@google.com> Merge "Audio policy: new media volume curve for speaker with DRC"
32ff60c6ec297256b59b6ce4f3cb341a0f4638dd 06-Jun-2014 Eric Laurent <elaurent@google.com> am 45df31f5: Merge "AudioFlinger: fix PatchPanel debug log." into lmp-preview-dev

* commit '45df31f511ba9ae9b45c769fc546eca4bcf4bbdb':
AudioFlinger: fix PatchPanel debug log.
ccd8e4a9da4d0bcc2c715452c5a18fabb23f86ac 06-Jun-2014 Jean-Michel Trivi <jmtrivi@google.com> Audio policy: new media volume curve for speaker with DRC

For devices with DRC on speaker (using the flag "speaker_drc_enabled"
in audio_policy.conf), set the speaker media volume to use a
new curve with more aggressive attenuation in the upper range.

Bug 15318604

Change-Id: Ia5fb9fdd608fddad22fadfb1065d35574030bb52
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
45df31f511ba9ae9b45c769fc546eca4bcf4bbdb 05-Jun-2014 Eric Laurent <elaurent@google.com> Merge "AudioFlinger: fix PatchPanel debug log." into lmp-preview-dev
4fa0bb24d51a8af69db9796f909fee6b61428cf4 05-Jun-2014 Eric Laurent <elaurent@google.com> Merge "add sound trigger native service"
c263ca0ad8b6bdf5b0693996bc5f2f5916e0cd49 05-Jun-2014 Glenn Kasten <gkasten@google.com> Squashed commit of the following:

commit 9128d6ffec43731d723f9b394f243d940f4c7e41
Author: Glenn Kasten <gkasten@google.com>
Date: Tue May 13 10:38:42 2014 -0700

Use of fast capture by normal capture

Will only configure fast capture path if the input buffer size is less than
10 ms and the input sample rate is same as the primary output sample rate.

Change-Id: I4a7cdc6069d750845412c626d27e83f72a1ab397

commit 2e5e0806a5abe7499848358ef5fde5c26405000d
Author: Glenn Kasten <gkasten@google.com>
Date: Mon Jun 2 08:29:22 2014 -0700

Add mPrimaryOutputSampleRate

Change-Id: I46b527fc3f2b5a5720a74b4f0b9a8f2e0d570b09

commit baf1d73467923996d1b1f2a9237260cc5697e050
Author: Andy Hung <hunga@google.com>
Date: Fri May 30 10:42:03 2014 -0700

Change parameter type for volume to float in AudioMixer

Change-Id: I4da1505ce852505f86f8e5b87f60e8edceeb30e0

commit 40fe20fa9760cd03c69778c2021cf7a490d75ece
Author: Andy Hung <hunga@google.com>
Date: Fri May 30 10:35:47 2014 -0700

Rename UNITY_GAIN to UNITY_GAIN_INT in AudioMixer

Change-Id: Ic040311305026f0b4c4280a5b3bef7a447ac1da3

commit 37c9a2b49f876abc5ff537a9ec036d7f0a423775
Author: Andy Hung <hunga@google.com>
Date: Thu May 29 21:33:13 2014 -0700

Refactor setVolumeRampVariables in AudioMixer

Change-Id: I8fcf3101bcea292de7c65433fa578f1c9cdd0974

commit 397070eca31f121d5d3993de1bfea99aaea5d4f3
Author: Andy Hung <hunga@google.com>
Date: Thu May 29 18:52:38 2014 -0700

Fix floating point output from mixer

A buffer pointer was being erroneously reset to buffer start,
potentially causing an audio glitch. The floating point
output mode is not enabled at this time, but will be in
the future.

Change-Id: If8b6414d232f064f3a2e2c5a6da889a91b27fb24

commit 2e61aa5b33b2247bbc5d4eaa0b519df9accd4bbc
Author: Andy Hung <hunga@google.com>
Date: Fri May 23 21:22:17 2014 -0700

Add multiple format capability to FastMixer

Floating point data from MixerThread into FastMixer.
Multiple output format capability from FastMixer to Sink.

Change-Id: I0da17810ee71381a39a006c46faec71108d22c26

commit b9ea653c702a785bbd23a66c5e588d40b4192c4e
Author: Andy Hung <hunga@google.com>
Date: Thu May 29 15:53:09 2014 -0700

Avoid resetting BufferProviders in mixer unnecessarily

Change-Id: Iad85c4dfd21be1dbf89dc11906106b34219376f8

commit 7f1a6d6da21c616f80cf9ba21bea11b419ec561b
Author: Andy Hung <hunga@google.com>
Date: Tue May 27 12:32:17 2014 -0700

Update dynamic resampler buffer fetching

Make the criteria tight for fetching to avoid storing
excessive frame data internal to the resampler.
This should reduce jitter in frame delivery computation.

Bug: 14962343
Change-Id: I7adaf714d11c272696ccdbf218bda994c7217477

commit b5e4aac07b9a02f0c803c090058602b03ac09ebb
Author: Glenn Kasten <gkasten@google.com>
Date: Tue May 27 12:30:54 2014 -0700

Allow kFastTrackMultiplier to be specified per device

Change-Id: I4eaaaf038df720cec4f5d9221d1b632970f9e3dd

commit b93cd97a52af31122df2da2cc0415cda888c8c73
Author: Andy Hung <hunga@google.com>
Date: Fri May 23 21:13:31 2014 -0700

Rename mixBuffer to mMixerBuffer in FastMixer

Likewise mixBufferState becomes mMixerBufferState.
This harmonizes with the naming in AF::MixerThread.

Change-Id: I1255d7c07cc2c6ee925d7430925236d2bd163122

commit 8340758622b9711365a8801806cbdf934803c63f
Author: Andy Hung <hunga@google.com>
Date: Mon May 12 16:51:41 2014 -0700

Add multiple format capability to AudioMixer

Change-Id: I04ac1cafd90b6ed652f8d51888ad07576678f0bc
Signed-off-by: Andy Hung <hunga@google.com>

commit 6b695b9d094820c232a897a3fabbe83d2b7193fe
Author: Glenn Kasten <gkasten@google.com>
Date: Thu Mar 13 14:59:31 2014 -0700

Start adding FastCapture based on FastThread WIP

This version supports at most one fast capture client.

Change-Id: Idf609bfc80ae22433433d66a5232c043c65506df

commit e951ad05a2c388471d7e2806d91e7d51325a150a
Author: Glenn Kasten <gkasten@google.com>
Date: Mon May 12 11:06:26 2014 -0700

Move validation of frameCount from set to openRecord_l

This move is needed because frameCount is validated on server side for
fast tracks (as should be done for normal tracks too).

Change-Id: I6d99e80869fd90fab373cf60ef348c01f075fbca

commit 73e76992dbba794894837c38e5472312ea829cf3
Author: Glenn Kasten <gkasten@google.com>
Date: Tue May 13 10:41:52 2014 -0700

Allow track buffer "allocation" to be from pipe

Change-Id: Ib9ac170f8e8b7746b3588157a56cbee3b753a1cb

commit 60de1d7ded05c6304037d4858b401094b1d2b4d3
Author: Andy Hung <hunga@google.com>
Date: Fri May 9 15:02:21 2014 -0700

Add format parameter to getTrackName() and track_t

Change-Id: Ia152a839014e235fbfb656104c15d7c1b456d02e
Signed-off-by: Andy Hung <hunga@google.com>

Change-Id: Ied0ade8b25d23e89bb03319a7e3135c238f735b9
udioflinger/Android.mk
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/AudioResamplerDyn.cpp
udioflinger/FastCapture.cpp
udioflinger/FastCapture.h
udioflinger/FastCaptureState.cpp
udioflinger/FastCaptureState.h
udioflinger/FastMixer.cpp
udioflinger/FastMixer.h
udioflinger/FastMixerState.cpp
udioflinger/FastMixerState.h
udioflinger/StateQueueInstantiations.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
24478d47fc631ab33208f4dd9d034abb6839c992 05-Jun-2014 Eric Laurent <elaurent@google.com> AudioFlinger: fix PatchPanel debug log.

Bug: 14815883.
Change-Id: I71cf2ef74a96d3cdb27f2beb1b76b8979c738335
udioflinger/PatchPanel.cpp
f1caa55fbe2a32a27968d7be2f0cd134e412db4d 05-Jun-2014 Andy Hung <hunga@google.com> Merge "Update resampler to fetch exactly the frames needed"
e40ed90293eeb0feecb5b7729cf24f8ecea9b412 05-Jun-2014 Eric Laurent <elaurent@google.com> am 26594add: Merge "audio policy: new setAudioPortConfig implementation" into lmp-preview-dev

* commit '26594add1ec0b6255c96b39e43ccdc95b2c480aa':
audio policy: new setAudioPortConfig implementation
b7a11d83f749ad0200778c4815e907d011d4b5d3 19-Apr-2014 Eric Laurent <elaurent@google.com> add sound trigger native service

Change-Id: I0cd954c1c7d28a334e786d0004431d4f6a1227ec
oundtrigger/Android.mk
oundtrigger/SoundTriggerHwService.cpp
oundtrigger/SoundTriggerHwService.h
a408743e8a759b344ac95322ae336459a81edf24 04-Jun-2014 Eric Laurent <elaurent@google.com> am 4bd9d452: Merge "audio policy: removed raw pointers." into lmp-preview-dev

* commit '4bd9d45230cd69c0409591874db3e6f2e3a226b3':
audio policy: removed raw pointers.
aaaea95d23b78313b7ddf1f8f670c9b0110474ed 04-Jun-2014 Eric Laurent <elaurent@google.com> am 83438ce6: Merge "audio policy: add permission for routing APIs." into lmp-preview-dev

* commit '83438ce6cbbff49ca26d4bd694ffdad4842ded5a':
audio policy: add permission for routing APIs.
a121f90f388343dc48793cbc7eb899aba42e7664 03-Jun-2014 Eric Laurent <elaurent@google.com> audio policy: new setAudioPortConfig implementation

Rewrite setAudioPortConfig() to take advantage of the new
AudioPortConfig class.

The configuration is now checked against AudioPort capabilities
and stored in the AudioPortConfig.

Fix a bug where the config mask was not set properly when calling
setAudioPortConfig at the PatchPanel interface.

Remove debug log in IAudioPolicyService.

Bug: 14815883.
Change-Id: I7eb7683a96e049581c13f2a212486507883d008d
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
1f2f2230900581e5de9cf01a883e5d9338f0df94 02-Jun-2014 Eric Laurent <elaurent@google.com> audio policy: removed raw pointers.

Use only RefBase objects for the following classes:
- AudioOutputDescriptor
- AudioInputDescriptor
- HwModule
- EffectDescriptor

Create a common base class AudioPortConfig for:
AudioOutputDescriptor, AudioInputDescriptor and DeviceDescriptor

Bug: 14815883.

Change-Id: I1bd193ef1020780d8b94c13142029903615aba97
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
717007429a50c02d2acc704a8c1ebbe6760a2c22 03-Jun-2014 Andy Hung <hunga@google.com> Update resampler to fetch exactly the frames needed

This avoids unnecessary overfetching/releasing, which
could cause problems with the upstream AudioBufferProvider.
A one input sample delay is placed on the stream compared
with the previous implementation.

This change only affects the Dynamic resampler.

Change-Id: Ic7fcff130e0081b4724cfb5a00dc8e8b4a8b1af3
udioflinger/AudioResamplerDyn.cpp
8f415570afb174f0781d8bf6b1c0fa6bdecca7cd 03-Jun-2014 Andy Hung <hunga@google.com> Merge "Change parameter type for volume to float in AudioMixer"
93f87fe162f6c18a296451d388ea68e76fd67fb6 03-Jun-2014 Andy Hung <hunga@google.com> Merge "Rename UNITY_GAIN to UNITY_GAIN_INT in AudioMixer"
9dc6699fd613c29fe08ef7bc0d32052c8ce297c1 03-Jun-2014 Glenn Kasten <gkasten@google.com> Merge "Use of fast capture by normal capture"
740a5ca81f6498b34baea04bb0fb3fc29fe1e135 03-Jun-2014 Andy Hung <hunga@google.com> Merge "Refactor setVolumeRampVariables in AudioMixer"
6dbb5e3336cfff1ad51d429fcb847307c06efd61 13-May-2014 Glenn Kasten <gkasten@google.com> Use of fast capture by normal capture

Will only configure fast capture path if the input buffer size is less than
10 ms and the input sample rate is same as the primary output sample rate.

Change-Id: I4a7cdc6069d750845412c626d27e83f72a1ab397
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
4ea00a25cf85877b48ebd1e15a657cfaab29af58 02-Jun-2014 Glenn Kasten <gkasten@google.com> Add mPrimaryOutputSampleRate

Change-Id: I46b527fc3f2b5a5720a74b4f0b9a8f2e0d570b09
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
5284ed53c14cd4d15bd793000ede7166d143e69a 29-May-2014 Eric Laurent <elaurent@google.com> audio policy: add permission for routing APIs.

Add check for signature or system permission
"android.permission.MODIFY_AUDIO_ROUTING" for routing
APIs.

Bug: 14815883.
Change-Id: Iefa0b9d90127a53e03a2e6d50dc93d8f4ae63e2f
udioflinger/ServiceUtilities.cpp
udioflinger/ServiceUtilities.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
43466a133984182b250453cea244eb146e83c010 02-Jun-2014 Eric Laurent <elaurent@google.com> am 62aaabb3: audio policy: fix unitialized hw module in audio port

* commit '62aaabb3905c61bb7acd6037414c206240a31c32':
audio policy: fix unitialized hw module in audio port
62aaabb3905c61bb7acd6037414c206240a31c32 02-Jun-2014 Eric Laurent <elaurent@google.com> audio policy: fix unitialized hw module in audio port

The hw module handle was not initialized when creating
and audio port configuration from an input stream descriptor.

Bug 15376641.

Change-Id: I6c784cded68a5c665fd22c3643765c63f70eb241
udioflinger/PatchPanel.cpp
udiopolicy/AudioPolicyManager.cpp
d28148537693b19320f3c3b5b34816d45542e9bd 02-Jun-2014 Andy Hung <hunga@google.com> Merge "Fix floating point output from mixer"
f947dbce4390f2c3c460325d37002a34f09c0b74 01-Jun-2014 Glenn Kasten <gkasten@google.com> Remove obsolete IAudioFlinger::channelCount()

Change-Id: Ie623edae2e795f9155f1f452fe4e6c7217a4a4c8
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.h
e28456465fca86ed1b8b2225de073cfba64c7c42 01-Jun-2014 Glenn Kasten <gkasten@google.com> Merge "Start adding FastCapture based on FastThread WIP"
481c8837c7f67852e06137d636915ea6e96247e3 31-May-2014 Eric Laurent <elaurent@google.com> am e1715a46: audio policy: add audio port gain control

* commit 'e1715a465a29db625da9d0ea365edf371e39e201':
audio policy: add audio port gain control
68f5fb51f6ef2f54a0955bac98c16c2aa811f809 31-May-2014 Eric Laurent <elaurent@google.com> am 1afeecb8: audio policy: parse device descriptors in config file

* commit '1afeecb88bea660b2c10b2096be0fd02433303ce':
audio policy: parse device descriptors in config file
72aa32f7dbbfb658097930b57659d8e50f24a953 31-May-2014 Eric Laurent <elaurent@google.com> resolved conflicts for merge of b52c152d to master

Change-Id: I34869bda071d511c9595ea0a5ff6571eb34da059
e1715a465a29db625da9d0ea365edf371e39e201 20-May-2014 Eric Laurent <elaurent@google.com> audio policy: add audio port gain control

Implement setAudioPortConfig() API to configure an
audio port.
Currently limited to gain control.

Bug: 14815883.

Change-Id: Ic1b268e5ba5c277e9f5b8fa63c81dd7c0b250024
udioflinger/PatchPanel.cpp
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
6be494077f8d7970f3a88129c5d139c5a0c88f6d 30-May-2014 Andy Hung <hunga@google.com> Change parameter type for volume to float in AudioMixer

Change-Id: I4da1505ce852505f86f8e5b87f60e8edceeb30e0
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/FastMixer.cpp
udioflinger/Threads.cpp
97ae82408469286426d8dc57a361350f74e24a8b 30-May-2014 Andy Hung <hunga@google.com> Rename UNITY_GAIN to UNITY_GAIN_INT in AudioMixer

Change-Id: Ic040311305026f0b4c4280a5b3bef7a447ac1da3
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/Tracks.cpp
5866a3b9689035580c31f1a02037b8176d7508a7 30-May-2014 Andy Hung <hunga@google.com> Refactor setVolumeRampVariables in AudioMixer

Change-Id: I8fcf3101bcea292de7c65433fa578f1c9cdd0974
udioflinger/AudioMixer.cpp
f8a106ae5c40735de6c75e7c12d5e0e2e22f12cf 30-May-2014 Andy Hung <hunga@google.com> Fix floating point output from mixer

A buffer pointer was being erroneously reset to buffer start,
potentially causing an audio glitch. The floating point
output mode is not enabled at this time, but will be in
the future.

Change-Id: If8b6414d232f064f3a2e2c5a6da889a91b27fb24
udioflinger/AudioMixer.cpp
671714b80cad4725d07691fbd8284cb869a0c27f 30-May-2014 Eric Laurent <elaurent@google.com> am 6a94d69d: audio policy: implement routing control

* commit '6a94d69dc4f32abb53c466a96f905bb199be6417':
audio policy: implement routing control
47aaf6da5d7ecc2ad28de004d1820b64b02dd344 30-May-2014 Andy Hung <hunga@google.com> Merge "Add multiple format capability to FastMixer"
c0008d1146ccdeda0a4eb08f8225225b1b1237dc 30-May-2014 Eric Laurent <elaurent@google.com> Merge "handle in and out audio device connection separately"
1258c1ab592a899fabb1e31eb5db2ef413b6f38a 24-May-2014 Andy Hung <hunga@google.com> Add multiple format capability to FastMixer

Floating point data from MixerThread into FastMixer.
Multiple output format capability from FastMixer to Sink.

Change-Id: I0da17810ee71381a39a006c46faec71108d22c26
udioflinger/FastMixer.cpp
udioflinger/FastMixer.h
udioflinger/Threads.cpp
1afeecb88bea660b2c10b2096be0fd02433303ce 14-May-2014 Eric Laurent <elaurent@google.com> audio policy: parse device descriptors in config file

Implement parsing of audio_policy.conf for device and gain
controller definitions.
Copy audio_policy_conf.h from hardware_legacy.
New syntax for devices and gain controllers description will not
be parsed by legacy audio policy manager.

Bug: 14815883.

Change-Id: I7f1035d514dcf55fb3e45ed1f633a2f63ee398f5
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/audio_policy_conf.h
b52c152d553556b2d227ffc943489de0c60b4b02 20-May-2014 Eric Laurent <elaurent@google.com> audio policy: add routing update client interface

Added IAudioPolicyServiceClient client binder interface
for client process to receive notifications from AudioPolicyService
when audio ports are added/removed or audio patches created/released.

The audio patches owned by a given client are automatically released when
this client binder dies.

Bug: 14815883.

Change-Id: I6013f6aec03b50565cffb1ad2cd1f0f8852032c5
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
6a94d69dc4f32abb53c466a96f905bb199be6417 20-May-2014 Eric Laurent <elaurent@google.com> audio policy: implement routing control

Add implementation of audio routing control via AudioSystem APIs.

The following APIs are implemented:
- listAudioPorts(): return a list of devices and output/input mixers ports
that can be used as sources or sinks for audio patches.
- createAudioPatch()/releaseAudioPatch(): create/release a connection patch between
two audio ports (e.g. to connect input from an HDMI device to a speaker output device).
Only one client application can own a patch from a given source.
When an audio port (device or mix) is part of an application created patch, its routing cannot
not be changed by a policy decision.
- listAudioPatches(): return a list of existing patches.

Each audio port addition/removal and each audio patch creation/release increments a generation count.
This generation count is used to ensure consistency betwen calls to
listAudioPorts() and listAudioPatches().

Bug: 14815883.

Change-Id: I022b638c2f5f0bb41543c7cfca7488fb45cfdd80
udioflinger/PatchPanel.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
b71e58b64cd4992355cf6afaf3f3530f723bc72c 30-May-2014 Eric Laurent <elaurent@google.com> handle in and out audio device connection separately

AudioService now indicates in and out device connection
separately in case of combined devices like wired headset
or BT SCO headset.

Change-Id: I97adf8343d0ce32c279ffc3cce5c84ca7a349e16
udiopolicy/AudioPolicyManager.cpp
1d26ddf715182d6082804ff70086c47fb8c354b8 30-May-2014 Andy Hung <hunga@google.com> Avoid resetting BufferProviders in mixer unnecessarily

Change-Id: Iad85c4dfd21be1dbf89dc11906106b34219376f8
udioflinger/AudioMixer.cpp
7dac33136d71ea566de4531235f5fbbd28048f0c 29-May-2014 Andy Hung <hunga@google.com> Merge "Update dynamic resampler buffer fetching"
1afdf38e0d8979e0a6bd5f3cc9b6751ca132753e 28-May-2014 Mike Lockwood <lockwood@google.com> Merge "Add audio policy support for A2DP sink"
203b1a18a806e2c56c701aac49cda963bccfad5b 01-Apr-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - IAudioPolicyService interface extension for patch panel

Change-Id: I0a62e5416edc41c3a0e816275085ab18a23066f1
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.h
951f455566775e5f01e67c5ee26863d7d19209d7 20-May-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - audioflinger: first patch panel implementation.

Added a new PatchPanel subclass to AudioFlinger
to handle audio ports and audio patches configuration
and connection.
The first implementation does not add new functionnality.
AudioPolicyManager uses patch panel interface to control
device routing.
AudioFlinger:
- Added PatchPanel class. The first implementation does not
add new functionnality. PatchPanel handles routing commands
for audio HAL after 3.0 or converts to setParameters for audio
HALs before 3.0.
- Added config events to ThreadBase to control synchronized
audio patch connection.
AudioPolicyManager:
- Use PatchPanel API to control device selection isntead of setParameters.
- New base class AudioPort common to audio device descriptors
and input output stream profiles. This class is RefBase and groups
attributes common to audio ports.
- Use same device selection flow for input as for outputs:
getNewInputDevice -> getDeviceForInptusiource -> setInputDevice

Change-Id: Idaa5a883b19a45816651c58cac697640dc717cd9
udioflinger/Android.mk
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/PatchPanel.cpp
udioflinger/PatchPanel.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
1cda6afaf6207a41303e653a6ecd7909d73186eb 11-Apr-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - IAudioFlinger interface extension for patch panel

Change-Id: Iaabe0a7e315d5725e00a74a6ed40339b98f20330
udioflinger/AudioFlinger.h
411cb8e45442d16d983a38722c7c7bce487bde6b 27-May-2014 Andy Hung <hunga@google.com> Update dynamic resampler buffer fetching

Make the criteria tight for fetching to avoid storing
excessive frame data internal to the resampler.
This should reduce jitter in frame delivery computation.

Bug: 14962343
Change-Id: I7adaf714d11c272696ccdbf218bda994c7217477
udioflinger/AudioResamplerDyn.cpp
fe9adc4850572cb04a9cf7877d0e77d0c1fde84e 27-May-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - audioflinger: fix deadlock upon AudioRecord creation error

AudioFlinger:openRecord() should not hold mClientLock when
releasing the local reference on AudioRecord as the destructor will
also lock mClientLock.
Same fix for AudioFlinger::createTrack().
Also make sure that AudioFlinger::createEffect() holds mClientLock
when clearing local reference to the Client in case of error.

Regression introduced by 021cf9634ab09c0753a40b7c9ef4ba603be5c3da

Bug: 15118096.
Change-Id: Ie961c398c8e0460bca9b95e2ee4ce6859316c275
udioflinger/AudioFlinger.cpp
e5cfbd53612f2383f2e32b7a2605628f3c7baf6e 23-May-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - audio policy: enable use of new AudioPolicyManager

Do not define USE_LEGACY_AUDIO_POLICY by default.
By default, all devices will now use the new audio policy implementation
in AudioPolicyManager.cpp

To continue using the legacy audio policy implemented by
AudioPolicyManagerBase in libhardware_legacy a device should
define USE_LEGACY_AUDIO_POLICY in its makefile.

Change-Id: I7b8cac3cbb24b11105ba6233501c7212f5985727
udiopolicy/Android.mk
d6461906586032716fc5ff9970c8c6cacf235a20 22-May-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - audioflinger: test min HAL version instead of current

Change-Id: Ibce2353b4390329b4c1a453e829178e3986c25a7
udioflinger/AudioFlinger.cpp
546734b3ab577d46afe863515104a062e88a109b 02-Apr-2014 Andy Hung <hunga@google.com> Add tests directory for AudioFlinger

Native tests for audio resampler through gtest framework.

Change-Id: Ia340ca51f9b9b78d67e03e3541e4462b98578c95
udioflinger/tests/Android.mk
udioflinger/tests/build_and_run_all_unit_tests.sh
udioflinger/tests/resampler_tests.cpp
udioflinger/tests/run_all_unit_tests.sh
5584c58c7c952b5ed891bbff3b00a0be3f96196d 28-May-2014 Eric Laurent <elaurent@google.com> Merge "IAudioPolicyService interface extension for patch panel"
ecc03733bfd3262ffadef3166e6be23b539c505c 28-May-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: first patch panel implementation."
5e49780692b4f23966be89ac32b19c3c1ead4e85 28-May-2014 Eric Laurent <elaurent@google.com> Merge "IAudioFlinger interface extension for patch panel"
41b0e2421a0cf8dc22f224ea078678d7db651bda 14-May-2014 Mike Lockwood <lockwood@google.com> Add audio policy support for A2DP sink

Change-Id: Ifcad9c1d4bdb79668e03a31d843ec46670dd0bd8
udiopolicy/AudioPolicyManager.cpp
c9cd62bf52dd5ea8dc292fb7bc80ff51ed1a79bb 28-May-2014 Glenn Kasten <gkasten@google.com> Merge "Allow kFastTrackMultiplier to be specified per device"
0349009fd19f89f8414c428f6b71b369f7546085 27-May-2014 Glenn Kasten <gkasten@google.com> Allow kFastTrackMultiplier to be specified per device

Change-Id: I4eaaaf038df720cec4f5d9221d1b632970f9e3dd
udioflinger/Threads.cpp
b9e722bdf00333557578497c5abfc77c5d779ecb 28-May-2014 Andy Hung <hunga@google.com> Merge "Rename mixBuffer to mMixerBuffer in FastMixer"
018d324dc599c5f4238a4cd631baac47c28d59fe 27-May-2014 Andy Hung <hunga@google.com> Merge "Add multiple format capability to AudioMixer"
8670c31fddbeadcf9627aa970c69a823f13939ff 01-Apr-2014 Eric Laurent <elaurent@google.com> IAudioPolicyService interface extension for patch panel

Change-Id: I0a62e5416edc41c3a0e816275085ab18a23066f1
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.h
1c333e252cbca3337c1bedbc57a005f3b7d23fdb 20-May-2014 Eric Laurent <elaurent@google.com> audioflinger: first patch panel implementation.

Added a new PatchPanel subclass to AudioFlinger
to handle audio ports and audio patches configuration
and connection.
The first implementation does not add new functionnality.
AudioPolicyManager uses patch panel interface to control
device routing.
AudioFlinger:
- Added PatchPanel class. The first implementation does not
add new functionnality. PatchPanel handles routing commands
for audio HAL after 3.0 or converts to setParameters for audio
HALs before 3.0.
- Added config events to ThreadBase to control synchronized
audio patch connection.
AudioPolicyManager:
- Use PatchPanel API to control device selection isntead of setParameters.
- New base class AudioPort common to audio device descriptors
and input output stream profiles. This class is RefBase and groups
attributes common to audio ports.
- Use same device selection flow for input as for outputs:
getNewInputDevice -> getDeviceForInptusiource -> setInputDevice

Change-Id: Idaa5a883b19a45816651c58cac697640dc717cd9
udioflinger/Android.mk
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/PatchPanel.cpp
udioflinger/PatchPanel.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
1a83b736737e7f625371093519ff7a10b05e0c63 27-May-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: fix deadlock upon AudioRecord creation error"
4b123406c10c17852734a1b691bb9ce2a4cb7caf 11-Apr-2014 Eric Laurent <elaurent@google.com> IAudioFlinger interface extension for patch panel

Change-Id: Iaabe0a7e315d5725e00a74a6ed40339b98f20330
udioflinger/AudioFlinger.h
5912117110ae6efadd862fcb0e395fdcd18aa00c 27-May-2014 Glenn Kasten <gkasten@google.com> Merge "Move validation of frameCount from set to openRecord_l"
fe1a94e68e173fe4dfe7699112422a94eddacb4e 27-May-2014 Eric Laurent <elaurent@google.com> audioflinger: fix deadlock upon AudioRecord creation error

AudioFlinger:openRecord() should not hold mClientLock when
releasing the local reference on AudioRecord as the destructor will
also lock mClientLock.
Same fix for AudioFlinger::createTrack().
Also make sure that AudioFlinger::createEffect() holds mClientLock
when clearing local reference to the Client in case of error.

Regression introduced by 021cf9634ab09c0753a40b7c9ef4ba603be5c3da

Bug: 15118096.
Change-Id: Ie961c398c8e0460bca9b95e2ee4ce6859316c275
udioflinger/AudioFlinger.cpp
45d68d366d07b10733c1e8af6a6984befbc08ce1 24-May-2014 Andy Hung <hunga@google.com> Rename mixBuffer to mMixerBuffer in FastMixer

Likewise mixBufferState becomes mMixerBufferState.
This harmonizes with the naming in AF::MixerThread.

Change-Id: I1255d7c07cc2c6ee925d7430925236d2bd163122
udioflinger/FastMixer.cpp
udioflinger/FastMixer.h
ef7c7fbd0e3fb36af14cd7d39f64c949031516a5 13-May-2014 Andy Hung <hunga@google.com> Add multiple format capability to AudioMixer

Change-Id: I04ac1cafd90b6ed652f8d51888ad07576678f0bc
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/FastMixer.cpp
c62476f0c0c1cf9283a38852bde0a4c9434df712 24-May-2014 Andy Hung <hunga@google.com> Merge "Add format parameter to getTrackName() and track_t"
7a470c375c2cef8b186fbadd9915b30e5d757453 24-May-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: enable use of new AudioPolicyManager"
39cf5681975ec9097742c47de7c2d0f8c11248a2 23-May-2014 Glenn Kasten <gkasten@google.com> Merge "Allow track buffer "allocation" to be from pipe"
24ffe7a9161943c8ba2353e956653a71af564b5d 23-May-2014 Elliott Hughes <enh@google.com> am 79262cfc: am 5b756bfd: am 8b187f4a: Merge "Move frameworks/av off <sys/atomics.h>."

* commit '79262cfc14a9d8b5aa29d43e84ea91eedb9492ba':
Move frameworks/av off <sys/atomics.h>.
7a0aecb09a562fec144c07aeb7a3468a1e6da52e 23-May-2014 Eric Laurent <elaurent@google.com> audio policy: enable use of new AudioPolicyManager

Do not define USE_LEGACY_AUDIO_POLICY by default.
By default, all devices will now use the new audio policy implementation
in AudioPolicyManager.cpp

To continue using the legacy audio policy implemented by
AudioPolicyManagerBase in libhardware_legacy a device should
define USE_LEGACY_AUDIO_POLICY in its makefile.

Change-Id: I7b8cac3cbb24b11105ba6233501c7212f5985727
udiopolicy/Android.mk
f91df1b368a140abd37c80b204bd48d78778cc43 13-Mar-2014 Glenn Kasten <gkasten@google.com> Start adding FastCapture based on FastThread WIP

This version supports at most one fast capture client.

Change-Id: Idf609bfc80ae22433433d66a5232c043c65506df
udioflinger/Android.mk
udioflinger/FastCapture.cpp
udioflinger/FastCapture.h
udioflinger/FastCaptureState.cpp
udioflinger/FastCaptureState.h
udioflinger/StateQueueInstantiations.cpp
29b703eec27b305e7b5b2343bf257643e38f6b68 12-May-2014 Glenn Kasten <gkasten@google.com> Move validation of frameCount from set to openRecord_l

This move is needed because frameCount is validated on server side for
fast tracks (as should be done for normal tracks too).

Change-Id: I6d99e80869fd90fab373cf60ef348c01f075fbca
udioflinger/Threads.cpp
6181ffd90a436f333c43a7f812391eee2c35005a 13-May-2014 Glenn Kasten <gkasten@google.com> Allow track buffer "allocation" to be from pipe

Change-Id: Ib9ac170f8e8b7746b3588157a56cbee3b753a1cb
udioflinger/Threads.h
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
5b756bfdaa27c8b606720544bf507213cf47376d 23-May-2014 Elliott Hughes <enh@google.com> am 8b187f4a: Merge "Move frameworks/av off <sys/atomics.h>."

* commit '8b187f4acea8d7e517ff9ced32fc7368bdbaa6e0':
Move frameworks/av off <sys/atomics.h>.
63492411cf4abff452b47f59ec7ff6f3e9925c84 22-May-2014 Elliott Hughes <enh@google.com> Move frameworks/av off <sys/atomics.h>.

Bug: 14903517
Change-Id: I92cdfc618d83fd914cfb558a07b1deae0255fccb
udioflinger/FastMixer.cpp
5806b3533437e3d83208e8e9d6bd74ed304e51ec 22-May-2014 Eric Laurent <elaurent@google.com> audioflinger: test min HAL version instead of current

Change-Id: Ibce2353b4390329b4c1a453e829178e3986c25a7
udioflinger/AudioFlinger.cpp
87cebadd48710e42474756fc3513df678de045ce 22-May-2014 Elliott Hughes <enh@google.com> resolved conflicts for merge of f285c91e to master

Change-Id: I4c995e297d09c0854a42142cc57dce8b771acf65
c10b874c4d0d6208fb93a7aa0dc8af4418faad45 22-May-2014 Calin Juravle <calin@google.com> am d5516339: Merge "Move frameworks/av from fdprintf to POSIX dprintf."

* commit 'd551633916d3677da4dda10aba6837bdc6803ee0':
Move frameworks/av from fdprintf to POSIX dprintf.
8b5f642eb2364ea7fe46a5b3af51b48b58f12183 22-May-2014 Elliott Hughes <enh@google.com> Move frameworks/av from fdprintf to POSIX dprintf.

Bug: 11156955
Change-Id: Ia98cd16b4c1f7be87cf060b7456de4f40896bacb
udioflinger/AudioFlinger.cpp
udioflinger/AudioWatchdog.cpp
udioflinger/FastMixer.cpp
udioflinger/StateQueue.cpp
udioflinger/Threads.cpp
amera/libcameraservice/utils/CameraTraces.cpp
edialog/MediaLogService.cpp
77a3374a6170fb5f0168169bc4bc3fa9baf318eb 22-May-2014 Ruben Brunk <rubenbrunk@google.com> Merge "camera2: Update CameraService for HAL1 shim."
9a59d411cbe68d6027c541854c6d7c1348e4ee3d 22-May-2014 Elliott Hughes <enh@google.com> am 85e6e87c: Merge "Restore accidentally-removed NULL timeout."

* commit '85e6e87c41bba51729cee8958a5c30157c8dc674':
Restore accidentally-removed NULL timeout.
e348c5b72ad889389c7c1c900c121f0fbee221b5 22-May-2014 Elliott Hughes <enh@google.com> resolved conflicts for merge of c0bf836f to master

Change-Id: I5cf238fa56d6fff443b212870cf9dd7f1110e7da
22f22ffcb111b38eb7a303bfde39aed108b43e07 22-May-2014 Elliott Hughes <enh@google.com> Restore accidentally-removed NULL timeout.

Change-Id: I933c80fea50950243f109acf8d6350013aaa811f
udioflinger/FastMixer.cpp
ad71caf25e31ecfc4ecf2c925e38fd87905fbc8e 22-May-2014 Elliott Hughes <enh@google.com> am 3b6da6bf: Merge "Move frameworks/av off private API."

* commit '3b6da6bfb50a1c0324fb4c87326d3a477944d5fe':
Move frameworks/av off private API.
ee499291404a192b059f2e04c5afc65aa6cdd74c 22-May-2014 Elliott Hughes <enh@google.com> Move frameworks/av off private API.

Bug: 11156955
Change-Id: Ib3bb9d66a2bf92977c2445b62aa074a2d7a45aea
udioflinger/FastMixer.cpp
udioflinger/FastMixer.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
b2119af7f4ced0ecfefd4c7388f86b4e3a3ea7d8 10-May-2014 Ruben Brunk <rubenbrunk@google.com> camera2: Update CameraService for HAL1 shim.

Updates the camera service to handle shim connections.

Changes include:
- Adds begin/end configure binder calls.
- Adds cache for shim client static camera metadata.
- Implements basic getCameraCharacteristic functionality for shim clients.

Bug: 15116722
Bug: 15117269

Change-Id: I510c5888ca15f8e7d3b8ed1680ff1c7f8f514744
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api2/CameraDeviceClient.h
9382378b6b271949bdce527ea3da748c13c4c692 22-May-2014 Elliott Hughes <enh@google.com> resolved conflicts for merge of b1080917 to master

Change-Id: Iabbe3e95e29f28461ff722b550e8a9f35bd2528f
d83062287758be57d1d0908b30bb18aa9b367f38 22-May-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: split audio policy library"
acbd9492996348bf4565fbaa5a14772f0f4ace38 22-May-2014 Elliott Hughes <enh@google.com> am d084206d: Merge "Move frameworks/av off __futex_syscall3."

* commit 'd084206d5a4a5364211af46e4201311933e83bfc':
Move frameworks/av off __futex_syscall3.
77e1512aee8092069514973379a59a318e721be3 22-May-2014 Elliott Hughes <enh@google.com> Move frameworks/av off __futex_syscall3.

Bug: 11156955
Change-Id: I943080bc51b6efa781059b48b5b5ecc4fa287512
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
98c6be0e30fa28e752b13f3dd5986d41710bb7ae 21-May-2014 Eric Laurent <elaurent@google.com> audio policy: split audio policy library

Split audio policy library into a service part and a policy part.
This will allow OEMs to customize the policy part:
- libaudiopolicyservice for the service.
- libaudiopolicymanager for the policy.

Two build options can be defined in device make file to select
the policy library:
- USE_LEGACY_AUDIO_POLICY = 1: this will use the legacy policy
in hardware/libhardware_legacy implemented by AudioPolicyManagerBase class.
This policy is loaded as a harware module and exposes the audio policy HAL
defined in include/hardware/audio_policy.h and is in a library called
audio_policy.XXX.so (e.g audio_policy.default.so)

The legacy HAL will not be updated with new features.

If USE_LEGACY_AUDIO_POLICY is not defined, the policy is implemented by
a class named AudioPolicyManager exposing an interface defined in
AudioPolicyInterface.h.
The corresponding library is libaudiopolicymanager.so.

New features will be added only to AudioPolicyInterface.h

The default implementation is provided here in file AudioPolicyManager.cpp

OEMs wanting to cutomize the policy can implement the AudioPolicyManager class
and provide the libaudiopolicymanager.so library.
In this case the device make file should define:
- USE_CUSTOM_AUDIO_POLICY = 1

For now, USE_LEGACY_AUDIO_POLICY = 1 is forced in audio policy service make file.
This will be removed when the new audio policy is enabled.

Change-Id: I066799dacc9b182b468a43d48ff7798c9109a414
udiopolicy/Android.mk
498692535c7ceecb3434a99c47e4c90ba3fdd90e 20-May-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: add new audio devices"
00ddac6f47a066a545342a81c40425e3a153e8a1 20-May-2014 Andy Hung <hunga@google.com> Merge "Update AudioMixer::getTrackName to save channelMask"
1b776237ec911f4bb09f42f295b41e13f5f49113 20-May-2014 Eric Laurent <elaurent@google.com> audio policy: add new audio devices

Add entries for new audio devices to string to enum table used
for audio_policy.conf file parsing.

Change-Id: Ica04c34af037d890a343af0b9eeb2ff0e5c86b02
udiopolicy/AudioPolicyManager.cpp
b4db73d022f3de3530bc2b3c9c831ccfdd1a2ead 20-May-2014 Andy Hung <hunga@google.com> Merge "Use new channel count functions for audio masks"
1e54e6dfc1bb8d33089ed8857f0f194e696f85e2 19-May-2014 Glenn Kasten <gkasten@google.com> Merge "Pass stereo gains as packed minifloat"
e8a1ced4da17dc6c07803dc2af8060f62a8389c1 10-May-2014 Andy Hung <hunga@google.com> Add format parameter to getTrackName() and track_t

Change-Id: Ia152a839014e235fbfb656104c15d7c1b456d02e
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/FastMixer.cpp
udioflinger/FastMixerState.cpp
udioflinger/FastMixerState.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
c56f3426099a3cf2d07ccff8886050c7fbce140f 22-Mar-2014 Glenn Kasten <gkasten@google.com> Pass stereo gains as packed minifloat

This will allow (eventually) a greater dynamic range for gains.
However there are still a few remaining places in effects and mixer
that will also need to be changed in order to get the full benefit.

Also fixes a minor bug: was not checking for NaN in AudioTrack C++.

Change-Id: I63bce9e82e0a61546d8ff475fb94bcb700d99c96
udioflinger/AudioFlinger.h
udioflinger/AudioMixer.h
udioflinger/Effects.h
udioflinger/FastMixer.cpp
udioflinger/FastMixerState.h
udioflinger/PlaybackTracks.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
5859b98476de3bbb4ae4dc00d4b2f010ca7897d3 19-May-2014 Eric Laurent <elaurent@google.com> am be2664da: am 4c9bde7a: am ce473c32: Merge "Codec Offload: Add NULL check as mCallbackThread is NULL when offloaded HAL is running BLOCKING mode"

* commit 'be2664dac34a6a9d9f754d4097b32158d4947cd2':
Codec Offload: Add NULL check as mCallbackThread is NULL when offloaded HAL is running BLOCKING mode
4c9bde7a3e636d3ecccd7905d142dbbb80e977a0 19-May-2014 Eric Laurent <elaurent@google.com> am ce473c32: Merge "Codec Offload: Add NULL check as mCallbackThread is NULL when offloaded HAL is running BLOCKING mode"

* commit 'ce473c32705e2d1c5fcc817198101e1220b3c8f7':
Codec Offload: Add NULL check as mCallbackThread is NULL when offloaded HAL is running BLOCKING mode
68112fc4f77ab8c4a744782f78e9792afe0cbfc1 14-May-2014 Andy Hung <hunga@google.com> Update AudioMixer::getTrackName to save channelMask

Change-Id: I4fb4abbff1b05bdd0f6e21b5f5f4c3f2a57ae28d
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
udioflinger/FastMixer.cpp
e541269be94f3a1072932d51537905b120ef4733 16-May-2014 Andy Hung <hunga@google.com> Use new channel count functions for audio masks

Change-Id: Ia658ab4b6320d19fdb50f123c930918724ff0ef3
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioFlinger.cpp
udioflinger/AudioMixer.cpp
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
deb9081a61b446dbe50461082974a4228899f178 14-May-2014 Glenn Kasten <gkasten@google.com> Merge "Pull up mFlags and isFastTrack from Track to TrackBase"
cbe6fddebe3ec84176037de7f9681d2407fa1113 14-May-2014 Glenn Kasten <gkasten@google.com> Merge "Explicitly include Configuration.h"
2d859b91a59b4f6d63ff2bd93b462cab60f4a8d7 14-May-2014 Glenn Kasten <gkasten@google.com> Merge "Fix memory corruption if increaseSamplingN is not called"
56604aa3a56dc8e15532597a0a74b3c7b165e006 13-May-2014 Uday Gupta <guptau@broadcom.com> Codec Offload: Add NULL check as mCallbackThread is NULL
when offloaded HAL is running BLOCKING mode

b/14897952

Change-Id: I159a33e1181c1a62d80ab4bd3337a35dafaad884
Signed-off-by: Uday Gupta <guptau@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
udioflinger/Threads.cpp
755b0a611f539dfa49e88aac592a938427c7e1b8 13-May-2014 Glenn Kasten <gkasten@google.com> Pull up mFlags and isFastTrack from Track to TrackBase

Change-Id: I6bd48292310be4e05758a11f617f50585904422d
udioflinger/PlaybackTracks.h
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
5b17c0b5b418c340d3e5201a72ee8c88c1755355 13-May-2014 Glenn Kasten <gkasten@google.com> Explicitly include Configuration.h

Must include Configuration.h in any source file with #ifdef or #if that
depends on Configuration.h. This avoid inconsistencies that could result
in subtle bugs.

Change-Id: I99fdf19d56e7c73de4e7d672b937336b932a2a00
udioflinger/AudioFlinger.h
udioflinger/StateQueue.h
963698408b1ce0f2ac7eab1e863dc7271de116a3 13-May-2014 Glenn Kasten <gkasten@google.com> Fix memory corruption if increaseSamplingN is not called

Change-Id: Icbf9aaf68c25ba3330ceb79167bd776cf0342d0d
udioflinger/FastThreadState.cpp
021cf9634ab09c0753a40b7c9ef4ba603be5c3da 13-May-2014 Eric Laurent <elaurent@google.com> AudioFlinger: add specific mutex for client lists

Add a specific mutex to protect access to mClients and
mNotificationClients lists. This avoids locking the main AudioFlinger
mutex from inside thread loops and allows not to worry about
cross deadlocks when sending a config event with status reply while
keeping the ThreadBase or AudioFlinger mutex locked.
As a way of consequence, remove notification client list passed to
processConfigEvents_l() and audioConfigChanged() as the list
can now be accessed by locking client mutex only.

Change-Id: I228022204b6709a8bb60cc96d9514a6ffe59b62e
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Effects.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
71fd9329263fb98d1aa1a1ad5452849119d73f9c 12-May-2014 Eric Laurent <elaurent@google.com> Merge "audiopolicy: refactor audio command threads"
0ede8924b98c2967be2795e8d4f9837d8d3f094c 10-May-2014 Eric Laurent <elaurent@google.com> audiopolicy: refactor audio command threads

- Use strong pointers for command data to avoid transfering
ownership of the object to receiver thread.
This avoids waiting for the command acknowlegement to proceed
with next command on server side.
- Use a separate mutex for each command condition.
- Factor in duplicated code to send commands.

Change-Id: Ib0526e7c4fa64a71ad4015f477c6361727c6f40a
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
39c852640929d90ae5bcbf49842cbd64bffaa29e 12-May-2014 Eino-Ville Talvala <etalvala@google.com> am 7fd1af85: am c36fbcdf: am f02f06c4: Merge "camera: check Intent entry count before reading it"

* commit '7fd1af85f8fb40f7cb4fcdba98418aeea61fb4f0':
camera: check Intent entry count before reading it
c36fbcdf37ec02314e7b8134bb0de5f624fa70fd 12-May-2014 Eino-Ville Talvala <etalvala@google.com> am f02f06c4: Merge "camera: check Intent entry count before reading it"

* commit 'f02f06c422a58ddaca49d14f21a196eaa435d07b':
camera: check Intent entry count before reading it
f02f06c422a58ddaca49d14f21a196eaa435d07b 12-May-2014 Eino-Ville Talvala <etalvala@google.com> Merge "camera: check Intent entry count before reading it"
c90f4c7c5838e4dee2f550c4d581e7205e666faa 15-Apr-2014 Yuvraj Pasi <ypasi@nvidia.com> camera: check Intent entry count before reading it

In case when find() returns empty entry, blindly
reading the entry will cause segfault

Change-Id: Ib5be7fd855c409ba3b45f0d43e15237367172817
amera/libcameraservice/api1/client2/Parameters.cpp
110135b9610fee8bfa5bac2d9ef4fc4c24991c36 09-May-2014 Glenn Kasten <gkasten@google.com> Explicitly ignore return value of __futex_syscall3

Change-Id: Ic65f257bfc4a0eff7bdd3c44fab68a3f17e2bd08
udioflinger/Threads.cpp
0fdbdd2a3909e4692fa3baaaa1f53eb91b31af56 10-May-2014 Glenn Kasten <gkasten@google.com> Merge "Remove obsolete IAudioRecord::getCblk()"
26d5ff926fa3323b39ae4408bcd29826a9523c9b 10-May-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: refactor thread config events"
fe9570c7b937b49d3603ccb394aed732b79bc6be 07-May-2014 Glenn Kasten <gkasten@google.com> Remove obsolete IAudioRecord::getCblk()

Change-Id: Id20b5efd765b9796b0e391610e06dc928a829ebf
udioflinger/AudioFlinger.h
udioflinger/Tracks.cpp
1035194cee4fbd57e35ea15c56e66cd09b63d56e 09-May-2014 Eric Laurent <elaurent@google.com> audioflinger: refactor thread config events

Merge config events and set parameters messaging mechanism.
- setting parameters now uses the config event mechanism
- config event now allow to wait for a condition and synchronize caller
binder thread with execution thread and return an execution status.
- simplify locking mechanism to avoid unlocking the thread
mutex while processing events.

Change-Id: Ia49cb3e617abec4bacb6c1f9a8cb304c4ed3902e
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
udioflinger/Threads.h
d776ac63ce9c013c9626226e43f7db606e035838 07-May-2014 Glenn Kasten <gkasten@google.com> IAudioFlinger::openRecord returns IMemory(s)

openRecord() now explicitly returns the control block and data buffer
as separate IMemory references. If the IMemory for data buffer
is 0, this means it immediately follows the control block.

Change-Id: Ic098f88f0e037f8fbe30006689e18cacacf09d06
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
99401131e58f2ff7f5571037d0d53b6f684e5543 08-May-2014 Eric Laurent <elaurent@google.com> audio policy: fix mute delay when setting output device

The duration of the temporary mute applied on each output
when switching device must be more than twice the actual delay
we wait for the mute to be effective at the output.
Otherwise some outputs with short latencies will be unmuted before the
device switch is actually executed.

This change makes sure that we take the maximum wait time into account
when requesting the delayed unmuting of each output.

Change-Id: Id92c201b47786082a44b6a5c1c8015273835a42e
udiopolicy/AudioPolicyManager.cpp
eee8fc78703dd77244407250402fe7464fe50fd3 08-May-2014 Glenn Kasten <gkasten@google.com> Merge "Add a per-thread heap that is read-only to clients"
cdedf74e34117f9834055973880ee728f11d97cd 08-May-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: cleanup AudioPolicyService destructor"
b880f5e5fc07397ddd09a94ba18bdf4fa62aae00 07-May-2014 Glenn Kasten <gkasten@google.com> Add a per-thread heap that is read-only to clients

Change-Id: I401263566ca20fbfb565689c8fa99458d3b283b2
udioflinger/Threads.cpp
udioflinger/Threads.h
657ff61389d7316f798d4abe03efac56fd528d91 07-May-2014 Eric Laurent <elaurent@google.com> audio policy: cleanup AudioPolicyService destructor

No need to clear strong pointers in the destuctor.
Add explicit exit() command to mOutputCommandThread.

Change-Id: I60bb248fe6a20bfd8a55358ef139692b93df0238
udiopolicy/AudioPolicyService.cpp
a079461668e881718fa6c0de967e557f59da1cab 07-May-2014 Glenn Kasten <gkasten@google.com> Merge "Fix a couple of fast capture typo bugs"
828f883a43f66f77d776a75d0ea2b87c7c826071 07-May-2014 Glenn Kasten <gkasten@google.com> Fix a couple of fast capture typo bugs

AudioRecord constructor was not passing flags through to set().
Server-side check was using wrong kind of channel mask.

Change-Id: Ifaa880ec323771e9fd168262be05f3e539f53390
udioflinger/Threads.cpp
5b61dddd0dba28922068da2487894761486aec6c 07-May-2014 Eric Laurent <elaurent@google.com> audio policy: fix typo in AudioPolicyManager constructor

Fix cut/paste error in new AudioPolicyManager constructor
causing the same index variable to be reused in nested for loops.

Change-Id: Id57ff19bf6dd8974486b07c8252029e377df2747
udiopolicy/AudioPolicyManager.cpp
5e0e2316578b8b9eccdf4002951d6e9cd96adaac 07-May-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: update from libhardware_legacy"
14136039b752376240698e8b422c76de01488bc5 06-May-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: fix missing string in logging code"
13c878f07fb36a49aade20cec684ed8e12724751 06-May-2014 Zhijun He <zhijunhe@google.com> Camera3: fix missing string in logging code

Change-Id: I15da6bb8b586b4641837f42d2145530fb45dd0bd
amera/libcameraservice/device3/Camera3Stream.cpp
d46929666d7e4b1cad45afd7dcb883ec4dd2d49f 06-May-2014 Eric Laurent <elaurent@google.com> audio policy: update from libhardware_legacy

Merge changes made to AudioPolicyManagerBase in libhardware_legacy
since it was forked here:

fd61179 Update policy handling for USB inputs
c7b6e3c audio: allow compiling for 64-bit
c26f454 Initial implementation of USB Audio output.
a7b1bc9 Audio policy is 32-bit only
26101ad audio policy : add AUDIO_DEVICE_IN_USB_DEVICE to sDeviceNameToEnumTable

Change-Id: I22bc883c20603a6598c6ee3ded636e9cc4d9ec03
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
7ebe2c64dea42a3fd4de34ccb877d23b7a4e8076 06-May-2014 Eric Laurent <elaurent@google.com> am 71171988: am f655acf1: am 8fb04d47: Merge "Fix memory leak when filtering commands in insertCommand_l()"

* commit '711719885d7563068579abf347c366cf6bc906f5':
Fix memory leak when filtering commands in insertCommand_l()
f655acf15e587dbf5d7120e9f2bf4b5bcb89941c 06-May-2014 Eric Laurent <elaurent@google.com> am 8fb04d47: Merge "Fix memory leak when filtering commands in insertCommand_l()"

* commit '8fb04d474ed9e0d1302ae223ee76fafbe5fb41a3':
Fix memory leak when filtering commands in insertCommand_l()
8fb04d474ed9e0d1302ae223ee76fafbe5fb41a3 06-May-2014 Eric Laurent <elaurent@google.com> Merge "Fix memory leak when filtering commands in insertCommand_l()"
d8484dd4cf124854e7ff950da4300887f32fd05b 05-May-2014 Glenn Kasten <gkasten@google.com> Merge "Use audio_is_linear_pcm()"
f2776a5692bb4228decbe4ea3c8cc6df1d9c684c 05-May-2014 Ruben Brunk <rubenbrunk@google.com> Merge "camera3: Update CameraMetadata vendor tag handling."
6640d87d1a9263c12bab6d7ded7cc78a3eb50ae9 05-May-2014 Natalie Silvanovich <natashenka@google.com> Merge "NULL check in ConnectPro"
e1b55da41878255570f18809c5fee72544740344 01-May-2014 Natalie Silvanovich <natashenka@google.com> NULL check in ConnectPro

Prevents service crash

Bug: 13744720
Change-Id: I7a5cdba830b4f96660f890ede6b94c38fc3108dd
amera/libcameraservice/CameraService.cpp
f81648ec38ff63f1f35516fa27c1c24d846e9ba5 18-Apr-2014 Ruben Brunk <rubenbrunk@google.com> camera3: Update CameraMetadata vendor tag handling.

Bug: 12134423
Change-Id: I97dc955ee9dd78ace93a7946296d6d9b0e407d43
amera/libcameraservice/CameraService.cpp
fa366b2a32294ea22bf7b6f237cdbbd715cbbeb9 03-May-2014 Ruben Brunk <rubenbrunk@google.com> Merge "Revert "camera3: Update CameraMetadata vendor tag handling.""
6770260f83f5576b041b7b3a2536d082a631f9b0 03-May-2014 Ruben Brunk <rubenbrunk@google.com> Revert "camera3: Update CameraMetadata vendor tag handling."

This reverts commit 4764324d2704f1b08bb7407014bf203924ff2363.

Change-Id: I86d7fcc11423502b73fab2a82af6aa89804f0b76
amera/libcameraservice/CameraService.cpp
6c516d800d97b7f25a22574998cb055c9d7f7b16 03-May-2014 Ruben Brunk <rubenbrunk@google.com> Merge "camera3: Update CameraMetadata vendor tag handling."
4764324d2704f1b08bb7407014bf203924ff2363 18-Apr-2014 Ruben Brunk <rubenbrunk@google.com> camera3: Update CameraMetadata vendor tag handling.

Bug: 12134423
Change-Id: I1d1be6792b6a4c9f08e042a8b2c89146bde5665e
amera/libcameraservice/CameraService.cpp
0a9aa4f5539482061dfe4dfa6128ef3696557818 02-May-2014 Glenn Kasten <gkasten@google.com> Merge "Fix bug for direct track with PCM != 16-bit"
c4b88a8d0f524666bf0f390075c334d047a104f2 01-May-2014 Glenn Kasten <gkasten@google.com> Fix bug for direct track with PCM != 16-bit

The AUDIO_FORMAT_PCM_8_BIT format was being converted to
AUDIO_FORMAT_PCM_16_BIT on client side even for direct tracks.
That conversion was incorrect; it should only be done for mixed tracks.

Also remove checks for specific PCM formats in the generic part of
server side of createTrack. Those format checks should only be done by
the thread. This will allow direct tracks for PCM 8-bit, PCM 24-bit, etc.

Change-Id: If5b9fd79f8642ed93e2aeabcaf4809b2ed798978
udioflinger/AudioFlinger.cpp
ad3770a20daf1265a088404edbd2ca340166e9ef 02-May-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: Don't notifyError for non-fatal errors"
993fa0603707e94ce259e95e56838a85b5ccbdc5 02-May-2014 Glenn Kasten <gkasten@google.com> Use audio_is_linear_pcm()

Change-Id: I17b30fdb6dbb6454ad0a20dd703fd603a37a8397
udioflinger/Threads.cpp
e11ae4b2f7d38c8092e7c67ff06610165d866d98 01-May-2014 Zhijun He <zhijunhe@google.com> Camera3: Don't notifyError for non-fatal errors

Bug: 14448494
Change-Id: Ie2e2dc6a8475189707c556845adb77f20f270df5
amera/libcameraservice/device3/Camera3Device.cpp
1a7be1ec9c769203e6c8e26378de0ab8e2ad493d 29-Apr-2014 Bill Yi <byi@google.com> Merge commit '91820d46b5f3065c2fded3cdf65d305715b33bb1' into HEAD
4799fa447c2c9681c0c51fa8151974a764679fdc 29-Apr-2014 Glenn Kasten <gkasten@google.com> Merge "Start pulling bits of FastMixer up to FastThread"
2234002b0710c8db73f82d397cb945cd541c6bbb 07-Apr-2014 Glenn Kasten <gkasten@google.com> Start pulling bits of FastMixer up to FastThread

Change-Id: I4c6f7b8f88fcf107bb29ee6432feecd4ab6554d2
udioflinger/Android.mk
udioflinger/Configuration.h
udioflinger/FastMixer.cpp
udioflinger/FastMixer.h
udioflinger/FastMixerDumpState.h
udioflinger/FastMixerState.cpp
udioflinger/FastMixerState.h
udioflinger/FastThread.cpp
udioflinger/FastThread.h
udioflinger/FastThreadState.cpp
udioflinger/FastThreadState.h
f7da096db8655531c2f2b7bddccd1064b1021155 24-Apr-2014 Zhijun He <zhijunhe@google.com> Camera3: scale the max jpeg buffer size based on resolutions

The max jpeg buffer size was always the android.jpeg.maxSize, regardless of
the actual jpeg capture size. This creates a huge memory waste especially
for smaller size jpeg capture. Now the max jpeg buffer is linearly scaled based
on the resolution.

Bug: 14288983
Change-Id: I8a971b8e2f4fc7fec0154547bdb688579af71a47
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
e273141263e988ab086a8d41e0e4fc75c00f1b86 24-Apr-2014 Glenn Kasten <gkasten@android.com> am 7e5c6351: am 4513aa2c: Merge "AArch64: rewrite audioflinger\'s sinc resample by intrinsics."

* commit '7e5c635114a7762ad44581300021667a0da97389':
AArch64: rewrite audioflinger's sinc resample by intrinsics.
7e5c635114a7762ad44581300021667a0da97389 24-Apr-2014 Glenn Kasten <gkasten@android.com> am 4513aa2c: Merge "AArch64: rewrite audioflinger\'s sinc resample by intrinsics."

* commit '4513aa2cda9e636e4ac675dab9a1353b22e951ae':
AArch64: rewrite audioflinger's sinc resample by intrinsics.
4513aa2cda9e636e4ac675dab9a1353b22e951ae 24-Apr-2014 Glenn Kasten <gkasten@android.com> Merge "AArch64: rewrite audioflinger's sinc resample by intrinsics."
7ef20390ba4375c4b08edd14923846086987a8c8 22-Apr-2014 Zhijun He <zhijunhe@google.com> camera3: Don't hold mLock during flush call

HAL calls into Camera3Device functions like processCaptureResult during flush
call. When Camera3Device runs into error state during flush call,
processCaptureResult calls setErrorState(), which leads to deadlock.

Change-Id: I35a03f6eb4b77f914097917cb37de98663de365f
amera/libcameraservice/device3/Camera3Device.cpp
e7ec24c9934c98a451e986a07651992df7fe6558 21-Apr-2014 Jianing Wei <jianingwei@google.com> Merge "CameraService: fix waitUntilIdle bug revealed by TestingCamera2."
106b83d2447d3209d12fdc05215b965e05c5efea 21-Apr-2014 Eino-Ville Talvala <etalvala@google.com> am dae621c2: am 95006625: Merge "camera: set mNeedConfig after creating ZSL stream"

* commit 'dae621c2c7f40f1587b97636975908e1374ade9a':
camera: set mNeedConfig after creating ZSL stream
dae621c2c7f40f1587b97636975908e1374ade9a 21-Apr-2014 Eino-Ville Talvala <etalvala@google.com> am 95006625: Merge "camera: set mNeedConfig after creating ZSL stream"

* commit '95006625bd1c562c952833bf08c52e7e6c524363':
camera: set mNeedConfig after creating ZSL stream
95006625bd1c562c952833bf08c52e7e6c524363 21-Apr-2014 Eino-Ville Talvala <etalvala@google.com> Merge "camera: set mNeedConfig after creating ZSL stream"
3c76fa3e73374dfe7bb93e1b03fed30749e1e4b9 21-Apr-2014 Jianing Wei <jianingwei@google.com> CameraService: fix waitUntilIdle bug revealed by TestingCamera2.

* clear mStreamingRequestList in flush
* fix frame number checker in notify and processCaptureResult

Bug: 14166437
Change-Id: I022421080d05138f9068c1b9b85d83bd613b04fb
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/device3/Camera3Device.cpp
6adc9ccb2948d9421a0ed4b74f52b909bcec2037 15-Apr-2014 Zhijun He <zhijunhe@google.com> Camera3: block until get an available buffer

Camera3Stream shouldn't error out when the max number of buffers are already
dequeued. It should block until next buffer returned from camera device.

Bug: 11595505
Change-Id: If65a70c29cb04219e14ded0744059c0ab783444b
amera/libcameraservice/device3/Camera3IOStreamBase.cpp
amera/libcameraservice/device3/Camera3IOStreamBase.h
amera/libcameraservice/device3/Camera3InputStream.cpp
amera/libcameraservice/device3/Camera3OutputStream.cpp
amera/libcameraservice/device3/Camera3Stream.cpp
amera/libcameraservice/device3/Camera3Stream.h
amera/libcameraservice/device3/Camera3ZslStream.cpp
77d4f613bbed8b646c8ddade6a0737fcbd391b07 18-Apr-2014 Jianing Wei <jianingwei@google.com> Merge "CameraService: fix race condition and wrong last frame number."
2d6bb3f9e3e7cc1c7debbbe3d74bf9c70b6f39d4 11-Apr-2014 Jianing Wei <jianingwei@google.com> CameraService: fix race condition and wrong last frame number.

Change-Id: Ie2be9a77a0b074497615de38cbb8e8f13b4858ec
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
1b24cf32e02a1372e57b3a2a432bc0adfe496e6d 16-Apr-2014 Mark Salyzyn <salyzyn@google.com> am e80631aa: am 839d11d1: Merge changes I0a744dc7,Id993a70d

* commit 'e80631aa1992ca50af679cd6a018c0ffda7f9b17':
media: use size_t for integer iterator to Vector::size()
media: 64 bit compile issues
e80631aa1992ca50af679cd6a018c0ffda7f9b17 16-Apr-2014 Mark Salyzyn <salyzyn@google.com> am 839d11d1: Merge changes I0a744dc7,Id993a70d

* commit '839d11d1f7be9dff2f06c7d30a9eb39cb6782078':
media: use size_t for integer iterator to Vector::size()
media: 64 bit compile issues
3ab368e0810d894dcbc0971350c095049478a055 15-Apr-2014 Mark Salyzyn <salyzyn@google.com> media: use size_t for integer iterator to Vector::size()

Change-Id: I0a744dc7815a86a993df9b0623440be620ec8903
udioflinger/AudioFlinger.cpp
udioflinger/Tracks.cpp
f0948bcf06b8a9679f4b772237c80ee63829423f 15-Apr-2014 Zhijun He <zhijunhe@google.com> Merge "Camera: don't dereference timestamp if it is missing"
e5e3d0823165dea9211a47232dbbbe361153fb49 15-Apr-2014 Yuvraj Pasi <ypasi@nvidia.com> camera: set mNeedConfig after creating ZSL stream

Set mNeedConfig after creating ZSL stream, camera device
will reconfigure for the case when only ZSL stream
is changed.

Change-Id: Ib592817f81125969824a1280349f77973116f375
amera/libcameraservice/device3/Camera3Device.cpp
6056bdda5b17c62ba320c806489e4d1a3b7653c7 15-Apr-2014 Zhijun He <zhijunhe@google.com> Camera: don't dereference timestamp if it is missing

Bug: 14059542
Change-Id: I8b45a98ef4b296db314cab3819d11626ac7211be
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
96b0d5ef85d4d71690c41c84456afbf19864c785 15-Apr-2014 Andy Hung <hunga@google.com> Merge "Improve resampler filter computation speed"
c125f38cd0ae35409a01b98a99e483550daa1313 12-Apr-2014 Glenn Kasten <gkasten@google.com> audioflinger: forward device change to effects in direct thread

Device change during offload playback is not informed to effect chain
which causes effects still work on unexpected output devices. Add device
change notification in direct output thread.

Original author wjiang <wjiang@codeaurora.org>

CRs-Fixed: 630408
Bug: 14053172
Signed-off-by: Glenn Kasten <gkasten@google.com>
Change-Id: I094a99bdf540479cee2fca6614ec35c2fa7d6046
udioflinger/Threads.cpp
27a17103f99d23157ac80ef7d75e25a3aae788bd 12-Apr-2014 Andy Hung <hunga@google.com> Merge "Update test-resample to handle multichannel"
48412dc92c4cc92a3f4821616e12290f5eeabd07 24-Mar-2014 Jesper Tragardh <jesper.tragardh@sonymobile.com> Fix memory leak when filtering commands in insertCommand_l()

When AudioPolicyService::AudioCommandThread::insertCommand_l filters
a command from the queue, the AudioCommand* is removed from the
vector mAudioCommands by calling mAudioCommands.removeAt(). This will
destroy the pointer and compact the vector, but not delete the
AudioCommand object.

This patch adds code to delete a filtered out AudioCommand and its
data object mParam. However, mParam was void* and deleting a void
pointer is undefined behavior according to the C++
standard. Therefore, the data classes are modified to inherit
from an abstract base class with a virtual destructor.

The deletion of non-filtered commands in
AudioPolicyService::AudioCommandThread::threadLoop() was already
correct, as each case casts mParam to the proper type before
deleting.

This also fixes AOSP issue 36370.

Change-Id: I2b63838aff3608132aa496f964a929f78c4b6267
udioflinger/AudioPolicyService.cpp
udioflinger/AudioPolicyService.h
df383a5a54582811e5e038efc557172b8ec69dd1 10-Apr-2014 Andy Hung <hunga@google.com> Update test-resample to handle multichannel

Option -c # specifies number of channels (mono default).
Option -s to specify stereo is removed (-c 2 replaces).
Option -h to specify WAV header is removed (WAV is now default).

Change-Id: Iba4b83806028a8a9c1ddba6f555182d214ef73ff
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/test-resample.cpp
43827aea591c2fffdb87006462a5aa7a131a25c0 10-Apr-2014 Vineeta Srivastava <vsrivastava@google.com> Merge "camera3: Remove register_stream_buffers for HAL 3.2+"
9e5763aefde93afd375e0d9874e515d7c27b212b 10-Apr-2014 Jianing Wei <jianingwei@google.com> Merge "CameraService: trigger appropriate callbacks for burst capture."
cb0652e5a850b2fcd919e977247e87239efaf70e 13-Mar-2014 Jianing Wei <jianingwei@google.com> CameraService: trigger appropriate callbacks for burst capture.

* Instead of tracking CameraMetadata only, now we track both
CameraMetadata and CaptureResultExtras, which is not part of
the HAL metadata. This will enable the correct callback of
onCaptureStarted and onResultReceived given burst requests.

* Get last frame number in reply when submitting requests,
canceling requests, and flushing device. For repeating requests,
this frame number is the last frame number of the previous
request. For non-repeating requests, this frame number is the
expected last frame number of the current request. The goal
is provide frame number to Java side in order to trigger
onCaptureSequenceCompleted correctly.

* Fix notifyError so that onDeviceError can be called correctly.

Bug: 10749500
Change-Id: I2f3dda6c530090055d4a2ff9f0f087bbbe8d9257
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
amera/libcameraservice/api1/client2/CaptureSequencer.h
amera/libcameraservice/api1/client2/FrameProcessor.cpp
amera/libcameraservice/api1/client2/FrameProcessor.h
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.h
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.h
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api2/CameraDeviceClient.h
amera/libcameraservice/api_pro/ProCamera2Client.cpp
amera/libcameraservice/api_pro/ProCamera2Client.h
amera/libcameraservice/common/Camera2ClientBase.cpp
amera/libcameraservice/common/Camera2ClientBase.h
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/common/FrameProcessorBase.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
12b44bd5fe3069cd3450d05b6c446b600e0553d3 10-Apr-2014 Zhongwei Yao <zhongwei.yao@arm.com> AArch64: rewrite audioflinger's sinc resample by intrinsics.

Pass conformance test on armv7 and aarch64, performance test is done on armv7.
Compared with original armv7 assembly version, this version has similar
result. Here is performance data on pandaboard android4.4 (input: random wave
file, unit: Mspl/s, toolchain:gcc 4.8):

| | origin(assembly) | current(intrinsics) | C version |
|----------------+------------------+---------------------+-----------|
| single channel | 6.17 | 7.14 | 3.43 |
| double channel | 5.24 | 5.63 | 3.50 |

Change-Id: If5670218e1586e9dfd2b8d9c66a6880f3e4808ca
udioflinger/AudioResamplerSinc.cpp
771386e6e6e79697e2d839ef0f25a242946ba1e5 09-Apr-2014 Andy Hung <hunga@google.com> Add and enable floating point option for audio resampler

Can be tested with test-resample.

Change-Id: I8339846d7c647444b6025d33cfa145d5d3658121
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResampler.cpp
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerDyn.h
d549139155b20d7cbf6a4326133e06def465ef54 09-Apr-2014 Andy Hung <hunga@google.com> Add floating point to audio resample processing

Add template type parameters for input, output data type.
Minor change in non-NEON mono channel handling.
Minor fixup on comments.

Change-Id: I7dc9972d130913718b62f32c02d31f99c06682f2
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerFirProcess.h
13d315eb8c0848ea0584b9fb1d27bab55bc8158b 04-Apr-2014 Igor Murashkin <iam@google.com> camera3: Remove register_stream_buffers for HAL 3.2+

Use 'setprop camera.dev.register_stream 1' to skip the fatal NULL check
- This property will be removed before shipping L

Bug: 13301331
Bug: 13435680
Change-Id: I16aacd7b22e0a10b34f6fb8501be0256170a8cd5
amera/libcameraservice/device3/Camera3IOStreamBase.cpp
amera/libcameraservice/device3/Camera3Stream.cpp
amera/libcameraservice/device3/Camera3Stream.h
430b61c72094882bc48693dfc10c256a6ae36ee9 09-Apr-2014 Andy Hung <hunga@google.com> Add capability for floating point Kaiser window filters

Change-Id: Idbb33248bbab2300c2650a4657d8fbc482a5d46c
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResamplerFirGen.h
781366833a12877b8d5ad4aa081114e30f799319 09-Apr-2014 Andy Hung <hunga@google.com> Update test-resample to handle floating point

Change-Id: Ib34d716fbabcd5eb70f8a5ffcf362e242671d916
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/test-resample.cpp
0d521d91154fe0199181c845b6dc70faf38ca8fb 08-Apr-2014 Glenn Kasten <gkasten@google.com> Merge "Fix 64-bit build warnings"
1e4e4f40b4e2c655ca377adbba53df897545c3ae 08-Apr-2014 Glenn Kasten <gkasten@google.com> Fix 64-bit build warnings

Change-Id: I667401522cb4ccd41013e2883a4c75ddeca08ef6
udioflinger/test-resample.cpp
bc6ae9bd4ee93e91e212ad35be038f21797ef31e 07-Apr-2014 Glenn Kasten <gkasten@google.com> Fix regression in FastMixer statistics

At some point, the mSampleRate in FastMixerDumpState stopped being
initialized correctly. I'm not sure when this happened, it doesn't seem to
be introduced in recent CLs. This lack of initialization caused
some of the FastMixer statistics based on sample rate to be useless.

Change-Id: Id2a96d606130a90c4c4f1bddd59778f6c6428a9c
udioflinger/FastMixer.cpp
84a0c6e87c48f58a0d3be71961432c086a4d24cc 02-Apr-2014 Andy Hung <hunga@google.com> Change references of Q19.12 to Q4.27 for clarity

Change-Id: I5beb7daf6ff9bc123ff3582f7c294edcaf8652f6
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
udioflinger/AudioResampler.h
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/test-resample.cpp
bafa561d0c9363c5307b6b1daa498bd3ae36089d 02-Apr-2014 Andy Hung <hunga@google.com> Improve resampler filter computation speed

Approximate speed improvement is 10-15% for filter computation,
which is floating point intensive. This will be important
for devices without hw floating point support.

Change-Id: I10b4e778c8d632b52218a777504b092c189e437f
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResamplerFirGen.h
2ade30003882f0c3782d68018d06cb81b99dfeb2 01-Apr-2014 Glenn Kasten <gkasten@google.com> Merge "FastMixer use FastThread and FastMixerState use FastThreadState"
1e0c8cd8fad2108c8ea085748fcca2059e3ce4ab 01-Apr-2014 Glenn Kasten <gkasten@google.com> Merge changes I5748f47d,I3f074933

* changes:
Add FastThread.h
Add FastThreadState
f7160b5dc3091fd9624f25d534c6848ee831b706 19-Mar-2014 Glenn Kasten <gkasten@google.com> FastMixer use FastThread and FastMixerState use FastThreadState

Change-Id: I594c973e9f575113bdefee6f4cf8c29d8beac1f3
udioflinger/FastMixer.h
udioflinger/FastMixerState.cpp
udioflinger/FastMixerState.h
4cd161b5bf7a8008d684db4b217ed84d1704e683 19-Mar-2014 Glenn Kasten <gkasten@google.com> Add FastThread.h

Change-Id: I5748f47dbfa42c14cc93973742e05ac963bf3ba8
udioflinger/FastThread.h
a18f644ce5eb4ab876b343e24ea613566c00058f 19-Mar-2014 Glenn Kasten <gkasten@google.com> Add FastThreadState

Change-Id: I3f07493375ace6e5cfdcd02ad90c4b6fad543b0c
udioflinger/Android.mk
udioflinger/FastThreadState.cpp
udioflinger/FastThreadState.h
3a6c90aa0617666d9abc94c02b752d9eb3d64772 13-Mar-2014 Glenn Kasten <gkasten@google.com> Add FIXMEs to createRecord for fast capture

Change-Id: I759be200fae32969212c52a409f46f2e704081e3
udioflinger/Threads.cpp
udioflinger/Threads.h
1490d5142d8d485ea0d56a9974726fb6dff0a62d 28-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Mark the logging heap read-only to media.log service"
5bdb3c4d93269511d21d155c78790ee70d423095 27-Mar-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: fix HAL3.x version check issue"
2f8a36fc8df14cba33fa7c5c1c9d5a52f8a133c2 27-Mar-2014 Eric Laurent <elaurent@google.com> Fix the build

Change-Id: I2169a3d26f4e35e5cfa35a1264175aab6ac4db41
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
95dd5ba5bf83716f2eed5fe72366c4212464d710 27-Mar-2014 Zhijun He <zhijunhe@google.com> Camera3: fix HAL3.x version check issue

Camera service should support HAL3.x instead of only HAL3.0.

Bug: 13609405
Change-Id: If7e86f9abe019547fc0be2e11337551cd7c57870
amera/libcameraservice/CameraDeviceFactory.cpp
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
2347c7b0502f5f71d2f0e22d39f1d5a61add3f6b 27-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: remove obsolete AudioPolicyManager class members"
ec31c8d17f587cba01d5516ccd336aa54323c668 27-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: use new audio device representation"
c9b8d90dabdf1234be0117c592f635a92c4eb0d9 27-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Use symbol AUDIO_IO_HANDLE_NONE from <system/audio.h>"
1b512c05f46465a7b1a1d69f82937d7199d5d926 17-Mar-2014 Eric Laurent <elaurent@google.com> audio policy: remove obsolete AudioPolicyManager class members

Remove mHasA2dp, mHasUsb and mHasRemoteSubmix members from
AudoPolicyManager. They are not needed any more since
we use device descriptors with additional attributes.

Also remove obsolete limitation on device address
length (MAX_DEVICE_ADDRESS_LEN).

Change-Id: Iffe760a521692a4b50be3f6b935af84afb61bb86
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
3a4311c68348f728558e87b5db67d47605783890 17-Mar-2014 Eric Laurent <elaurent@google.com> audio policy: use new audio device representation

Represent audio devices with more attributes than just the
type (audio_device_t).
This is in preparation for new routing APIs allowing
device selection based on more criteria than just the type
(address, channel mask...)
A new class DeviceDescriptor is created and used by functions
needing more information than just the device type.
Bit fields for available and supported input or output devices are
replaced by vectors of device descriptors.
Each available device is allocated a unique ID for future use.
Removed obsolete mA2dpDeviceAddress, mScoDeviceAddress and mUsbCardAndDevice
fields replaced by address stored in DeviceDescriptor.

Policy decisions like getDeviceForStrategy() are still based
only on the device type.

Change-Id: I5de3b3ffb12ff8dcfb746782ab1e6b15bf040d0c
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
5c4fa907328c8ee586367272c7525cb87742f14d 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Use LOG_ALWAYS_FATAL instead of LOG_FATAL"
142f519aa1acd5804d111e60d100f170fed28405 26-Mar-2014 Glenn Kasten <gkasten@google.com> Use symbol AUDIO_IO_HANDLE_NONE from <system/audio.h>

Change-Id: Id6b1aa17558eb73e17f22b8eab6cd02e00a96dff
udioflinger/AudioFlinger.cpp
adad3d7d935da176ff24941b4ae9edf7340e9b96 21-Feb-2014 Glenn Kasten <gkasten@google.com> Use LOG_ALWAYS_FATAL instead of LOG_FATAL

LOG_FATAL is compiled out in most builds, so the
assertion checks were not being performed.

Change-Id: I774f0985ab9c5ccecd8989a0f1c940386b73fc35
udioflinger/AudioMixer.cpp
udioflinger/FastMixer.cpp
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
ecdca392ed40e89a6ef14b86446e952c35497ac4 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Use symbolic constants from <system/audio.h>"
51beebba9d4989d05831a13bbe5cdf53ecac1bf5 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Use symbol AUDIO_DEVICE_NONE from <system/audio.h>"
73ec11738cd4399c55d4905665a14a7c4cd42cbf 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Fix uses of KeyedVector"
1cebdb77323e4554a316b9c34bf36957b7dad5ae 26-Mar-2014 Eino-Ville Talvala <etalvala@google.com> Revert "camera: Fix setParameters for Preview FPS single/range values"

Causes a regression on some devices, so reverting until we're in a position to fix those devices.

This reverts commit 9078a1b3b9f9c0c48046ade0e8e18b0d79a659db.

Bug: 13563098
Change-Id: I7aedd01fde8b8fdee77e972ec395f0ecadbf8ccb
amera/libcameraservice/api1/client2/Parameters.cpp
551cec544652783e3342c18386f64cee22412b60 26-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Document AudioFlinger::nextUniqueId()"
45faf7e02791993a487d6e038d16ff46395f1975 17-Jan-2014 Glenn Kasten <gkasten@google.com> Use symbol AUDIO_DEVICE_NONE from <system/audio.h>

Change-Id: I61f882c5e7c949bf00d3bfc745ebf3b5e1c42a58
udioflinger/AudioFlinger.cpp
66e4635cb09fadcaccf912f37c387396c428378a 17-Jan-2014 Glenn Kasten <gkasten@google.com> Use symbolic constants from <system/audio.h>

AUDIO_INTERLEAVE_*
AUDIO_STREAM_MIN
AUDIO_SESSION_ALLOCATE

Change-Id: I31dd6f327204685e50716079ce21c4ba206dff11
udioflinger/Threads.cpp
9ea65d0f4a564478343b1a722fae4ce5883670c3 17-Jan-2014 Glenn Kasten <gkasten@google.com> Fix uses of KeyedVector

Constructor for AudioFlinger::mAudioHwDevs was missing, and so
AudioFlinger::findSuitableHwDev_l() could return an undefined pointer
if a non-0 module wasn't found.

A KeyedVector of Plain Old Data (POD) element type must specify the
default value in the constructor, or else the default will be undefined.

Minor:
- Parameter had wrong type in constructor for AudioSystem::gOutputs.
- Remove obsolete AudioSystem::gStreamOutputMap.

Change-Id: I9841493e018440e559d8b8b0e4e748ba2b2d365b
udioflinger/AudioFlinger.cpp
bcefec31bd1346133052356ffc8d7ac8a5b13fab 17-Jan-2014 Glenn Kasten <gkasten@google.com> Document AudioFlinger::nextUniqueId()

Change-Id: Iafe96f1c10bd85cb23a2553945ca68aa601dc2eb
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
29cdd9bb46437ab580deabf33b2242106e0090b6 25-Mar-2014 Eino-Ville Talvala <etalvala@google.com> am a1aaaf86: am 4f53fe74: Merge "CameraService: deadlock fix"

* commit 'a1aaaf86cd04eabaf961a30d7b0a9fa857089862':
CameraService: deadlock fix
c3dcf1007aa964f825b2ea2ef86acb7f332e748f 25-Mar-2014 Igor Murashkin <iam@google.com> am 65550a0e: am 0370be96: DO NOT MERGE: camera: Fix setParameters for Preview FPS single/range values

* commit '65550a0e17852fe657795508e3bf05bdbfb2520b':
DO NOT MERGE: camera: Fix setParameters for Preview FPS single/range values
65550a0e17852fe657795508e3bf05bdbfb2520b 25-Mar-2014 Igor Murashkin <iam@google.com> am 0370be96: DO NOT MERGE: camera: Fix setParameters for Preview FPS single/range values

* commit '0370be96e33ea0c8fb4069e704deccce43b7403c':
DO NOT MERGE: camera: Fix setParameters for Preview FPS single/range values
a1aaaf86cd04eabaf961a30d7b0a9fa857089862 25-Mar-2014 Eino-Ville Talvala <etalvala@google.com> am 4f53fe74: Merge "CameraService: deadlock fix"

* commit '4f53fe74051026e6635ba5bdbed4f1898cb66028':
CameraService: deadlock fix
91820d46b5f3065c2fded3cdf65d305715b33bb1 25-Mar-2014 Igor Murashkin <iam@google.com> am 0370be96: DO NOT MERGE: camera: Fix setParameters for Preview FPS single/range values

* commit '0370be96e33ea0c8fb4069e704deccce43b7403c':
DO NOT MERGE: camera: Fix setParameters for Preview FPS single/range values
1cc3f85de70e813998102bf572caad3691a6b6a2 25-Mar-2014 Eino-Ville Talvala <etalvala@google.com> am 4f53fe74: Merge "CameraService: deadlock fix"

* commit '4f53fe74051026e6635ba5bdbed4f1898cb66028':
CameraService: deadlock fix
0370be96e33ea0c8fb4069e704deccce43b7403c 19-Mar-2014 Igor Murashkin <iam@google.com> DO NOT MERGE: camera: Fix setParameters for Preview FPS single/range values

As a workaround, duplicate CameraParameters into CameraParameters2 to
prevent ABI break for some camera HALs that directly link into
CameraParameters.

CameraParameters2 implements the real fixes needed in the framework,
while CameraParameters is left in to satisfy older camera HALs.

Bug: 12609188
Change-Id: I82ea6f5de2183dd046d4bf5683600c97f37ab4da
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
6ec3a15257ca2b56b675a610aef43cc4ec6aaf00 30-Apr-2013 Kalle Lampila <kallex.lampila@intel.com> CameraService: deadlock fix

Release lock before return from CameraService::dump()

Change-Id: Ia20b0921fc675a284f3b7f8d26e0e3596b5a8774
Signed-off-by: Kalle Lampila <kallex.lampila@intel.com>
amera/libcameraservice/CameraService.cpp
d6d1883f607d40be5d9a87909ae563cf94256c24 25-Mar-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: Fix flush call deadlock"
32ce52b01dab863f2b4749e1c69f619cf820486f 24-Mar-2014 Colin Cross <ccross@android.com> am 5c679d41: resolved conflicts for merge of 3d7c5002 to klp-modular-dev-plus-aosp

* commit '5c679d41714e42f153f6aeb492df54510a195bc1':
libcameraservice: build 64-bit
libcameraservice: fix 64-bit print format warnings
69a374897392c8bd70f441b7284f6f578c651ec9 24-Mar-2014 Zhijun He <zhijunhe@google.com> Camera3: Fix flush call deadlock

Flush shouldn't call waitUntilDrained directly, as they are all API calls
with mLock and mInterfaceLock held. Move the waitUntilDrained implementation
into waitUntilDrainedLocked to solve this issue.

Change-Id: Id7d931091d5c11e12204790841097433515446db
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
5c679d41714e42f153f6aeb492df54510a195bc1 22-Mar-2014 Colin Cross <ccross@android.com> resolved conflicts for merge of 3d7c5002 to klp-modular-dev-plus-aosp

Change-Id: Ia6d87d56174d1388c1148fb55b6e4bc57d8666db
7b1524d4e866b53ab0d02a59cc6ccb133bd98f77 22-Mar-2014 Colin Cross <ccross@android.com> resolved conflicts for merge of 3d7c5002 to klp-dev-plus-aosp

Change-Id: I19e1a26bd0226119c4fe2920bf6a09aaeff315d9
cfe09079608d78a0a358f01bb49f279859e38664 22-Mar-2014 Jianing Wei <jianingwei@google.com> Merge "CameraService: Add support for burst capture and repeating burst."
90e59c98c343e941b1a75307ffa4b4b5f1eb50d6 13-Mar-2014 Jianing Wei <jianingwei@google.com> CameraService: Add support for burst capture and repeating burst.

Bug: 10749500
Change-Id: I292a485b222e5cf97388d76bf0d956a6ac54bb2f
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api2/CameraDeviceClient.h
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
4bd71b4ed6f1825b287e448c336e3e59138c2956 21-Mar-2014 Colin Cross <ccross@android.com> libcameraservice: build 64-bit

libcameraservice builds fine for 64-bit, remove LOCAL_32_BIT_ONLY

Change-Id: I9f28bc42dc424dee9b92e6ab092f86d3aa1419b7
amera/libcameraservice/Android.mk
e5729fac81c8a984e984fefc90afc64135817d4f 21-Mar-2014 Colin Cross <ccross@android.com> libcameraservice: fix 64-bit print format warnings

Use PRId64 from inttypes.h to print nsecs_t (int64_t)
Use %zu to print size_t

Change-Id: I135620e0388db33587a8a7da393b48a45cb7275a
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
amera/libcameraservice/api1/client2/FrameProcessor.cpp
amera/libcameraservice/api1/client2/JpegCompressor.cpp
amera/libcameraservice/api1/client2/JpegProcessor.cpp
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/common/Camera2ClientBase.cpp
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3IOStreamBase.cpp
amera/libcameraservice/device3/Camera3Stream.cpp
amera/libcameraservice/device3/Camera3ZslStream.cpp
amera/libcameraservice/device3/StatusTracker.cpp
amera/libcameraservice/gui/RingBufferConsumer.cpp
9ac3c9a7ee931088d09027ffa09414cb0402886f 21-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: add option to use new policy manager"
9078a1b3b9f9c0c48046ade0e8e18b0d79a659db 19-Mar-2014 Igor Murashkin <iam@google.com> camera: Fix setParameters for Preview FPS single/range values

Bug: 12609188
Change-Id: I82ea6f5de2183dd046d4bf5683600c97f37ab4db
amera/libcameraservice/api1/client2/Parameters.cpp
46d1b4ab7e83c677532587c7c8bd46eb8b30fc67 19-Mar-2014 Glenn Kasten <gkasten@google.com> resolved conflicts for merge of f40c4c56 to master

Change-Id: Ifd5385ad42a81e02e6a6afc6281f09fbff361671
d09ec3b22013ef43d422c916dfd44bab9101a659 19-Mar-2014 Glenn Kasten <gkasten@android.com> am 36817364: Merge "Add libaudioresampler"

* commit '36817364738d4c45adc3e448fbec02a9611bfeda':
Add libaudioresampler
f40c4c561151ae93595e8fab5dcaaa1c69df74ef 19-Mar-2014 Glenn Kasten <gkasten@android.com> am 36817364: Merge "Add libaudioresampler"

* commit '36817364738d4c45adc3e448fbec02a9611bfeda':
Add libaudioresampler
ddf887c08b58382920effb7f0b2049e471960b4a 19-Mar-2014 Glenn Kasten <gkasten@android.com> Add libaudioresampler

libaudioresampler is available in both 32-bit and 64-bit,
unlike libaudioflinger which is currently 32-bit only.

Bug: 8141282
Change-Id: I839f7b4e6aaed6984012ca6d514323f927669df6
udioflinger/Android.mk
cf515ab0030cf5e0bef843638af7c989a8f6843a 15-Mar-2014 Glenn Kasten <gkasten@google.com> Mark the logging heap read-only to media.log service

Change-Id: Ie26a9e7e37c951774c71d2c53886db52dd5479aa
udioflinger/AudioFlinger.cpp
c7e05b0fc54f9ad22c6d219bf8cf6f10f8d9ba9c 18-Mar-2014 Glenn Kasten <gkasten@android.com> am 0c282de7: am 77658a06: Merge "AudioPolicyService: malloc/delete pair"

* commit '0c282de73240b1efce64558ab2fa0a8be1f4292b':
AudioPolicyService: malloc/delete pair
da677084cf68b62063815217156e7b262b493c3d 18-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: OffloadThread fix for resume underrun"
89a677950917263e34327c7b47f3bb7a06ab0b28 18-Mar-2014 Eric Laurent <elaurent@google.com> Merge "AudioFlinger: Change track ready condition in STOPPING_1 state"
9d9cba5be2b51d4c6c31cb7169ef2b786c35ddfd 18-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: Handle pause /resume in stopping state"
dce54a1492c410ad0d93253b341fb33305337505 10-Mar-2014 Eric Laurent <elaurent@google.com> audio policy: add option to use new policy manager

Add build option USE_LEGACY_AUDIO_POLICY to use either new
audio policy manager in local AudioPolicyManager.cpp
or the legacy AudioPolicyManagerBase.cpp via the policy HAL.

New features will be implemented only by the new audio policy manager.
Platform customiization will be by config file or new policy HAL.

AudioPolicyClientImplLegacy.cpp copied from AudioPolicyClientImpl.cpp
AudioPolicyInterfaceImplLegacy.cpp copied from AudioPolicyInterfaceImpl.cpp

New implementations of AudioPolicyInterface and AudioPolicyClient talking directly to
AudioPolicyManager.

Change-Id: I7a320883a1de13de2c9295343e996addf2f3c154
udiopolicy/Android.mk
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyClientImplLegacy.cpp
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyInterfaceImplLegacy.cpp
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
b5ea3014b8be9eaa16da0144bd81af6fa514d8e2 18-Mar-2014 Dan Stoza <stoza@google.com> Merge "Remove deprecated BufferQueue constructor"
d8590167fec151cc2e8f6e28e406c99882f40884 18-Mar-2014 Glenn Kasten <gkasten@android.com> am 77658a06: Merge "AudioPolicyService: malloc/delete pair"

* commit '77658a069c81a0d5b4a1b81443b470a3ea64cab0':
AudioPolicyService: malloc/delete pair
0c282de73240b1efce64558ab2fa0a8be1f4292b 18-Mar-2014 Glenn Kasten <gkasten@android.com> am 77658a06: Merge "AudioPolicyService: malloc/delete pair"

* commit '77658a069c81a0d5b4a1b81443b470a3ea64cab0':
AudioPolicyService: malloc/delete pair
77658a069c81a0d5b4a1b81443b470a3ea64cab0 18-Mar-2014 Glenn Kasten <gkasten@android.com> Merge "AudioPolicyService: malloc/delete pair"
0fab43120972dfbf4d6f0ec19ab470131b6c8b09 18-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: renamed AudioPolicyManagerBase to AudioPolicyManager"
6fe207b2992a5de2f766b6ab30bc760aa243f4a9 18-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: remove dependency from AudioSystemLegacy"
47b496dac93235740011fcfe7578b19c6b8445e5 18-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: import audio policy manager from hardware legacy"
a2b81d6cb02d8427dc0d719aa75c34ceddfc3c09 18-Mar-2014 Eric Laurent <elaurent@google.com> Merge "audio policy: split implementation"
2d3ca68363f723fbe269d3ce52dab4985dfc7154 07-Mar-2014 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: OffloadThread fix for resume underrun

AudioFlinger can miss resuming h/w on a pause->resume transition
if sufficient data isn't available

Bug: 11358524.
Change-Id: Ic3c75256290d3515fd4a96dfcc900909fbe5bc15
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
164985121796cf214c7a83d32005d9b01125b558 18-Mar-2014 Eric Laurent <elaurent@google.com> AudioFlinger: Change track ready condition in STOPPING_1 state

Set FS_FILLED only if framesReady() > 0

Change-Id: Ibb1d2e988ff17fcf3a7ab61031a3f85df82f18d5
udioflinger/Tracks.cpp
8d6c292a0bed3d63b5b7297d09a604af6327c663 05-Feb-2014 Krishnankutty Kolathappilly <kkolat@codeaurora.org> audioflinger: Handle pause /resume in stopping state

-Pre-requisite:
Perform seek on the clip. After seek the data remaining till EOS
is little more than the driver and common block buffering.
-Framework state:
Offload thread is waiting for signal from the HAL for a free
buffer. Audio Player calls sink stop on reaching EOS. Audio
track is waiting on obtain buffer for a free space in common
block to send the last buffer. The track is moved to stopping
state as input EOS is reached.
-Issue:
Perform pause/ resume in this state(STOPPING), Audio playback
does not resume.
-Fix
Ensure resume is called in stopping state if frames ready is
greater than zero.

Bug: 12870871

Change-Id: Ib1378c4ee5ce4bea655691e93de0775f7b1d2804
Signed-off-by: Glenn Kasten <gkasten@google.com>
udioflinger/PlaybackTracks.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
9ff25ced1404c896df9e6ed3a6ad289305559361 18-Mar-2014 Igor Murashkin <iam@google.com> am 557847ee: am a6ca0acf: am bd3e2e03: camera2: Fix segfault when using null availability listener

* commit '557847ee511dd5e75d584ff04449322f0f098241':
camera2: Fix segfault when using null availability listener
557847ee511dd5e75d584ff04449322f0f098241 18-Mar-2014 Igor Murashkin <iam@google.com> am a6ca0acf: am bd3e2e03: camera2: Fix segfault when using null availability listener

* commit 'a6ca0acf0d009acf45b05561273aaad44ab22533':
camera2: Fix segfault when using null availability listener
314869117d5e3365fc3e43fee01209d18515ca42 18-Mar-2014 Eric Laurent <elaurent@google.com> Merge "move audio policy service to a separate library"
a6ca0acf0d009acf45b05561273aaad44ab22533 17-Mar-2014 Igor Murashkin <iam@google.com> am bd3e2e03: camera2: Fix segfault when using null availability listener

* commit 'bd3e2e03f3ab686c52982a9e50cae853128172cf':
camera2: Fix segfault when using null availability listener
63143ee8a0a59d73655c8eac715ae7321027fa2b 17-Mar-2014 Igor Murashkin <iam@google.com> am bd3e2e03: camera2: Fix segfault when using null availability listener

* commit 'bd3e2e03f3ab686c52982a9e50cae853128172cf':
camera2: Fix segfault when using null availability listener
947237f67dd5335b26326a98fd7d3eae5fd7d702 11-Mar-2014 Ruben Brunk <rubenbrunk@google.com> camera3: Remove old vendor tag ops dependencies.

Bug: 12134423
Change-Id: I7acdf76d4c0674bdb1cc939592d4620687c785c3
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
e1445da74730473a66a3ae8414e940aebfe6585d 17-Mar-2014 Igor Murashkin <iam@google.com> camera2: Don't log vendor tag errors when camera HAL too old

Change-Id: Iac3d23284230c95c85ee404abbf9b22df1ae721c
amera/libcameraservice/CameraService.cpp
bd3e2e03f3ab686c52982a9e50cae853128172cf 17-Mar-2014 Igor Murashkin <iam@google.com> camera2: Fix segfault when using null availability listener

ICameraService::addListener / removeListener will now return BAD_VALUE
if a null listener is used.

Bug: 12891434
Change-Id: I9764110094d8fd42e22fcc8df3ef0e73c1b070e7
amera/libcameraservice/CameraService.cpp
3ef14ef30359376006a233f6a21a165d4b65a7df 13-Mar-2014 Glenn Kasten <gkasten@google.com> Make error handling more similar for output and capture

And simplify error case

Change-Id: I0bb1ec252945d672cc4cef137977b912f1b23d51
udioflinger/AudioFlinger.cpp
udioflinger/Tracks.cpp
15e5798908ccac14e10c84834eaf08c42931bd06 24-Sep-2013 Glenn Kasten <gkasten@google.com> Make error handling for audio driver initCheck more similar

Change-Id: I8222f00f7ac89d52235af0f64f3fee7a8c471e1e
udioflinger/Threads.cpp
570f633e0b02d1bc25f3312b92e72cc29a40ca38 13-Mar-2014 Glenn Kasten <gkasten@google.com> Make session ID code similar between output and capture

Change-Id: I873a97d0e36e1a452421df4f749d51e1916797a5
udioflinger/AudioFlinger.cpp
e848bd9abb3bbbd4c66f9fb9d1442f7663d7ba40 13-Mar-2014 Glenn Kasten <gkasten@google.com> Move declarations to where needed

Also remove unnecessary ALOGV and dead variable inFrameCount

Change-Id: I34547fb0fd2ff142fc60277bedfa4064e7356611
udioflinger/AudioFlinger.cpp
c5a17425986b4ce3384e6956762c86018b49c4a0 13-Mar-2014 Glenn Kasten <gkasten@google.com> Remove name output parameter from createTrack

It was only used for one log.
A better solution will be a per-track unique ID.

Change-Id: Ia440e02ae4a5a4019a9a2d08970e1ee93ac4c3a3
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
c3df838434b37d8400eea2438083cc01a4c1cc71 13-Mar-2014 Glenn Kasten <gkasten@google.com> Replace if/else by switch

Change-Id: Ibe96c8fb1f0ba7f850c0561f60769ce63aceba5d
udioflinger/Threads.cpp
05997e21af6c4517f375def6563af4b9ebe95f39 13-Mar-2014 Glenn Kasten <gkasten@google.com> Whitespace and comments

Change-Id: I99752cca74a459c4746ea4718acb0115439e50bd
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
0e0e846f3d86906ff990025981e514d6bcf44d8e 13-Mar-2014 Glenn Kasten <gkasten@google.com> Prepare for additional capture formats

Change-Id: Ib10b004f0029191b33a97671e41b0d86ebfbe0b9
udioflinger/AudioFlinger.cpp
758799cef41fc5495f59eeb6249d02ce9154cde8 14-Mar-2014 Glenn Kasten <gkasten@google.com> resolved conflicts for merge of 3c780188 to master

Change-Id: Ic579d346c27ff05ea6444faaa60fa6caaec86fbf
236104afb2300b7d969b1dc786f14b5f912df1cf 14-Mar-2014 Glenn Kasten <gkasten@android.com> am 089affb6: Merge "mediaserver and associated services are 32-bit only"

* commit '089affb6c2d9ed1e2d49df4be02d30dc490506f9':
mediaserver and associated services are 32-bit only
3c7801882bbb6d5f3cc641525a54cb8a6c4aca34 14-Mar-2014 Glenn Kasten <gkasten@android.com> am 089affb6: Merge "mediaserver and associated services are 32-bit only"

* commit '089affb6c2d9ed1e2d49df4be02d30dc490506f9':
mediaserver and associated services are 32-bit only
4b12341875be1ee7f0b37fa9972f1ea09da94b59 14-Mar-2014 Andy Hung <hunga@google.com> Merge "Fix Offload playback in AudioFlinger"
37e0661f476d2f9a393cff80e1be4955c5ff014f 14-Mar-2014 Andy Hung <hunga@google.com> Merge "Revert "Revert "Convert AudioFlinger mSinkBuffer to flexible format"""
5b10a2037a835e790994b9ebec3c2e55052f1f3b 13-Mar-2014 Andy Hung <hunga@google.com> Fix Offload playback in AudioFlinger

This fixes Offload playback regression introduced by adding
flexible format to mSinkBuffer. Test case is AAC file playback.

Bug: 13450717
Change-Id: I0fa11978295ed4793be90c565e5b8abedf156914
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/Threads.cpp
010a1a1a552cdaad362cea8a0333b8906402dbcb 13-Mar-2014 Andy Hung <hunga@google.com> Revert "Revert "Convert AudioFlinger mSinkBuffer to flexible format""

This reverts commit e2a9c29f35e0c09782558542fc4cf9823779590e.
udioflinger/Threads.cpp
udioflinger/Threads.h
1d59fea10d94e425cd48667d3030418e3907c56c 13-Mar-2014 Ruben Brunk <rubenbrunk@google.com> Merge "camera3: Pass vendor tags through binder."
d1176ef16677b6c94fb893edb6a864cdccc0b190 21-Feb-2014 Ruben Brunk <rubenbrunk@google.com> camera3: Pass vendor tags through binder.

Bug: 12134423

- Adds a class for parceling vendor tag definitions.
- Passes vendor tag definitions to clients of the camera service.
- Switches over to new vendor tag mechanism when reading from HAL.

Change-Id: Icef3fe9e67160767bdb8244ac49c85b68b497123
amera/libcameraservice/Android.mk
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
e2a9c29f35e0c09782558542fc4cf9823779590e 13-Mar-2014 Eric Laurent <elaurent@google.com> Revert "Convert AudioFlinger mSinkBuffer to flexible format"

This reverts commit e7e676fd2866fa4898712c4effa9e624e969c182.

Bug: 13450717.
Change-Id: Ib80b0d14428fecce33c62003a1fcf83f71cee03b
udioflinger/Threads.cpp
udioflinger/Threads.h
8aa0f0619ea867e8fb240cf27913d4f8ae767385 12-Mar-2014 Dan Stoza <stoza@google.com> Remove deprecated BufferQueue constructor

Bug: 13415624
Change-Id: Ifc8f778b70102a38a9f7a086632e6884714e6b58
amera/libcameraservice/api1/client2/CallbackProcessor.cpp
amera/libcameraservice/api1/client2/JpegProcessor.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/device3/Camera3InputStream.cpp
amera/libcameraservice/device3/Camera3ZslStream.cpp
af783aa91f7a279153fb8bab8d0d6b9f737996e9 03-Mar-2014 Glenn Kasten <gkasten@android.com> mediaserver and associated services are 32-bit only

also 32-bit only command-line apps

Change-Id: I9ac557a8d02bbf6986a9b5c3cdce23d400b306a3
udioflinger/Android.mk
amera/libcameraservice/Android.mk
edialog/Android.mk
708601d042ae2a927da2181f33da47d9b01ad411 12-Mar-2014 Zhijun He <zhijunhe@google.com> am f0fb921c: am bc69c8ba: DO NOT MERGE: Camera: delete preview callback when preview size is changed

* commit 'f0fb921c0170fe3b8ebce8fbe3c133a99c6def9f':
DO NOT MERGE: Camera: delete preview callback when preview size is changed
e07208765fcd5904165e425ec714a25c350a2f40 11-Mar-2014 Eric Laurent <elaurent@google.com> audio policy: renamed AudioPolicyManagerBase to AudioPolicyManager

Change-Id: Ia8b5ae9c3a9cf6ed98f162614ea331efc78e9ff2
udiopolicy/AudioPolicyManager.cpp
udiopolicy/AudioPolicyManager.h
udiopolicy/AudioPolicyManagerBase.cpp
udiopolicy/AudioPolicyManagerBase.h
3b73df74357b33869b39a1d69427673c780bd805 11-Mar-2014 Eric Laurent <elaurent@google.com> audio policy: remove dependency from AudioSystemLegacy

Remove all dependencies on AudioSystemLegacy from AudioPolicyManagerBase.
Only use types and definitions from audio.h and audio_policy.h.
Also move code back into android name space.

Change-Id: I0c2582cf854027fb1e599981865a6cbe7b5a9490
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyManagerBase.cpp
udiopolicy/AudioPolicyManagerBase.h
e552edb33fb5873179ae0a46d9579d1103eb13c6 11-Mar-2014 Eric Laurent <elaurent@google.com> audio policy: import audio policy manager from hardware legacy

Import AudioPolicyManagerBase from hardware/libhardware_legacy
to prepare move from android_audio_legacy name space.

Change-Id: I5d6682ccd2bfdeefbf2f6f81a557480a76aaf4fc
udiopolicy/AudioPolicyInterface.h
udiopolicy/AudioPolicyManagerBase.cpp
udiopolicy/AudioPolicyManagerBase.h
2d388eccc9dc085337c7a03a68467cbee6b809e1 07-Mar-2014 Eric Laurent <elaurent@google.com> audio policy: split implementation

Split audio policy service implementation to ease
further evolution:
AudioPolicyInterfaceImpl.cpp contains the implementation of
IAudioPolicyService interface
AudioPolicyClientImpl.cpp contains the implementation of the
AudioPolicyManager client interface
AudioPolicyService.cpp contains the rest of the code mostly
command threads implementation and pre processing management.

AudioPolicyService.cpp:

Change-Id: Ic48ba165532ef66e84a30894d01f750ed6619d02
udiopolicy/Android.mk
udiopolicy/AudioPolicyClientImpl.cpp
udiopolicy/AudioPolicyInterfaceImpl.cpp
udiopolicy/AudioPolicyService.cpp
c7e5040aa8b8e4da86814bf560346c7571e48087 06-Mar-2014 Eric Laurent <elaurent@google.com> move audio policy service to a separate library

Change-Id: Ibc3ef07aa9860b7fd4f9aaff27b0dbe0dcbf1cbf
udioflinger/Android.mk
udioflinger/AudioPolicyService.cpp
udioflinger/AudioPolicyService.h
udiopolicy/Android.mk
udiopolicy/AudioPolicyService.cpp
udiopolicy/AudioPolicyService.h
f0fb921c0170fe3b8ebce8fbe3c133a99c6def9f 11-Mar-2014 Zhijun He <zhijunhe@google.com> am bc69c8ba: DO NOT MERGE: Camera: delete preview callback when preview size is changed

* commit 'bc69c8ba9a8fc881603669205a56d0ca1b572a95':
DO NOT MERGE: Camera: delete preview callback when preview size is changed
b120f897ad41c0a386081f74f47fd560c6e86f34 11-Mar-2014 Zhijun He <zhijunhe@google.com> am bc69c8ba: DO NOT MERGE: Camera: delete preview callback when preview size is changed

* commit 'bc69c8ba9a8fc881603669205a56d0ca1b572a95':
DO NOT MERGE: Camera: delete preview callback when preview size is changed
e7e676fd2866fa4898712c4effa9e624e969c182 05-Mar-2014 Andy Hung <hunga@google.com> Convert AudioFlinger mSinkBuffer to flexible format

Change-Id: I618d9c99a5f6f8c8d6a9f4b2d19e82c9ddc3b06e
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/Threads.cpp
udioflinger/Threads.h
bc69c8ba9a8fc881603669205a56d0ca1b572a95 21-Jan-2014 Zhijun He <zhijunhe@google.com> DO NOT MERGE: Camera: delete preview callback when preview size is changed

Preview callback stream is left configured even the preview size is changed.
This makes the callback stream unnecessarily configured even in recording mode,
which could cause distorted preview for some devices.

Bug: 12210027
Bug: 12591410
Change-Id: If50cddfe5562e91aec1feb1760eccb82ddb21730
amera/libcameraservice/api1/Camera2Client.cpp
98ef978df4e928f486d244c4d7f7ad9f13111e98 04-Mar-2014 Andy Hung <hunga@google.com> Add mEffectBuffer to AudioFlinger

Change-Id: Icf97c50040bc127723d56eb4d2fb6e790a7253d9
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/Threads.cpp
udioflinger/Threads.h
6a7b53008ac0831431f42c620d2988c65b21d859 07-Mar-2014 Eino-Ville Talvala <etalvala@google.com> am a11111f9: Merge changes Id28b35fd,Ie4e64977,I2950f31e into klp-dev

* commit 'a11111f9135c98cf4247bbd1a61d7df3053e549e':
DO NOT MERGE: Camera: fix focusArea wrong indexing issue
DO NOT MERGE: camera2: Fix race with stream deletion during disconnect.
DO NOT MERGE: camera2/3: Add protection for still capture path
f69f9869514730aebe5724c461768507084dfff7 07-Mar-2014 Glenn Kasten <gkasten@google.com> NBAIO::Format_from_SR_C requires audio_format_t parameter

Change-Id: I4b65f6ed2f6ca3608b3a5f88f52a93af0b9b1f4a
udioflinger/Threads.cpp
e857b65c1d3aa055281cb48f59c9b5eb4a062dd0 07-Mar-2014 Narayan Kamath <narayan@google.com> am 3c9130a8: Merge "Make frameworks/av 64-bit compatible"

* commit '3c9130a8a12ce962dc8d22e04243b135b9e98b01':
Make frameworks/av 64-bit compatible
10ac79930120efea20b125f5faedfe89e8674676 07-Mar-2014 Glenn Kasten <gkasten@android.com> am 5930e8eb: Merge "AudioFlinger: Remove code for supporting resampling in fast tracks"

* commit '5930e8ebdacf3a59c13eef11fd03658ba58b443e':
AudioFlinger: Remove code for supporting resampling in fast tracks
32fbb48de0248518fc5a14099b32fe4b8e9fc102 07-Mar-2014 Glenn Kasten <gkasten@android.com> am 4361749d: Merge "AudioTrack: Never try to use the fast path if resampling is required"

* commit '4361749d74113069aafb0620a1189404205c58d0':
AudioTrack: Never try to use the fast path if resampling is required
396a2bc8d1934ccea6159dfcee88e47f0c3c21aa 07-Mar-2014 Glenn Kasten <gkasten@android.com> am d66cd743: Merge "audioflinger: conform inline ASM to UAL"

* commit 'd66cd743525cc049033caa3e81cbdf74c72a4556':
audioflinger: conform inline ASM to UAL
40659dea8eefaa9d7f5b742e3333d68b6f0dd89c 07-Mar-2014 Eino-Ville Talvala <etalvala@google.com> am 47ef192f: am a11111f9: Merge changes Id28b35fd,Ie4e64977,I2950f31e into klp-dev

* commit '47ef192f0296642b901e82d0c72c5a1a0d08f4df':
DO NOT MERGE: Camera: fix focusArea wrong indexing issue
DO NOT MERGE: camera2: Fix race with stream deletion during disconnect.
DO NOT MERGE: camera2/3: Add protection for still capture path
47ef192f0296642b901e82d0c72c5a1a0d08f4df 07-Mar-2014 Eino-Ville Talvala <etalvala@google.com> am a11111f9: Merge changes Id28b35fd,Ie4e64977,I2950f31e into klp-dev

* commit 'a11111f9135c98cf4247bbd1a61d7df3053e549e':
DO NOT MERGE: Camera: fix focusArea wrong indexing issue
DO NOT MERGE: camera2: Fix race with stream deletion during disconnect.
DO NOT MERGE: camera2/3: Add protection for still capture path
a11111f9135c98cf4247bbd1a61d7df3053e549e 07-Mar-2014 Eino-Ville Talvala <etalvala@google.com> Merge changes Id28b35fd,Ie4e64977,I2950f31e into klp-dev

* changes:
DO NOT MERGE: Camera: fix focusArea wrong indexing issue
DO NOT MERGE: camera2: Fix race with stream deletion during disconnect.
DO NOT MERGE: camera2/3: Add protection for still capture path
55fbfbbbf00722dac3f789be69138445b771a1e1 06-Mar-2014 Glenn Kasten <gkasten@google.com> Merge "Use larger capture pipe since we support resampling by 6:1"
6cbccee701e74fa43a5ea49c15af7dd3267b6699 14-Dec-2013 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: Fix for a deadlock in track creation

AudioFlinger enters a deadlock (with itself) on trying to free a
RecordTrack or Track object that failed initialization. Clear this
bad object from the caller instead.

Bug: 12423233
Change-Id: I926f2beb922a70f6924e593e2bbf1a5b5df85b16
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
4f4c9a22f4676c65bcae77f0805dcd699b3ba475 06-Mar-2014 Eric Laurent <elaurent@google.com> am 281dd4e1: audioflinger: fix static track end detection

* commit '281dd4e13309973dbb85bce531f884237e0d8fb0':
audioflinger: fix static track end detection
a413dd621966044753a8fa1f57c76d847b6f4bec 29-Jan-2014 Zhijun He <zhijunhe@google.com> DO NOT MERGE: Camera: fix focusArea wrong indexing issue

Bug: 12304559
Change-Id: Id28b35fdd9697c1ec3365f617996801965de8bd0
amera/libcameraservice/api1/client2/Parameters.cpp
0c937b4946fae178447d9f8d29200fa2798c05f9 05-Mar-2014 Eric Laurent <elaurent@google.com> am eb16bb5d: am 7028a2c8: am 7e92abea: audioflinger: fix offload write buffer offset

* commit 'eb16bb5dcecf430bfec1c2a4bd15851c83b9c3cc':
audioflinger: fix offload write buffer offset
7028a2c8106ee5a22db88da5dad581820ee07254 05-Mar-2014 Eric Laurent <elaurent@google.com> am 7e92abea: audioflinger: fix offload write buffer offset

* commit '7e92abeafb184e8a34213d7149592e95a72601b0':
audioflinger: fix offload write buffer offset
6706009fa8294c8cdab1cdab4585f00d42df483e 05-Dec-2013 Ruben Brunk <rubenbrunk@google.com> DO NOT MERGE: camera2: Fix race with stream deletion during disconnect.

Bug: 11856804

- Shutdown order in Camera2Client allows a stream to be
deleted before the corresponding processing thread has
quit. This can result in updates being called on the
processor thread without a valid stream.

Change-Id: Ie4e649771f4321498659211f2a37ed89a6d956c4
amera/libcameraservice/api1/Camera2Client.cpp
81d754306ecd4a587459015da5168270c2a5c167 27-Nov-2013 Zhijun He <zhijunhe@google.com> DO NOT MERGE: camera2/3: Add protection for still capture path

Jpeg stream in JpegProcessor could be deleted while process new capture is
ongoing, which unsafe to access a dead consumer endpoint.
Bug: 9316454
Change-Id: I2950f31ea28d0ba01f08502e2e3ba452bf8bb818
amera/libcameraservice/api1/client2/JpegProcessor.cpp
d812fc012298470a1b8120e6d60a24b0b1d48047 03-Dec-2013 Glenn Kasten <gkasten@google.com> Increase kFastTrackMultiplier from 1 to 2

Bug: 11967381
Change-Id: Iedec06280aa745d9df5d661f4916940cede9c191
udioflinger/Threads.cpp
281dd4e13309973dbb85bce531f884237e0d8fb0 21-Dec-2013 Eric Laurent <elaurent@google.com> audioflinger: fix static track end detection

If a static track is not a fast track,
prepareTracks_l() must rely on framesReady() to
detect end of buffer and remove the track from the active
track list.
Failing to do so results in the track staying active but
not processed by the mixer because in underrun. This leaves the
mix buffer content uninitialized and causes the effect process
function to accumulate its output onto undefined data.

Bug: 12013676.
Change-Id: I4b0819a9d93141ac3307b8786fc6a451dd585220
udioflinger/Threads.cpp
abab1c33caf0982c11713e6d64d60105dcbc8ab7 06-Jan-2014 Gaurav Kumar <gaurav.kumar@broadcom.com> AudioMixer: Remove tracks from enabledTracks after reseting outTemp

If any track goes through AudioMixer::process__genericNoResampling, and
its getnextbuffer returns NULL, Then that track is removed by AudioMixer
from enabledTracks.

Thus if all tracks getnextbuffer return NULL, Then this function doesn't
reset outTemp and last buffer in AudioFlinger's mMixBuffer will be
repeated and noise is observed.

Remove tracks from enabledTracks after reseting outTemp to zero, so that
process__genericNoResampling will reset outTemp and noise won't appear.

Bug: 12450065

Change-Id: I28996d425838728955f01eb1a00acf6e6dc2dea1
Signed-off-by: Gaurav Kumar <gaurav.kumar@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
udioflinger/AudioMixer.cpp
7e92abeafb184e8a34213d7149592e95a72601b0 22-Nov-2013 Eric Laurent <elaurent@google.com> audioflinger: fix offload write buffer offset

Fix current audio HAL write buffer offset calculation
which assumes that the frame size is a multiple of 2.
'
Bug: 12823725.

Change-Id: I0195ed5cfef225a6f114e7dd405a02680bb7254e
udioflinger/Threads.cpp
0504a198d6595e29e58d1d66ae59fac1d662384a 05-Mar-2014 Haynes Mathew George <hgeorge@codeaurora.org> am 632c3790: am 7c206e5b: am e0cd1051: audioflinger: update track ready condition

* commit '632c3790523896260dc43fd6cd40a158765cdb15':
audioflinger: update track ready condition
d384a2c44810ce1b51277cc4ab4c5415ff7de6ee 05-Mar-2014 Haynes Mathew George <hgeorge@codeaurora.org> am 4f9e38c6: am 21e81bca: am e010f65e: audioflinger: Fix for a deadlock in track creation

* commit '4f9e38c60cc79407a8b2966b3b9780a3e395b017':
audioflinger: Fix for a deadlock in track creation
7c206e5bd24b5ae4565d0e60b637458a1054dfcf 05-Mar-2014 Haynes Mathew George <hgeorge@codeaurora.org> am e0cd1051: audioflinger: update track ready condition

* commit 'e0cd1051ed9fea0629745c29020516ae62298461':
audioflinger: update track ready condition
21e81bca4d1e6f7d1ccac61b65da7c7a4a121064 05-Mar-2014 Haynes Mathew George <hgeorge@codeaurora.org> am e010f65e: audioflinger: Fix for a deadlock in track creation

* commit 'e010f65e6337267cb15f8894c950a3f64370dd36':
audioflinger: Fix for a deadlock in track creation
50c3157c5a3e0617be77716beff1ae8801d8a72f 04-Dec-2013 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: check for condition before waiting

AsyncCallbackThread must check for any condition that
was already been satisfied before waiting.

Bug: 11824817
Change-Id: I04683a1f355de4f440106cab47fd916aa39d5e35
udioflinger/Threads.cpp
e0cd1051ed9fea0629745c29020516ae62298461 28-Dec-2013 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: update track ready condition

Signal track ready if the track isStopping().

Bug: 12423190
Change-Id: I95e14905df10ebf301e398263478c8ca25d7e2ce
udioflinger/Tracks.cpp
e010f65e6337267cb15f8894c950a3f64370dd36 14-Dec-2013 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: Fix for a deadlock in track creation

AudioFlinger enters a deadlock (with itself) on trying to free a
RecordTrack or Track object that failed initialization. Clear this
bad object from the caller instead.

Bug: 12423233
Change-Id: I926f2beb922a70f6924e593e2bbf1a5b5df85b16
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
788207057ed4b8df4719ed8089f376ef52de9ca1 01-Mar-2014 Andy Hung <hunga@google.com> Rename mSinkFormat to mMixerFormat for AudioMixer::track_t

AudioMixer::SINK_FORMAT also changes to AudioMixer::MIXER_FORMAT

Change-Id: Ic3f8be77d2c75c082c4fd140bc907e30c304d285
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
udioflinger/Threads.cpp
7ed1873acbf43280c5afe51833c3d628fe34e258 01-Mar-2014 Andy Hung <hunga@google.com> Merge "Use float_from_q19_12 conversion in AudioMixer"
3375bde6c6c1821fca3eeb4840774112e26c9a68 01-Mar-2014 Andy Hung <hunga@google.com> Use float_from_q19_12 conversion in AudioMixer

Change-Id: Idbe84fb9610c7e636a84468f2e2402a913435ca9
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
e842614837e5401adf77e90485300c288b9a7876 01-Mar-2014 Glenn Kasten <gkasten@google.com> Use larger capture pipe since we support resampling by 6:1

This avoids overruns on the client AudioRecord side,
without requiring client to use a large buffer.
It should not increase input latency, since a newly started AudioRecord
always joins the stream starting at the latest data.

Change-Id: Ib2b8de75cc40a6a3d493a1f8b46b41220f69264f
udioflinger/Threads.cpp
b442921146664fba77b91f221e9b1997ffb8170e 01-Mar-2014 Andy Hung <hunga@google.com> Merge "Add MixerBuffer for accumulation of float audio"
3c35c48a47e9cfbc25778652ff8423f905271a19 28-Feb-2014 Andy Hung <hunga@google.com> Merge "Rename mixBufferSize to mSinkBufferSize in AudioFlinger"
eafbe37da9a08f7599281bc19e000cdf70ae08b6 28-Feb-2014 Andy Hung <hunga@google.com> Merge "Rename constants for MixBufferSize to SinkBufferSize"
625b57c5ab5fefde1547d89a061420be733fb7dd 28-Feb-2014 Andy Hung <hunga@google.com> Merge "Rename mMixBuffer to mSinkBuffer in AudioFlinger"
d2304db2fcb5112292105a0949a55986a4c9875f 03-Feb-2014 Glenn Kasten <gkasten@google.com> Rename setStreamOutput to invalidateStream

And simplify by removing the unused I/O handle parameter 'output'.

Change-Id: Ie9c4df17a7378066312d4ed8790fda7a9125c95e
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/AudioPolicyService.cpp
69aed5f0f4a3be3996d1e78a0473e1a72c1547da 26-Feb-2014 Andy Hung <hunga@google.com> Add MixerBuffer for accumulation of float audio

Path into and out of MixerBuffer is set up, but not
currently enabled.

Change-Id: I9d50752607d22dd2a3d9cc7e053babf8dfb22958
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/Threads.cpp
udioflinger/Threads.h
25c2dac12114699e90deb1c579cadebce7b91a97 27-Feb-2014 Andy Hung <hunga@google.com> Rename mixBufferSize to mSinkBufferSize in AudioFlinger

Change-Id: I4d1d18d716fa3ad8c0e7cc87f5a2823422f504eb
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/Threads.cpp
udioflinger/Threads.h
09a5007b17acb49d25cfa386a2e2534d942e8854 27-Feb-2014 Andy Hung <hunga@google.com> Rename constants for MixBufferSize to SinkBufferSize

Updated variable names are
kMinNormalSinkBufferSizeMs
kMaxNormalSinkBufferSizeMs

Change-Id: I91969eae3f8c10275db8778634cbf05fdec0712b
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/Threads.cpp
2098f2744cedf2dc3fa36f608aa965a34602e7c0 27-Feb-2014 Andy Hung <hunga@google.com> Rename mMixBuffer to mSinkBuffer in AudioFlinger

Change-Id: I1f55630425b8ce36e9df2aaf64e06a8960b69a47
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/Threads.cpp
udioflinger/Threads.h
8897759002677a7072a51a7f0b7cc63761c5f2d4 27-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Move up AudioFlinger::createTrack and openRecord parameter checks"
53b5d098b7d5d4412b9b9fe08daaf84c56b716e9 05-Feb-2014 Glenn Kasten <gkasten@google.com> Move up AudioFlinger::createTrack and openRecord parameter checks

Perform the basic sample rate, format, and channel masks tests as
early as possible. Now the thread methods only need to do the thread
type-specific checks.

Change-Id: I57d8319a228dda0446ca9b3ddcb7c9f67f28238c
udioflinger/AudioFlinger.cpp
4d3c5bde85c5404d7927a770da90a5c9d09fb6a7 27-Feb-2014 Andy Hung <hunga@google.com> Merge "Add Track Sink Format to AudioMixer"
a1ab7cc8611c83427b57f6d4d4ce7aad9d1c0330 25-Feb-2014 Andy Hung <hunga@google.com> Add Track Sink Format to AudioMixer

Track Sink Format now allows both AUDIO_FORMAT_PCM_FLOAT and
AUDIO_FORMAT_PCM_16_BIT (default). The float case is not
enabled now.

Change-Id: Ibee70cab4725c8bc9905e49f1f9a9c2448f76e00
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
b78d804b1090a430a126a6c356037ded96ffd91a 25-Feb-2014 Andy Hung <hunga@google.com> Merge "Fix 1:1 dynamic resampler rate setting"
9d518f1aa50da9c3dfadb97090fb79aac886da12 25-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "The -O option now takes a CSV instead of a single value"
3f73448090d99612c6d8f579e4164507d8848cc1 24-Feb-2014 Ruben Brunk <rubenbrunk@google.com> Merge "camera2: Fix race with stream deletion during disconnect."
323da1015a758243c2c43017b026a01c6cf0c6f2 22-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Account for unreleased frames when predicting resampler needs"
d0e0cfa58a35508c14818b88804845194b5d80e1 22-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Make tee sink work again"
607fa3e928de696eba49f198af72d68e4591ca1b 21-Feb-2014 Glenn Kasten <gkasten@google.com> Account for unreleased frames when predicting resampler needs

Other changes related to resampling:
- improve logs
- use correct form of assert
- don't round up max usable circular buffer sizes to power of 2;
this gives more predictable results
- add some FIXMEs

Bug: 13133176
Change-Id: I8d3c90eed4eb0c0c1fbac3c864e179a2806c2301
udioflinger/Threads.cpp
c52b033f0be38ca915d389b672bcf9c46b4c78ef 21-Feb-2014 Glenn Kasten <gkasten@google.com> The -O option now takes a CSV instead of a single value

Also added -P option to provide a CSV list of provided values.

Change-Id: I4e0d6fe8b062d27d95d33493f80bd8f1c510d2c8
udioflinger/test-resample.cpp
f66b42242342017c26eb97de544dae31dd2537ca 20-Feb-2014 Glenn Kasten <gkasten@google.com> Make tee sink work again

It was broken by this earlier change to NBAIO:
> Change-Id: I5eda412648b094358f5eefc38300e9ec8a734cd3
But the code was not being compiled, so the error was not caught earlier.

Also increase the default size of per-track pipe to a reasonable value.

Change-Id: Ica05017e6c6533e1fea9df379a9b204eebed4a1f
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
8ea16e4b0a7d398d26887c18675b3899de5d779d 21-Feb-2014 Eric Laurent <elaurent@google.com> audioflinger: fix race condition in SyncEvent callback

Now that the SyncEvent callback is implemented by the
RecordTrack instead of the RecordThread, there is a possibility
that the callback is called after the track deletion.

SyncEvent callback now uses a weak pointer instead of
a raw pointer as cookie. This allows the callback implementer to
acquire a strong reference on the object pointed to by the cookie.

Bug: 13114128.
Change-Id: Id61b8f06044ed1e52c6f7e7c666cdede68340de2
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
1af34085e18c4d5ab297232f167a71e89ff7f65d 20-Feb-2014 Andy Hung <hunga@google.com> Fix 1:1 dynamic resampler rate setting

Change-Id: Id69e98ebaaca8dd8c976eb823f1cc1024b0eddf5
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResamplerDyn.cpp
56df9ff31d583ad3eae4f279a3df550273c58e1e 17-Feb-2014 Glenn Kasten <gkasten@google.com> Allow specifying frames per call to resample()

Bug: 13073201
Change-Id: Id2f0fcd7562d9ba5a58c128d71bbba42dfea86cc
udioflinger/test-resample.cpp
d20db4c4d8eb2593b5d0214890420a49e0b01796 20-Feb-2014 Andy Hung <hunga@google.com> Merge "Fix resampler to allow output of single frame"
24781fff62a4cf7279d3dac83c33e2ac612712ba 19-Feb-2014 Andy Hung <hunga@google.com> Fix resampler to allow output of single frame

Bug: 13073201
Change-Id: If7818a3389a191a37277bbd8e96a59ef8ce68509
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResampler.cpp
udioflinger/AudioResampler.h
udioflinger/AudioResamplerCubic.cpp
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerSinc.cpp
4cc0a6a835c806d200ef83ef31fe5bef327c355c 17-Feb-2014 Glenn Kasten <gkasten@google.com> Multi-client recording continued

Remove mReqChannelCount and mReqSampleRate.
Increase number of input frames needed for sample rate converter.
Add TODO comments to investigate later.
Fix bugs in sample rate conversion.

Change-Id: I3aa54b862843d518b6e4ece9a7f52fd27d741629
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
25f4aa83efaa9179e65a20583a6d441de2c3ff3f 07-Feb-2014 Glenn Kasten <gkasten@google.com> Move handleSyncStartEvent and clearSyncStartEvent to RecordTrack

Change-Id: I611a63e63acf3eb17e2072c1a77b91fe9e62e36a
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
deca2ae0a7cf8bc54ff3f30b7dc39bbc78b94c0d 07-Feb-2014 Glenn Kasten <gkasten@google.com> Add _l suffix to readInputParameters/OutputParameters

They are always called while thread mutex is locked,
or in the thread constructor.

Change-Id: I56df71563a52a5cd6cea6fc0914df993519e1b74
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/Threads.h
6dd62fb91d82dedcfa3ab38c02eb0940b4ba932a 06-Dec-2013 Glenn Kasten <gkasten@google.com> Multi-client recording

Supports multiple clients both at native sample rate and with resampling.

Change-Id: Icea55b4fd30751761b7debaa3ce016c79e712d8d
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
c940c38242e8e0265db25a646ad63263934f2bb9 13-Feb-2014 Marco Nelissen <marcone@google.com> Merge "Track pid for each session"
c6d7ab74962bfd24d105277b28248b4819763abd 12-Feb-2014 Andy Hung <hunga@google.com> Merge "Proper adjustment of filterlength for downsampling"
a3bb9a3a25b58669d75da4f73764ac4c2bf34158 11-Feb-2014 Andy Hung <hunga@google.com> Proper adjustment of filterlength for downsampling

Bug: 12963040
Change-Id: I772b8efd3f7eae6d075994b210dd0168f5365f4d
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResamplerDyn.cpp
d457c970c8d08519cd77280a90b61ae1e342cfe3 11-Feb-2014 Marco Nelissen <marcone@google.com> Track pid for each session

so they can be properly freed.

Change-Id: I6f389035bc29e74e7c367c1c6d0252b180f666b3
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
1d6fa7af1288b550faabe4ec2cf98684236723db 11-Feb-2014 Narayan Kamath <narayan@google.com> resolved conflicts for merge of 566be7c3 to master

Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
377b2ec9a2885f9b6405b07ba900a9e3f4349c38 03-Feb-2014 Kévin PETIT <kevin.petit@arm.com> Make frameworks/av 64-bit compatible

Contains the necessary changes to make frameworks/av build and work
on a 64-bit machine.

Signed-off-by: Craig Barber <craig.barber@arm.com>
Signed-off-by: Kévin PETIT <kevin.petit@arm.com>
Signed-off-by: Ashok Bhat <ashok.bhat@arm.com>
Signed-off-by: Marcus Oakland <marcus.oakland@arm.com>

Change-Id: I725feaae50ed8eee25ca2c947cf15aee1f395c43
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/AudioMixer.cpp
udioflinger/Effects.cpp
udioflinger/FastMixer.cpp
udioflinger/StateQueue.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/CameraClient.cpp
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device3/Camera3IOStreamBase.cpp
amera/libcameraservice/device3/Camera3ZslStream.cpp
b1f5b0dd237c2767ad7bc0b081d03aafc87589ea 10-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Fix clang warnings in AudioFlinger"
4b76d27d6c4751b31a1cb8ac5e6da1d4b7724a7b 10-Feb-2014 Glenn Kasten <gkasten@android.com> am 5a458ede: am 5930e8eb: Merge "AudioFlinger: Remove code for supporting resampling in fast tracks"

* commit '5a458ede3b7d303723fde4b856532bdc3b94971b':
AudioFlinger: Remove code for supporting resampling in fast tracks
3523e8c40bc60af0c95d1aa71a51a13d69ec80a2 10-Feb-2014 Glenn Kasten <gkasten@android.com> am 4e12dade: am 4361749d: Merge "AudioTrack: Never try to use the fast path if resampling is required"

* commit '4e12dadeec10993d2f77cce96600e73ca0dd86e2':
AudioTrack: Never try to use the fast path if resampling is required
5930e8ebdacf3a59c13eef11fd03658ba58b443e 10-Feb-2014 Glenn Kasten <gkasten@android.com> Merge "AudioFlinger: Remove code for supporting resampling in fast tracks"
4361749d74113069aafb0620a1189404205c58d0 10-Feb-2014 Glenn Kasten <gkasten@android.com> Merge "AudioTrack: Never try to use the fast path if resampling is required"
9601c6efcb2552960d6f125d073525b581c1b7ec 10-Feb-2014 Marco Nelissen <marcone@google.com> Merge "Pretty up audioflinger dumpsys"
01d3acba9de861cb2b718338e787cff3566fc5ec 06-Feb-2014 Glenn Kasten <gkasten@google.com> Fix clang warnings in AudioFlinger

Change-Id: I0fa61025c979709ad7d655bc717df5f194b6089e
udioflinger/AudioFlinger.h
udioflinger/AudioMixer.h
udioflinger/AudioPolicyService.cpp
udioflinger/AudioResampler.cpp
udioflinger/AudioResampler.h
udioflinger/Effects.cpp
udioflinger/Effects.h
ec95f0e82a680931e9c7c9011dbbd68d5ab484c8 10-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Use printf format %#x for audio_format_t in logs"
b220884bf3129253cc5bc8d030bc475411ea4911 07-Feb-2014 Marco Nelissen <marcone@google.com> Pretty up audioflinger dumpsys

Change-Id: I57e44b4c36b99f7149542bbcf9645521c6152dfa
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Effects.cpp
udioflinger/FastMixer.cpp
udioflinger/PlaybackTracks.h
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
8f762d577f2dcf34357eb8731070ae465649ec9a 08-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Fix whitespace"
a793625031a3e326a261a0843598c35a5784bbde 07-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Use Format_isValid() and Format_isEqual() instead of direct comparison"
4944acb7355b3aa25748fd25945a363a69d65444 19-Aug-2013 Glenn Kasten <gkasten@google.com> Fix whitespace

Change-Id: I9add0872030a26933f6b6dad1be299154611cc56
udioflinger/AudioPolicyService.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
cac3daa6332bf6d1f7d26adc4a9915f3d7992dd9 07-Feb-2014 Glenn Kasten <gkasten@google.com> Use printf format %#x for audio_format_t in logs

Change-Id: I1c611d1037685d52ccc84efe0fccd6413ec938e9
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
f74f213c0cd0612101e00a73704429dac1a92fe3 07-Feb-2014 Eric Laurent <elaurent@google.com> Merge "AudioFlinger: Offload track transition fix"
d9a4783985203c759ddcca784798ef395668fe05 07-Feb-2014 Eric Laurent <elaurent@google.com> Merge "AudioFlinger: Modify flush handling for offload path"
c9583cba9913682e1c181675c6d0066292fb719d 07-Feb-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: OffloadThread state fix"
010c4c8ec50eb04ece15f792c508a3b869749310 07-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Fix IoConfigEvent constructor initializer list"
4c6a433d74d5ae8b9bc0557207e3ced43bf34a25 15-Jan-2014 Haynes Mathew George <hgeorge@codeaurora.org> AudioFlinger: Offload track transition fix

Trigger state changes in OffloadThread on adding a new offload track.

Bug: 12530661
Change-Id: I95b62764c7ac041d470702e86b951f812eb0e70f
udioflinger/Threads.cpp
udioflinger/Threads.h
7844f679be8d94c5cdf017f53754cb68ee2f00da 15-Jan-2014 Haynes Mathew George <hgeorge@codeaurora.org> AudioFlinger: Modify flush handling for offload path

Do not allow an offload track to directly control the offload thread
behavior. OffloadThread can check for any pending flush reporting
by its active tracks and decide to flush the HW or not.

Bug: 12530661
Change-Id: Ib33f023c942f6c091b618004136b153c38a6eef6
udioflinger/PlaybackTracks.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
0f02f265123b7ef2fd6ac09ff70cde26eb5559ad 11-Jan-2014 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: OffloadThread state fix

When switching from one offload session to another that
reuses the same offload output, audio HAL is paused & flushed in
preparation for the new track

OffloadThread must reset mHwPaused to allow proper state transitions
for the second track. In addition, Offload thread need not
explicitly call resume on HAL while handling a flush.

Bug: 12530661
Change-Id: I8173845e1782b5a8b372a82c7d337299a61e0efe
udioflinger/Threads.cpp
3ce28aa3cb5262775180a8b423cfb4a5670ebc59 05-Feb-2014 Martin Storsjo <martin@martin.st> AudioFlinger: Remove code for supporting resampling in fast tracks

This isn't used at the moment.

Change-Id: I4e0fb2af5f7d959dbafd5ddb7defa1c6b8e8636a
udioflinger/FastMixer.cpp
udioflinger/FastMixerState.cpp
udioflinger/FastMixerState.h
udioflinger/Threads.cpp
412d4744efae64083e4f99a664e3efaba031af48 05-Feb-2014 Andreas Huber <andih@google.com> Merge "FINAL ATTEMPT: HTTP services are now provided from JAVA and made available to media code"
4a25471795b05ffcfcc079e9f9cb5ed549023d14 05-Feb-2014 Glenn Kasten <gkasten@android.com> am 5ef74dce: am d66cd743: Merge "audioflinger: conform inline ASM to UAL"

* commit '5ef74dce64a1b70534547c044a6d15533f4a9dca':
audioflinger: conform inline ASM to UAL
7332c37c459f5f382a9e4105d522d1c5a7f6f0b5 05-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "audioflinger: Fix for a deadlock in track creation"
2a16afb8dc056877f34124ba5befe75171de930f 05-Feb-2014 Glenn Kasten <gkasten@google.com> Merge "Fix unused parameter warnings in audio"
1b86fe063badb5f28c467ade39be0f4008688947 29-Jan-2014 Andreas Huber <andih@google.com> FINAL ATTEMPT: HTTP services are now provided from JAVA and made available to media code

Change-Id: I9f74a86e70422187c9cf0ca1318a29019700192d
amera/libcameraservice/CameraService.cpp
ce6249980434dd04e0eac397083d917cdc4452e9 24-Jan-2014 Ruben Brunk <rubenbrunk@google.com> camera3: Update maxRegions tag.

Change-Id: I22501cbf7f941d9626b88182e2dda8a13a620d01
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
5f51ade2c290e239a125dc88943b240e1105fd97 04-Feb-2014 synergy dev <synergye@codefi.re> audioflinger: conform inline ASM to UAL

Clang requires some inline ASM to conform to the UAL standards (Unified Assembler Language).
This fixes a small issue in this inline asm to allow building.

Change-Id: Ifd9b1814343ab5ade636b9401a21d575559dac16
udioflinger/AudioResampler.cpp
6e0d67d7b496ce17c0970a4ffd3a6f808860949c 31-Jan-2014 Glenn Kasten <gkasten@google.com> Use Format_isValid() and Format_isEqual() instead of direct comparison

Change-Id: Ie87607aa514976947540a77775e6425c4e56e7d9
udioflinger/AudioFlinger.cpp
udioflinger/FastMixer.cpp
udioflinger/Tracks.cpp
a98a58ce32f4ad1bdb7692184eb17622fb11e397 04-Feb-2014 Andy Hung <hunga@google.com> Merge "Fix dynamic resampling for non-NEON devices"
83be2560d9396b3bd32919123bd67a783e6aaf7c 03-Feb-2014 Andy Hung <hunga@google.com> Fix dynamic resampling for non-NEON devices

The stride by 16 code template automatically falls back to stride by 2
(as the NEON code template override does not occur).
As such the stride by 2 (in the switch) was removed as it was unnecessary.
Removing the if() causes the fall back to happen properly for non-NEON
compilation.

Change-Id: Ia7aec6ae1d88eb54377e56e2fb57f2ae5b74cf1b
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResamplerDyn.cpp
0f11b51a57bc9062c4fe8af73747319cedabc5d6 01-Feb-2014 Glenn Kasten <gkasten@google.com> Fix unused parameter warnings in audio

Change-Id: I665ba3358dd9502f0adec70d486e7bf8a2e1b0fe
udioflinger/AudioFlinger.cpp
udioflinger/AudioPolicyService.cpp
udioflinger/Effects.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
edialog/MediaLogService.cpp
49debee5bdddd7a1e0742a3ab66d4630bbe25ca2 01-Feb-2014 Glenn Kasten <gkasten@google.com> Fix IoConfigEvent constructor initializer list

Fortunately this bug never showed up, because the parameter
field has not been used yet.

Change-Id: I2b36e2b7e1dcc2039c494fc5ea4994d262435aac
udioflinger/Threads.h
398f21348e5100289f6e5be30c8b5257fa04aaf9 31-Jan-2014 Martin Storsjo <martin@martin.st> AudioTrack: Never try to use the fast path if resampling is required

Unless AudioFlinger was built with FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE
enabled, AudioFlinger would deny using the fast path (and internally
fall back to the normal codepath) when it realized that resampling
was required. Since the buffer size calculations within AudioFlinger
don't take resampling into account properly (see the calculation
below "AUDIO_OUTPUT_FLAG_FAST denied" in audioflinger/Threads.cpp,
just below the hunk that this patch changes), make sure AudioTrack
doesn't try to use the fast path if resampling is required.

This removes the possibility to enable
FAST_TRACKS_AT_NON_NATIVE_SAMPLE_RATE in AudioFlinger since it
AudioTrack now won't even try to use the fast path for content
that requires resampling, regardless of the AudioFlinger configuration.

Change-Id: Icf0f8ad50bf0fdb84657f518c0120aa0535f23f9
udioflinger/Configuration.h
udioflinger/Threads.cpp
9e0308c03d4e76d3146cbb6e30aeb3ac03f05cf5 30-Jan-2014 Andy Hung <hunga@google.com> Enable new dynamic audio resampler as default

The default may still be overridden by af.resampler.quality
in the local or build properties file. For the build properties
check the relevant device.mk files.

In the absence of being overridden, the 44.1 to 48kHz and
48 to 44.1kHz conversion will use the DYN_MED_QUALITY resamplers
and other conversion will use the DYN_LOW_QUALITY resamplers.

Change-Id: Icf9a4af5422cddc445e1904eef93984b0abe6a44
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
udioflinger/AudioResampler.cpp
745e9a8283b56c7772ee7d72383a3f2e012e1ef9 21-Dec-2013 Eric Laurent <elaurent@google.com> audioflinger: fix static track end detection

If a static track is not a fast track,
prepareTracks_l() must rely on framesReady() to
detect end of buffer and remove the track from the active
track list.
Failing to do so results in the track staying active but
not processed by the mixer because in underrun. This leaves the
mix buffer content uninitialized and causes the effect process
function to accumulate its output onto undefined data.

Bug: 12013676.
Change-Id: Iad72c921fa18d34811abf7d1073890c093a27725
udioflinger/Threads.cpp
e983e0a0017fce81dc3d9bea36f5abb7b7bce40b 30-Jan-2014 Andy Hung <hunga@google.com> Merge "Remove warnings in Audio mixer resampler compilation."
03e9e83c47ab4a518da0a1f36b8f702f59221c95 14-Dec-2013 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: Fix for a deadlock in track creation

AudioFlinger enters a deadlock (with itself) on trying to free a
RecordTrack or Track object that failed initialization. Clear this
bad object from the caller instead.

Bug: 12423233
Change-Id: I926f2beb922a70f6924e593e2bbf1a5b5df85b16
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
ee931ff7d6620e5705f4dfba901fdb03fa4a35fd 28-Jan-2014 Andy Hung <hunga@google.com> Remove warnings in Audio mixer resampler compilation.

Change-Id: Ie68766142796772a54a90afdea188d0a5a78d4ac
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioMixer.cpp
udioflinger/AudioResampler.cpp
000a4193dd82549192277fd4b9bb571d8a4c262f 30-Jan-2014 Eric Laurent <elaurent@google.com> audioflinger: fix record thread exit pending check

RecordThread loop must not release the mutex after checking for
exitPending and before waiting for a new wake up condition.
This can happen under the hood when methods like processConfigEvents_l()
or checkForNewParameters_l() are called. So exitPending() must
be checked after calling these functions.

Bug: 12787961.
Change-Id: Ia18c518bd5344fbb2401067303fcfe76a86879c4
udioflinger/Threads.cpp
0eed5ac1a14067d0fd51282e97b43b4fd9121842 29-Jan-2014 Glenn Kasten <gkasten@google.com> Merge commit 'adf3f9b9' into manualmerge

Change-Id: Icdef7d075b160eb2a5ced7c57f90c6a6a4b4c64a
1bf0eecd2ec6a3b3e29ad2c91bcefda76abef2fe 29-Jan-2014 Glenn Kasten <gkasten@android.com> Merge "AudioMixer: Remove tracks from enabledTracks after reseting outTemp"
7e79cd2d3067cdb7b9daf639cf772d4dd149c934 06-Jan-2014 Gaurav Kumar <gaurav.kumar@broadcom.com> AudioMixer: Remove tracks from enabledTracks after reseting outTemp

If any track goes through AudioMixer::process__genericNoResampling, and
its getnextbuffer returns NULL, Then that track is removed by AudioMixer
from enabledTracks.

Thus if all tracks getnextbuffer return NULL, Then this function doesn't
reset outTemp and last buffer in AudioFlinger's mMixBuffer will be
repeated and noise is observed.

Remove tracks from enabledTracks after reseting outTemp to zero, so that
process__genericNoResampling will reset outTemp and noise won't appear.

Bug: 12450065
Change-Id: I1ccac7ee4a3bf7fd930254356c072099e11e7c19
Signed-off-by: Gaurav Kumar <gaurav.kumar@broadcom.com>
Signed-off-by: Pierre Couillaud <pierre@broadcom.com>
udioflinger/AudioMixer.cpp
894fb7bc41dc8c3b8fb7d21ba24a5777c4347a5b 29-Jan-2014 Zhijun He <zhijunhe@google.com> Camera: fix focusArea wrong indexing issue

Bug: 12304559
Change-Id: Id28b35fdd9697c1ec3365f617996801965de8bd0
amera/libcameraservice/api1/client2/Parameters.cpp
5f44635dc35814b98b4dc2b255355a93122fec59 22-Jan-2014 Zhijun He <zhijunhe@google.com> camera3: Delete output stream of bi-directional stream

Bi-directional stream (like Zsl stream) is both input and output streams. When
deleted, both streams need to be deleted.

Change-Id: I8b6bb9054fec264cc03754003797de0bae10cb20
amera/libcameraservice/device3/Camera3Device.cpp
4bbf8ea1f17e85123abd2b037d357e2a89664511 27-Jan-2014 Zhijun He <zhijunhe@google.com> Merge "Camera: delete preview callback when preview size is changed"
ad1763b4ae3c60eb11182d2fd4c5a79f15275a52 27-Jan-2014 Zhijun He <zhijunhe@google.com> Merge "Camera3: Flush device before ZSL reprocess"
1862a008db748fd55834345dffe298078455d5c3 24-Jan-2014 Zhijun He <zhijunhe@google.com> Merge "Camera: delete zsl stream for video mode"
f0002d142e6d24c5438600b2c259679de710f8ac 24-Jan-2014 Glenn Kasten <gkasten@google.com> Merge "Replace control block frameCount_ by explicit in/out parameter"
c1b7cc4d3eeb55fd03ff77b099b827e7568480e4 21-Jan-2014 Zhijun He <zhijunhe@google.com> Camera: delete preview callback when preview size is changed

Preview callback stream is left configured even the preview size is changed.
This makes the callback stream unnecessarily configured even in recording mode,
which could cause distorted preview for some devices.

Bug: 12210027
Bug: 12591410
Change-Id: If50cddfe5562e91aec1feb1760eccb82ddb21730
amera/libcameraservice/api1/Camera2Client.cpp
491e341211b4772c75f719158f6b397e1c40497d 27-Dec-2013 Zhijun He <zhijunhe@google.com> Camera3: Flush device before ZSL reprocess

Call flush before sending ZSL reprocess request. This not only ensures no
in-flight requests pending in the HAL before ZSL reprocess request, but also
makes reprocess request to be processed by the HAL sooner.

Bug: 12230973
Change-Id: I4c9e5a0fb75ccdc1e8861262c08d599d04170b7f
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/device3/Camera3Device.cpp
c69b91ceae6255e41c5413796fb0ed4f7af45b15 18-Jan-2014 Ruben Brunk <rubenbrunk@google.com> camera3: Update sceneMode tag spec.

Change-Id: I495435397086a295280c556d94fe8efd442a12c3
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/Parameters.cpp
0ce5ca5e113d58cbcb7cb48615d6dbbf3fbe7c66 17-Jan-2014 Glenn Kasten <gkasten@google.com> Merge "Cleanup createTrack error handling"
6a507298357c9ff869b97db57a890e58bd6bdec0 17-Jan-2014 Glenn Kasten <gkasten@google.com> Merge "AudioRecord::getInputFramesLost() cleanup"
0cde076ddb283c84c3801a2df4cc3df99bd1577f 17-Jan-2014 Glenn Kasten <gkasten@google.com> Cleanup createTrack error handling

Similar to cleanup done earlier for openRecord in this CL:
> Change-Id: I84897dd7d30b370640b54e928f230604b873cb68

Bug: 10888816
Change-Id: I804a47f898e0319a60a9bd58906bbb037e45cc25
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
b1c8d9fbc69e2f103699d24a81c2406e52a94c9f 15-Jan-2014 Eino-Ville Talvala <etalvala@google.com> am a2949165: am 3eccdde9: am c7614eb7: Merge "libcameraservice: Fix build in ISO C++11 mode"

* commit 'a2949165680158db31dc1fce32f62bbe70c31820':
libcameraservice: Fix build in ISO C++11 mode
c7614eb7cf2e3e121baa3de26e3622974a163786 15-Jan-2014 Eino-Ville Talvala <etalvala@google.com> Merge "libcameraservice: Fix build in ISO C++11 mode"
dbed8955148dd2fe39584007c528e3a532f1a04e 15-Jan-2014 Glenn Kasten <gkasten@google.com> Merge "Fix error handling in AudioSystem::getOutputForEffect"
5f972c031d4061f4f037c9fda1ea4bd9b6a756cd 13-Jan-2014 Glenn Kasten <gkasten@google.com> AudioRecord::getInputFramesLost() cleanup

Fixed bug that if the binder call failed (for example if the
IAudioFlinger binder is dead), then getInputFramesLost was returning
garbage. Now it correctly returns zero, which is the error value for
this method.

The type declarations for getInputFramesLost were inconsistent:
a mixture of unsigned int, size_t, and uint32_t. Now it returns uint32_t
everywhere, which is what the underlying HAL API returns.

Added a FIXME about the side effect behavior. This will need review
for multi-client.

Change-Id: Ifa2e117a87dbd0c1f2c892a31d1c3dd919bf1a0a
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
udioflinger/Threads.h
5b27ccd67c845aa20a12a1fb58339e7e81e3d536 15-Jan-2014 Glenn Kasten <gkasten@google.com> Merge "Use AUDIO_SESSION_ALLOCATE instead of 0"
03f696e3eb89c0642f9a2b761ff2cfc6af003d16 10-Jan-2014 Andy Hung <hunga@google.com> Merge "Improve dynamic audio resampler filter generation"
6340829ffb9ff7586ffb88a214f56340d4c70d60 10-Jan-2014 Glenn Kasten <gkasten@android.com> am 0ba9f9b0: am d8d45edf: am 61540b5f: Merge "Frameworks: AudioFlinger: Fix effects memory leak"

* commit '0ba9f9b07d47e9e6b374798f397fe961256a6029':
Frameworks: AudioFlinger: Fix effects memory leak
61540b5fe82cad1c6baa018f02bd2554e62e4364 10-Jan-2014 Glenn Kasten <gkasten@android.com> Merge "Frameworks: AudioFlinger: Fix effects memory leak"
efa6ea97022780b68e595e5326e30dbe2a799202 08-Jan-2014 Glenn Kasten <gkasten@google.com> Fix error handling in AudioSystem::getOutputForEffect

and AudioPolicyService::getOutputForEffect.
The conventional error value for audio_io_handle_t is 0,
not a status_t cast to audio_io_handle_t.

Change-Id: I34b3fd1a50f3fa1cbf39f32eea1911112a4e094a
udioflinger/AudioPolicyService.cpp
6582f2b14a21e630654c5522ef9ad64e80d5058d 03-Jan-2014 Andy Hung <hunga@google.com> Improve dynamic audio resampler filter generation

Improve dynamic audio resampler filter generation speed by 2x.
The resulting filters should be the same (excepting roundoff).

Also added check for upsampling sample rate changes to share
previously generated filters.

Modify the profiling to improve output format and sampling result
reliability.

Change-Id: I9aa6b914fd552a63f79dd4a95945df2f8275772a
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerDyn.h
udioflinger/AudioResamplerFirGen.h
udioflinger/test-resample.cpp
0bcfa88149e2404b34d13c622e3921e1b846cdf8 28-Dec-2013 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: update track ready condition

Signal track ready if the track isStopping().

Bug: 12423190
Change-Id: Ie279995d5f90fa8211a20dfbeacc1cf9b921d0bf
udioflinger/Tracks.cpp
67d15f9ab45e7c03b23c871f680b1fae577ac43a 07-Jan-2014 Eric Laurent <elaurent@google.com> Merge "audioflinger: fix static track end detection"
04143e411f18557579651a41de8f20edc2f8856a 30-Dec-2013 Andy Hung <hunga@google.com> Merge "Audio resampler update to add S16 filters"
86eae0e5931103e040ac2cdd023ef5db252e09f6 09-Dec-2013 Andy Hung <hunga@google.com> Audio resampler update to add S16 filters

This does not affect the existing resamplers.
New resampler accessed through additional quality settings:

DYN_LOW_QUALITY = 5
DYN_MED_QUALITY = 6
DYN_HIGH_QUALITY = 7

Change-Id: Iebbd31871e808a4a6dee3f3abfd7e9dcf77c48e1
Signed-off-by: Andy Hung <hunga@google.com>
udioflinger/Android.mk
udioflinger/AudioResampler.cpp
udioflinger/AudioResampler.h
udioflinger/AudioResamplerDyn.cpp
udioflinger/AudioResamplerDyn.h
udioflinger/AudioResamplerFirGen.h
udioflinger/AudioResamplerFirOps.h
udioflinger/AudioResamplerFirProcess.h
udioflinger/AudioResamplerFirProcessNeon.h
udioflinger/test-resample.cpp
f0b7026fca225581c7711e4d802117869b66e9dc 26-Dec-2013 Zhijun He <zhijunhe@google.com> Camera2 API: fix front facing camera flip issue

Camera stream transform calculation should take camera facing into account.
For example, front facing camera preview stream should be horizontally or
vertically flipped.

Bug: 12300670
Change-Id: Ib497f0b8c3e65974de05d4f0aca3c51e99717c3d
amera/libcameraservice/api2/CameraDeviceClient.cpp
13e4c960ea3db03a43e084fbd85d52aa77f7b871 21-Dec-2013 Eric Laurent <elaurent@google.com> audioflinger: fix static track end detection

If a static track is not a fast track,
prepareTracks_l() must rely on framesReady() to
detect end of buffer and remove the track from the active
track list.
Failing to do so results in the track staying active but
not processed by the mixer because in underrun. This leaves the
mix buffer content uninitialized and causes the effect process
function to accumulate its output onto undefined data.

Bug: 12013676.
Change-Id: Iad72c921fa18d34811abf7d1073890c093a27725
udioflinger/Threads.cpp
aea7ea06394bcb155972d82055d4ea59962e4051 26-Jun-2013 Glenn Kasten <gkasten@google.com> Use AUDIO_SESSION_ALLOCATE instead of 0

Also fix a couple of places where we were using AUDIO_SESSION_OUTPUT_MIX,
which happens to also be equal to 0, but has a different meaning.

Change-Id: I90e39be3b89f5021a96d9e3b8d10929013ca977f
udioflinger/AudioFlinger.cpp
74935e44734c1ec235c2b6677db3e0dbefa5ddb8 19-Dec-2013 Glenn Kasten <gkasten@google.com> Replace control block frameCount_ by explicit in/out parameter

in IAudioFlinger::createTrack and IAudioFlinger::openRecord

Change-Id: I09c644c80e92c8e744b1b99055988a2588b2a83d
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
47f3f5a119194d4c06815453be9950ba112c8e3e 18-Dec-2013 Glenn Kasten <gkasten@google.com> Fix bug in test-resample's AudioBufferProvider

The contract for AudioBufferProvider::releaseBuffer() was missing.

Bug: 12194314
Change-Id: I2fcf75e7b8eaf6db34f360206d79457a04a73565
udioflinger/test-resample.cpp
bd72d22097f78f5bd668b223bc8c94e351311e31 18-Dec-2013 Glenn Kasten <gkasten@google.com> Add ability to read .wav files to test-resample

Previously test-resample could only read .raw files, and the input
sample rate had to be specified. Now the input sample rate is derived
from the input file. This also allows us to read 8-bit PCM files,
and other formats such as floating-point in the future.

However, the ability to read raw files is lost.
A workaround is to use sox or equivalent on the host.

Change-Id: Icd06b4d02482b3ad07bf03979f46860e68d38ad9
udioflinger/test-resample.cpp
f5293648b727fb3909cd2300a73377f032f8b050 17-Dec-2013 Glenn Kasten <gkasten@google.com> Use libsndfile to write .wav files

This will reduce code duplication, and allow us take advantage of more
advanced capabilities of libsndfile in the future.

Change-Id: I25fa2b6d0c21e325aeaf05bda62cf7aab0c5deb4
udioflinger/Android.mk
udioflinger/test-resample.cpp
9a1c785c019bdb25fefa7d1c0e50862ddc0e4e21 18-Dec-2013 Glenn Kasten <gkasten@google.com> Merge "Fix several test-resample BufferProvider bugs"
e00eefe64e3bad166c672db96c9c35992766e819 17-Dec-2013 Glenn Kasten <gkasten@google.com> Fix several test-resample BufferProvider bugs

Previously getNextBuffer always returned the same data address over
and over. Now it correctly returns the right portion of the input buffer.

Previously getNextBuffer always returned the total number of frames in
the input, which might be larger than the size requested by the caller,
and/or larger than the number of remaining input frames. It also always
returned successfully, even when there should be no frames available.
This violates the contract for getNextBuffer. Now getNextBuffer will
return the maximum of the number of frames requested, and the number of
remaining frames available. If that maximum is zero, getNextBuffer will
return an error instead.

Previously releaseBuffer would silently allow releasing more frames than
were actually gotten, which violates the contract for releaseBuffer.
Now releaseBuffer checks for this and logs a message if it happens.

Add 'v' (verbose) option to log buffer provider calls.

Bug: 12194314
Change-Id: I9b915e954b3612a07ef271da8652486b8875e0fd
udioflinger/test-resample.cpp
c95616357a911e5c1c55873492b05ebfa3cf1894 04-Dec-2013 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: check for condition before waiting

AsyncCallbackThread must check for any condition that
has already been satisfied before waiting.

Bug: 11824817
Change-Id: Ic8c2090d521ecd6a30b76ee75635258d35eb1eff
udioflinger/Threads.cpp
688ca6330a5e7d072f67a1791e464fa7dec08b72 17-Dec-2013 Glenn Kasten <gkasten@google.com> am 5c474238: am 5893736d: am a67c7653: Merge "Increase kFastTrackMultiplier from 1 to 2"

* commit '5c474238bc579224ec8f7267d05651b0aa934100':
Increase kFastTrackMultiplier from 1 to 2
a67c76538fff102cd44b2f38dd073df5f2a33605 17-Dec-2013 Glenn Kasten <gkasten@google.com> Merge "Increase kFastTrackMultiplier from 1 to 2"
24a325d6f8c4bbf9330e6ce0c769d46e04266ffc 04-Dec-2013 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: check for condition before waiting

AsyncCallbackThread must check for any condition that
was already been satisfied before waiting.

Bug: 11824817
Change-Id: Ic8c2090d521ecd6a30b76ee75635258d35eb1eff
udioflinger/Threads.cpp
70aca464f7e39a3b208341f442b6fc2316e17147 05-Dec-2013 Glenn Kasten <gkasten@google.com> Merge "Add RecordThread media.log and deferred deallocation"
0312b69e65e4c8bf6a0c0757d9100dee3651c16e 05-Dec-2013 Glenn Kasten <gkasten@google.com> Merge "Change mActiveTrack to mActiveTracks vector"
481fb67a595f23c5b7f5be84b06db9b84a41a42f 30-Sep-2013 Glenn Kasten <gkasten@google.com> Add RecordThread media.log and deferred deallocation

This change allows a media.log buffer for RecordThread.

Unlike playback threads which stick around forever, the RecordThread comes
and goes for every capture session. This means that the media.log buffer
for a RecordThread would disappear too, and so was useless. Now when a
thread exits, it's associated media.log buffer is just marked for deferred
deallocation. It is only actually freed when the memory is needed.

Other changes:
- Fix bug in unregistering comparison, it was comparing the wrong pointers
- Increased size of log area so we can log for RecordThread also

Change-Id: If45d4c03a793b86390a0112ec3acc5d41b2e3635
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
dfe715582943b3fc9bab91f88257a3bba6c6deef 05-Dec-2013 Ruben Brunk <rubenbrunk@google.com> camera2: Fix race with stream deletion during disconnect.

Bug: 11856804

- Shutdown order in Camera2Client allows a stream to be
deleted before the corresponding processing thread has
quit. This can result in updates being called on the
processor thread without a valid stream.
amera/libcameraservice/api1/Camera2Client.cpp
b5fed68bcdd6f44424c9e4d12bfe9a3ff51bd62e 03-Dec-2013 Glenn Kasten <gkasten@google.com> Increase kFastTrackMultiplier from 1 to 2

Change-Id: I158f147295eebcea96e4047d7618069bc48bdd7d
udioflinger/Threads.cpp
866d90595a177f6027e97161781948baebf2aa68 02-Dec-2013 Glenn Kasten <gkasten@google.com> Merge "Code simplification and movement to prepare for mActiveTracks"
138851bd3cadfb60238f87567e24808925731837 27-Nov-2013 Zhijun He <zhijunhe@google.com> camera2/3: Add protection for still capture path

Jpeg stream in JpegProcessor could be deleted while process new capture is
ongoing, which unsafe to access a dead consumer endpoint.
Bug: 9316454
Change-Id: I2950f31ea28d0ba01f08502e2e3ba452bf8bb818
amera/libcameraservice/api1/client2/JpegProcessor.cpp
480acec40aa2d96119530c7d451282af8cf07327 23-Nov-2013 Glenn Kasten <gkasten@google.com> Merge "Fix bug in creation of EffectHandle when out of memory"
639512ce33fb19c876b1be68555d83ccda6e7ad7 23-Nov-2013 Glenn Kasten <gkasten@google.com> Merge "Consistent error checking for sp<IMemory> and pointer()"
04733dbdede313fc5e291070014c1a0641fe6166 22-Nov-2013 Eric Laurent <elaurent@google.com> audioflinger: fix offload write buffer offset

Fix current audio HAL write buffer offset calculation
which assumes that the frame size is a multiple of 2.

Change-Id: I0195ed5cfef225a6f114e7dd405a02680bb7254e
udioflinger/Threads.cpp
5b19084a5089e3f6527a82440a1c8227c3a366fa 21-Nov-2013 Zhijun He <zhijunhe@google.com> Merge "Camera3: Remove request from InFlightMap for error case"
1b05dfc8df5e741086747d076fc39c79fb4acb33 21-Nov-2013 Zhijun He <zhijunhe@google.com> Camera3: Remove request from InFlightMap for error case

We don't expect HAL send back valid result metadata if error occurs for a
request, such as during flush call. The request needs to be removed from in
flight request map accordingly.

Bug: 9758581
Change-Id: I51fe327337325ce72f11ce592778a2af02e98479
amera/libcameraservice/device3/Camera3Device.cpp
2b806406ac1ec680b6fe3aaa84c54bdc4e43ad8d 21-Nov-2013 Glenn Kasten <gkasten@google.com> Change mActiveTrack to mActiveTracks vector

The size of mActiveTracks is still limited to 1 for now.

Change-Id: Ia6b06b25d8c4709f087110ae29c589999407a2a2
udioflinger/Threads.cpp
udioflinger/Threads.h
f10ffec18f930d92e1abe9200d60e746831841a7 21-Nov-2013 Glenn Kasten <gkasten@google.com> Code simplification and movement to prepare for mActiveTracks

Share code to acquire wake lock at entry to loop

Change-Id: I01fb645de9417055c0adfc6a4c4011bf22ea4f94
udioflinger/Threads.cpp
e75da4004b2c814987aa2adf8a76190f92d99c65 20-Nov-2013 Glenn Kasten <gkasten@google.com> Fix bug in creation of EffectHandle when out of memory

If there is insufficient client memory to create the EffectHandle,
it was returning a handle which would be useless. Now it correctly
reports the out-of-memory error back to client.

Change-Id: I894e65d5d17df39383032c1527be6ccd35f578bb
udioflinger/Effects.cpp
udioflinger/Effects.h
udioflinger/Threads.cpp
663c2247b71086e30bfd3192979d1dd7f15c539e 24-Sep-2013 Glenn Kasten <gkasten@google.com> Consistent error checking for sp<IMemory> and pointer()

There have been concerns that an sp<IMemory> could be non-0, but the
associated pointer() still be NULL. There are rumors this may happen
when a non-0 sp<IMemory> is passed in by client but the shared memory cannot
be re-mapped into mediaserver.

There's also evidence in the early (2009/03/03) pre-git code of checking
pointer() for NULL, after a local allocate() returned a non-0 sp<IMemory>.
It's not clear if this is "cargo cult" paranoia, or if there was a
genuine reason for the check.

In any case, we now consistently check pointer() for sp<IMemory>
input parameters in createTrack() and queueTimedBuffer().

We also check after successful allocate(). If allocate() returns a
non-0 sp<> but NULL pointer(), then treat it as if the allocate() had
returned 0.

Change-Id: I3013ac5766b493d443ecef71711ec861076a623e
udioflinger/AudioFlinger.cpp
udioflinger/Tracks.cpp
30ff92cba19c5acd747631365db1e1084e45ab34 20-Nov-2013 Glenn Kasten <gkasten@google.com> Code simplification for timed allocate

Change-Id: I5acccd7418c5b4a4dc0112147c750fef9f74bf33
udioflinger/Tracks.cpp
b50df220ae76c7bb6e78b096ece06b2609cf4ffe 19-Nov-2013 Zhijun He <zhijunhe@google.com> Merge "Camera3: add systraces for hal open/close"
213ce79e943a3b51d7859a184d8211c859c960a0 19-Nov-2013 Zhijun He <zhijunhe@google.com> Camera3: add systraces for hal open/close

Bug: 10901465
Change-Id: I32fb96aa0f9efd423bdb9a3d92c142a096a7a47f
amera/libcameraservice/device3/Camera3Device.cpp
3bd2531ac7c87b85bc9f5abf558b5dc247caaa86 18-Nov-2013 Igor Murashkin <iam@google.com> Merge "camera3: Remove BufferQueue::MIN_UNDEQUEUED_BUFFERS references"
054aab3479a094b0a04d48db9cb8f325ea5be162 18-Nov-2013 Igor Murashkin <iam@google.com> camera3: Remove BufferQueue::MIN_UNDEQUEUED_BUFFERS references

Change-Id: I4730ac7849e915e88d3b8fc8aa869f53a8242501
amera/libcameraservice/device3/Camera3InputStream.cpp
amera/libcameraservice/device3/Camera3InputStream.h
amera/libcameraservice/device3/Camera3ZslStream.cpp
amera/libcameraservice/device3/Camera3ZslStream.h
amera/libcameraservice/gui/RingBufferConsumer.h
731076cc7857fe322eed018569a2a67f6eac0e54 15-Nov-2013 Eric Laurent <elaurent@google.com> am 06d62548: am d7e59228: audioflinger: do not use raw pointer for tracks

* commit '06d6254823b8f7a46690369e57b5f149c94c9f65':
audioflinger: do not use raw pointer for tracks
d7e59228caad3867794d847f6bf163c6495e9506 15-Nov-2013 Eric Laurent <elaurent@google.com> audioflinger: do not use raw pointer for tracks

Commit 9da3d95 surfaced a problem caused by the use of a raw
pointer to a track in offload thread implementation.

Pointers to tracks should always be weak or strong pointers.

Bug: 11708529.
Change-Id: Ic48632532d186c9be8261f73cefdf824b9fbbd2b
udioflinger/Threads.cpp
udioflinger/Threads.h
27c70d391da6fde79d2e03fb767f9913555c1e9c 15-Nov-2013 Eino-Ville Talvala <etalvala@google.com> am 0f1ecc2e: am d8a62e25: Camera2: Rework the FPS range vs. FPS single setting detection

* commit '0f1ecc2e2ff84144d5293f7f79ba895538d27f9b':
Camera2: Rework the FPS range vs. FPS single setting detection
d8a62e25ba6520c2531c7a3d32cc8066e1dab776 14-Nov-2013 Eino-Ville Talvala <etalvala@google.com> Camera2: Rework the FPS range vs. FPS single setting detection

Give up on current approach of writing out consistent FPS values
into parameters that will be read back by the app.

- Preserve app's latest set parameters exactly, and compare against
them when detecting if a new FPS range or single FPS value has been
selected.

- Since get() returns exactly what was set(), it doesn't matter if the
app calls getParameters() before its next setParameters(), in terms
of retriggering FPS selection logic. Before, the behavior varied
depending on whether the app re-read the parameters.

- As before, if app changes both range and single FPS in a single set
call, the range set wins. Otherwise, the value that has changed more
recently is used.

Bug: 11570973
Change-Id: I72b5e60c3f60e88d55127dd1bda87e26eaf929c6
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
561879df42b65f44b83c391d78d351e9ad4cb162 14-Nov-2013 Eric Laurent <elaurent@google.com> am 307aa870: am 4215e616: Merge "audioflinger: fix offload track transition" into klp-dev

* commit '307aa87038017dff8ae1dd0262c0ff87723894d7':
audioflinger: fix offload track transition
b04b25321dd323142eec7c5136c81dea3629cf14 14-Nov-2013 Eric Laurent <elaurent@google.com> am b50fa77b: am 9f357f31: Merge "audioflinger: fix offload resume after drain" into klp-dev

* commit 'b50fa77b2cc7dadae1b8ebb591d42976879ac43c':
audioflinger: fix offload resume after drain
9da3d9573a18ffe08365557c706cf52f09118d1c 13-Nov-2013 Eric Laurent <elaurent@google.com> audioflinger: fix offload track transition

Make sure that when transitioning from one active
offloaded track to the next we flush DSP content
if both tracks are not on the same audio session.
This happens when switching between two applications
playing the same type of content (e.g MP3, stereo, 44.1).
In this case, we reuse the same output thread because the track
formats are compatible.

Bug: 11247103.
Change-Id: I2b9031591149adeb70766da5e0d21ff2933a37e8
udioflinger/Threads.cpp
1b9f9b134e732a48198e51f16424f330cbf03143 13-Nov-2013 Eric Laurent <elaurent@google.com> audioflinger: fix offload resume after drain

When pausing and resuming during the drain,
the drain sequence number shuold not be modified
otherwise the drain callback will be ignored.
This causes failure to notify end of stream to audio
player and transition to next song.

Bug: 11247103.
Change-Id: I2a35c5cc3fd6aa667cdd257f9e9cc8715cef5159
udioflinger/Threads.cpp
48da8933f18e7ebd5bccb8de04aada099ed99e74 12-Nov-2013 Eino-Ville Talvala <etalvala@google.com> am 5c2379fd: am 184dfe4e: Camera API2: Add support for partial result quirk

* commit '5c2379fdf93029c683c8bcf41b7b663b9940c921':
Camera API2: Add support for partial result quirk
184dfe4ea5e2ba33951bed2b1366007aee0ce3da 08-Nov-2013 Eino-Ville Talvala <etalvala@google.com> Camera API2: Add support for partial result quirk

- Camera3Device: Include requestId in partial 3A results
- FrameProcessorBase: Add support for partial result listeners
- CameraDeviceClient: Listen and forward partial results to client

Bug: 11115603
Change-Id: If1cc6bbc32932742ac142c058688761ebf6a8024
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/common/FrameProcessorBase.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
579dd27d96497022e534e859c6ebbec675ee07aa 08-Nov-2013 Glenn Kasten <gkasten@google.com> Fix build

Change-Id: I1ecccada22047d9c828152a53ad68b5599ff8827
udioflinger/Threads.cpp
8594843c15b4722ced39436fe9e64f3e57e7ace4 19-Aug-2013 Glenn Kasten <gkasten@google.com> Pull HAL reads out of RecordThread resample

Previously, the resample was indirectly calling HAL read
from within the BufferProvider's getNextBuffer. Now the HAL
read is done ahead of time into a circular buffer,
and the getNextBuffer just reads out of that memory.

This change will permit some future planned features.

Also removed the mono to mono resampling optimization,
as that optimization will no longer be valid in the future.

Change-Id: I59f5016a2df91078d697c37a7dec2d9d9f44542e
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
d8a1de6204829b0379bbd13042f1450bdb203f2b 08-Nov-2013 Glenn Kasten <gkasten@google.com> Merge "Channel counts are uint32_t"
7bf17159f233111a21b293cde8e227231353cd75 07-Nov-2013 Eino-Ville Talvala <etalvala@google.com> am d9d8b7b6: am fd6ecdd3: Camera HAL3/API1: Add support for the partial result quirk.

* commit 'd9d8b7b63514ceea143968b3f114c52755dda9ef':
Camera HAL3/API1: Add support for the partial result quirk.
fd6ecdd39bd83ea020f78b425e96310380d66c35 11-Oct-2013 Eino-Ville Talvala <etalvala@google.com> Camera HAL3/API1: Add support for the partial result quirk.

- Camera2Client:
- Detect partial result quirk
- Camera3Device:
- Accumulate all partial results together
- Fire off 3A-only result once all 3A states are available
- FrameProcessorBase:
- Filter out partials, don't send to listeners
- FrameProcessor:
- Skip face detect on partials
- Make sure to only handle a 3A update for a given frame once
- Trigger AF notifications when AF mode or trigger changes, to
properly detect all AF transitions.

Bug: 11115603
Change-Id: Iea8aa73c568701562a46071f7ea100624251d10b
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/FrameProcessor.cpp
amera/libcameraservice/api1/client2/FrameProcessor.h
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
f551e9961a6f66d63bb57f288c4be01b00725289 20-Aug-2013 Glenn Kasten <gkasten@google.com> Channel counts are uint32_t

Change-Id: I5676b6a291b72d7db6326f7eaf6d17588de51b05
udioflinger/AudioMixer.cpp
udioflinger/Threads.cpp
09faf14b434bec0d184fecec947e3d750bcc64ff 07-Nov-2013 Glenn Kasten <gkasten@google.com> Merge "Rename standby methods"
d6fadf0479b489b09b764070974d8a59855ede64 30-Oct-2013 Glenn Kasten <gkasten@google.com> Simplify track 'needs' bits

Use more standard coding convention for bit masks,
and add a FIXME about max channel count.

Change-Id: I856784016703417ee480b92ae73757c472f9cf95
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
8f32537d028231abed103c68705bc5d07cedf919 30-Oct-2013 Glenn Kasten <gkasten@google.com> Remove redundant this->

Change-Id: Id783201e802b6ce294fa92f4bbe492adfb446686
udioflinger/AudioMixer.cpp
e25b778b11183fda65418ab2142873a030521870 30-Oct-2013 Glenn Kasten <gkasten@google.com> Remove dead code

Change-Id: Ide9196aa348cd3846b5c71d51fe6538f38ea8dc2
udioflinger/AudioMixer.cpp
5c6ba3ad8eed1d59e5e2ffe6b70ced2d582a9def 06-Nov-2013 Glenn Kasten <gkasten@google.com> Merge "Fix race condition in initializing downmix"
49c34acbef91800930b0fe561e0787145a10cfcc 30-Oct-2013 Glenn Kasten <gkasten@google.com> Fix race condition in initializing downmix

The code that initializes downmix GUID searches for an effect of
the right type. If two or more AudioMixers are created, there is a
possibility that the GUID will temporarily have the wrong value.

Now the initialization is only done once, regardless of how many
AudioMixers there are.

Other minor changes:
- use naming convention of leading 's' for static member variables
- log message for no downmix effect is now a warning instead of an error,
since it is not an error until there is actual content to downmix
without a downmix effect

Change-Id: I33ab0e51cf9d24ecaf8ae868883736b0772178c4
udioflinger/AudioMixer.cpp
udioflinger/AudioMixer.h
0699ed950b307663e0f7e01aecdfb505e62df7d6 06-Nov-2013 Glenn Kasten <gkasten@google.com> Merge "Move local declarations to point of first use"
44f412a81dcca8f7149d483eeeee9057ad0101cf 06-Nov-2013 Eric Laurent <elaurent@google.com> am 44dc9155: am 48b6cd98: Merge "audioflinger: fix direct output underrun" into klp-dev

* commit '44dc91554521eaab478674a7f812cb8a4fa4f809':
audioflinger: fix direct output underrun
7bb88779cdc1a1fe1445d6d1691fb7daac932e74 06-Nov-2013 Glenn Kasten <gkasten@google.com> Merge "Rename TrackPaused to trackPaused"
1b3ec0f33cbdcac5e148c23abc5bc4f68d780ed4 06-Nov-2013 Glenn Kasten <gkasten@google.com> Merge "Use const more places"
a23f17ac334ff20a11ee63dd177cb1080e44c483 06-Nov-2013 Eric Laurent <elaurent@google.com> audioflinger: fix direct output underrun

Underruns on tracks handled by a direct or offloaded
threads were not properly reported to the applications
causing a failure to automatically recover.

Bug: 11535001.
Change-Id: I7a8696b4d646f78b16710addfe7c108d0dd0038d
udioflinger/Threads.cpp
93e471f620454f7de73d190521568b1e25879767 19-Aug-2013 Glenn Kasten <gkasten@google.com> Rename standby methods

ThreadBase::standby() returns the value of mStandby.

RecordThread::standby() "overrode" ThreadBase::standby(), but with a
different meaning and no return value. This meant you couldn't
access the parent's class definition within RecordThread.

This could be confusing, so this CL renames RecordThread::standby()
to standbyIfNotAlreadyInStandby().

Change-Id: I9196ee12701dd2dccdfaed922af2d7b8e8774676
udioflinger/Threads.cpp
udioflinger/Threads.h
b91aa63779ad1ce1846fbc604f9ec935e0c67852 19-Aug-2013 Glenn Kasten <gkasten@google.com> Move local declarations to point of first use

Change-Id: I8a078386e371caab5174fc07b47f48fb9f21609a
udioflinger/Threads.cpp
e6f35b13567d920af19f0b8dc35f9120b7cf1dc9 19-Aug-2013 Glenn Kasten <gkasten@google.com> Rename TrackPaused to trackPaused

Change-Id: I3b38e0c9a6bbb6e18cb5b1f72670139a3071cb8f
udioflinger/Threads.cpp
b2737d0b33c17e408d96d6f9eeaa3381479c94c7 19-Aug-2013 Glenn Kasten <gkasten@google.com> Use const more places

Change-Id: Ibc068d319d6fff26f2d11248e17481d8f7f027e0
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
661076292093f82aec488baf8460cdf204a5efd2 01-Nov-2013 Zhijun He <zhijunhe@google.com> Camera: delete zsl stream for video mode

Change-Id: I9ebfe0cb7376092c6ecd71e5c1c5058947282a5f
amera/libcameraservice/api1/Camera2Client.cpp
1c7258b3c34b5656de92d845f6366a0f3ac1e0c6 31-Oct-2013 Eric Laurent <elaurent@google.com> am 4cf799fb: am 5c7ffaed: Merge "AudioFlinger: fix duplicating thread standby." into klp-dev

* commit '4cf799fbbb74de102d34ccb014ba7fbd9bfa5e14':
AudioFlinger: fix duplicating thread standby.
5c7ffaed6f04b844c2e4e2024bfb0203ac2233dd 31-Oct-2013 Eric Laurent <elaurent@google.com> Merge "AudioFlinger: fix duplicating thread standby." into klp-dev
2c3740f01acca69c3e0bcc5e01bb0edc51b6777f 31-Oct-2013 Eric Laurent <elaurent@google.com> AudioFlinger: fix duplicating thread standby.

Commit fd47797 fixing issue 11247103 introduced a regression
where the duplicating thread does not exit standby state as
expected. This in turn prevents the tracks sending audio to
other threads to complete their activity cycle normally.

The fix conists in clearing mStandby state also in the specialized
threadLoop_write() method of DuplicatingThread subclass.

Bug: 11451415.
Change-Id: Ie8a92c819a56a2834ea25fa70a8b7b2125721775
udioflinger/Threads.cpp
06b3aa2f8a431eba782aa8c8f5da19f945678983 30-Oct-2013 Igor Murashkin <iam@google.com> am 34790c86: am 3ff5792a: Merge "camera: Collect stack traces when bad things happen, print with dumpsys" into klp-dev

* commit '34790c866cdc309e3779b811db43f63aa7eae7ef':
camera: Collect stack traces when bad things happen, print with dumpsys
3ff5792adfdbf67662a5f8064315a55690d53944 30-Oct-2013 Igor Murashkin <iam@google.com> Merge "camera: Collect stack traces when bad things happen, print with dumpsys" into klp-dev
1fc6cb5be26734938b3999e6bf4ce0e625e7d284 30-Oct-2013 Eric Laurent <elaurent@google.com> am ce275b7d: am 1c594b63: Merge "audioflinger: enable effects after registration if needed" into klp-dev

* commit 'ce275b7dd20e3d4781a46126c753e6eb998e6c0f':
audioflinger: enable effects after registration if needed
1c594b637df26499ce1dae2db34f2b3290efd838 30-Oct-2013 Eric Laurent <elaurent@google.com> Merge "audioflinger: enable effects after registration if needed" into klp-dev
ff3e31d2b100d8efd969b358b18e4405c49dd10d 24-Oct-2013 Igor Murashkin <iam@google.com> camera: Collect stack traces when bad things happen, print with dumpsys

Bug: 11324229
Change-Id: Ic920e170a8f5a389fc139bbf5416c0e3186c7fb6
amera/libcameraservice/Android.mk
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/utils/CameraTraces.cpp
amera/libcameraservice/utils/CameraTraces.h
d21952fe5bc94f7bb6ee729f806c0e641fdb1a0d 29-Oct-2013 Eric Laurent <elaurent@google.com> am 7f8f7585: am fd477974: AudioFlinger: more fixes for offload audio lost

* commit '7f8f758506a95d6fe5c0e52aa7b5ef82fb18861a':
AudioFlinger: more fixes for offload audio lost
fd4779740ec3e9e865d5514464df26d015354388 26-Oct-2013 Eric Laurent <elaurent@google.com> AudioFlinger: more fixes for offload audio lost

mStandby being false was not a reliable indication that
something had been written to audio HAL.

Considering the last track in mActiveTracks vector as the
latest activated track was wrong as this is a SortedVector.

Bug: 11247103.
Change-Id: I397d011c5afcdd779def3fe25aaae7669a472cfc
udioflinger/Threads.cpp
udioflinger/Threads.h
9cae217050aa1347d4ac5053c305754879e3f97f 14-Jan-2013 Marco Nelissen <marcone@google.com> Assign blame for playback wakelocks.

Set a work source for the playback wakelock, so that playback is
counted against the requesting app instead of the media server.

Cherrypicked from master.

b/9464621

Change-Id: I7329f88a288a95a582a78005a1c3d16a5a611e31
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/PlaybackTracks.h
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
462fd2fa9eef642b0574aa7409de0bde3fec8d43 14-Jan-2013 Marco Nelissen <marcone@google.com> Assign blame for playback wakelocks.

Set a work source for the playback wakelock, so that playback is
counted against the requesting app instead of the media server.

Change-Id: I7329f88a288a95a582a78005a1c3d16a5a611e31
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/PlaybackTracks.h
udioflinger/RecordTracks.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
a153b68f2260a8ed7fbb236fa659b13264ac5ac0 19-Oct-2013 Glenn Kasten <gkasten@google.com> am 77177fa2: am 95c03858: Merge "Allow releaseBuffer after flush" into klp-dev

* commit '77177fa20773d02b4f9c4147ecb98107f019fa7d':
Allow releaseBuffer after flush
95c03858e2ab4fb693a2bfe47b3caa806e43c044 19-Oct-2013 Glenn Kasten <gkasten@google.com> Merge "Allow releaseBuffer after flush" into klp-dev
2e422c472c91aa7912befd0fc038d1e11f354bc1 18-Oct-2013 Glenn Kasten <gkasten@google.com> Allow releaseBuffer after flush

After AudioTrack start checks for pending flush,
allow releaseBuffer on any previously obtained buffer.
For example, this can happen if the resampler has obtained
a buffer but not released the whole buffer yet.
Note that the resampler will be reading obsolete data.

Bug: 11285590
Change-Id: I0614fbb62e43604aac3089cce4b7797c87a306b5
udioflinger/Tracks.cpp
6a7327f110b86613e6e8c7de105c49803acacc1d 18-Oct-2013 Eric Laurent <elaurent@google.com> am 6edd8ca5: am 6a51d7ed: audioflinger: fix track terminated before playing

* commit '6edd8ca5b7e3d169db4314d2b994bc9d48e9e082':
audioflinger: fix track terminated before playing
6a51d7ed7062536ccc892c8850a34ed55cbc8d5c 18-Oct-2013 Eric Laurent <elaurent@google.com> audioflinger: fix track terminated before playing

When a track is terminated before any audio was written,
we should not send a drain request to the HAL. The drain
will be ignored and we will wait the async callback for ever.

Also fix a potential deadlock by not deleting a track with the
thread mutex held: mPreviousTrack changed from a sp to a raw pointer.

Bug: 11247103.
Change-Id: I0a4b47b099204c7c326d45d700234ab8f72d8eae
udioflinger/Threads.cpp
udioflinger/Threads.h
9138d32050411c04cc45c25094352cf8b6e01df9 18-Oct-2013 Glenn Kasten <gkasten@google.com> am e45796de: am dedc7b0f: Merge "Fix flush() followed by start()" into klp-dev

* commit 'e45796dee9c072cdb13a00b407e68be2cd55e2f2':
Fix flush() followed by start()
12022ff8d223ccf4dfae019c81e4a93a3f44985c 17-Oct-2013 Glenn Kasten <gkasten@google.com> Fix flush() followed by start()

Bug: 11259166
Change-Id: I72526cdfd4e3ff4b06e6a317e577f57cc285205d
udioflinger/Tracks.cpp
d6c628f6db7e1b5079cb9a60cf84208891001ec4 17-Oct-2013 Zhijun He <zhijunhe@google.com> am dddafa84: am 3defdab8: Merge "Camera: don\'t do hw support check for ZSL" into klp-dev

* commit 'dddafa84dcbd85c11a732e7553d0b884e5a08c27':
Camera: don't do hw support check for ZSL
afada1e56cf0f91be5e44678850fcead2a70cca2 17-Oct-2013 Zhijun He <zhijunhe@google.com> Camera: don't do hw support check for ZSL

Only use camera.disable_zsl_mode to control disable/enable ZSL.

Bug: 11258054
Change-Id: Ibf10b959d0913f7dedb59d89b571e9bf66fe978a
amera/libcameraservice/api1/client2/Parameters.cpp
3278eed31fcf82045ac00dcd549dda5270c88971 15-Oct-2013 Narayan Kamath <narayan@google.com> am 8580679e: am 014e7fa2: Make Audio wakelock names less unique.

* commit '8580679e1780617d978d28a43e932314b86608ce':
Make Audio wakelock names less unique.
e6056ba0f2399fa3ebea9665e12a8237f99de250 15-Oct-2013 Yu Yezhong <yuyezhong@gmail.com> Frameworks: AudioFlinger: Fix effects memory leak

Patch by: csheng@marvell.com
Change-Id: I4e3032fb34643902f98e8fd7c8e894b6452324c9
Signed-off-by: Yu Yezhong <yuyezhong@gmail.com>
udioflinger/AudioPolicyService.cpp
987cd7c8b8697cd4f444135819c8608fe088260f 14-Oct-2013 Zhijun He <zhijunhe@google.com> am 1810a287: am 15ad2470: Camera: Fix deadlock in Camera3OutputStream

* commit '1810a287ecc81c243983051f9b1e32ff92ef1365':
Camera: Fix deadlock in Camera3OutputStream
014e7fa2e90827d911c37bb0ce4d2e10e14d0bb3 14-Oct-2013 Narayan Kamath <narayan@google.com> Make Audio wakelock names less unique.

These wakelocks now show up in the client process, where they
might cause wakelock overflows if AudioFlinger threads die often.

The client process should be agnostic of audio flinger threading,
so don't make the wakelock names rely on audioflinger thread names.

Wakelock names now depend only on the audio flinger thread type, and
not the ID itself.

bug: 11200551

Change-Id: Ia1f71b569cb7502d617b77596abc245f461a6ec0
udioflinger/Threads.cpp
udioflinger/Threads.h
d72b7c0180ee83fc3754629ed68fc5887a125c4c 13-Oct-2013 Eric Laurent <elaurent@google.com> audioflinger: enable effects after registration if needed

This fixes a bug where effects were not properly reenabled after
being moved from one playback thread to another. The effect
is enabled but the audio policy manager sees it as disabled.

Bug: 11181933.
Change-Id: I19cac7acbaf61c546e667fd85ed7d4eda1c716d8
udioflinger/AudioFlinger.cpp
udioflinger/Tracks.cpp
15ad2470b2f2ac34473eb568b606ad75e8e63ac6 12-Oct-2013 Zhijun He <zhijunhe@google.com> Camera: Fix deadlock in Camera3OutputStream

process capture request thread, process capture result and setParameter
binder threads can run into circular locking situation when acquiring
StreamingProcessor lock, Camera3Stream lock, and bufferQueue lock.
Releasing the Camera3Stream lock briefly in process capture request
thread getbuffer call can break this deadlock.

Bug: 11016037
Change-Id: If08d4b134c26be26039b1d5363759e60f911bad6
amera/libcameraservice/device3/Camera3OutputStream.cpp
6d2af34b7b2e3873de76f5834cd324c59a05e270 11-Oct-2013 Zhijun He <zhijunhe@google.com> am 92d27553: am d5ed2263: Merge "Camera: Skip AE precapture when possible" into klp-dev

* commit '92d275536ce3a7f1055627ac087b0f3a9957ad68':
Camera: Skip AE precapture when possible
a0c9584b6841831f1c75c27d027c939b2b4e0762 11-Oct-2013 Eino-Ville Talvala <etalvala@google.com> am c989d2d4: am 1dd08b30: Merge "Camera2/3: Add more tracing for API1" into klp-dev

* commit 'c989d2d4f6f7e63b1572673b390a5e89fa5c5702':
Camera2/3: Add more tracing for API1
d5ed2263a485d6e633fe08f033d04fad75daec6f 11-Oct-2013 Zhijun He <zhijunhe@google.com> Merge "Camera: Skip AE precapture when possible" into klp-dev
1dd08b30e2366cabc50d883885d6229dab8218f2 11-Oct-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera2/3: Add more tracing for API1" into klp-dev
b790abf4d17f1c6865af7eb1595ec94dc0306447 11-Oct-2013 Zhijun He <zhijunhe@google.com> Camera: Skip AE precapture when possible

Skip AE precapture when AE is already converged for still capture use case. This
could save still capture latency 6-7 frame time for AE already converged case.

Bug: 10712902
Change-Id: Ie5512618b76e5d87c62c57c3d96d2004c604e29e
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
2b07e0207da44d7b3cc63c369fd10c9f12a5e2cd 11-Oct-2013 Eino-Ville Talvala <etalvala@google.com> Camera2/3: Add more tracing for API1

- AF state
- Async autofocus completion
- Async takePicture completion
- Stages of takePicture

Bug: 10570497
Change-Id: Ida9fedd81aa4ee3ae3fb8dfada858a3bc3c213a3
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/Camera2Client.h
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
amera/libcameraservice/api1/client2/CaptureSequencer.h
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
amera/libcameraservice/device3/Camera3Device.cpp
f1a968c41875e9487c35e77778270eb24d2ddffb 10-Oct-2013 Zhijun He <zhijunhe@google.com> am b9c0bd8a: am cc27e117: Camera: Save 1 frame time for takePicture call

* commit 'b9c0bd8ac65e8984e63a7e170b198e638fd3467f':
Camera: Save 1 frame time for takePicture call
cc27e117ed01c9a2b4def5a9c7a3103af83ee47e 04-Oct-2013 Zhijun He <zhijunhe@google.com> Camera: Save 1 frame time for takePicture call

Move the latest request signal call right before submitting request to HAL,
which avoids unnecessary 1 frame time wait.

Also fix request status constructor issue, and the log tag for Camera2Client.

Bug: 10570497
Change-Id: I0b1818658bee9983b117e49a5a00f1aab515c567
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
71d241c0e2092d6012ff28fecf5be0cba0cea4d8 09-Oct-2013 Igor Murashkin <iam@google.com> am c55d9e72: am 828363da: Merge "camera2: Don\'t race while dumping last frame metadata" into klp-dev

* commit 'c55d9e72f8d12e42a1f036badacd245fa99680e6':
camera2: Don't race while dumping last frame metadata
828363dada5878fca6e0cb1553fbea96f38671c8 09-Oct-2013 Igor Murashkin <iam@google.com> Merge "camera2: Don't race while dumping last frame metadata" into klp-dev
f1d5450ca6442cb459827c8bb0bee28676e70ace 08-Oct-2013 Eino-Ville Talvala <etalvala@google.com> am b488b251: am a5209c2e: Merge "Camera3: Improve resilience to stream failures" into klp-dev

* commit 'b488b25148b8e3814a6c4854e6e8cbea6ea33735':
Camera3: Improve resilience to stream failures
a5209c2e6a89ecd8d3bec79cb0e82a677301d794 08-Oct-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera3: Improve resilience to stream failures" into klp-dev
07d2169d46f3536add6044dbf106967a1982252f 25-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera3: Improve resilience to stream failures

- Handle binder connection drops (DEAD_OBJECT) for streams
- Just log an error, don't go to an error state when queue/dequeue fails

Bug: 10347526
Change-Id: Ib463ffe15d58db444cf5d8cad176a201c7d1facc
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3IOStreamBase.cpp
215bb3499c7eeea6303e55fac66452f2574c022a 08-Oct-2013 Igor Murashkin <iam@google.com> camera2: Don't race while dumping last frame metadata

Bug: 11095203
Change-Id: Icfb31e1719634b62004d6c15a95a9316e9642e4c
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/common/FrameProcessorBase.h
35295078ab59c8c5d143a54d5a55557c3ca62c51 07-Oct-2013 Glenn Kasten <gkasten@google.com> resolved conflicts for merge of 9a7d11f0 to master

Change-Id: Ie4d101185a93d37ec280f608813ad62a077a584e
fee4ce338d78eeb58af1f66831ead53322d3859e 07-Oct-2013 Glenn Kasten <gkasten@google.com> Merge "Cleanup openRecord error handling" into klp-dev
61f58c0c8d02970ea6d94ff816c54bf606f755b7 05-Oct-2013 Eric Laurent <elaurent@google.com> am c22a1a49: am ea0fadeb: audioflinger: offload: fix pause/flush/resume

* commit 'c22a1a495c26b8a36fa15233cc136cb6ce6d6bea':
audioflinger: offload: fix pause/flush/resume
ea0fadeb5d81ef3cb7f9db458c9033d628bdb86a 05-Oct-2013 Eric Laurent <elaurent@google.com> audioflinger: offload: fix pause/flush/resume

If a pause/flush/resume sequence is fast enough, resume is received while
we are still in PAUSING state in which case it is a NOP. If this happens,
flush is still forwarded to the audio HAL but is not preceeded by a pause
which can cause problems to the audio DSP.
It is necessary to preserve the flush as this sequence is typical to a seek.

The fix consists in forcing a pause/resume when a flush request must be
executed and the audio HAL has not been paused previously.

Bug: 11081559.
Change-Id: Ib84ed26d503a61c05933b923ec556b10cedfe140
udioflinger/Threads.cpp
1c7feca9cc3e408dfeb632e7060cf31e5015227e 04-Oct-2013 Eric Laurent <elaurent@google.com> am 6c48a011: am 026c5b07: Merge "audioflinger: fix wake lock acquisition check" into klp-dev

* commit '6c48a01188746202164f8e10d63ff3775dfcf727':
audioflinger: fix wake lock acquisition check
547789d25dc6bd6561553bcf6b384fb0d4fee834 04-Oct-2013 Eric Laurent <elaurent@google.com> audioflinger: fix wake lock acquisition check

Commit e14a5d6 introduced a bug in ThreadBase::acquireWakeLock() where
the wake lock acquisition return code is not initialized before
being checked causing the wake lock token to be sometines not set
and potential failure to release the wake lock later.

Bug: 10985160.
Change-Id: Iffd40e773ae3bcfec3c148a844d5dbebbf474eaf
udioflinger/Threads.cpp
2efc2a5551dc8d48cc4fcec97b29e45eb38c6ee5 04-Oct-2013 Zhijun He <zhijunhe@google.com> am 22077c59: am 19fffcbd: Merge "Camera3: track request status in inflight queue" into klp-dev

* commit '22077c5962dd2a435caa241cade297e2e3d8afc5':
Camera3: track request status in inflight queue
5918e0cb64200f64632595f7aea6062c65d43353 04-Oct-2013 Marco Nelissen <marcone@google.com> am b5677882: am 8097068d: Merge "Better recording wake lock accounting" into klp-dev

* commit 'b5677882cf9a34bd3f2daf76d10951282ea9b083':
Better recording wake lock accounting
4cde555e00a129f5684b1bdba1440fc89760383b 04-Oct-2013 Eino-Ville Talvala <etalvala@google.com> am 38ea22bb: am b2d71d3a: Merge "Camera API 2, Device 2/3: Implement idle and shutter callbacks" into klp-dev

* commit '38ea22bb3a841dd37cc2be0fdca8c5e4ba3cf6db':
Camera API 2, Device 2/3: Implement idle and shutter callbacks
19fffcbd89a51af797265af2e11c97be5820a07d 04-Oct-2013 Zhijun He <zhijunhe@google.com> Merge "Camera3: track request status in inflight queue" into klp-dev
1d1f846c0dbaa36d0944e7b1e54cc07863e00a92 03-Oct-2013 Zhijun He <zhijunhe@google.com> Camera3: track request status in inflight queue

Bug: 9758581
Change-Id: I1d7135cd0932bd6b453acabfeb9a553985c887bc
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
8097068de97c0cdab8150931f290edbd5b3721e5 03-Oct-2013 Marco Nelissen <marcone@google.com> Merge "Better recording wake lock accounting" into klp-dev
e14a5d6d2cc91dd2fc09ffdf7aa670b37da0795d 03-Oct-2013 Marco Nelissen <marcone@google.com> Better recording wake lock accounting

Count wake lock use against the app that initiated the recording,
not against the media server.

b/10985160

Change-Id: Iae6e6c030b7f1c6081d9c79725d6990f60dadaaa
udioflinger/Threads.cpp
udioflinger/Threads.h
f1e98d857ec377f2c9b916073d40732e6ebb7ced 06-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera API 2, Device 2/3: Implement idle and shutter callbacks

- Update callback Binder interface
- Rename frameId to be requestId to be consistent and disambiguate
from frameNumber.
- Implement shutter callback from HAL2/3 notify()
- Add in-flight tracking to HAL2
- Add requestId to in-flight tracking
- Report requestId from shutter callback
- Implement idle callback from HAL3 process_capture_result
- Add new idle tracker thread
- Update all idle waiting to use the tracker
- Add reporting from request thread, all streams to tracker
- Remove existing idle waiting infrastructure

Bug: 10549462
Change-Id: I867bfc248e3848c50e71527e3561fe92dc037958
amera/libcameraservice/Android.mk
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
amera/libcameraservice/api1/client2/CaptureSequencer.h
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.h
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.h
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api2/CameraDeviceClient.h
amera/libcameraservice/api_pro/ProCamera2Client.cpp
amera/libcameraservice/api_pro/ProCamera2Client.h
amera/libcameraservice/common/Camera2ClientBase.cpp
amera/libcameraservice/common/Camera2ClientBase.h
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/common/FrameProcessorBase.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
amera/libcameraservice/device3/Camera3IOStreamBase.cpp
amera/libcameraservice/device3/Camera3IOStreamBase.h
amera/libcameraservice/device3/Camera3InputStream.cpp
amera/libcameraservice/device3/Camera3OutputStream.cpp
amera/libcameraservice/device3/Camera3Stream.cpp
amera/libcameraservice/device3/Camera3Stream.h
amera/libcameraservice/device3/Camera3StreamInterface.h
amera/libcameraservice/device3/StatusTracker.cpp
amera/libcameraservice/device3/StatusTracker.h
e78d02aedcc4990365a0fd8d36c6de255cc6b431 02-Oct-2013 Zhijun He <zhijunhe@google.com> am 3d839a32: am f05e50eb: Camera: only return static metadata for HAL3 device

* commit '3d839a327a17262ada6dc002544209c9310f0c2b':
Camera: only return static metadata for HAL3 device
911d5ce961e3ec82c0a189a171e60726cd3c5b23 02-Oct-2013 Zhijun He <zhijunhe@google.com> am e0bd5368: am 26c1fb23: Merge "Camera: drop stale callback buffer" into klp-dev

* commit 'e0bd536878ed1bf78424990b54ba19d5038305e2':
Camera: drop stale callback buffer
cd0ea3624dd8b713e78a066852f668ace2bf43da 02-Oct-2013 Zhijun He <zhijunhe@google.com> am 0fb0400b: am 8b905e19: Merge "Camera: Set default thumbnail size with matched aspect ratio" into klp-dev

* commit '0fb0400bc54cd1d9ca67f1ba18db1238cded9a50':
Camera: Set default thumbnail size with matched aspect ratio
34717c83733def81287e2b4ba2f62b416325c7ae 02-Oct-2013 Eric Laurent <elaurent@google.com> am 3424d6e1: am 1adf20ce: Merge "fix volume and effect enable delay on offloaded tracks" into klp-dev

* commit '3424d6e17637e0743ddf3bf4688af8ee36e69264':
fix volume and effect enable delay on offloaded tracks
f05e50eb06d3f70e50fa7f44c1fd32128033b49d 01-Oct-2013 Zhijun He <zhijunhe@google.com> Camera: only return static metadata for HAL3 device

This effectively disables the camera2 APIs for HAL2.x or lower HAL device.

Bug: 10360518
Change-Id: I0f374ac533468c6181f5672c75088b7144b9c53d
amera/libcameraservice/CameraService.cpp
26c1fb23a1e2cc059aac42fd1814efba2a3e9640 01-Oct-2013 Zhijun He <zhijunhe@google.com> Merge "Camera: drop stale callback buffer" into klp-dev
893068ad0ca0cce8428f5a358c86b81139399c07 01-Oct-2013 Zhijun He <zhijunhe@google.com> Camera: drop stale callback buffer

Sometimes, when preview size is changed and preview callback is enabled, stale
callback buffer from previous size could be delivered to callback processor
because stop preview doesn't guarantee consumer side buffers are properly
cleaned up. We need drop these buffers to avoid sending wrong data to app side.

Bug: 11009183
Change-Id: If9281e8c02481f883872ce58dfd8660a06d56a47
amera/libcameraservice/api1/client2/CallbackProcessor.cpp
8b905e19548248904ab0fd0b63c9adcab2331a1a 01-Oct-2013 Zhijun He <zhijunhe@google.com> Merge "Camera: Set default thumbnail size with matched aspect ratio" into klp-dev
98232ab7c20bfbdfe176d2c25bb810dbb5e7b4f1 30-Sep-2013 Jean-Michel Trivi <jmtrivi@google.com> am a2340b30: Merge "Don\'t call audio effect process on offloaded playback threads" into klp-dev

* commit 'a2340b3059b9d6e4286d0db7069df477c164df0c':
Don't call audio effect process on offloaded playback threads
a6c7d98033c161592a062c61eaa6b7fd635e3006 30-Sep-2013 Eric Laurent <elaurent@google.com> am 0adc67df: Merge "audioflinger: fix crash when starting offload thread" into klp-dev

* commit '0adc67dfc5cedb211c36f06849681a60a32f5805':
audioflinger: fix crash when starting offload thread
aceceea5e0d5772353e6049f51cc29084b76ead1 30-Sep-2013 Eino-Ville Talvala <etalvala@google.com> am 1da3b602: Camera2 API: Hack: Always use async mode with GLConsumer

* commit '1da3b602130d71ac3bff1a1fdecdc5e0d7b9d701':
Camera2 API: Hack: Always use async mode with GLConsumer
9fc79c6fccc41255bb4f3538e2a21b01db8dc2dc 30-Sep-2013 Zhijun He <zhijunhe@google.com> Camera: Set default thumbnail size with matched aspect ratio

Make default thumbnail size match the default still capture size aspect ratio.

Bug: 10885012
Change-Id: If46da9508d3b71992f0e14a35c600b7e8d347f4e
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
59fe010bcc072597852454a2ec53d7b0a2002a3b 28-Sep-2013 Eric Laurent <elaurent@google.com> fix volume and effect enable delay on offloaded tracks

Volume: add a method to wake up the mediaserver playback
thread when a volume command is received on an offloaded track.

Effects: call effect chain process on offloaded playback threads
asynchronously from writes to allow effect state updates while
waiting for async write callback.

Bug: 10796540.

Change-Id: Id2747ae88783575d1d7ffd6fc86fbd054ab2c739
udioflinger/AudioFlinger.h
udioflinger/Effects.cpp
udioflinger/PlaybackTracks.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
a2340b3059b9d6e4286d0db7069df477c164df0c 27-Sep-2013 Jean-Michel Trivi <jmtrivi@google.com> Merge "Don't call audio effect process on offloaded playback threads" into klp-dev
0adc67dfc5cedb211c36f06849681a60a32f5805 27-Sep-2013 Eric Laurent <elaurent@google.com> Merge "audioflinger: fix crash when starting offload thread" into klp-dev
4de95592980dba88a35b3dc8f3fd045588387a4f 27-Sep-2013 Eric Laurent <elaurent@google.com> audioflinger: fix crash when starting offload thread

Passing a sp to parent thread to AsyncCallbackThread() constructor
causes a strong reference to be acquired on the OffloadThread inside
its constructor which causes an early launch of the thread loop
with unpredictable consequences.

Pass a wp to parent thread instead.

Also move the creation of the AsyncCallbackThread to
readOutputParameters() where mUseAsyncWrite is initialized which
makes more sense.

Also change the type of AsyncCallbackThread parent thread to PlaybackThread
instead of OffloadThread to allow a broder use of non blocking write which
in theory is not limited to audio offload use case.

Bug: 8174034.
Change-Id: I4b093b022030cd4f5eb8b8e477333e91098a6549
udioflinger/Threads.cpp
udioflinger/Threads.h
1da3b602130d71ac3bff1a1fdecdc5e0d7b9d701 27-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera2 API: Hack: Always use async mode with GLConsumer

Until a cleaner solution is implemented, force buffer queues to
consumers that set USAGE_HW_TEXTURE usage to be asynchronous.

Bug: 10949105
Change-Id: I69e6b02b773831396767c282ce8c5936c5d41f03
amera/libcameraservice/api2/CameraDeviceClient.cpp
fed6292af65a0b97b583ecbd3c232b3811a3f37b 26-Sep-2013 Jean-Michel Trivi <jmtrivi@google.com> Don't call audio effect process on offloaded playback threads

An audio effect process command is not meant to be called for
playback threads belonging to offloaded playback.

Bug 10933817

Change-Id: Idc7b6a0224791bbf8d61648474d3c288617c498f
udioflinger/Effects.cpp
3c928c3a7a9684501664a59082a2583347e47664 26-Sep-2013 Zhijun He <zhijunhe@google.com> am 369af71e: am 6914de6d: Merge "Camera: Implement getCameraCharacteristics" into klp-dev

* commit '369af71eb7e402ee68b66b0f0ede5d4d40c857d1':
Camera: Implement getCameraCharacteristics
6914de6dd1d74fcf74e3247c89f9293fbf7bafe5 26-Sep-2013 Zhijun He <zhijunhe@google.com> Merge "Camera: Implement getCameraCharacteristics" into klp-dev
2b59be89dc245b6e2475d9e8b0c5f2392370e71e 25-Sep-2013 Zhijun He <zhijunhe@google.com> Camera: Implement getCameraCharacteristics

Bug: 10904541
Bug: 10360518
Change-Id: Ie9ca6b3b0b5f2fe529e6b0decc193096e770a017
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
62dbe93f7743061e97fc3299386a2f887ca748cf 25-Sep-2013 Eric Laurent <elaurent@google.com> am 4e141a4f: am 1802399c: Merge "fix deadlock in audioflinger::createEffect()" into klp-dev

* commit '4e141a4f1303767f70ea983925ec01b034fe667b':
fix deadlock in audioflinger::createEffect()
1802399c7c4d8557922688f246df292703f417f1 25-Sep-2013 Eric Laurent <elaurent@google.com> Merge "fix deadlock in audioflinger::createEffect()" into klp-dev
eb3c337a3d6c74ec857dfc8be7eeafe634614bcd 25-Sep-2013 Eric Laurent <elaurent@google.com> fix deadlock in audioflinger::createEffect()

commit 5baf2af5 introduced a regression by calling
getOutputForEffect() with AudioFLinger main mutex locked.
The locking order must always be AudioPolicyService mutex then
AudioFlinger then ThreadBase mutex.

Bug: 10916796.
Change-Id: Ide34a2d84dbb06dbb35abd0640d91b01b0ac4d40
udioflinger/AudioFlinger.cpp
udioflinger/Effects.h
34a8e85cbf5fc713af3bed9eb08212b477f4b03e 25-Sep-2013 Eino-Ville Talvala <etalvala@google.com> am 8318c786: am 2b890936: Merge "Camera2/3: Support new PASSIVE_UNFOCUSED AF state" into klp-dev

* commit '8318c7862f2edca41a0e1d10d2e45af026e6089f':
Camera2/3: Support new PASSIVE_UNFOCUSED AF state
2b890936e978de0a8d4450ee1aaeda53d22b5f4e 25-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera2/3: Support new PASSIVE_UNFOCUSED AF state" into klp-dev
aab58d138ab3baccbf1badd6cfda1de1bfc24681 24-Sep-2013 Eino-Ville Talvala <etalvala@google.com> am 50ad1d36: am 1ecd3dc4: Merge "Camera2/3: Properly disambiguate FPS range vs. single FPS setting" into klp-dev

* commit '50ad1d3631efb486b3043c63ebd2774c7e3d337b':
Camera2/3: Properly disambiguate FPS range vs. single FPS setting
1ecd3dc4c779754e9d6603a17b9b3c6b709fb0cc 24-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera2/3: Properly disambiguate FPS range vs. single FPS setting" into klp-dev
e93cf2ca27ae6f4a81d4ef548bbf10a34db6d98f 24-Sep-2013 Glenn Kasten <gkasten@google.com> Cleanup openRecord error handling

Bug: 10888816
Change-Id: I84897dd7d30b370640b54e928f230604b873cb68
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
c0dab528e8c63abce2022a391dface95c3ef67e5 24-Sep-2013 Eric Laurent <elaurent@google.com> am a57e2ab5: am 664539d2: audioflinger: fix ro.audio.silent in offload again

* commit 'a57e2ab58a17d3da35593a6c85f65e19249e9ebc':
audioflinger: fix ro.audio.silent in offload again
79360ad49d6f84d9e99a08d225a642d65079d740 24-Sep-2013 Eric Laurent <elaurent@google.com> am 3f1d3b97: am 21e54568: fix incoming call audio start time.

* commit '3f1d3b97f723cf39fe6bde9efd0a3fc9e78028a5':
fix incoming call audio start time.
664539d25180ab8f77e0521533ea2821cf28985f 24-Sep-2013 Eric Laurent <elaurent@google.com> audioflinger: fix ro.audio.silent in offload again

Commit 1abbdb4 was not working 100% of the times because
it is possible that the offload thread loop never sleeps
after being created in which case the property is never read.

The loop now reads the property once when starting.

Bug: 10899309.
Change-Id: I2e2ca332f2d7086e59d65f6010378c4d9618ba9e
udioflinger/Threads.cpp
21e5456821e3c107d09b0629adbf23c9e06e7c0b 23-Sep-2013 Eric Laurent <elaurent@google.com> fix incoming call audio start time.

commit cec4abb fixing issue 6720482 had a flaw that
would insert commmands at the wrong position in the
audio policy service command thread queue causing other
commands to be delayed more than expected.

A change in track stop timing introduced by commit bfb1b83
made this issue visible when answering a call.

Bug: 10860012.
Change-Id: Iec769112f14e13d13b64628b808e43663e33771c
udioflinger/AudioPolicyService.cpp
4ad28ea0a76c7ecdfcc5b96af2b0afcb0c3e5120 21-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera2/3: Support new PASSIVE_UNFOCUSED AF state

Bug: 10860639
Change-Id: I39be64abaf79b49b2d1f74e1c2ab2adf718ae701
amera/libcameraservice/api1/Camera2Client.cpp
70b054021a3a22622c2710267362c5e235ed73bd 21-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera2/3: Properly disambiguate FPS range vs. single FPS setting

The camera1 API allows for either setPreviewFrameRate or
setPreviewFPSRange, so both values may or may not change in a single
setParameter call.

The disambiguation of which setting has been changed since the last
setParameter() call was not fully correct, so a sequence of changes
that only changed setPreviewFPSRange or didn't change either could be
interpreted as as a change to setPreviewFrameRate.

Bug: 10842868
Change-Id: I40baeced80a58f09f8a1742ece8dd5e141e9c1e3
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
b0a5e24d162f6ff55aca720c3562556b87d69637 20-Sep-2013 Eino-Ville Talvala <etalvala@google.com> am af724697: am 291a09c3: Merge "Camera2/3: For still captures, use widest FPS range available." into klp-dev

* commit 'af724697148f5f5ed0026e2ac8ca7f886a96deb7':
Camera2/3: For still captures, use widest FPS range available.
0230a2a8a413076a138db4c4e1dea018104fd5e2 20-Sep-2013 Eric Laurent <elaurent@google.com> am c6bed216: am a3b97ad2: Merge "audioflinger: implement getTimestamp() for offloaded tracks" into klp-dev

* commit 'c6bed216e3a759a855ac4b9b743fbaed2d5929c1':
audioflinger: implement getTimestamp() for offloaded tracks
d2b80a1fb90cb4dc3f569e716af0279c1e1ea72d 20-Sep-2013 Eric Laurent <elaurent@google.com> am ce3e7cb0: am fbb2609f: Merge "audioflinger: fix lost offload thread resume event" into klp-dev

* commit 'ce3e7cb0bd09e7861d417b7d45c1e5921f10a93f':
audioflinger: fix lost offload thread resume event
291a09c3537f2160ec2f1cac16a22212304c2cbf 20-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera2/3: For still captures, use widest FPS range available." into klp-dev
0181fde7bd20238cb13ae2665f0e5bfe7c2d9ac8 20-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera2/3: For still captures, use widest FPS range available.

Instead of using the application-selected preview FPS range for still
captures, select the widest FPS range advertised by the device and use
it for still captures instead, to give the HAL the widest range of exposure
values to choose from possible.

Bug: 10842868
Change-Id: I0e24f5eb713a4f8df116cd5979a84390cc0974d7
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
a3b97ad288e6808c54c6275eaac1bd53108d8f11 20-Sep-2013 Eric Laurent <elaurent@google.com> Merge "audioflinger: implement getTimestamp() for offloaded tracks" into klp-dev
accc147666bfd37fc8b4ef745f18a8c751555ec2 20-Sep-2013 Eric Laurent <elaurent@google.com> audioflinger: implement getTimestamp() for offloaded tracks

Bug: 9587132.
Change-Id: Ie9d5f4cca96306d08bc9a2dbd6edd8953096702d
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
fbb2609f132f23a983d376dec9ae6bfebfcacc4c 20-Sep-2013 Eric Laurent <elaurent@google.com> Merge "audioflinger: fix lost offload thread resume event" into klp-dev
ede6c3b8b1147bc425f7b923882f559a513fe23b 19-Sep-2013 Eric Laurent <elaurent@google.com> audioflinger: fix lost offload thread resume event

It was possible that a resume request signaled by addTrack_l()
while waiting for an async write callback is lost. This is because
mSignalPending was not set and waitingAsyncCallback_l() would pause the
thread loop before executing prepareTracks_l().

The fix consists in using signal_l() method to wake the thread
loop o that mSignalPending is set.

Also make sure that sleepTime is reset to 0 when resuming to make sure
that we write any remaining bytes to the HAL.

Bug: 10810347.

Change-Id: If9a3b22cc3b9e6eb384a56c48c40e6258d0896ad
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
1c826b3c038bdfaafa60c4038faa991529b4c20f 19-Sep-2013 Igor Murashkin <iam@google.com> am f572b3f1: am b5bca3ff: Merge "camera2: Tell all streams to ignore global device UI rotation" into klp-dev

* commit 'f572b3f11eb896f444b9e034c10f542911f0e966':
camera2: Tell all streams to ignore global device UI rotation
b5bca3ff7784ce95431224482ec42a50261e04b2 19-Sep-2013 Igor Murashkin <iam@google.com> Merge "camera2: Tell all streams to ignore global device UI rotation" into klp-dev
d7e076589dc5298d7a78cb683159723b7eb08d7f 19-Sep-2013 Eric Laurent <elaurent@google.com> am 87fb4f30: am d1b28d41: audioflniger: fix leaked audiosession references

* commit '87fb4f30077e7bcf78e65cf25fe95bd58238bad1':
audioflniger: fix leaked audiosession references
f8b2a6f7dea06234c7966798d9363d2d236488a6 18-Sep-2013 Igor Murashkin <iam@google.com> camera2: Tell all streams to ignore global device UI rotation

- Also use android.sensor.orientation to set the right transform
flags automatically.

Bug: 10804238
Change-Id: I10caf8331f19e107c461696963cc10f597c91d83
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api2/CameraDeviceClient.h
d1b28d41dbda203ffb420ba2e36cbe736b163ff8 19-Sep-2013 Eric Laurent <elaurent@google.com> audioflniger: fix leaked audiosession references

acquireAudioSessionId() should not create session references
if the caller is not listed in the known notification clients.
It happens when the MediaPlayer or AudioTrack is created by the
mediaserver on behalf of a client (e.g CameraService). In this case
releaseAudioSessionId() can be called from a different pid and
the session reference will not be removed.
Also we will not be able to remove the reference if the client
process dies.

Bug: 10606426.
Change-Id: Ibb5e27518daeb484a2e66302e4c6221cbaca5b70
udioflinger/AudioFlinger.cpp
dc8cae8c118e4aef4ef1f7b2c6f79becc1df4a05 18-Sep-2013 Eric Laurent <elaurent@google.com> am bf5e2397: am 5baf2af5: more support for audio effect offload

* commit 'bf5e23979a03da96ce1d63126c480103232f174b':
more support for audio effect offload
5baf2af52cd186633b7173196c1e4a4cd3435f22 13-Sep-2013 Eric Laurent <elaurent@google.com> more support for audio effect offload

Offloading of audio effects is now enabled for offloaded
output threads. If an effect not supporting offload is enabled,
the AudioTrack is invalidated so that it can be recreated in PCM
mode.

Fix some issues in effect proxy related to handling of effect
commands to offloaded and non offloaded effects.

Also fixed a bug on capture index in software Visualizer effect.

Bug: 8174034.

Change-Id: Ib23d3c2d5a652361b0aaec7faee09102f2b18fce
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Effects.cpp
udioflinger/Effects.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
9dbf87543b3a08fe39ba160494207f074294134c 17-Sep-2013 Eino-Ville Talvala <etalvala@google.com> am 0c126a84: am a099d1f6: Merge "Camera3: Always set a trigger ID for an active trigger" into klp-dev

* commit '0c126a8471f7a723e000a12995024704f16aead8':
Camera3: Always set a trigger ID for an active trigger
a099d1f6be3fbbb1af4c12b2ab627397f0826982 17-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera3: Always set a trigger ID for an active trigger" into klp-dev
4aad3ca1cf99e56ca34aac9892a8692d2976571c 16-Sep-2013 Zhijun He <zhijunhe@google.com> am f0a6b8bc: am 72a2f171: Merge "Camera: setCallBackWindow only if callback surface is used" into klp-dev

* commit 'f0a6b8bcb22a742318c46d51b4343a64acf94900':
Camera: setCallBackWindow only if callback surface is used
1bcd8e9f74ac5c50a2888465aa38cc6f24eca997 16-Sep-2013 Zhijun He <zhijunhe@google.com> am 92db0c12: am 66281c3a: Camera: Don\'t overwrite the error status

* commit '92db0c12caec61485851c87faee9a78245ae1fde':
Camera: Don't overwrite the error status
2f876f9ee63396e4e0117f85c5b3132cac7e2c9d 13-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera3: Always set a trigger ID for an active trigger

This is to work around HAL implementations that expect to see an
ID for every trigger.

Use a dummy trigger ID of 1, since 0 has special meaning for older
HALs.

Bug: 10720617
Change-Id: I9cb1b8dbcb113cb9e737e5adb04032fd61a54c12
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
527748abf04c0060894fd7aace54959a2c343435 16-Sep-2013 Zhijun He <zhijunhe@google.com> Camera: setCallBackWindow only if callback surface is used

Calling setCallBackWindow without checking the previewCallbackSurface could make
the stream to be deleted during callback stream operation, which is bad because
the preview is still active and the delete fails.

Bug: 10730496
Change-Id: I8addac25e5aa7901bf200d730c749bee2c088090
amera/libcameraservice/api1/Camera2Client.cpp
66281c3a5d7eea486ddc6ad30088ba92956fd4fd 14-Sep-2013 Zhijun He <zhijunhe@google.com> Camera: Don't overwrite the error status

Bug: 10749544
Change-Id: I6096effde03e18ee1b8c63cf3b36dce0344054c5
amera/libcameraservice/common/Camera2ClientBase.cpp
6d07d9bd2e0549ca2682ad9e94118feee1f733f6 14-Sep-2013 Eric Laurent <elaurent@google.com> am 029838a9: am 7f91e5e0: Merge "audioflinger: fix ro.audio.silent in offload mode" into klp-dev

* commit '029838a98c9377299ef3341e21e9378fd5562ab6':
audioflinger: fix ro.audio.silent in offload mode
bd091600eabdac6bd62987fb5ac91255ea2706d1 14-Sep-2013 Zhijun He <zhijunhe@google.com> am 571634ff: am d4dadf23: Merge "Camera: Limit supported preview sizes" into klp-dev

* commit '571634ff67db466327a32397c876d9365ff27698':
Camera: Limit supported preview sizes
d455cdfad40ca0558b8f4f800ec192027e272c14 14-Sep-2013 Eric Laurent <elaurent@google.com> am c91eb605: am 972a173d: audioflinger: longer offload thread standby delay

* commit 'c91eb6059a6af8b84c48e0ce727b01829f9cd789':
audioflinger: longer offload thread standby delay
7f91e5e09cf3bd8068894b2e54cbdaac70bf53a0 14-Sep-2013 Eric Laurent <elaurent@google.com> Merge "audioflinger: fix ro.audio.silent in offload mode" into klp-dev
1abbdb4429479975718421c4fef3f79ce7c820e3 14-Sep-2013 Eric Laurent <elaurent@google.com> audioflinger: fix ro.audio.silent in offload mode

Change-Id: I5a1a79000d53146689b0a198cc5419c36509703f
udioflinger/Threads.cpp
d4dadf23dd2dd8acd514d60d84475954070340b8 14-Sep-2013 Zhijun He <zhijunhe@google.com> Merge "Camera: Limit supported preview sizes" into klp-dev
3ef464e095da6c5d1acb5723dbc4b9f7cfd4ecf8 12-Sep-2013 Zhijun He <zhijunhe@google.com> Camera: Limit supported preview sizes

The ANDROID_SCALER_AVAILABLE_PROCESSED_SIZES can provide sizes as large
as jpeg sizes, which could cause potential issues when trying to do
full size still capture and full size preview. This is not supported
by many devices due to hardware limitation. This change limits the
preview (as well video) size to no more than 1080p.

Bug: 10625115
Change-Id: I9467ab843553ec06e8249b4a17c0ecf4c6d6f04e
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
972a173d7d1de1a3b5a617aae3e2abb6e05ae02d 04-Sep-2013 Eric Laurent <elaurent@google.com> audioflinger: longer offload thread standby delay

- Increase offloaded output thread standby delay to 1 second
to allow transition between tracks with going to stanby
if reusing the same audio track (gapless)

- Make sure pause/flush/resume sequence is sent to the HAL
in the right order

- Fix format display in track dump

Bug: 8174034.
Change-Id: I43ef6f8fdbf7427e4eff6cc2d0665d7d1463ea8a
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
f523897787b64cf2217d0ab4946b564420c675fe 12-Sep-2013 Glenn Kasten <gkasten@google.com> am 8a220740: am dc33c542: Merge "Fix AudioTrack shared memory leak" into klp-dev

* commit '8a220740cd77eb844123d3914190a94513797b40':
Fix AudioTrack shared memory leak
dc33c542351449ceee95cc50a9009f495e7c72ba 12-Sep-2013 Glenn Kasten <gkasten@google.com> Merge "Fix AudioTrack shared memory leak" into klp-dev
db358afc965d9bfb703953ac004275428a7cda64 12-Sep-2013 You Kim <you.kim72@gmail.com> AudioPolicyService: malloc/delete pair

Change-Id: I75cd44ac0caccda9148faaa052c9e7a0c06d46d1
Signed-off-by: You Kim <you.kim72@gmail.com>
udioflinger/AudioPolicyService.cpp
d5577f26de1ae3a0dc6fbea9c60a07d585f894bf 12-Sep-2013 Eric Laurent <elaurent@google.com> am 4823964d: am efc4d489: Merge "audioflinger: add HOTWORD audio source." into klp-dev

* commit '4823964d198228289ff21530bf8b01bb2ef196bb':
audioflinger: add HOTWORD audio source.
efc4d4899e03fb8464017dd48539106cec2163de 12-Sep-2013 Eric Laurent <elaurent@google.com> Merge "audioflinger: add HOTWORD audio source." into klp-dev
0c72b24f91c68442eb374bd1b338c394105b8262 11-Sep-2013 Glenn Kasten <gkasten@google.com> Fix AudioTrack shared memory leak

Bug: 2801375
Change-Id: I50e15164fe310f69ea019dca5b49171a02bc6992
udioflinger/PlaybackTracks.h
udioflinger/Tracks.cpp
9a54bc27876acd5d8be5b1fc3dc46701fe76fbb3 09-Sep-2013 Eric Laurent <elaurent@google.com> audioflinger: add HOTWORD audio source.

HOTWORD is a special capture audio source that uses
the same audio tuning as VOICE_RECOGNITION but allows an
active capture to be preempted.

Bug: 10640877.

Change-Id: Iea09a11cbcdbacc8d434e5230e7559dcd1b44ac0
udioflinger/AudioPolicyService.cpp
udioflinger/RecordTracks.h
udioflinger/ServiceUtilities.cpp
udioflinger/ServiceUtilities.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
46636a0c108be12639ad4d6766d45bbfaa98c31f 10-Sep-2013 Igor Murashkin <iam@google.com> am a57c8b5c: am 6220f993: Merge "camera3: Dump latest request sent with dumpsys" into klp-dev

* commit 'a57c8b5cb86730297945736ca4e4b441f2a3448a':
camera3: Dump latest request sent with dumpsys
6220f993541b0317e6ace3c410dd35a8d76e30bc 10-Sep-2013 Igor Murashkin <iam@google.com> Merge "camera3: Dump latest request sent with dumpsys" into klp-dev
8136cfae9c22ae8ff42eec9ed751833dda605444 09-Sep-2013 Eric Laurent <elaurent@google.com> am 8a910716: am 6ca83fad: Merge "audioflinger: no effects on offloaded tracks" into klp-dev

* commit '8a910716892d17a2ac62c7e9884af0e9d75b26bc':
audioflinger: no effects on offloaded tracks
6ca83fad0c32f8d9c81c9e16b4f87025d1abbda1 09-Sep-2013 Eric Laurent <elaurent@google.com> Merge "audioflinger: no effects on offloaded tracks" into klp-dev
a041f2fce87fa7a0926365d8e8fbc66019ac0661 09-Sep-2013 Zhijun He <zhijunhe@google.com> am 8d7e1693: am d1d6467d: Camera: Correct stream id types

* commit '8d7e1693148c48e5e6ef3095ed8db2334c6b8c81':
Camera: Correct stream id types
813e2a74853bde19e37d878c596a044b3f299efc 31-Aug-2013 Eric Laurent <elaurent@google.com> audioflinger: no effects on offloaded tracks

Invalidate offloaded tracks when an effect is enabled
so that the track is recreated in PCM mode and the effect
can be applied.
This is temporary until effect offloading is implemented.

Bug: 8174034.

Change-Id: I77b8b54a10db6cb8334be76d863ea7e720eaad09
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Effects.cpp
udioflinger/Effects.h
udioflinger/Tracks.cpp
d1d6467d3bcbc1305eeba0176a2edf04925c368e 07-Sep-2013 Zhijun He <zhijunhe@google.com> Camera: Correct stream id types

Bug: 10604704
Change-Id: I223ac5d200eb6439c08955fb7ad586592099fbae
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.h
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/device3/Camera3Device.cpp
1e479c0f4cb3e2174dde0b02e5656fb658f73495 07-Sep-2013 Igor Murashkin <iam@google.com> camera3: Dump latest request sent with dumpsys

Bug: 10606535
Change-Id: I0dd5ca3e09f45701659ab9ebd3b51939a2f6e6ba
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
ec22d7da84a9cb22a6dcd0d79c4b3724565b8286 07-Sep-2013 Zhijun He <zhijunhe@google.com> am 7f69ab55: am 84b7fb0c: Camera: Send VIDEO_SNAPSHOT intent for video snapshot case

* commit '7f69ab555b70b76af2e163799f1edc85b24d109b':
Camera: Send VIDEO_SNAPSHOT intent for video snapshot case
84b7fb0c88ddd05ed7c148c82fe1691040a9404d 06-Sep-2013 Zhijun He <zhijunhe@google.com> Camera: Send VIDEO_SNAPSHOT intent for video snapshot case

Bug: 9924539
Change-Id: Ief39eff79c31f2c2aa5df2fe1a0f04c4afc74690
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
bfc4214079875f0dc8c349e8c475d1813c234e67 06-Sep-2013 Eric Laurent <elaurent@google.com> am 99b84e8b: am 3b4529e0: audioflinger: remove async write race conditions

* commit '99b84e8b013a6e0b926693067b00e82cfbe2ca4f':
audioflinger: remove async write race conditions
3b4529e03c5fc7a44c22f9091ad15a269bfca3a8 06-Sep-2013 Eric Laurent <elaurent@google.com> audioflinger: remove async write race conditions

Remove possible race conditions between async callback
thread and offload thread when clearing and setting the
draining and write blocked flags.

Bug: 8174034.
Change-Id: I7af10491f39dc0e7d7414862a9d8e763daa2e2b7
udioflinger/Threads.cpp
udioflinger/Threads.h
5a0c108ed567a4d7fdaf1fb00916180f6864cb39 06-Sep-2013 Ruben Brunk <rubenbrunk@google.com> am 6e32da82: am 36a8b33a: Merge "camera: Fix race condition between setParameters() and stopPreview()." into klp-dev

* commit '6e32da82cf455d16debe66b819c2e0c48a056525':
camera: Fix race condition between setParameters() and stopPreview().
36a8b33a23dca49c9617e97e22e5d67f7d25c268 06-Sep-2013 Ruben Brunk <rubenbrunk@google.com> Merge "camera: Fix race condition between setParameters() and stopPreview()." into klp-dev
a27c4aa222c8dd1712617dad954c5f3aa68d5427 05-Sep-2013 Ruben Brunk <rubenbrunk@google.com> camera: Fix race condition between setParameters() and stopPreview().

Bug: 10414772
Change-Id: I928cb3935afb101da8a7931f88c27dccdb03b4a9
amera/libcameraservice/api1/Camera2Client.cpp
4167457a22f311fea2bd94c0916607eed0541b0b 04-Sep-2013 Ruben Brunk <rubenbrunk@google.com> am bef61478: am 7a4c2711: Merge "Fix CameraService error flag when running HAL1 with API2." into klp-dev

* commit 'bef614789efa7300e54703f5505f94a3f2acda5c':
Fix CameraService error flag when running HAL1 with API2.
17963d16d66526288ed66c91a6744daf3acfd731 20-Aug-2013 Ruben Brunk <rubenbrunk@google.com> Fix CameraService error flag when running HAL1 with API2.

Bug: 10620944

Change-Id: I44c0d09a3d313ae8f724fbe61fa5f36cf5b38b6d
amera/libcameraservice/CameraService.cpp
344202e13a91c9d3d109fd8f4a67f5b23efa7800 04-Sep-2013 Glenn Kasten <gkasten@google.com> am 55817ab9: am fe346c70: Fix miscellanous AudioTrack::getTimestamp() bugs

* commit '55817ab9c1868f1e6a59155f55c768f01509cda5':
Fix miscellanous AudioTrack::getTimestamp() bugs
b9258d930d67fc314373f94ab4423974e5f87e1a 04-Sep-2013 Glenn Kasten <gkasten@google.com> am 97992cc7: am 732845c7: FastMixer computes presentation timestamps for fast tracks

* commit '97992cc71fd0bbd4aa22e5195ee7e5cde09ac254':
FastMixer computes presentation timestamps for fast tracks
1462a2b84a578b5541683c824e0f77ebf2aa82ae 04-Sep-2013 Glenn Kasten <gkasten@google.com> am a4a82c5f: am 6466c9e6: Add ExtendedAudioBufferProvider::framesReleased and onTimestamp

* commit 'a4a82c5f8f3eccfa10ce30a52cbb4b1c5c983282':
Add ExtendedAudioBufferProvider::framesReleased and onTimestamp
fe346c707f59d763ded93bc3d27b51f0c0408258 30-Aug-2013 Glenn Kasten <gkasten@google.com> Fix miscellanous AudioTrack::getTimestamp() bugs

Check that get_presentation_position is non-NULL before calling.

AudioTrack::getTimestamp not implemented for fast tracks.

Fix typo in Track::getTimestamp().

Fix bugs in AudioTrack::getTimestamp after stop:
- getTimestamp while stopped is not allowed.
- stop, start, getTimestamp now returns the correct value.

Change-Id: Ie8d9dc1f28d8927634e04175a68b147ffc2ea8eb
udioflinger/Tracks.cpp
a7fef85e7d419a4f5d6a3144f9ba70ceff2f122a 04-Sep-2013 Glenn Kasten <gkasten@google.com> am f81d5fc1: am 943ba3cc: Merge "Add NBAIO_Sink::getTimestamp()" into klp-dev

* commit 'f81d5fc1d67a5252d0da1a45274460c4dd33b87b':
Add NBAIO_Sink::getTimestamp()
732845c7e8d294bb1aaa4cd9687da62b51f1f6e6 23-Aug-2013 Glenn Kasten <gkasten@google.com> FastMixer computes presentation timestamps for fast tracks

and forwards them to each track's ExtendedAudioBufferProvider::onTimestamp().

Change-Id: I06fb9586bb7e20d5c0289abdc8cac6cd3fd2f6e8
udioflinger/FastMixer.cpp
6466c9e6e6278c740aed77f695f679be9f5db478 23-Aug-2013 Glenn Kasten <gkasten@google.com> Add ExtendedAudioBufferProvider::framesReleased and onTimestamp

and implement them in SourceAudioBufferProvider using the associated NBAIO_Source,
and in Track using the associated AudioTrackServerProxy.

Change-Id: I60dc4adba63fc1dc452ff16caf347e4a7c8242c2
udioflinger/PlaybackTracks.h
udioflinger/Tracks.cpp
943ba3cca8df0da24db38e97e43aaacb5b788a21 04-Sep-2013 Glenn Kasten <gkasten@google.com> Merge "Add NBAIO_Sink::getTimestamp()" into klp-dev
53827966d116dae8039e20deeed84b96c353ed26 03-Sep-2013 Eino-Ville Talvala <etalvala@google.com> am 68f193f3: am 0a4df035: Camera2/3: Increase precapture start timeout

* commit '68f193f3deab9ce579ab7a43d079725ba6e4880e':
Camera2/3: Increase precapture start timeout
0a4df03542e7d7aab716a60e206dceaf5da178f3 03-Sep-2013 Eino-Ville Talvala <etalvala@google.com> Camera2/3: Increase precapture start timeout

Currently, we only wait 200 ms for the HAL to switch to the precapture
state. This is insufficient at low preview frame rates (dark
conditions, ~10 fps), where a 3-request-deep HAL pipeline will take
300 ms to produce a precapture trigger output. In those cases, we
would prematurely skip the precapture sequence, causing bad quality
pictures.

Since this is a fallback timeout to prevent deadlock in case of a bad
HAL or framework implementation, increase the timeout to 1 second. Has
no impact on correctly-working implementations

Bug: 10430191
Change-Id: I08e99f8e7f3beb8f15dcee32632cdebfe3dca8b3
amera/libcameraservice/api1/client2/CaptureSequencer.h
767094dd98b01baf21de2ad09c27b3c98776cf73 23-Aug-2013 Glenn Kasten <gkasten@google.com> Add NBAIO_Sink::getTimestamp()

with a real implementation in AudioStreamOutSink
for dummy implementation initially in MonoPipe.

Use in AudioFlinger::PlaybackThread::threadLoop_write()
to keep the input to the timestamp latch up-to-date.

Change-Id: I10ef277991b63bb43d55d6f3df75116ef32246cd
udioflinger/Threads.cpp
0fd582e3ce5243c3e5a429fee3330aafc69b69fa 31-Aug-2013 Eric Laurent <elaurent@google.com> am 5d8cbf41: am 6bf9ae20: audioflinger: offloaded tracks flush/pause order

* commit '5d8cbf41ee7e511d20a649e240d6aecbbac3fae7':
audioflinger: offloaded tracks flush/pause order
6bf9ae20b3bd2dbb8f2e89ee167a6785222301cf 31-Aug-2013 Eric Laurent <elaurent@google.com> audioflinger: offloaded tracks flush/pause order

Make sure that a flush received after a pause is forwarded
to the HAL after the pause.

Change-Id: Ib3221f70c59f8b3dbbac20b23104f6b779b75be0
udioflinger/Threads.cpp
6c59945f3aae980621c52bcd4bb89d6084060a77 30-Aug-2013 Igor Murashkin <iam@google.com> am 9c1d4ce0: am d656a4be: Merge "camera: Fix deadlock when sending callbacks during disconnect" into klp-dev

* commit '9c1d4ce0e15a08550f99e42be85881d9f8cb7528':
camera: Fix deadlock when sending callbacks during disconnect
d656a4be3c3b6bc249b06599c2b02c2863d2c47f 30-Aug-2013 Igor Murashkin <iam@google.com> Merge "camera: Fix deadlock when sending callbacks during disconnect" into klp-dev
7408189dfab8374de82f8824c35b6a839dcb4ee4 30-Aug-2013 Eino-Ville Talvala <etalvala@google.com> am 74ba940f: am 96be8bb7: Merge "Camera3: Be busy as soon as work arrives." into klp-dev

* commit '74ba940f780d27a30128cde1179e441bb600a7db':
Camera3: Be busy as soon as work arrives.
96be8bb7c2ce0fc6d3c62f3467e752ddf87c7f44 30-Aug-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera3: Be busy as soon as work arrives." into klp-dev
4fb55c15da1a563ab925914a0f493a3dc80495a3 30-Aug-2013 Igor Murashkin <iam@google.com> camera: Fix deadlock when sending callbacks during disconnect

Bug: 10552448
Change-Id: Ie93ba744ae6705aa657f980ae8e08ec624feeb39
amera/libcameraservice/api2/CameraDeviceClient.cpp
f557872b594d15599bdb65efd91eb5adeb1d0840 30-Aug-2013 Glenn Kasten <gkasten@google.com> am 908d3c09: am 51ec03c2: Merge "Implement Track::getTimestamp()" into klp-dev

* commit '908d3c09ca7f2ccb280aa5dc8d876099ff9a9d0f':
Implement Track::getTimestamp()
30c296c153447f5c2bb5251928bf4d3c4e28e552 30-Aug-2013 Glenn Kasten <gkasten@google.com> am 3ae0a58a: am 9841f636: Merge "Add AudioFlinger::PlaybackThread::Track::getTimestamp()" into klp-dev

* commit '3ae0a58a83d092d96672295c8a62908478f28a9b':
Add AudioFlinger::PlaybackThread::Track::getTimestamp()
ec9ad1b0947f5d6b465281312dbe92f096a8f881 30-Aug-2013 Glenn Kasten <gkasten@google.com> am f94b2946: am 56b59224: Merge "Add IAudioTrack::getTimestamp()" into klp-dev

* commit 'f94b2946a511c5cbb6b9001449ca8278cb332bda':
Add IAudioTrack::getTimestamp()
26fe6c7c56477ef227205c68f17df07ca3501d65 29-Aug-2013 Eino-Ville Talvala <etalvala@google.com> Camera3: Be busy as soon as work arrives.

RequestThread's internal busy flag (mPaused) was not being immediately
set when new work was submitted to it. This allowed for a race
condition where a capture() followed by an immediate
waitUntilDrained() would immediately return from the wait.

Set the mPaused flag to false immediately in capture() and
setStreamingRequest() to avoid this, instead of waiting until the end
of the next RequestThread iteration.

Bug: 10531739
Change-Id: I54a79fe5361d527ec717f41ad805e9b319a48cd8
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
bd096fd9d8e5fc0e62f98807f4818a06f70d0812 23-Aug-2013 Glenn Kasten <gkasten@google.com> Implement Track::getTimestamp()

using a new timestamp latch in PlaybackThread, and
AudioTrackServerProxy::framesReleased() which returns mServer.

Change-Id: I1ebfba968c773faaab95648c272fd3ebd74718d6
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
573d80a8f463f648a515fc0975bf83951b272993 26-Aug-2013 Glenn Kasten <gkasten@google.com> Add AudioFlinger::PlaybackThread::Track::getTimestamp()

with a dummy implementation initially,
and use it in AudioFlinger::TrackHandle::getTimestamp()

Change-Id: I2da88fc52a135a7f0d9fd9538986e919dc8ccd3b
udioflinger/PlaybackTracks.h
udioflinger/Tracks.cpp
53cec22821072719ee02c856e9ac2dda2496c570 29-Aug-2013 Glenn Kasten <gkasten@google.com> Add IAudioTrack::getTimestamp()

with dummy implementation in AudioFlinger::TrackHandle, and
implement AudioTrack::getTimestamp() using IAudioTrack.

Also document invariant that mAudioTrack and control block are always
non-0 after successful initialization.

Change-Id: I9861d1454cff7decf795d5d5898ac7999a9f3b7e
udioflinger/AudioFlinger.h
udioflinger/Tracks.cpp
998d8225f6e4cb9f14e16a058ed2b04bf7237f69 27-Aug-2013 Eino-Ville Talvala <etalvala@google.com> am 677d2d3d: am e07f5372: Merge "Camera2: Add flush support" into klp-dev

* commit '677d2d3d4b212c81e4d3738794044711dca8ec8f':
Camera2: Add flush support
abaa51d3ca31f0eda99e1d271e6dc64c877dbf58 14-Aug-2013 Eino-Ville Talvala <etalvala@google.com> Camera2: Add flush support

- On HAL2 devices, fall back to wait until idle
- On HAL3 devices, call HAL flush method

Bug: 9758581
Change-Id: Ie1c570a15f6590a1ee6c271e3b989c48079b468a
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api2/CameraDeviceClient.h
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
bc794f8e5c8f5ea5519f2c333f7eb1bd800dae34 22-Aug-2013 Eino-Ville Talvala <etalvala@google.com> am 8ad43118: am 1ce7c34e: Camera1: Set preview to be asynchronous, and remove dead code

* commit '8ad43118cf7207d02c0b7e9251c3e549b741f471':
Camera1: Set preview to be asynchronous, and remove dead code
1ce7c34e67c2cf58dd88c31f36f4bd62e375f7f0 21-Aug-2013 Eino-Ville Talvala <etalvala@google.com> Camera1: Set preview to be asynchronous, and remove dead code

- Use the controlledByApp flag to make sure application-bound
preview buffer queue is asynchronous as before
- Remove setPreviewDisplay in service, since it is no longer in
the binder interface
- Rename setPreviewTexture to setPreviewTarget, to make it clear it's
the only game in town now. Rename only on the binder level and service
for now.

Bug: 10312644
Change-Id: Icd33a462022f9729a63dc65c69b755cb7969857e
amera/libcameraservice/CameraService.h
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/Camera2Client.h
amera/libcameraservice/api1/CameraClient.cpp
amera/libcameraservice/api1/CameraClient.h
61bd7a0281ffecb99b27bff63334c559df7357e6 20-Aug-2013 Jeff Brown <jeffbrown@google.com> am 0541b3bb: am c8b226f4: Merge "Enforce permission for recording from remote submix." into klp-dev

* commit '0541b3bb40fa23e97e0a4599463b6afc0e271939':
Enforce permission for recording from remote submix.
893a5642871114fca3b2a00c6ff8e5699ce3e3ed 17-Aug-2013 Jeff Brown <jeffbrown@google.com> Enforce permission for recording from remote submix.

Bug: 10265163
Change-Id: I2395036bac6e10baeaf6ea4bc3093bd9dd98742d
udioflinger/AudioFlinger.cpp
udioflinger/ServiceUtilities.cpp
udioflinger/ServiceUtilities.h
c49d9f8511442ce555fa7365de24f3ef21928670 17-Aug-2013 Ruben Brunk <rubenbrunk@google.com> am a8542f05: am e9f3a314: Merge "Refactor CameraService to handle errors properly." into klp-dev

* commit 'a8542f05253e31a64428baf93a31183988a065bb':
Refactor CameraService to handle errors properly.
0f61d8f14aa368c9cd7076528e8096e10ed100a0 08-Aug-2013 Ruben Brunk <rubenbrunk@google.com> Refactor CameraService to handle errors properly.

Bug: 10361136

-Connect calls now return status_t error flags.

Change-Id: Idca453b111e5df31327f6c99ebe853bb2e332b95
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
7165268ffa6c7b6b405b6afad82e2a346500e8ee 15-Aug-2013 Glenn Kasten <gkasten@google.com> Don't lock and then immediately unlock effect chains

Change-Id: Id9a4b1e9c49cecfd3a008a7814b5c14dad9a5831
udioflinger/Threads.cpp
b86432b1d62e7c9034223f0120b9bceb44215c41 15-Aug-2013 Glenn Kasten <gkasten@google.com> Fix races in reading activeTrack->mState without lock

Change-Id: I8cfbd9884fa5959a846ddb52cdc797266b896769
udioflinger/Threads.cpp
9e98235a9e9bb870e1c76911e3b4d00386a52c39 14-Aug-2013 Glenn Kasten <gkasten@google.com> Simplify flow by having all mActiveTrack.clear() continue

Change-Id: Icd160b0aa79a747bd19fabaa7feee813afb155e0
udioflinger/Threads.cpp
5edadd46c76c5ff1c3edabf2ea943c2278e82e1c 15-Aug-2013 Glenn Kasten <gkasten@google.com> Don't sleep with effect chains locked

Change-Id: I6eae037304d3dc8a8f3ef55c5b210fd4f8856e99
udioflinger/Threads.cpp
ad5bcc29b216412dbc4d936c270d30620c68f361 14-Aug-2013 Glenn Kasten <gkasten@google.com> Copy mActiveTrack for stability and easier access

Change-Id: If0d88610ec35128054a22f42b2d79f07c4b724eb
udioflinger/Threads.cpp
1ba19cd7fcdf18ab6efab2a1b831affab9a46157 14-Aug-2013 Glenn Kasten <gkasten@google.com> Simplify code by pulling up mActiveTrack == 0 test

Change-Id: I225bb032b2fde97d891191f3599d9850c2d27bb2
udioflinger/Threads.cpp
d9fc34fb0fcfcc739f868b116edf50c62af19d5e 14-Aug-2013 Glenn Kasten <gkasten@google.com> Remove dead 'if'

Change-Id: I23c082f0115ae598cad293be0ac66a130afb692a
udioflinger/Threads.cpp
4ef0b463a56c19bad9197aa9f90d792090461429 14-Aug-2013 Glenn Kasten <gkasten@google.com> Fix race in checking exitPending() in RecordThread::threadLoop()

Change-Id: I97a1c5ab17a6c334d275be794392dcf6c9a88d0e
udioflinger/Threads.cpp
2cfbf88b89854f30b295e8ae26a031edb8d712f8 14-Aug-2013 Glenn Kasten <gkasten@google.com> Simplify code that checks for record standby

Take advantage of the new processConfigEvents_l()
and it's post condition that mConfigEvents is empty.

Change-Id: Icd40fb175f3e374203c9c8d2e9df2c3929bed89b
udioflinger/Threads.cpp
26a4029c95620a2b98187cf003cd3c58eea03747 14-Aug-2013 Glenn Kasten <gkasten@google.com> checkForNewParameters_l returns a value which is currently ignored

Change-Id: I19b9cc9df094d67560f6e832d94fa284dca18687
udioflinger/Threads.cpp
d5418eb594435c958d6c37fa9938161a0112adbd 14-Aug-2013 Glenn Kasten <gkasten@google.com> Use Autolock where possible

Change-Id: Id0e1836831c45beda4e5cb11e983005ea699fc2a
udioflinger/Threads.cpp
f777331418a86cd9fd709af898ef24a69967aeb4 14-Aug-2013 Glenn Kasten <gkasten@google.com> Add ThreadBase::processConfigEvents_l()

Change-Id: I6bcdc212a984c52ab98b0b0744943b4ecc1e1542
udioflinger/Threads.cpp
udioflinger/Threads.h
c527a7c2b1bfd26e8f3086e1b653d56e521379d9 14-Aug-2013 Glenn Kasten <gkasten@google.com> Pull in scope of effectChains

Change-Id: Id5336f8663099088a0958fb8bd59fc5df9f92829
udioflinger/Threads.cpp
47c2070b2ce8aedb7300c0aad91caccf3c383841 14-Aug-2013 Glenn Kasten <gkasten@google.com> Add record thread locking comments and FIXMEs

Change-Id: Ia5bdc9b8b013c2e40af17c82833051290bf4df70
udioflinger/Threads.cpp
2d94426cd3302cb1215c92c5f1c4b90c24ceb72b 13-Aug-2013 Glenn Kasten <gkasten@google.com> Convert if/else-if in threadLoop to switch

Change-Id: I7428abb332ead6c2a1df5903f6c4e166be1f7abb
udioflinger/Threads.cpp
3468e8a4d79cc6a7bb0f03f8382426195bed44df 14-Aug-2013 Glenn Kasten <gkasten@google.com> Fix switch indentation to follow our audio style

Change-Id: I137763917962b276838715319b163c763cb54c71
udioflinger/Threads.cpp
34fca34606b448e6b71c2942f63cb13a0aebd620 13-Aug-2013 Glenn Kasten <gkasten@google.com> Explicit comparison to 0 for integral types

Change-Id: I2bfe864d1bda719581e297a38d96abfc0e3748b9
udioflinger/AudioMixer.cpp
udioflinger/Threads.cpp
3255095af6677caeeebf81c8891ce8db745617ff 06-Aug-2013 Glenn Kasten <gkasten@google.com> Move local variable declarations to point of first use

Change-Id: Ia0fc4b099a3cf8bb5b67b287e7687e9dc9691e0e
udioflinger/AudioFlinger.cpp
6e2ebe97f2ad0a21907f20f9ee644c4eacbb7a40 13-Aug-2013 Glenn Kasten <gkasten@google.com> Use curly braces in 'if' to make it easier to add logs

Change-Id: I58b33fefdd8bf703647414157a99a3223be3531c
udioflinger/AudioFlinger.cpp
udioflinger/AudioMixer.cpp
udioflinger/AudioPolicyService.cpp
udioflinger/AudioResampler.cpp
udioflinger/AudioResamplerCubic.cpp
udioflinger/Effects.cpp
udioflinger/FastMixer.cpp
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
e198c360d5e75a9b2097844c495c10902e7e8500 13-Aug-2013 Glenn Kasten <gkasten@google.com> Whitespace

Change-Id: Id3ccc183a03421330d0498faaa62a45915cdc3d6
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
2fc14730e4697a6f456b4631549c9981f6b0b115 05-Aug-2013 Glenn Kasten <gkasten@google.com> Comments

Change-Id: I56f82904cb3855bad6f33ad1ff4ddf66a61c5720
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
c0029a8551d65929cbf51a55bd3bae3342a1f2fe 13-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Check input HAL channel mask instead of channel count"
030033342a6ea17003e6af38a56c7edc6d2ead01 07-Aug-2013 Glenn Kasten <gkasten@google.com> Clean up error handling in createTrack and openRecord

Outside callers now use initCheck() to determine whether a TrackBase
has been created successfully, instead of relying on internal knowledge.

Previously, callers needed to know that a TrackBase was only valid if it's
getCbk() != 0. For a Track (playback), they needed to know to also check
the track's name (track index). Now, outsiders can just call initCheck().

Other changes:
- Return a 0 reference if track creation fails
- Remove a dead line of code in AudioFlinger::openRecord

Change-Id: If374924a3f6fd27906f625aa83dd0a1e3f506e00
udioflinger/AudioFlinger.cpp
udioflinger/PlaybackTracks.h
udioflinger/Threads.cpp
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
9156ef3e11b68cc4b6d3cea77f1f63673855a6d1 07-Aug-2013 Glenn Kasten <gkasten@google.com> Status pointer passed by caller is always non-NULL

in createTrack, openRecord, createEffect, createTrack_l,
createRecordTrack_l, and createEffect_l.

Change-Id: I2e459e4de9c78145f4d496e6abf289479a2f0941
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/Threads.cpp
udioflinger/Threads.h
e51a70ab6326715f614c737de1e8ea1941057b3b 12-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Remove obsolete TrackBase::getBuffer()"
e92db4bdb575d897d6bbd5086761fa9387393c83 12-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Pull up readyToRun into ThreadBase"
b0e6b967c290c905c4c696df4a8ac9e9d591928b 12-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Simplify the code that allocates mMixBuffer by removing mAllocMixBuffer"
309f7abb3c170ba764e67e9b6fed31fb442e9953 09-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Use 0 for sp<>, NULL for raw pointers"
3a6d5ded7187ae324532a60b03532c33d607e282 09-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Rename reqChannels to reqChannelMask"
f874f1375d758c8a7a84572a94371fbd4085f0df 08-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Pull up mBufferSize from RecordThread to ThreadBase"
2c03d0a2b741310c47d5f625cbdec4a4e4a0778e 08-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Remove obsolete field RecordTrack::mAudioRecordServerProxy"
da09d5f1d8c7946708f8504daf305d96713b78bd 08-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "memset audio_config to zero"
ec3fb50c8ee25ac263a9c2cbe9242f877bef960c 17-Jul-2013 Glenn Kasten <gkasten@google.com> Check input HAL channel mask instead of channel count

The only supported channel masks are mono and stereo;
arbitrary channel masks are not yet allowed.

Change-Id: I9cebbe56480b53b98e59aa55245a1f03a30d2839
udioflinger/Threads.cpp
aac30336994235e42a92861eb83289131a6b94dd 06-Aug-2013 Glenn Kasten <gkasten@google.com> Remove obsolete TrackBase::getBuffer()

Change-Id: Ic39c7baa9538080bfec114bf18ff9b9986c93fed
udioflinger/TrackBase.h
937098b9b564a779ff1c8c2d9e60769ee5c69810 26-Jun-2013 Glenn Kasten <gkasten@google.com> Use 0 for sp<>, NULL for raw pointers

Change-Id: Ia0595afdc41e1dec428d7a3db73558b54c417bf3
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
deeef54487a34034dc0cfaab20b20d557224c07c 02-Aug-2013 Mathias Agopian <mathias@google.com> separte producer and consumer interfaces

Bug: 9265647
Change-Id: Iefabc11e4bd2e2e8ffd31160476c450affe6629c
amera/libcameraservice/api1/client2/CallbackProcessor.cpp
amera/libcameraservice/api1/client2/JpegProcessor.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/device3/Camera3InputStream.cpp
amera/libcameraservice/device3/Camera3InputStream.h
amera/libcameraservice/device3/Camera3ZslStream.cpp
amera/libcameraservice/gui/RingBufferConsumer.cpp
amera/libcameraservice/gui/RingBufferConsumer.h
fb872cc6f77f6d74011fab703b3edd7023c736cb 06-Aug-2013 Glenn Kasten <gkasten@google.com> memset audio_config to zero

Per guideline in hardware/libhardware/include/hardware/audio.h,
"You should memset() the entire structure to zero before use to
ensure forward compatibility."

Change-Id: I2bce70ef6ea4b070668bd9cbc54bfe20a60111aa
udioflinger/AudioFlinger.cpp
f506e9495f2b2123b3bec7d42ec8ef13c6213ee8 06-Aug-2013 Glenn Kasten <gkasten@google.com> Rename reqChannels to reqChannelMask

This avoids potential ambiguity with channel count.

Change-Id: I0db82efc4c14dd8189d65a1db29809a085acf528
udioflinger/AudioFlinger.cpp
6ae6b811666865815ebb1f670aacb1a0f2edaa73 06-Aug-2013 Glenn Kasten <gkasten@google.com> Remove obsolete field RecordTrack::mAudioRecordServerProxy

Change-Id: I054ba929e209797542940a0e734fc15f19f321c9
udioflinger/RecordTracks.h
udioflinger/Tracks.cpp
cf04c2cb8e031acc03c1c91cb1ccab15098c89b6 06-Aug-2013 Glenn Kasten <gkasten@google.com> Pull up readyToRun into ThreadBase

Change-Id: Ib150afd72c3b35d83599a61664e89302a8feb4b5
udioflinger/Threads.cpp
udioflinger/Threads.h
c1fac191069774c7bfcb062edbb821ea56e7dbc0 06-Aug-2013 Glenn Kasten <gkasten@google.com> Simplify the code that allocates mMixBuffer by removing mAllocMixBuffer

Change-Id: I5ac41210251789a034d760309c50fe018f2442ce
udioflinger/Threads.cpp
udioflinger/Threads.h
70949c47fbae3f836d15f040551d7631be3ed7c2 06-Aug-2013 Glenn Kasten <gkasten@google.com> Pull up mBufferSize from RecordThread to ThreadBase

Now both playback and record threads have a HAL buffer size for fast
tracks, and a potentially larger-sized buffer for normal tracks.

Change-Id: I6f57b85ecece3cbd4e9e64b8c41c3352f7656912
udioflinger/Threads.cpp
udioflinger/Threads.h
5279e3e1187e4da0fed4349d29ea548f52e95f95 06-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "RecordThread::createRecordTrack_l use flags for fast tracks"
75180715a8f85dd7ddf3da710fba8eb7709f8999 06-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "RecordTrack::createRecordTrack_l flags are in/out"
3aa03e40668dd90390d9f1702f8c576e15b366c3 06-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "IAudioFlinger::openRecord track_flags_t flags is in/out"
ce7842c295638ee1432041186700a71d4bf1c176 05-Aug-2013 Eino-Ville Talvala <etalvala@google.com> Merge "Camera3: Provide consumer usage flags to HAL for each stream"
b2f5b19e5b6e1408a259add23dba91037756a943 30-Jul-2013 Eino-Ville Talvala <etalvala@google.com> Camera3: Provide consumer usage flags to HAL for each stream

At stream configure time, pass on the stream's consumer usage flags
to the HAL, to speed up final hardware configuration.

Bug: 9592202
Change-Id: Ie467be053be36a09e482f5f05cad65df42d66476
amera/libcameraservice/device3/Camera3IOStreamBase.h
amera/libcameraservice/device3/Camera3InputStream.cpp
amera/libcameraservice/device3/Camera3InputStream.h
amera/libcameraservice/device3/Camera3OutputStream.cpp
amera/libcameraservice/device3/Camera3OutputStream.h
amera/libcameraservice/device3/Camera3Stream.cpp
amera/libcameraservice/device3/Camera3Stream.h
90e58b1fefc8caf70b34301a92bc86179580b6fc 01-Aug-2013 Glenn Kasten <gkasten@google.com> RecordThread::createRecordTrack_l use flags for fast tracks

Look at client's request for a fast track in the flags parameter,
and check whether the request can be satisfied.

Change-Id: I65ddaeb1b85670fe9066076f638bfed0cda01c0d
udioflinger/Threads.cpp
udioflinger/Threads.h
ddb0ccf3fb6fe8da8c71a6deb30561b821f3c0a2 01-Aug-2013 Glenn Kasten <gkasten@google.com> RecordTrack::createRecordTrack_l flags are in/out

The flags are currently unused, but will be used for requesting a fast
track. Making flags in/out will allow reporting back up to client that
the request is denied.

Change-Id: Ifbee57da3632ce130551065a426577fb97b1a68d
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
udioflinger/Threads.h
eeca32671896739e84050da5992d5f151a1629de 01-Aug-2013 Glenn Kasten <gkasten@google.com> IAudioFlinger::openRecord track_flags_t flags is in/out

This will allow AudioFlinger to tell client it is denying a request.

Change-Id: Iff2be3ad6636371bbda9c9899a283c94620c1f06
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
f36dbfe3d517e9311be0a4d0fd6658380690e84c 02-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Report underruns for fast tracks also"
1a3739169becc850999c3c06db402541119a428c 01-Aug-2013 Glenn Kasten <gkasten@android.com> am 6d4d8790: am b687ff9f: Merge "Fix mismatched delete/new couple"

* commit '6d4d879037a495f9a4276a6996d1845594ce9090':
Fix mismatched delete/new couple
6d4d879037a495f9a4276a6996d1845594ce9090 01-Aug-2013 Glenn Kasten <gkasten@android.com> am b687ff9f: Merge "Fix mismatched delete/new couple"

* commit 'b687ff9f2e02790e8a8e3964cb73e87546cd72dd':
Fix mismatched delete/new couple
c5f8c3e5502f3c220fdbb54573608f3b3bd47517 31-Jul-2013 Zhijun He <zhijunhe@google.com> Merge "Camera: fix the metadate parcel write issue"
11d0d44d583f679638cc927bfffe920e495e90cc 31-Jul-2013 Zhijun He <zhijunhe@google.com> Camera: fix the metadate parcel write issue

Also rename the frameId to requestId to make it less confusing.

Change-Id: I14a20b6fcabb86294afb31fc0c56397e185c1373
amera/libcameraservice/common/FrameProcessorBase.cpp
82aaf94a5b18939e4d790bbc752031f3070704a3 18-Jul-2013 Glenn Kasten <gkasten@google.com> Report underruns for fast tracks also

This fixes a regression that was introduced earlier
by commit 9f80dd223d83d9bb9077fb6baee056cee4eaf7e5
called "New control block for AudioTrack and AudioRecord".
That commit broke underrun reporting for fast tracks.

Also remove Track::mUnderrunCount, which counted the number of underrun
events, and was only used by dumpsys media.audio_flinger.

Now dumpsys media.audio_flinger reports the number of underrun frames,

Isolated underrun-related control block accesses via the proxy, so that
the server is not directly poking around in the control block.

The new proxy APIs are AudioTrackServerProxy::getUnderrunFrames() and
AudioTrackServerProxy::tallyUnderrunFrames(). getUnderrunFrames() returns
a rolling counter for streaming tracks, or zero for static buffer tracks
which never underrun, but do a kind of 'pause' at end of buffer.
tallyUnderrunFrames() increments the counter by a specified number of frames.

Change-Id: Ib31fd73eb17cbb23888ce3af8ff29f471f5bd5a2
udioflinger/PlaybackTracks.h
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
b08ab81bab9e8cd2e3a7fff02725a387070fd078 31-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Add resampler comments and fix a typo"
34af02647b387a252fb02bab8e2cb9f7bd9c8abb 30-Jul-2013 Glenn Kasten <gkasten@google.com> Add resampler comments and fix a typo

Change-Id: Ie071673875f663de4212eed4a4dff89d51a5a915
udioflinger/AudioFlinger.cpp
udioflinger/AudioResampler.h
udioflinger/Threads.cpp
udioflinger/Threads.h
7b82efe7a376c882f8f938e1c41b8311a8cdda4a 26-Jul-2013 Eino-Ville Talvala <etalvala@google.com> Camera: Rename new API to camera2, rearrange camera service

- Support API rename from photography to camera2
- Reorganize camera service files
- API support files to api1/, api2/, api_pro/
- HAL device support files into device{1,2,3}/
- Common files into common/
- Camera service remains at top-level

Change-Id: Ie474c12536f543832fba0a2dc936ac4fd39fe6a9
amera/libcameraservice/Android.mk
amera/libcameraservice/Camera2Client.cpp
amera/libcameraservice/Camera2Client.h
amera/libcameraservice/Camera2ClientBase.cpp
amera/libcameraservice/Camera2ClientBase.h
amera/libcameraservice/Camera2Device.cpp
amera/libcameraservice/Camera2Device.h
amera/libcameraservice/Camera3Device.cpp
amera/libcameraservice/Camera3Device.h
amera/libcameraservice/CameraClient.cpp
amera/libcameraservice/CameraClient.h
amera/libcameraservice/CameraDeviceBase.cpp
amera/libcameraservice/CameraDeviceBase.h
amera/libcameraservice/CameraDeviceFactory.cpp
amera/libcameraservice/CameraDeviceFactory.h
amera/libcameraservice/CameraHardwareInterface.h
amera/libcameraservice/CameraService.cpp
amera/libcameraservice/CameraService.h
amera/libcameraservice/ProCamera2Client.cpp
amera/libcameraservice/ProCamera2Client.h
amera/libcameraservice/api1/Camera2Client.cpp
amera/libcameraservice/api1/Camera2Client.h
amera/libcameraservice/api1/CameraClient.cpp
amera/libcameraservice/api1/CameraClient.h
amera/libcameraservice/api1/client2/BurstCapture.cpp
amera/libcameraservice/api1/client2/BurstCapture.h
amera/libcameraservice/api1/client2/CallbackProcessor.cpp
amera/libcameraservice/api1/client2/CallbackProcessor.h
amera/libcameraservice/api1/client2/Camera2Heap.h
amera/libcameraservice/api1/client2/CaptureSequencer.cpp
amera/libcameraservice/api1/client2/CaptureSequencer.h
amera/libcameraservice/api1/client2/FrameProcessor.cpp
amera/libcameraservice/api1/client2/FrameProcessor.h
amera/libcameraservice/api1/client2/JpegCompressor.cpp
amera/libcameraservice/api1/client2/JpegCompressor.h
amera/libcameraservice/api1/client2/JpegProcessor.cpp
amera/libcameraservice/api1/client2/JpegProcessor.h
amera/libcameraservice/api1/client2/Parameters.cpp
amera/libcameraservice/api1/client2/Parameters.h
amera/libcameraservice/api1/client2/StreamingProcessor.cpp
amera/libcameraservice/api1/client2/StreamingProcessor.h
amera/libcameraservice/api1/client2/ZslProcessor.cpp
amera/libcameraservice/api1/client2/ZslProcessor.h
amera/libcameraservice/api1/client2/ZslProcessor3.cpp
amera/libcameraservice/api1/client2/ZslProcessor3.h
amera/libcameraservice/api1/client2/ZslProcessorInterface.h
amera/libcameraservice/api2/CameraDeviceClient.cpp
amera/libcameraservice/api2/CameraDeviceClient.h
amera/libcameraservice/api_pro/ProCamera2Client.cpp
amera/libcameraservice/api_pro/ProCamera2Client.h
amera/libcameraservice/camera2/BurstCapture.cpp
amera/libcameraservice/camera2/BurstCapture.h
amera/libcameraservice/camera2/CallbackProcessor.cpp
amera/libcameraservice/camera2/CallbackProcessor.h
amera/libcameraservice/camera2/Camera2Heap.h
amera/libcameraservice/camera2/CaptureSequencer.cpp
amera/libcameraservice/camera2/CaptureSequencer.h
amera/libcameraservice/camera2/FrameProcessor.cpp
amera/libcameraservice/camera2/FrameProcessor.h
amera/libcameraservice/camera2/JpegCompressor.cpp
amera/libcameraservice/camera2/JpegCompressor.h
amera/libcameraservice/camera2/JpegProcessor.cpp
amera/libcameraservice/camera2/JpegProcessor.h
amera/libcameraservice/camera2/Parameters.cpp
amera/libcameraservice/camera2/Parameters.h
amera/libcameraservice/camera2/ProFrameProcessor.cpp
amera/libcameraservice/camera2/ProFrameProcessor.h
amera/libcameraservice/camera2/StreamingProcessor.cpp
amera/libcameraservice/camera2/StreamingProcessor.h
amera/libcameraservice/camera2/ZslProcessor.cpp
amera/libcameraservice/camera2/ZslProcessor.h
amera/libcameraservice/camera2/ZslProcessor3.cpp
amera/libcameraservice/camera2/ZslProcessor3.h
amera/libcameraservice/camera2/ZslProcessorInterface.h
amera/libcameraservice/camera3/Camera3IOStreamBase.cpp
amera/libcameraservice/camera3/Camera3IOStreamBase.h
amera/libcameraservice/camera3/Camera3InputStream.cpp
amera/libcameraservice/camera3/Camera3InputStream.h
amera/libcameraservice/camera3/Camera3OutputStream.cpp
amera/libcameraservice/camera3/Camera3OutputStream.h
amera/libcameraservice/camera3/Camera3OutputStreamInterface.h
amera/libcameraservice/camera3/Camera3Stream.cpp
amera/libcameraservice/camera3/Camera3Stream.h
amera/libcameraservice/camera3/Camera3StreamBufferListener.h
amera/libcameraservice/camera3/Camera3StreamInterface.h
amera/libcameraservice/camera3/Camera3ZslStream.cpp
amera/libcameraservice/camera3/Camera3ZslStream.h
amera/libcameraservice/common/Camera2ClientBase.cpp
amera/libcameraservice/common/Camera2ClientBase.h
amera/libcameraservice/common/CameraDeviceBase.cpp
amera/libcameraservice/common/CameraDeviceBase.h
amera/libcameraservice/common/FrameProcessorBase.cpp
amera/libcameraservice/common/FrameProcessorBase.h
amera/libcameraservice/device1/CameraHardwareInterface.h
amera/libcameraservice/device2/Camera2Device.cpp
amera/libcameraservice/device2/Camera2Device.h
amera/libcameraservice/device3/Camera3Device.cpp
amera/libcameraservice/device3/Camera3Device.h
amera/libcameraservice/device3/Camera3IOStreamBase.cpp
amera/libcameraservice/device3/Camera3IOStreamBase.h
amera/libcameraservice/device3/Camera3InputStream.cpp
amera/libcameraservice/device3/Camera3InputStream.h
amera/libcameraservice/device3/Camera3OutputStream.cpp
amera/libcameraservice/device3/Camera3OutputStream.h
amera/libcameraservice/device3/Camera3OutputStreamInterface.h
amera/libcameraservice/device3/Camera3Stream.cpp
amera/libcameraservice/device3/Camera3Stream.h
amera/libcameraservice/device3/Camera3StreamBufferListener.h
amera/libcameraservice/device3/Camera3StreamInterface.h
amera/libcameraservice/device3/Camera3ZslStream.cpp
amera/libcameraservice/device3/Camera3ZslStream.h
amera/libcameraservice/photography/CameraDeviceClient.cpp
amera/libcameraservice/photography/CameraDeviceClient.h
d054c32443a493513ab63529b0c8b1aca290278c 12-Jul-2013 Glenn Kasten <gkasten@google.com> Move control block mName to createTrack() output

This is part of a series of CLs to clean up the shared memory
control block, by removing any fields that don't have to be there.

Change-Id: I6e51003a1293b6800258c31b22cff2eba42162e7
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/PlaybackTracks.h
udioflinger/Tracks.cpp
96f60d8f04432a1ed503b3e24d5736d28c63c9a2 12-Jul-2013 Glenn Kasten <gkasten@google.com> Rename control block flags to mFlags

Change-Id: I7b6d31e24531954ab1ecdf3ed56c19433700bd89
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
97252bb0e40a5a9b41f020163393cf6c5da10b7e 30-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "AudioRecord and HAL input stream must be 16-bit PCM only"
f20e1d8df84c5fbeeace0052d100982ae39bb7a4 12-Jul-2013 Glenn Kasten <gkasten@google.com> Rename control block server to mServer and add comments

Change-Id: Ieabd91acee92d0e84e66fbd358df5282b856306e
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
a30e75897934da2ce7b1b03bcb4b58e139d3e81e 30-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Fix theoretical race using TrackBase::sampleRate()"
eb144bbbd0b18427562b0d7db5b38e11f9484739 09-Oct-2012 Andrei V. FOMITCHEV <andreix.fomitchev@intel.com> Fix mismatched delete/new couple

In RecordThread::readInputParameters(), mRsmpInBuffer is allocated
with new[] and should be freed with delete[] instead of delete.

This error has been found by valgrind.

Change-Id: I2f947abb658a21a7d1e61eebb99270cb37d2d147
Signed-off-by: Andrei V. FOMITCHEV <andreix.fomitchev@intel.com>
Signed-off-by: David Wagner <david.wagner@intel.com>
Signed-off-by: Jack Ren <jack.ren@intel.com>
Signed-off-by: Bruce Beare <bruce.j.beare@intel.com>
udioflinger/Threads.cpp
fa319e6d918b84f93fb5457af5d1cca6421ac517 30-Jul-2013 Glenn Kasten <gkasten@google.com> Remove CC_LIKELY and CC_UNLIKELY where not needed

Only keep them in performance-sensitive code

Change-Id: Ib257ddd7bc39ce9896997ffae008c524ac743d01
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
udioflinger/Tracks.cpp
548efc94813c1dec6e8cf6c085ae41ccb04827f1 29-Nov-2012 Glenn Kasten <gkasten@google.com> Rename RecordThread::mInputBytes to the more generic mBufferSize

This prepares for using it in PlaybackThreads later

Change-Id: Id90a92aa6372e4b69914b0008cef07296ca5d6a3
udioflinger/Threads.cpp
udioflinger/Threads.h
9b58f63e45ef2fdfb839b9b9bb3411d81eb96128 16-Jul-2013 Glenn Kasten <gkasten@google.com> Move members from ThreadBase to PlaybackThread

Move mNormalFrameCount and frameCountHAL(), since they're not used by
record threads. Also comment which fields are updated by readParameters().

Change-Id: I5fc0a8a89cc637976f22d49271a5a3e136dab4e1
udioflinger/Threads.cpp
udioflinger/Threads.h
cd4f9920f5658fcf1bf62bfebf5232a1fea06ea6 30-Jul-2013 Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org> libcameraservice: Fix build in ISO C++11 mode

Change log macro define so it can't be confused for a C++11 string
literal

Change-Id: Idcc8085735177aa3313fdea66dc0736cca749f9b
Signed-off-by: Bernhard Rosenkraenzer <Bernhard.Rosenkranzer@linaro.org>
amera/libcameraservice/gui/RingBufferConsumer.cpp
7f249fa9bcb64da324d19f551943fac7686d221c 29-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Use standard name and type for channel mask"
ae4b5f93444802632d71ec34373842e6f5febbaa 29-Jul-2013 Igor Murashkin <iam@google.com> Merge "camera2 api: Override default RGBx formats to IMPLEMENTATION_DEFINED"
175f8338e67aae6d0ca420b8f45a5f7cab4394d5 29-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Simplify getParameters()"
f6ed423af92a56ef54bba23eba883b1f21448b54 16-Jul-2013 Glenn Kasten <gkasten@google.com> Treat mChannelCount as uint32_t consistently

mChannelCount was 8-, 16-, or 32-bits

Change-Id: I2cc2fedf3e33144e5c8bbd9894763282d9217f63
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/TrackBase.h
1581101ce2a8c1b8d0b07b643ad891595221d781 29-Jul-2013 Igor Murashkin <iam@google.com> camera2 api: Override default RGBx formats to IMPLEMENTATION_DEFINED

Bug: 9487482
Change-Id: I09d3b4e41454d350c4bc7b1f8e893c3dad655e73
amera/libcameraservice/photography/CameraDeviceClient.cpp
2eeca1f8e18106d118f7268cb9d8597539685c5c 29-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Move local variable declarations to point of first use"
b59c1ad726b8bdf441f373d0bdc612539769334a 29-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Declare methods in binder opcode order"
3dcd00dddec86a1c5133083ad7ba2265d49c048c 17-Jul-2013 Glenn Kasten <gkasten@google.com> Declare methods in binder opcode order

Change-Id: I5f624b7a51ffe1a17a67c056cf984f74e4c56eac
udioflinger/AudioFlinger.h
udioflinger/Tracks.cpp
3af48e6b28983da8c11d3d7d7fdd2088d881b462 29-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Remove obsolete mBufferEnd"
b283374cbf79dc5a36f1eef0015d7baf8881792e 29-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Move delete AudioMixer closer to point of re-allocation"
35cc4f3127322ad3e3dd1e15e8ae29ff4b4a3af6 25-Jul-2013 Glenn Kasten <gkasten@google.com> Remove obsolete mBufferEnd

Change-Id: I507c6109d66000bb30933ca23b912a1316f55e5e
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
bd4c4fbb3b073e48963185d11a15da1fa18d2e54 25-Jul-2013 Glenn Kasten <gkasten@google.com> Remove obsolete TrackBase::step(), mStepCount, mStepServerFailed

Change-Id: I6347096f066b8b19451c6472db7b0671f0cf7702
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
afbbc6c5f6bc470d504dcf24ceb3ac21d57fb78d 29-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Simplify RecordTrack::stop()"
420ea49539d23ab305a7b33c0854a7a475493dd4 27-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "CBLK_OVERRUN, not CBLK_UNDERRUN, is for record threads"
65d30dd9ee498f7b3bfc033735458a6ff399c207 27-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Remove obsolete TrackBase::reset()"
422801c5e9b795105f28e639c4bed5ee3f4e56f3 26-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "HAL stream format for mixer output threads must be stereo 16-bit PCM"
a8356f663014e7d4c27869629af83d8bb3441e19 25-Jul-2013 Glenn Kasten <gkasten@google.com> Simplify RecordTrack::stop()

Change-Id: Ib959c1e9dc9544d12277ce11bea445118b2e0521
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/Tracks.cpp
fc38a2e0268b5e531db2975c3a81462a3593c861 25-Jul-2013 Glenn Kasten <gkasten@google.com> CBLK_OVERRUN, not CBLK_UNDERRUN, is for record threads

Change-Id: I8948f76ef4717a423c37cd6ea7db4381636af612
udioflinger/Tracks.cpp
0fea74cdbc09c1259e08215e2ea90e7988d62df8 25-Jul-2013 Glenn Kasten <gkasten@google.com> Remove obsolete TrackBase::reset()

Change-Id: I38100b7e28a12d7af8cb40ae3f4d9cb4a0ebe701
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
bfb1b832079bbb9426f72f3863199a54aefd02da 07-Jan-2013 Eric Laurent <elaurent@google.com> AudioFlinger: offload playback, non-blocking write

- Added specialized playback thread class for offload playback,
derived from directoutput thread.
This thread type handles specific state transitions for offloaded
tracks and offloading commands (pause/resume/drain/flush..) to audio HAL.
As opposed to other threads, does not go to standby if the track is paused.

- Added support for asynchronous write and drain operations at audio HAL.
Use a thread to handle async callback events from HAL: this avoids locking
playback thread mutex when executing the callback and cause deadlocks when
calling audio HAL functions with the playback thread mutex locked.

- Better accouting for track activity: call start/stop and release Output
methods in audio policy manager when tracks are actually added and removed
from the active tracks list.
Added a command thread in audio policy service to handle stop/release commands
asynchronously and avoid deadlocks with playback thread.

- Track terminated status is not a state anymore. This condition is othogonal
to state to permitted state transitions while terminated.

Change-Id: Id157f4b3277620568d8eace7535d9186602564de
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/AudioPolicyService.cpp
udioflinger/AudioPolicyService.h
udioflinger/Effects.cpp
udioflinger/Effects.h
udioflinger/PlaybackTracks.h
udioflinger/Threads.cpp
udioflinger/Threads.h
udioflinger/TrackBase.h
udioflinger/Tracks.cpp
9e8fcbcd8efa51d70d1207ff57bfbfe31324287a 25-Jul-2013 Glenn Kasten <gkasten@google.com> Move delete AudioMixer closer to point of re-allocation

No need to delete AudioMixer before readOutputParameters

Change-Id: Icafa785c9021bbe8d985e4f9527f8fc8c5e62622
udioflinger/Threads.cpp
7fc97ba08e2850f3f16db704b78ce78e3dbe1ff0 17-Jul-2013 Glenn Kasten <gkasten@google.com> HAL stream format for mixer output threads must be stereo 16-bit PCM

Direct and tunnel output threads can support various HAL stream formats,
included encoded. But currently there are stereo 16-bit PCM assumptions
in several places for mixer and duplicating output threads:
- mMixBuffer and mixBuffer()
- AudioMixer including resampler
- FastMixer's mixBuffer
- effects
- NBAIO_Format
- anywhere FCC_2 is used
- possibly other places

Until those assumptions are removed, this CL enforces stereo 16-bit
PCM in mixer and duplicating threads at the place where the HAL format
is read. It was already being checked in checkForNewParameters_l(),
but not in readOutputParameters().

Change-Id: Ibe344cc922743da234299097aa1bb1f54795cc9b
udioflinger/FastMixer.cpp
udioflinger/Threads.cpp
d8ea699dc8e7dac58bb32e9cdb31b0758da25817 16-Jul-2013 Glenn Kasten <gkasten@google.com> Simplify getParameters()

Change-Id: Iedfeca3cd477d023c350d6d4e6eed874ee467a32
udioflinger/Threads.cpp
34542acfa25c6413c87a94b6f7cc315a0c496277 26-Jun-2013 Glenn Kasten <gkasten@google.com> Move local variable declarations to point of first use

Change-Id: Ideb83dea2c3002651c34fa646753cba598e29e93
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
fad226abd12435dbcd232f7de396f1a097b2bd5f 17-Jul-2013 Glenn Kasten <gkasten@google.com> Use standard name and type for channel mask

Former name 'channels' was ambiguous with respect to channel count.

Change-Id: I716f792d95a7e0c787d27514ad6e93dbcef8a415
udioflinger/Threads.cpp
291bb6d8947c5b0c062f0895d623c529259bfa39 17-Jul-2013 Glenn Kasten <gkasten@google.com> AudioRecord and HAL input stream must be 16-bit PCM only

Currently there are 16-bit PCM assumptions in several places for capture:
- resampler API
- mRsmpInBuffer and mRsmpOutBuffer
- RecordThread::threadLoop upmix, downmix, and resampling
- possibly other places

Until those assumptions are removed, this CL enforces 16-bit PCM in both
client and server at all places where a format is checked.

Change-Id: I08b0570bff626ad0d341804825a72c14e61b4233
udioflinger/AudioFlinger.cpp
udioflinger/Threads.cpp
2ab500c632569e2f131a1a2288459933da70c4ee 23-Jul-2013 Zhijun He <zhijunhe@google.com> camera2: Implement ICameraDeviceUser::waitUntilIdle

Also fixed some logging typo

Change-Id: Ib254bdb137dca10b12595c23aeb1c53097423425
amera/libcameraservice/camera3/Camera3OutputStream.cpp
amera/libcameraservice/photography/CameraDeviceClient.cpp
amera/libcameraservice/photography/CameraDeviceClient.h
47110057829ba7d5c7b41fd2aa381b5f5ed811ca 23-Jul-2013 Zhijun He <zhijunhe@google.com> Camera: ProCamera connect need support HAL3 device

Change-Id: Iae7e5f9e6387f61f1c4bbb91f75803fc1fdf2668
amera/libcameraservice/CameraService.cpp
01061c1d57700b37fa879217763494cdf94d5c98 22-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Use AudioSystem::setLowRamDevice() to configure memory"
cb155c8f4bf556b0d37c3596c4dc265ab491152b 22-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Revert "Fix Audioflinger crash when TeeSink is enabled""
18cf609ca3f20a9da2c7e140088d7557e7479f49 22-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Fix compile warning"
288abb6fe160dff109dedbf89b227fc2b10a2ee8 20-Jul-2013 Zhijun He <zhijunhe@google.com> Merge "camera2: Fix request ID bug"
cd63212dedc29d72d4746a4070d018fdbca316a9 20-Jul-2013 Mathias Agopian <mathias@google.com> Merge "update to new Consumer APIs"
e4bc8dbf0329c4845c692a02e54c16906998f77d 20-Jul-2013 Eino-Ville Talvala <etalvala@google.com> am b0177ff2: am 46910bdc: Camera2/3: Fix deadlock when starting recording before preview.

* commit 'b0177ff25e3e620be6ebe1e2c3f645b2f05dd57e':
Camera2/3: Fix deadlock when starting recording before preview.
b0177ff25e3e620be6ebe1e2c3f645b2f05dd57e 19-Jul-2013 Eino-Ville Talvala <etalvala@google.com> am 46910bdc: Camera2/3: Fix deadlock when starting recording before preview.

* commit '46910bdc57c35ac36bd4adcbb76f4f3a590e3f21':
Camera2/3: Fix deadlock when starting recording before preview.
fe0799e8f1c5db22df3bafdfb9ec995f5494d260 19-Jul-2013 Zhijun He <zhijunhe@google.com> camera2: Fix request ID bug

Wrong request id was pushed in request list.

Change-Id: I55bf7ae84ca41eec79db1a81d2cde35beaa2a6b9
amera/libcameraservice/photography/CameraDeviceClient.cpp
1b8ae3d9f3605fab7d14c323f2118ba3c769a42a 19-Jul-2013 Glenn Kasten <gkasten@google.com> Fix compile warning

Change-Id: I80de4a013dc65eb7c532561438fd10e005354c03
udioflinger/AudioPolicyService.cpp
4182c4e2a07e2441fcd5c22eaff0ddfe7f826f61 15-Jul-2013 Glenn Kasten <gkasten@google.com> Use AudioSystem::setLowRamDevice() to configure memory

Bug: 9798886
Change-Id: I9321e3f369f1ed9429ae222e3926ebdeb012b8b0
udioflinger/AudioFlinger.cpp
udioflinger/AudioFlinger.h
udioflinger/FastMixer.cpp
udioflinger/FastMixer.h
udioflinger/Threads.cpp
0d61251648b5110bfc33ef5b3d19bbf65db0a7b5 16-Jul-2013 Glenn Kasten <gkasten@google.com> Revert "Fix Audioflinger crash when TeeSink is enabled"

This reverts commit 84e391686d7eced293913d1d7993721224ee0ba1.

Bug: