History log of /frameworks/av/services/audioflinger/Threads.h
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
67f97291bfb7caec5152d2c93913191729db5917 21-Apr-2018 Eric Laurent <elaurent@google.com> audioflinger: fix mmap volume update

Make sure volume callback is sent at least each time a new
client stream is started.

Bug: 78122737
Test: repro steps in bug.
Change-Id: I5b5ac617d604ed23bf8528affa1877b6cc0b5494
/frameworks/av/services/audioflinger/Threads.h
331679c8a5cd21a0e6a7a1d851e965e4721f7420 17-Apr-2018 Eric Laurent <elaurent@google.com> Revert "Revert "audioflinger: implement silenced capture for mmap""

This reverts commit 611ebb95e76c230214780b7b583b8a3c5277ac7a.

Bug: 78118584
bug: 72134552
Test: 'adb shell write_sine_callback -m3 -pl -s100 -x' and Plug headphones in and out.
Test: AAudio CTS tests
Change-Id: I7558ad7b9c6c2d352ebce105382fe914c26fd35e
/frameworks/av/services/audioflinger/Threads.h
611ebb95e76c230214780b7b583b8a3c5277ac7a 16-Apr-2018 Eric Laurent <elaurent@google.com> Revert "audioflinger: implement silenced capture for mmap"

This reverts commit a2f478ca0b2bda8db9b321f0cfa9e9d3cf6130f9.

Bug: 78118584
Change-Id: Ie0da3dea445f2474c7a889c5f9919305c1c96d40
/frameworks/av/services/audioflinger/Threads.h
a2f478ca0b2bda8db9b321f0cfa9e9d3cf6130f9 11-Apr-2018 Eric Laurent <elaurent@google.com> audioflinger: implement silenced capture for mmap

Implement silencing of audio capture for idle UIDs for
MMAP streams.

Use audio HAL setMicGain() API to silence the mmap buffer for
exclusive mode and when only one client is active in shared mode.

Add new MmapStreamCallback method onStreamSilenced() for AAudio
service to selectively silence streams from silenced UIDs in
shared mode.

Bug: 72134552
Test: manual
Change-Id: I7c92ba0002bc5ba003c1a3c887edddf9ae53b538
/frameworks/av/services/audioflinger/Threads.h
c86a7f7de52f0ff0059e8c6c4fa4619aa7fae5c5 03-Apr-2018 Kevin Rocard <krocard@google.com> Audio V4: Send volume and duplicated track attr in update metadata

Only the volume of MMAP thread was previously sent and
the attributes of duplicated tracks were skipped.

Bug: 38184704
Bug: 69623109
Test: check that the HAL receives correct track metadata volume
Test: check that the HAL receives correct duplicated track metadata
Signed-off-by: Kevin Rocard <krocard@google.com>

Change-Id: I1e3b14edd8c9a5a65d2b9f4cf8660997c81c701c
/frameworks/av/services/audioflinger/Threads.h
069c2719e753732d5af9ba51e5fcc34342b0c9f2 30-Mar-2018 Kevin Rocard <krocard@google.com> Audio V4: Propagate track attributes to HAL

This patch does not propagate the volume.

Bug: 38184704
Bug: 69623109
Test: log metadata in HAL
Change-Id: I313563cafd9f2b29a13839c3c075beb65a170632
Signed-off-by: Kevin Rocard <krocard@google.com>
/frameworks/av/services/audioflinger/Threads.h
1f564acca544826daaf7dca44e39cec6016b82fd 29-Mar-2018 Kevin Rocard <krocard@google.com> Audio V4: Propagate audio attributes to tracks

This patch has not functional changes.

Bug: 38184704
Bug: 69623109
Test: play music and a audio
Change-Id: Ide6ec7de4dbfab4af2653475901c3b3daee36e52
Signed-off-by: Kevin Rocard <krocard@google.com>
/frameworks/av/services/audioflinger/Threads.h
56ecf3e3ce36d111a17d67485047836660128629 12-Mar-2018 Phil Burk <philburk@google.com> audioflinger: only update mHalVolFloat on success

This will fix a regression with AAudio MMAP stream not getting
its initial volume set correctly.
Also initialize mHalVolFloat.

Bug: 74547253
Test: adb shell write_sine_callback -pl -s10 -m1
Test: should have the same initial volume as
Test: adb shell write_sine_callback -pl -s10 -m3
Change-Id: Ie0c1f9ba51e2059a888d2273f41588f101b09a5c
/frameworks/av/services/audioflinger/Threads.h
1bc088a918d7038603230637d640941953b314d4 10-Feb-2018 Andy Hung <hunga@google.com> Call AudioMixer only from MixerThread threadLoop.

As part of change:
Remove track name offset by TRACK0.
Move track name management to the Tracks class.
Sync mixer track name to FastMixer track index.

Fixes regression introduced by commit 8ed196a.

Test: SoundPool, AudioTrack CTS, Usability
Bug: 72937362
Bug: 73004420
Change-Id: I2f1a33f6f0da66bcd7aa91e2a4b663ff822df645
/frameworks/av/services/audioflinger/Threads.h
653cc0ab6d5b714d1f26adcd08f9bc3269b62fa0 18-Jan-2018 jiabin <jiabin@google.com> Support query active microphones information in AudioRecord.

This is part of device enumeration. With the new add API, developer
could get the active microphones information for each channel.

Bug: 64038649
Test: Run cts and check the print log.
Change-Id: Ic63d86e533a30e40697da7522a5a81f7cfcea988
/frameworks/av/services/audioflinger/Threads.h
c6116926de37cabb1d35ddd57eaff0e19fcec8bc 24-Jan-2018 Andy Hung <hunga@google.com> Merge "AudioMixer: Enable 256 tracks, up from 32 tracks"
8ed196ac0f4aa8ae811c012dfa6f596fddebf1bf 05-Jan-2018 Andy Hung <hunga@google.com> AudioMixer: Enable 256 tracks, up from 32 tracks

Client apps can have 40 tracks, up from 14 tracks

Related code cleanup:
a) Removed State nested class
b) Moved static functions to Track member functions
c) Moved static function hooks to pointer-to-member-function hooks
d) Some reorganization of touched code for recent C++ style

Test: test-mixer native mixer test
Test: SoloTester effect test
Test: SoundPool with many tracks
Test: CTS AudioTrackTest
Bug: 64161002
Change-Id: I0d09620acd715d577e776bb6f76e94e87e554520
/frameworks/av/services/audioflinger/Threads.h
f4ddfefc8ba59a8486d91826154cc9447821409e 16-Jan-2018 Svet Ganov <svetoslavganov@google.com> Don't record audio if UID is idle - media framework

To protect user's privacy if a UID is in an idle state we allow
recording but report silence (all zeros in the byte array) and once
the process goes in an active state we report the real mic data.
This avoids the race between the app being notified aboout its
lifecycle and the audio system being notified about the state
of a UID.

Test: Added - AudioRecordTest#testRecordNoDataForIdleUids
Passing - cts-tradefed run cts-dev -m CtsMediaTestCases
-t android.media.cts.AudioRecordTest

bug:63938985

Change-Id: I1442a9dda1553e9ea7a4a654c50555ac1ec06aa0
/frameworks/av/services/audioflinger/Threads.h
f14db3c3ebc1ea29b3eb5b7e9b944cabcb5f83ff 08-Dec-2017 Eric Laurent <elaurent@google.com> Revert "Revert "refactor AudioRecord and AudioFlinger openRecord()""

This reverts commit 0aa3c6eba07f987fe84b5fa450274a8e730971e3.

Bug: 70388312
Test: AudioRecord CTS, Audio smoke tests
Change-Id: I45394bccf82b922aa2b68fee3e02afc280f6729c
/frameworks/av/services/audioflinger/Threads.h
0aa3c6eba07f987fe84b5fa450274a8e730971e3 08-Dec-2017 Eric Laurent <elaurent@google.com> Revert "refactor AudioRecord and AudioFlinger openRecord()"

This reverts commit 3e1acc0c58b337dec4054d78c28b48b2e77e0784.

bug: 70388312

Change-Id: I6782d6eceeece1bad998b02af26c0119da70a13d
/frameworks/av/services/audioflinger/Threads.h
3e1acc0c58b337dec4054d78c28b48b2e77e0784 02-Dec-2017 Eric Laurent <elaurent@google.com> refactor AudioRecord and AudioFlinger openRecord()

Refactor the mechanism used by audio record tracks to query and
attach to an input mixer/stream in audio flinger. This will:
- reduce the number of binder transactions needed to create a record track
- move sample rate, framecount and flags validations to audio server side
- move audio session allocation to audio server side
- prepare restriction of certain binder transactions to audioserver only

Also:
- renamed openRecord() to createRecord() for consistency with AudioTrack
- make AudioRecord mStatus update consistent when calling default
contructor + set() or constructor with arguments
- make AudioClient, CreateTrackXXX and CreateRecordXXX classes derive
from Parcelable
- restore audio session ID validity check in AudioFlinger::createTrack()

Test: CTS tests: AudioRecordTest, AudioRecordingConfigurationTest, AudioPreProcessingTest
Test: manual test for capture use cases: camcorder, OK Google, VoIP calls
Change-Id: I72edaa7ddef1da11c77df21e88378e3aa9012d58
/frameworks/av/services/audioflinger/Threads.h
ef6cf3fc6cfb12e089e787efcbf1fc485ed54931 22-Nov-2017 Andy Hung <hunga@google.com> Merge "Converting effect chains to float point by default."
94a1ee822686e920a33e312f4032f991731aea07 22-Jul-2017 rago <rago@google.com> Converting effect chains to float point by default.

Removed additional conversions from/to int16/float.
Fixed config file restrictions.
Detection of native format (int16/float) of effects.
On-the-fly conversion to/from 16 bit effects if necessary.
WIP: testing effects in all possible configurations.

Bug: 63935479
Test: Bufflog dumps, frequency analysis comparison, SoloTester
Change-Id: Id4cabc5c5698befc90a5d68b0b996a9b9adebfc4
/frameworks/av/services/audioflinger/Threads.h
21da647792c0b78ab3943be0f32066015d5e8c34 10-Nov-2017 Eric Laurent <elaurent@google.com> refactor AudioTrack and AudioFlinger createTrack()

Refactor the mechanism used by audio tracks to query and attach
to an output mixer/stream in audio flinger. This will:
- reduce the number of binder transactions needed to create a track
- move sample rate, framecount and flags validations to audio server
side
- move audio session allocation to audio server side
- prepare restriction of certain binder transactions to audioserver only

Test: CTS tests for AudioTrack

Change-Id: If4369aad6c080a56c0b42fbfcc97c8ade17a7439
/frameworks/av/services/audioflinger/Threads.h
2c67bad03e6754f69706e58500c60a61911e191e 22-Sep-2017 Eric Laurent <elaurent@google.com> Merge "audioflinger: volume control to HAL for VoIP streams" into oc-mr1-dev am: 87917b98d3
am: 64643717f9

Change-Id: I0bc3ceb15b47749091c0080385c8b6b10bde8f07
7c29ec95f494d241faa07d0d70579729520e3114 21-Sep-2017 Eric Laurent <elaurent@google.com> audioflinger: volume control to HAL for VoIP streams

Do not apply stream volume in software for special VoIP output
stream mixers but send it to the HAL instead.

Bug: 64392515.
Test: Fi calls
Change-Id: I698a1a0ad17d672d09187529dcbc5d259284e4af
/frameworks/av/services/audioflinger/Threads.h
f3c109f17c842c78000effae850e6eadac603f42 29-Aug-2017 Eric Laurent <elaurent@google.com> Merge "audioflinger: fix mmap device selection" into oc-mr1-dev am: faf18c58ba
am: c7f474434f

Change-Id: Ibcb27cab661f710b14a303eeb12f72191c4eefd8
7aa0ccbcb6e8d35c894356015c23574619bcf648 28-Aug-2017 Eric Laurent <elaurent@google.com> audioflinger: fix mmap device selection

Preserve initial device selection on mmap streams in order to
reuse it when a new client starts on the same stream so that
audiopolicy does not use the default route for the new client.

Bug: 64981153
Test: verify AAudio playback over MMAP with forced device selection to
speaker while headset is connected.

Change-Id: I7c117c3c0f8e7ad08f8e63ea804c19ce21808874
/frameworks/av/services/audioflinger/Threads.h
2a6a945d65c986dcc779f70f18afde1d7a74397b 28-Jul-2017 Sanna Catherine de Treville Wager <scwager@google.com> Develop histogram logging

Add date to WriteToFile filenames and simplify
file format. Add timestamp logging to
NormalMixer. Change histogram resolution
dynamically based on logarithmic distance
from the distribution center. Add context
information: thread, hash and time.

Example of right end of a histogram with
rounding for values >= 27:

1 1 2 1 1 1 2 2 1

| | |
| | | | | | | | |
_____________________________________________
21.1 21.2 22.9 23.0 23.3 27.0 34.0 37.0 38.0 ms

Test: dumpsys media.log

Change-Id: I255e2d28d76a1c7a06d48e7c3eacdf2f846a7ea3
/frameworks/av/services/audioflinger/Threads.h
4ecf14419c0857986c1cff6c59cd1f71a9c6013f 18-Jul-2017 Eric Laurent <elaurent@google.com> audio flinger: fix AEC and NS suspend logic am: d8365c54d0
am: 03e1cd73c6

Change-Id: I1df3309a9170f104016b969b285f47179a4ae55d
d8365c54d049aade9e02ccae722f311f846cad9a 17-Jul-2017 Eric Laurent <elaurent@google.com> audio flinger: fix AEC and NS suspend logic

Make sure we suspend/restore AEC and NS only when the suspend condition
actually changes to avoid mismatch in number of suspends/restores
causing the ref counting mechanism to leave the effects in suspend mode
while they should not.

Also clear the suspend state on an effect session before parking it in
the orphan chains list so that it is in default state whne attached to a
new record thread.

Bug: 63015903
Test: verify that switching BT SCO on/off with Duo enables or disables
AEC and NS accordingly

Change-Id: I4d0f0bf818deca3952da3c67bb7e83cb500429c7
/frameworks/av/services/audioflinger/Threads.h
cb4dae216758d9e9a28050f65097f1ce905c03e9 02-Jul-2017 Eric Laurent <elaurent@google.com> aaudio: indicate client UID and PID to audio flinger

Implement correct indication of client UID and PID to audio flinger
for AAudio MMAP streams in both exclusive mode and shared mode.
- Add start/stop client methods on MMAP streams used only when the MMAP
stream is in AAudio service and carries a mix of shared streams.
- Add "In Service'" indication from "client" side to AAudioServiceStreamMMAP
so that the behavior can be adapted accordingly.
- Modify logic on audio flinger side with regard to mmap tracks and
audio HAL stream activity:
- use same audio session for all clients on a same stream to match
audio policy logic to share same direct output stream for clients on same
session. This is also more consistent with current volume and effect
handling as all MMAP clients sharing the same output stream have the
same volume and use case.
- start/stop the HAL when the stream is started/stopped with the initial client
handle (returned when the stream is opened) but do not create a track.
AAudioService implementation will always send an additional start command before
first client starts and a stop command after last client stops,
in both shared and exclusive mode.
- start/stop a track only if the start/stop stream command is received
with a handle different from the initial handle.
- Allow more than one active client from the same UID on a MMAP input in audio policy.

Bug: 62950008
Test: verify playback and capture in mmap mode
Merged-In: I86151bbb637ff172d2fd5f813056eab13a7bcd3c
Change-Id: I86151bbb637ff172d2fd5f813056eab13a7bcd3c
/frameworks/av/services/audioflinger/Threads.h
a54f1283fdd9adbd64ecca4e14af56aaa0e8c825 02-Jul-2017 Eric Laurent <elaurent@google.com> aaudio: indicate client UID and PID to audio flinger

Implement correct indication of client UID and PID to audio flinger
for AAudio MMAP streams in both exclusive mode and shared mode.
- Add start/stop client methods on MMAP streams used only when the MMAP
stream is in AAudio service and carries a mix of shared streams.
- Add "In Service'" indication from "client" side to AAudioServiceStreamMMAP
so that the behavior can be adapted accordingly.
- Modify logic on audio flinger side with regard to mmap tracks and
audio HAL stream activity:
- use same audio session for all clients on a same stream to match
audio policy logic to share same direct output stream for clients on same
session. This is also more consistent with current volume and effect
handling as all MMAP clients sharing the same output stream have the
same volume and use case.
- start/stop the HAL when the stream is started/stopped with the initial client
handle (returned when the stream is opened) but do not create a track.
AAudioService implementation will always send an additional start command before
first client starts and a stop command after last client stops,
in both shared and exclusive mode.
- start/stop a track only if the start/stop stream command is received
with a handle different from the initial handle.
- Allow more than one active client from the same UID on a MMAP input in audio policy.

Bug: 62950008
Test: verify playback and capture in mmap mode
Change-Id: I86151bbb637ff172d2fd5f813056eab13a7bcd3c
/frameworks/av/services/audioflinger/Threads.h
2c6c3bb76b2fa18ed3536331a1700250bd04c7ce 16-Jun-2017 Andy Hung <hunga@google.com> AudioFlinger: Log Record and MMap thread events

Also update track dump for better grouping and consistency.

Test: adb shell dumpsys media.audio_flinger
Bug: 62700410
Bug: 62701585
Change-Id: I3a6e76eac871cb08ff14d45f7d3992a6e7fba045
/frameworks/av/services/audioflinger/Threads.h
cc49b266bb2a6dcc4249afe26f6374f48b753396 05-May-2017 rago <rago@google.com> Merge "Fix wait time for audio threads in suspend mode" into oc-dev am: 24fd2f7d29
am: f12f9ca0be

Change-Id: I31eac5f1953eb00c253a140dd9d3959055936eba
1bb9082596c9cac2995dc9b4465a7c6d5666d099 03-May-2017 rago <rago@google.com> Fix wait time for audio threads in suspend mode

Better estimation of wait time in suspended audio threads.

Bug: 34772697

Test: phone calls with BT headset.
Change-Id: Icf99c0671def810b57332a321e4de4680697715b
/frameworks/av/services/audioflinger/Threads.h
bf49308851509d38dbf3f57d9682a819d9f983c9 18-Apr-2017 Mikhail Naganov <mnaganov@google.com> audioflinger: Make use of android-base/macros.h

Replace local definitions of "array size" macro, and
declarations of non-copyable objects with corresponding
constructs from android-base/macros.h.

Also change "protected:" to "private:" for classes
not designed to be inherited.

Change-Id: I2d1e6d153511ed84d52fe6377879f83258890653
Test: make
/frameworks/av/services/audioflinger/Threads.h
2dc0a5b768b5bac4ab017d3da68b1e97a162296f 13-Apr-2017 Glenn Kasten <gkasten@google.com> Merge "Add histograms for FastMixer"
d9534fb35245b8bcd2489e717bdd1ad9269b3000 12-Apr-2017 Phil Burk <philburk@google.com> Merge "AAudioService: integrated with audioserver" into oc-dev
c0c70e3c7dd10bc2c0caffcab1f3f5fb406b35fb 09-Feb-2017 Phil Burk <philburk@google.com> AAudioService: integrated with audioserver

Call the MmapStreamInterface from AudioFlinger instead of the FakeHAL.
Fix sending timestamps from the thread.
Add shared mode in service.

Bug: 35260844
Bug: 33398120
Test: CTS test_aaudio.cpp
Change-Id: I44c7e4ecae4ce205611b6b73a72e0ae8a5b243e5
Signed-off-by: Phil Burk <philburk@google.com>
(cherry picked from commit 7f6b40d78b1976c78d1300e8a51fda36eeb50c5d)
/frameworks/av/services/audioflinger/Threads.h
7f6b40d78b1976c78d1300e8a51fda36eeb50c5d 09-Feb-2017 Phil Burk <philburk@google.com> AAudioService: integrated with audioserver

Call the MmapStreamInterface from AudioFlinger instead of the FakeHAL.
Fix sending timestamps from the thread.
Add shared mode in service.

Bug: 35260844
Test: CTS test_aaudio.cpp
Change-Id: I44c7e4ecae4ce205611b6b73a72e0ae8a5b243e5
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audioflinger/Threads.h
eef598c5539aa2be5a106f2483b19e368e4b8c0e 03-Apr-2017 Glenn Kasten <gkasten@google.com> Add histograms for FastMixer

Bug: 37153050
Test: dumpsys media.log shows histograms for audio activity on FastMixer
Change-Id: I6bb4bf19d62da1ed1d8cda43d428b03153a35de3
/frameworks/av/services/audioflinger/Threads.h
6d8018f0b7be9deec6b0acab10a0dca6e91d0fb8 21-Feb-2017 Glenn Kasten <gkasten@google.com> Improve audio logs and dumpsys media.audio_flinger

Include mFrameCount in shared memory corrupt error log.

Fix typo in log for primary audio interface.

Include the new server frame count in logs for fast tracks.

Always log when fast is successful for output tracks, as it helpful
(was already there for input).

Cleanup dumpsys for threads.

Bug: 37153050
Test: builds OK, and logs contain more information
Change-Id: I2b5b4d700e8eb7c261a3125fb03ddc00bf08537e
(cherry picked from commit 1bfe09a0b1755a79abd32b41c0dd433b88fc260c)
/frameworks/av/services/audioflinger/Threads.h
1bfe09a0b1755a79abd32b41c0dd433b88fc260c 21-Feb-2017 Glenn Kasten <gkasten@google.com> Improve audio logs and dumpsys media.audio_flinger

Include mFrameCount in shared memory corrupt error log.

Fix typo in log for primary audio interface.

Include the new server frame count in logs for fast tracks.

Always log when fast is successful for output tracks, as it helpful
(was already there for input).

Cleanup dumpsys for threads.

Test: builds OK, and logs contain more information
Change-Id: I2b5b4d700e8eb7c261a3125fb03ddc00bf08537e
/frameworks/av/services/audioflinger/Threads.h
293558ad1977e24e65f7ba78f47382d33fc77d64 21-Mar-2017 Andy Hung <hunga@google.com> AudioFlinger: Improve Thread logging.

Test: dumpsys media.audio_flinger
Bug: 30572472
Change-Id: I43f72354a6ece045f5f9f664946a406166974258
/frameworks/av/services/audioflinger/Threads.h
18b570146c971fe729c391bfbb869391084e623d 14-Feb-2017 Eric Laurent <elaurent@google.com> audioflinger: add standby() method to MmapStreamInterface

Bug: 33398120
Test: open/start/stop/close MMAP no IRQ stream for capture and playback

Change-Id: I48ec202a71565f759c441c2a835d8c8190e76334
/frameworks/av/services/audioflinger/Threads.h
10cbff139360f3f642e0e3b3ccf2d463dbed22cf 22-Feb-2017 Andy Hung <hunga@google.com> VolumeShaper: Enable for offload and direct tracks

Test: Play Music in offload mode
Bug: 31015569
Change-Id: I00bb59e3e6809d4682f42057b1cc083f4fa9b9d1
/frameworks/av/services/audioflinger/Threads.h
f5f4056014118f6ddd16affe853fd0605001ab40 13-Feb-2017 Eric Laurent <elaurent@google.com> Merge "audio: several concurrent capture fixes"
7863c791dba8c4e5e9591b6837d410e580be0a25 10-Feb-2017 Eric Laurent <elaurent@google.com> Merge changes from topic 'mmap_no_irq'

* changes:
Add support for mmap stream
audioflinger: define MMAP HAL Stream control interface
555530ab903504ad3586bc24cd8a4f200f5c39ae 08-Feb-2017 Eric Laurent <elaurent@google.com> audio: several concurrent capture fixes

Make sure AudioRecord clients are invalidated synchronously
when closing an input stream instead of when the capture thread
exits.

Fix AudioPolicyManager::getInputForDevice() logic to make sure that
not only the first opened input encountered is considered when looking
for a compatible input to reuse for concurrent capture.

Bug: 22702906
Test: run CTS test
Change-Id: I7f69609d4ee70a37ab06753ff970b12df17d885b
/frameworks/av/services/audioflinger/Threads.h
83f042776b131b149f803fff6ab184ae2c4d98cd 07-Feb-2017 Mikhail Naganov <mnaganov@google.com> audioflinger: Adjust priority of hal threads

HALs are prohibited from using framework binder, and there is
no equivalent scheduling policy service in hwbinder. Thus, in order
to match priorities of FastCapture / Mixer threads with their
counterparts in the HAL, it is needed to request the priority boost
from audioflinger on behalf of the HAL.

Test done to verify the priority was correctly set.

Bug: 34131400
Change-Id: If8b6b031c0fcba771fae901a5b8e7da89b3a1570
Test: check priority match between audioflinger's and hal's threads
/frameworks/av/services/audioflinger/Threads.h
8981605d43e24c46d395acb5f145b99589d45917 12-Jan-2017 Andy Hung <hunga@google.com> AudioFlinger: Move RecordBufferConverter to libaudioprocessing

Test: Recording loopback
Bug: 31015569
Change-Id: I7897d959f36ac7424544e35f47576c99a442dd54
/frameworks/av/services/audioflinger/Threads.h
6acd1d432f526ae9a055ddaece28bf93b474a776 04-Jan-2017 Eric Laurent <elaurent@google.com> Add support for mmap stream

Add support for MMAP streams created by Oboe service.
- A new audio thread class MmapThread deriving from ThreadBase
is added to manage permissions, volume, routing and wakelocks for activity
on MMAP streams.
- Requests received over MmapStreamInterface to open, start and stop
a MMAP stream are forwarded to audio policy manager so that activity
on MMAP capture and playback streams is visible to audio policy and
taken into account in volume and routing management.
`

Bug: Bug: 33398120
Test: manual test
Change-Id: I957906495fe9277d2972d810b633f50cd1e14ec3
/frameworks/av/services/audioflinger/Threads.h
d01b0f18491c355d808a57cb272404480e69618f 08-Nov-2016 Andy Hung <hunga@google.com> AudioFlinger: update to use uid_t

Test: Power manager shows correct uids for audio
Bug: 32713790
Change-Id: I60134f60631ea00886efc912ba298443aadd3c00
/frameworks/av/services/audioflinger/Threads.h
f28bcf5c057dd9738a09f3cb367cf0b44087135d 20-Dec-2016 Andy Hung <hunga@google.com> AudioFlinger: Use property for local log lines

dumpsys lines can be increased up to 256 (kLogSize) by

adb shell setprop persist.audio.locallog.lines 256

Test: Run piano app and check audioflinger dumpsys
Bug: 30572472
Change-Id: Ie27812b15732432856452e4c46d81abf860aaee2
/frameworks/av/services/audioflinger/Threads.h
5b4051afc26367d7accd06580c5135c8295759f9 20-Dec-2016 Andy Hung <hunga@google.com> Merge "AudioFlinger: Associate audio time with client uid"
dae27707fc7d8370eb200d25d1a7c6dd7ad5e201 31-Oct-2016 Andy Hung <hunga@google.com> AudioFlinger: Associate audio time with client uid

Group active track operations for add and remove together.
PlaybackThread now uses strong pointer for active tracks.

Test: Play Music, Youtube, Batterystats, CTS AudioTrack
Bug: 32361950
Change-Id: I101df081dd8d090560a83c44c2fa9ffcbf39c84d
/frameworks/av/services/audioflinger/Threads.h
20b9ef0b55c9150ae11057ab997ae61be2d496ef 05-Dec-2016 Eric Laurent <elaurent@google.com> Add unique audio port IDs to AudioTrack and AudioRecord

This will allow to track activity at the track level instead of
at audio session level as only possible with current implementation.

AudioTracks and AudioRecords will receive a unique audio port ID the
first time they register to audio policy with
getOutputForAttr()/getInputForAttr() and keep this ID for their
lifetime.

This CL is the first partial change and just updates the
audio policy and audio flinger APIs used at track creation time.

Test: basic regression test of audio playback and capture use cases

Change-Id: I8d612e67738e120494f61e3f7c60bfd0b2c6a329
/frameworks/av/services/audioflinger/Threads.h
abf6ff26df459d991cdbc2dca3b78046c97469db 03-Dec-2016 Andy Hung <hunga@google.com> Merge "Log audio information to ensure complete delivery"
0d5a2ed0a05a2bf337c68edb54f24c60e18032c1 02-Dec-2016 Eric Laurent <elaurent@google.com> improve audio effect framwework thread safety

- Reorganize handle effect creation code to make sure the effect engine
is created with both thread and effect chain mutex held.
- Reorganize handle disconnect code to make sure the effect engine
is released with both thread and effect chain mutex held.
- Protect IEffect interface methods in EffectHande with a Mutex.
- Only pin effect if the session was acquired first.
- Do not use strong pointer to EffectModule in EffectHandles:
only the EffectChain has a single strong reference to the EffectModule.

Test: Tested with EffectTest app. Regression tests in main audio use cases.

Bug: 32707507
Change-Id: Ia1098cba2cd32cc2d1c9dfdff4adc2388dfed80e
/frameworks/av/services/audioflinger/Threads.h
2148bf0e79c436b8764b9edc4c8f2730cce98a32 29-Nov-2016 Andy Hung <hunga@google.com> Log audio information to ensure complete delivery

Test: Audio playback
Bug: 30572472
Change-Id: Ibad6fc202692cd3480ae726627252afdead083f3
/frameworks/av/services/audioflinger/Threads.h
9cab746b116b8aed38ca6b97bfea35103535e522 10-Nov-2016 Eric Laurent <elaurent@google.com> Revert "AudioFlinger: Associate audio time with client uid"

This reverts commit 2f366df67c31119bb6dd726becd32d14b18e6573.

Bug: 32728805
Change-Id: If0a158154814492eda427de0af8a49c0b0a91180
/frameworks/av/services/audioflinger/Threads.h
5850c4c8eecbe0db3cee8511a4f82cb443e27d08 10-Nov-2016 Eric Laurent <elaurent@google.com> Revert "AudioFlinger: Remove naked track pointers"

This reverts commit 062bfceaefab29f0f71db7d5a248b3f5f0572b6a.
Bug: 32728805
/frameworks/av/services/audioflinger/Threads.h
1f12a8ad958344c50733b948628ffa06db9c5bc6 08-Nov-2016 Andy Hung <hunga@google.com> Audio: Use uid_t for uids

Test: Power manager shows correct uids for audio
Bug: 32713790
Change-Id: If5337e17283268f74dc0f00cc66ece9153d680ef
/frameworks/av/services/audioflinger/Threads.h
062bfceaefab29f0f71db7d5a248b3f5f0572b6a 01-Nov-2016 Andy Hung <hunga@google.com> AudioFlinger: Remove naked track pointers

Test: Play Music offloaded and kill audioserver
Change-Id: I3114a67f248e067e0b5334d76e4b5e6c39858040
/frameworks/av/services/audioflinger/Threads.h
2f366df67c31119bb6dd726becd32d14b18e6573 31-Oct-2016 Andy Hung <hunga@google.com> AudioFlinger: Associate audio time with client uid

Group active track operations for add and remove together.
PlaybackThread now uses strong pointer for active tracks.

Test: Play Music, Youtube, Batterystats, CTS AudioTrack
Bug: 32361950
Change-Id: Ica96e2b84b9dfa5766571e24de49401a81a30e9d
/frameworks/av/services/audioflinger/Threads.h
711ee66377eb053cd7a3467ca519239ebb7bf300 25-Sep-2016 Eric Laurent <elaurent@google.com> audioflinger: limit max number of tracks per client am: ad7dd9610b am: 6cfa8fdc9f
am: 5c24d28bfc

Change-Id: I3653bed5e0a0ef1476aa4409b256a8a81c6bc3fa
5c24d28bfc72423ff5bb6de3d46fe4747d9b64b1 23-Sep-2016 Eric Laurent <elaurent@google.com> audioflinger: limit max number of tracks per client am: ad7dd9610b
am: 6cfa8fdc9f

Change-Id: I1952387cd010a11ce9512a8b56a363cc4bb7a078
ad7dd9610b6fafa81baf69607f4ac669da88182a 22-Sep-2016 Eric Laurent <elaurent@google.com> audioflinger: limit max number of tracks per client

Limit max number of audio tracks for a given application to
limit the chance of denial of service by misbehaving apps
not releasing tracks.

Bug: 7007023
Change-Id: Id7ac37450aabdbeaa5f83cb6e4b2a2b0c749f99c
/frameworks/av/services/audioflinger/Threads.h
1dc98674f701dada94143b4d31b7221c58346c6c 19-Aug-2016 Mikhail Naganov <mnaganov@google.com> Abstract away access to audio streams HAL in AudioFlinger

In this CL all direct access to audio_stream_t, audio_stream_out_t, and
audio_stream_in_t their functions is encapsulated within the new
hierarchy of Stream[In|Out]HalLocal classes. AudioFlinger uses
interface classes Stream[In|Out]HalInterface to access these functions.

Note that NBAIO still receives raw HAL stream handles and needs to be
converted separately.

Bug: 30222631
Test: manual with Loopback app

Change-Id: I6388cfa2006791c9c0aa7bb186719209726a2d48
/frameworks/av/services/audioflinger/Threads.h
1b291841a58ce6b2b291232dfdd56134b2185c48 18-Jul-2016 Glenn Kasten <gkasten@google.com> Fix RecordThread running too often if fast capture is active

Bug: 30159297
Change-Id: Ieca804450168391c162fc4862398586fcc5d7e4e
/frameworks/av/services/audioflinger/Threads.h
5ca8f32280377dd923e72c3c6bd3994217461b8b 11-Aug-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of fd923e7 to stage-aosp-master am: df5d9246f9
am: 63ef5a38f8

Change-Id: I516a43c5e56323e99ad7a8ca2e4811b77c9704f4
df5d9246f9607b1c2f8b134c46a05af06e206da3 11-Aug-2016 Chih-Hung Hsieh <chh@google.com> resolve merge conflicts of fd923e7 to stage-aosp-master

Change-Id: I75b44b89bae41197a1fd68362d20b8ba2b4dd192
e964d4e421e2d1ca937227a580c0c837091a11e3 09-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in audio and playerservice.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1

Change-Id: I265f3b094e08d5705b506b3fbba51439c134af84
/frameworks/av/services/audioflinger/Threads.h
36d0ca16024820df9a12903d2ac443fabcc180bc 09-Aug-2016 Chih-Hung Hsieh <chh@google.com> Fix clang-tidy warnings in audio and playerservice.

* Add explicit keyword to conversion constructors.
Bug: 28341362
* Use const reference type for read-only parameters.
Bug: 30407689
Test: build with WITH_TIDY=1

Change-Id: I265f3b094e08d5705b506b3fbba51439c134af84
Merged-In: I265f3b094e08d5705b506b3fbba51439c134af84
/frameworks/av/services/audioflinger/Threads.h
416601541797b132ee8abe1e1d15d773ad975ce5 29-Jul-2016 Andy Hung <hunga@google.com> AudioFlinger: Prevent offload underrun during active playback
am: f804475807

Change-Id: Iefc9c73590b5aede7ef3ee1a2eaf728bdd01113e
ef0eed3d26e54c176b813fb7656c1cfb2c473062 29-Jul-2016 Andy Hung <hunga@google.com> AudioFlinger: Account for frames dropped in suspend mode
am: 238fa3deff

Change-Id: I7a4ca332e3f75cdd4002821f29ed3b7334d5d193
f929f9b203ef4787d45f8b24aab053aaab993be9 29-Jul-2016 Andy Hung <hunga@google.com> Merge "AudioFlinger: Prevent offload underrun during active playback" into nyc-mr1-dev
f769ab76d185a63e6da12f58fe902e977f1ad0fd 29-Jul-2016 Andy Hung <hunga@google.com> Merge "AudioFlinger: Account for frames dropped in suspend mode" into nyc-mr1-dev
238fa3deff26d7e4d9e81bd0a88c936f16226c4e 28-Jul-2016 Andy Hung <hunga@google.com> AudioFlinger: Account for frames dropped in suspend mode

These frames must be added to the kernel position in timestamps.

Bug: 30025777
Change-Id: I30c14503c9467059c3782e5c96c01ae1cf3709f6
/frameworks/av/services/audioflinger/Threads.h
f804475807407442d5596ab7378ed07d50664063 27-Jul-2016 Andy Hung <hunga@google.com> AudioFlinger: Prevent offload underrun during active playback

Bug: 29897830
Change-Id: Id99d416cdaa8bf62daca8f92e3564f2895f15490
/frameworks/av/services/audioflinger/Threads.h
de0613d0ad8b8fb9d19a27185ae4d307a5b7fb9d 23-Jul-2016 Eric Laurent <elaurent@google.com> audioflinger: keep wakelock during offload drain

Even if ro.audio.offload_wakelock property is false we must
keep wakelock during offload drain seuqnce due to some driver
implementations risking to let the system enter suspend.

This restores functionality in commit 078538cfc6.

Bug: 30151948
Change-Id: Ib3a3e5c7e173ad7b1776817b81427932bfd16bf0
/frameworks/av/services/audioflinger/Threads.h
4527b9ebc6a37b861f5a3bba68bcc63dc8d69ada 08-Jul-2016 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: async callback error handling

Invalidate all tracks on receiving an async error
callback from the output stream.

Change-Id: I92f441ed7fd904b85f464a041847880faac5b383
/frameworks/av/services/audioflinger/Threads.h
4c415062ad1bb53e9af8f644d8215837262b79bb 18-Jun-2016 Eric Laurent <elaurent@google.com> audioflinger: add check for effect vs thread compatibility

Make sure that only HW accelerated effects are added on FAST
playback or record threads and no effect is added on threads with
RAW flag.

Make sure that tracks with RAW and FAST flags are compatible with exiting
effects on a playback or record threads and clear flags accordingly.

Bug: 4999001

Change-Id: I0c060f1ee4dfb9f1e206633536e67f7c3b7b3788
/frameworks/av/services/audioflinger/Threads.h
050677873c10d4da308ac222f8533c96cca3207e 02-Jun-2016 Eric Laurent <elaurent@google.com> Add AudioTrack and AudioRecord flag checks

Verify that the requested flags are compatible with the input
or output flags when creating and AudioRecord or AudioTrack

Get rid of IAudioFlinger::track_flags_t which was redundant
with audio_input_flags_t and audio_output_flags_t.

Change-Id: I0dd9232f857b2737e99a8c668806e45bce09cdbd
/frameworks/av/services/audioflinger/Threads.h
13084621072ea2e4c34e2a9d79793c621d9bf005 17-May-2016 Eric Laurent <elaurent@google.com> audioflinger: fix invalidateTracks() on offload thread

Commit 05317d29 introduced a regression causing a systematic flush
on offload output thread when invalidateTracks() is called even if
no track is using the stream type specified.

Bug: 28786996
Change-Id: Iee393ee8b1093c40647235bd35f4a6fa9b62937a
/frameworks/av/services/audioflinger/Threads.h
e93cc03da360a1a0d2ad937c745ce8c8e8be81c2 05-May-2016 Eric Laurent <elaurent@google.com> audioflinger: various offload playback fixes

Revert underrun sleep time optimization added for
offload by commit 51716185 which can cause music to pause for a few
seconds in some corner cases.

Allow underruns in STOPPING_1 state to avoid dropping last buffer
received by the AudioTrack callback after stop() is called by the
client.

Allow interruption of thread loop sleep if a command is pending to
speed up track start sequence.

Do not wait for a full AudioTrack buffer before writing to audio HAL
when resuming playback or transitioning to next track.

Also moved log level for underruns in AudioSink from I to D to reduce
spam on user builds.

Bug: 28545177
Bug: 27682362
Bug: 28347796

Change-Id: I05b651b7878a2d2eedcac43cd669e32add171d40
/frameworks/av/services/audioflinger/Threads.h
05317d29b27e5fda654bea21b80d4423a03f49b3 04-May-2016 Haynes Mathew George <hgeorge@codeaurora.org> audioflinger: set flush pending on invalidating offload track

On invalidating an offload track, the IAudioTrack instance is
destroyed and the offload output is released. If it so happens
that APM::getOutputForAttr for the new IAudioTrack is called before
OffloadThread::prepareTracks_l checks and removes an invalid track,
the same output can get reused.

The side effect of this is data present in HAL and below from before the
invalidate will be rendered before data from the new seek position
is rendered. This is unexpected.

To fix this, set hint to issue flush when an offload track is invalidated.

Bug: 28566885
Change-Id: Ib6c38a3abb600598b87591bac90d03b7150d5216
/frameworks/av/services/audioflinger/Threads.h
dc2c50bad491d2c0c8a2efc0e24491076701c63c 21-Apr-2016 Glenn Kasten <gkasten@google.com> Make max fast tracks configurable using a property

ro.audio.max_fast_tracks

Rename the currently configured maximum number of fast tracks
from FastMixerState::kMaxFastTracks to FastMixerState::sMaxFastTracks.

There is no guarantee that the CPU will be able to handle
the configured number of fast tracks.

Bug: 27564141
Change-Id: If9af226d839b226503488c3cb20a4bb8950b429d
/frameworks/av/services/audioflinger/Threads.h
4a8308b11b92e608cdaf29f73f7919e75706f9a2 18-Apr-2016 Glenn Kasten <gkasten@google.com> Add AudioSystem::getFrameCountHAL()

And add comments about declaring methods in binder opcode order.

Bug: 28117362
Change-Id: I3c4426fa4bb3ce9c4a207a44d3bb1103d7fef160
/frameworks/av/services/audioflinger/Threads.h
646679779a8f952980a5d4219ad9c6f93efc4b92 31-Mar-2016 Eric Laurent <elaurent@google.com> audioflinger: keep wakelock during offload playback

Add a system property ro.audio.offload_wakelock to select
if a wakelock should be kept during offload playback while waiting for
write completion callback.
The default is yes, keep the wakelock.

On some platforms, the cost of entering or exiting suspend is so high
that is it better to not release a wakelock at all rather than releasing
it periodically.

Bug: 26208297
Change-Id: Ib41c7e4ed9c8c0c063363eb9fe99a2ecc81b521b
/frameworks/av/services/audioflinger/Threads.h
d848eb48c121c119e8ba7583efc75415fe102570 08-Mar-2016 Glenn Kasten <gkasten@google.com> Use audio_session_t consistently

Bug: 27562099
Change-Id: I328d8226191386b163f2ace41233607294c50dcd
/frameworks/av/services/audioflinger/Threads.h
517161856d74f5fe39cce131f29b977bc1745991 01-Mar-2016 Eric Laurent <elaurent@google.com> audio flinger: fix offload track underrun

Fix offload track underrun detection causing early disabling
of offloaded audio tracks.

Optimize sleep time in case of underrun to avoid spinning while
waiting for new data.

Re-enable offload when streaming

Bug: 26668110

Change-Id: I874728c69647ac05e1effb84c48700a6d0ac7435
/frameworks/av/services/audioflinger/Threads.h
c54b1ffc92b8ad27608a8af21033d7cab33cb3a0 23-Feb-2016 Andy Hung <hunga@google.com> Fix AudioTrack presentationComplete regression

Bug: 27310929
Change-Id: Id52299660d90b07220a4fd9996da53fe755a41f1
/frameworks/av/services/audioflinger/Threads.h
818e7a32ce3633980138aff2c2bfcc5158b3cfcc 17-Feb-2016 Andy Hung <hunga@google.com> Implement server side playback timestamps with 64 bit accuracy

Provide server timestamps if the HAL doesn't provide it.
Provide monotonic - boottime translation.
Integrate record timestamps and playback timestamps together.

Bug: 17472992
Bug: 22871200
Bug: 26400089
Bug: 26682703
Change-Id: If1974f94232fcce7ba0bbcdf63d9e54ed51918ff
/frameworks/av/services/audioflinger/Threads.h
e10393e72454bfd8298017dc193faf424f4e9a8f 12-Jun-2015 Andy Hung <hunga@google.com> Fix audio timestamp computation for pause, stop, and dynamic speed changes

Timestamp on pause and underrun (stop) do not reflect actual position.
Timestamps do not account for dynamic changes to track speed / sample rate.

Bug: 11085154
Bug: 17552775
Change-Id: I0e5e40ab3eaee82f0c91b9f399089698a0b1947e
/frameworks/av/services/audioflinger/Threads.h
3f0c902beb53a245c9db35e871607dba05b8d391 16-Jan-2016 Andy Hung <hunga@google.com> Add AudioRecord timestamps

Bug: 13569372
Bug: 22886739
Change-Id: Ibc81afefb733d23676a632a0f2da31163fdbe05f
/frameworks/av/services/audioflinger/Threads.h
03c48d5afcb3dfc1e43df93e1f3b3b3e9292e148 28-Jan-2016 Glenn Kasten <gkasten@google.com> Add limiter for mono blend

Bug: 26904791
Change-Id: I76b16e70871cd9fc0a9b8badc66f27069fabe1cb
/frameworks/av/services/audioflinger/Threads.h
d79072e9dff59f767cce2cda1caab80ce5a0815b 06-Jan-2016 Glenn Kasten <gkasten@google.com> Remove TimedAudioTrack and associated code

Bug: 8278435
Change-Id: I095c1a4888e645e14d93b0b15fbef4524a831ca1
/frameworks/av/services/audioflinger/Threads.h
2ddee19245641e86bca436dda23a0f5089bf2ab5 19-Dec-2015 Andy Hung <hunga@google.com> Add setMasterMono and getMasterMono

Bug: 15283594
Bug: 22700363
Change-Id: I32dc1fcecf285967a61bd508af3bb299595db57d
/frameworks/av/services/audioflinger/Threads.h
3f273d10817ddb2f792ae043de692efcdf1988ae 24-Nov-2015 Wei Jia <wjia@google.com> Uses AudioFlinger to signal battery stats for audio.

Bug: 18177221
Change-Id: I704010c037cb99bb74b98798ee8e494fa8bdc875
/frameworks/av/services/audioflinger/Threads.h
7c1ec5f038e63a5eb8b04434577c25bc23f5f410 09-Jul-2015 Eric Laurent <elaurent@google.com> audio: several fixes in audio routing callbacks

- audio policy:
Force device change to ensure new audio patch creation
upon first track activity on a given output.
Fix function device_distinguishes_on_address() which could mistake
some output device with remote submix input device.

- audio flinger:
Reduce number of binder calls upon new client registration by only
sending ioConfigChanged() callbacks to newly registered client.
Fix first patch after output thread creation not triggering an
ioConfigChanged() callback.

-audio system:
Force client registration upon routing callback installation to force
new ioConfigChanged() callback from audio flinger.

Bug: 22381136.

Change-Id: Ieb0d9f92f563a40552eb31bc0499c8ac65f78ce4
/frameworks/av/services/audioflinger/Threads.h
e8726fea8a53bf3474aa3c6deaf2f6c1f565e694 26-Jun-2015 Eric Laurent <elaurent@google.com> reduce number of binder calls from mediaserver

Reduce the number of audio port, audio patch and
IO config changed binder calls from mediaserver to
client processes:
- Do not call IO config changed callback if selected
device is the same as previously selected one on a given
audio flinger playback or capture thread.
- Do not call the audio port or audo patch list update
callback on a client if this client as no listener registered.

Bug: 22045560.

Change-Id: If780e105404de79b7cb5c80c27b793ceb6b1c423
/frameworks/av/services/audioflinger/Threads.h
40eb1a1f8871909c272e72afaf7d5af84fea2412 18-Jun-2015 Andy Hung <hunga@google.com> Reduce log messages on AudioFlinger throttle

Bug: 21858740
Change-Id: I8f291b64c1033867bb57ffceaa3b7d94aa998715
/frameworks/av/services/audioflinger/Threads.h
43b4dcc660e6da96285e4672ae371070ab845401 10-Jun-2015 Phil Burk <philburk@google.com> AudioFlinger: flush stream when switching tracks

For direct threads, when recycling a stream, perform a flush so
that the frame position is reset.

Bug: 21145353
Change-Id: I08611cd64bb249a9659c44f9e4c47e7455f4838f
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audioflinger/Threads.h
08fb1743f80437c38b4094070d851ea7f6d485e5 01-Jun-2015 Andy Hung <hunga@google.com> Throttle MixerThread data pull to no more than twice expected rate

This helps prevent underruns with NuPlayer and other applications
which set up buffers that are close to minimum size or use deep
buffers, and rely on a double-buffering sleep strategy to fill.

Enabled by default. Disabled by setting af.thread.throttle 0

Bug: 19062223
Bug: 21198655
Change-Id: Ia52b48e0c99588af5db53c43fede2afd775b8899
/frameworks/av/services/audioflinger/Threads.h
ad9cb8b88e4f8face23f01d8dc89fa769dacb50f 27-May-2015 Eric Laurent <elaurent@google.com> audio flinger: add suffix to time variables names

Add suffix to clarify units for the following variables:
standbyTime -> mStandbyTimeNs
standbyDelay -> mStandbyDelayNs
activeSleepTime -> mActiveSleepTimeUs
idleSleepTime -> mIdleSleepTimeUs
sleepTime -> mSleepTimeUs

Change-Id: I7f5d602c39e0ef3f6fe9ef99eaf1b351c7bd4fc3
/frameworks/av/services/audioflinger/Threads.h
72e3f39146fce4686bd96f11057c051bea376dfb 20-May-2015 Eric Laurent <elaurent@google.com> audio flinger: do not call JAVA services until system is ready

Wait for system ready indication form AudioService before enabling
calls to scheduling service or power manager.

Bug: 11520969.
Change-Id: I221927394f4a08fd86c9d457e55dd0e07949f0cf
/frameworks/av/services/audioflinger/Threads.h
f6870aefc5e31d4220f3778c4e79ff34a61f48ad 08-May-2015 Eric Laurent <elaurent@google.com> audio flinger: fix fuzz test crash

Clear output stream pointer in duplicating thread
when the main output to which it is attached is closed.

Also do not forward master mute and volume commands to
duplicating threads as this is not applicable.

Also fix logic in AudioFlinger::primaryPlaybackThread_l()
that could accidentally return a duplicating thread.
This never happens because the primary thread is always
first in the list.

Bug: 20731946.
Change-Id: Ic8869699836920351b23d09544c50a258d3fb585
/frameworks/av/services/audioflinger/Threads.h
296fb13dd9b5e90d6a05cce897c3b1e7914a478a 01-May-2015 Eric Laurent <elaurent@google.com> Implement audio device callback

Add class AudioSystem::AudioDeviceCallback notifying
AudioSystem clients upon device selection change on a given
input or output thread.
Maintain a list of installed callback per I/O handle in AudioSystem
and call registered callbacks when an OPEN of CONFIG_CHANGED event
is received on IAudioFlingerClient::ioConfigChanged().
Add methods to AudioTrack and AudioRecord to add and remove device
change callbacks.
Add methods to AudioTrack and AudioRecord to query currently selected
device.
ioConfigChanged() events now convey the audio patch describing
the input or output thread routing.

Fix AudioRecord failure to start when invalidation is
handled by start().

Change-Id: I9e938adf025fa712337c63b1e02a8c18f2a20d39
/frameworks/av/services/audioflinger/Threads.h
8ce74c3c11458faa34395591a3424e90db856bfc 02-May-2015 Phil Burk <philburk@google.com> Merge "AudioTrack: fix direct tracks not pausing" into mnc-dev
6fc2a7c81f62b1e21487ae37e11aae6241bc3ead 01-May-2015 Phil Burk <philburk@google.com> AudioTrack: fix direct tracks not pausing

When a Direct Track is paused and the HAL does not support
pause() and resume() then the HW never gets paused.
The app can just keep writing data, which gets played.

Bug: 18899620
Change-Id: Ice0f360956ff7ca425f6f24a0a2a8640d8b43fa8
Signed-off-by: Phil Burk <philburk@google.com>
/frameworks/av/services/audioflinger/Threads.h
73e26b661af50be2c0a4ff6c9ac85f7347a8b235 28-Apr-2015 Eric Laurent <elaurent@google.com> AudioSystem: refactor audio config cache and callbacks

Clean up implementation of audio configuration cache and
callback events from AudioFlinger:

- Define class AudioIoDescriptor for audio input and output
configurations outside of AudioSystem class.
- Do not use void * but an AudioIoDescriptor as argument to
audio config callbacks from AudioFlinger.
- Remove unused configuration events.
- Move AudioSystem audio input and output cache from static singletons to
members of AudioFlingerClient subclass.

Change-Id: I67c196c32c09ce2756af0755ee1fe631040c3270
/frameworks/av/services/audioflinger/Threads.h
054d9d3dea1390294650ac704acb4aa0a0731217 24-Apr-2015 Eric Laurent <elaurent@google.com> PatchPanel: do not use setParameters() internally.

Do not use setParameters() with AUDIO_PARAMETER_STREAM_ROUTING
when communicating the input or output device selected to playback or
record threads, even for HAL version less than 3.0.
Use createAudioPatch()/releaseAudioPatch() instead.
This allows to send more information on the output or input device being
selected.

Also fix a regression introduced in L where the output device selection
was not communicated to effects on record threads.

Change-Id: I4780ada53241d56694b005c992171e173c3bf8f5
/frameworks/av/services/audioflinger/Threads.h
d330ee46022f34da76d14d0c4d2910526ecc2321 20-Apr-2015 Andy Hung <hunga@google.com> Add floating and multichannel record to AudioFlinger

Change-Id: Ia388fb012a0b6d81613ef87142a97d76836338f9
/frameworks/av/services/audioflinger/Threads.h
5744661e85981f8a9456bf470e2761235fc026da 20-Apr-2015 Andy Hung <hunga@google.com> Make record buffer in RecordThread variable format

Change-Id: Id4bb9b973eeea16946fba3bc084c7ac270d9fa33
/frameworks/av/services/audioflinger/Threads.h
73c02e4277b399c2ec1555d32b6ad5df23bb83dc 29-Mar-2015 Andy Hung <hunga@google.com> Improve ResamplerBufferProvider

Change-Id: I3cc3af221ad5797ff219d75227350733afa180db
/frameworks/av/services/audioflinger/Threads.h
97a893eb34f8687485c88eaf15917974a203f20b 29-Mar-2015 Andy Hung <hunga@google.com> Add RecordBufferConverter for RecordThread data processing

Change-Id: Ia3aab8590cd41e8a7cba0a7345d70d2866d92045
/frameworks/av/services/audioflinger/Threads.h
f59497bd3c190e087202043de5450ef06e92b27d 27-Jan-2015 Glenn Kasten <gkasten@google.com> Update comments

Change-Id: I37d3c4ce22b74fe8581a886fe5a7f9fef8266dad
/frameworks/av/services/audioflinger/Threads.h
d7dca050c630bddbd73a6623271b34b4290460ee 06-Mar-2015 Glenn Kasten <gkasten@google.com> Rename mName to mThreadName and kNameLength to kThreadNameLength

Change-Id: I0adfcdcab7923a07a840ec0e04528cb8bfc41f10
/frameworks/av/services/audioflinger/Threads.h
81879df8dc51df4d8a3880349e9e1e6b5e3cebfb 07-Jan-2015 Eric Laurent <elaurent@google.com> am 69158e3e: am 6ab33981: am 610255e8: Merge "audioflinger: pause HW A/V sync output when AudioTrack underruns" into lmp-mr1-dev

* commit '69158e3e7b565a5ca131a2efaa9b76615ca80cbb':
audioflinger: pause HW A/V sync output when AudioTrack underruns
b187de1ada34a9023c05d020a4592686ba761278 30-Dec-2014 Glenn Kasten <gkasten@google.com> Line length 100

Change-Id: I6c8fe626a3825fa9e139319656d682a57b887c97
/frameworks/av/services/audioflinger/Threads.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
/frameworks/av/services/audioflinger/Threads.h
23c8dc13787186dc98731055858b2fba3aedc105 17-Dec-2014 Eric Laurent <elaurent@google.com> am 85aca658: am d33712d7: am 145cf5d8: Merge "audioflinger: implement pause/resume for direct outputs" into lmp-mr1-dev

* commit '85aca658ac7d20584b0647427256df50a5f243ef':
audioflinger: implement pause/resume for direct outputs
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
/frameworks/av/services/audioflinger/Threads.h
3a3e87005fdfbfe4564605220a044b8023d0f539 26-Nov-2014 Eric Laurent <elaurent@google.com> am 72215491: am 1a475921: am 223fd5c9: audio: new routing strategies and stream types

* commit '72215491c60fbcdb9a2f0be782e24e39cca249c5':
audio: new routing strategies and stream types
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
/frameworks/av/services/audioflinger/Threads.h
97b7b75b6a31330e213bdb96ccc60916218ad903 28-Sep-2014 Glenn Kasten <gkasten@google.com> Improve dumpsys for output threads

Display output thread type and flags.
Also add units and use consistent spelling.

Change-Id: I19eb627f41c4887b6ad0543024a8477a99890798
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
955e24d3a8e218d4711cabc6558781e095011132 30-Sep-2014 Glenn Kasten <gkasten@google.com> Merge "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp" 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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
5ba4440c11eb975ec0e104e0af1981838f42f57c 04-Jul-2014 Glenn Kasten <gkasten@google.com> Merge "Remove obsolete IAudioFlinger::channelCount()"
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
f947dbce4390f2c3c460325d37002a34f09c0b74 01-Jun-2014 Glenn Kasten <gkasten@google.com> Remove obsolete IAudioFlinger::channelCount()

Change-Id: Ie623edae2e795f9155f1f452fe4e6c7217a4a4c8
/frameworks/av/services/audioflinger/Threads.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
/frameworks/av/services/audioflinger/Threads.h
c62476f0c0c1cf9283a38852bde0a4c9434df712 24-May-2014 Andy Hung <hunga@google.com> Merge "Add format parameter to getTrackName() and track_t"
6181ffd90a436f333c43a7f812391eee2c35005a 13-May-2014 Glenn Kasten <gkasten@google.com> Allow track buffer "allocation" to be from pipe

Change-Id: Ib9ac170f8e8b7746b3588157a56cbee3b753a1cb
/frameworks/av/services/audioflinger/Threads.h
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>
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
b880f5e5fc07397ddd09a94ba18bdf4fa62aae00 07-May-2014 Glenn Kasten <gkasten@google.com> Add a per-thread heap that is read-only to clients

Change-Id: I401263566ca20fbfb565689c8fa99458d3b283b2
/frameworks/av/services/audioflinger/Threads.h
3a6c90aa0617666d9abc94c02b752d9eb3d64772 13-Mar-2014 Glenn Kasten <gkasten@google.com> Add FIXMEs to createRecord for fast capture

Change-Id: I759be200fae32969212c52a409f46f2e704081e3
/frameworks/av/services/audioflinger/Threads.h
010a1a1a552cdaad362cea8a0333b8906402dbcb 13-Mar-2014 Andy Hung <hunga@google.com> Revert "Revert "Convert AudioFlinger mSinkBuffer to flexible format""

This reverts commit e2a9c29f35e0c09782558542fc4cf9823779590e.
/frameworks/av/services/audioflinger/Threads.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
/frameworks/av/services/audioflinger/Threads.h
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>
/frameworks/av/services/audioflinger/Threads.h
98ef978df4e928f486d244c4d7f7ad9f13111e98 04-Mar-2014 Andy Hung <hunga@google.com> Add mEffectBuffer to AudioFlinger

Change-Id: Icf97c50040bc127723d56eb4d2fb6e790a7253d9
Signed-off-by: Andy Hung <hunga@google.com>
/frameworks/av/services/audioflinger/Threads.h
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>
/frameworks/av/services/audioflinger/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>
/frameworks/av/services/audioflinger/Threads.h
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>
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
25f4aa83efaa9179e65a20583a6d441de2c3ff3f 07-Feb-2014 Glenn Kasten <gkasten@google.com> Move handleSyncStartEvent and clearSyncStartEvent to RecordTrack

Change-Id: I611a63e63acf3eb17e2072c1a77b91fe9e62e36a
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/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
/frameworks/av/services/audioflinger/Threads.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
/frameworks/av/services/audioflinger/Threads.h
4944acb7355b3aa25748fd25945a363a69d65444 19-Aug-2013 Glenn Kasten <gkasten@google.com> Fix whitespace

Change-Id: I9add0872030a26933f6b6dad1be299154611cc56
/frameworks/av/services/audioflinger/Threads.h
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"
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
/frameworks/av/services/audioflinger/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
/frameworks/av/services/audioflinger/Threads.h
0f11b51a57bc9062c4fe8af73747319cedabc5d6 01-Feb-2014 Glenn Kasten <gkasten@google.com> Fix unused parameter warnings in audio

Change-Id: I665ba3358dd9502f0adec70d486e7bf8a2e1b0fe
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
f0002d142e6d24c5438600b2c259679de710f8ac 24-Jan-2014 Glenn Kasten <gkasten@google.com> Merge "Replace control block frameCount_ by explicit in/out parameter"
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.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
/frameworks/av/services/audioflinger/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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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.
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
/frameworks/av/services/audioflinger/Threads.h
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
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
/frameworks/av/services/audioflinger/Threads.h
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
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
/frameworks/av/services/audioflinger/Threads.h
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
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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()
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
/frameworks/av/services/audioflinger/Threads.h
f777331418a86cd9fd709af898ef24a69967aeb4 14-Aug-2013 Glenn Kasten <gkasten@google.com> Add ThreadBase::processConfigEvents_l()

Change-Id: I6bcdc212a984c52ab98b0b0744943b4ecc1e1542
/frameworks/av/services/audioflinger/Threads.h
e198c360d5e75a9b2097844c495c10902e7e8500 13-Aug-2013 Glenn Kasten <gkasten@google.com> Whitespace

Change-Id: Id3ccc183a03421330d0498faaa62a45915cdc3d6
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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"
f874f1375d758c8a7a84572a94371fbd4085f0df 08-Aug-2013 Glenn Kasten <gkasten@google.com> Merge "Pull up mBufferSize from RecordThread to ThreadBase"
cf04c2cb8e031acc03c1c91cb1ccab15098c89b6 06-Aug-2013 Glenn Kasten <gkasten@google.com> Pull up readyToRun into ThreadBase

Change-Id: Ib150afd72c3b35d83599a61664e89302a8feb4b5
/frameworks/av/services/audioflinger/Threads.h
c1fac191069774c7bfcb062edbb821ea56e7dbc0 06-Aug-2013 Glenn Kasten <gkasten@google.com> Simplify the code that allocates mMixBuffer by removing mAllocMixBuffer

Change-Id: I5ac41210251789a034d760309c50fe018f2442ce
/frameworks/av/services/audioflinger/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
/frameworks/av/services/audioflinger/Threads.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
/frameworks/av/services/audioflinger/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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/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
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
afbbc6c5f6bc470d504dcf24ceb3ac21d57fb78d 29-Jul-2013 Glenn Kasten <gkasten@google.com> Merge "Simplify RecordTrack::stop()"
a8356f663014e7d4c27869629af83d8bb3441e19 25-Jul-2013 Glenn Kasten <gkasten@google.com> Simplify RecordTrack::stop()

Change-Id: Ib959c1e9dc9544d12277ce11bea445118b2e0521
/frameworks/av/services/audioflinger/Threads.h
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
/frameworks/av/services/audioflinger/Threads.h
c6ae3c8a261794fd4445e4e152d1ada074a3f92f 17-Jul-2013 Glenn Kasten <gkasten@google.com> Fix theoretical memory leak in mConfigEvents

Change-Id: I137f70676c8919661e716c33e0dd9c25c2b6285c
/frameworks/av/services/audioflinger/Threads.h
fb1fdc9d6603aa228362e7349451f6455c9849c2 11-Jul-2013 Glenn Kasten <gkasten@google.com> Add comments

Change-Id: Ifbf3a46a4183c8abc0feee1c588953ab10303cc1
/frameworks/av/services/audioflinger/Threads.h
bf04b5860182d8f4130dcb5d6d88ee68a58c99cd 02-Mar-2013 Glenn Kasten <gkasten@google.com> Merge "media.log cleanup" into jb-mr2-dev
ab7d72f0804fbb7e91ad9d2a16f826d97e20e5d0 27-Feb-2013 Glenn Kasten <gkasten@google.com> media.log cleanup

Remove almost all of the specific logs, but leave the media.log
logging infrastructure in place for the next time we need it.

Re-apply a few good changes that were reverted earlier:
- check logf format vs. argument list compatibility
- distinguish potentially modified and actually modified tracks in FastMixer
- fix benign bug where sq->end() was called more than once
- fix a build warning

Bug: 6490974
Change-Id: I02d3e83646c738acaebb415bd0d6b548638b4ef5
/frameworks/av/services/audioflinger/Threads.h
46909e7eb074ce1b95b8a411eb71154f53f84f77 26-Feb-2013 Glenn Kasten <gkasten@google.com> Remove tee sink debugging at compile time

Bug: 8223560
Change-Id: Iddbfb06c45d43d9f20bb428215dd4094931e19a7
/frameworks/av/services/audioflinger/Threads.h
7f5d335f7b4caecd0dfb8f1085f352f1d2da5d2e 16-Feb-2013 Glenn Kasten <gkasten@google.com> Revert "Temporary additional logging to investigate bug"

This reverts commit 32584a7d672864b20ab8b83a3cb23c1858e908b7

Change-Id: I9dc680578b955b1af462eeb7a49d61a0d45eb81b
/frameworks/av/services/audioflinger/Threads.h
32584a7d672864b20ab8b83a3cb23c1858e908b7 13-Feb-2013 Glenn Kasten <gkasten@google.com> Temporary additional logging to investigate bug

The bug appears related to continuing to use an invalid buffer provider
in fast mixer after track destruction, so focus the added logs in that area.

Also includes a bug fix: was calling log in an unsafe place
near Threads.cpp AudioFlinger::PlaybackThread::createTrack_l line 1250.

Details:
- include caller pid or client pid where appropriate
- increase log buffer size
- log mFastIndex when AudioMixer sees an invalid bufferProvider.
- log both potentially modified and actually modified tracks in FastMixer.
- fix benign bug where sq->end() was called more than once.
- log StateQueue push() call and return.
- increase StateQueue size from 4 to 8 entries
- log mixer->enable(), bufferProvider, and currentTrackMask
- log buffer provider addresses
- increase fast mixer log buffer again
- check logf format vs. argument list compatibility
- add logging to AudioMixer
- add checking of magic field in AudioMixer to detect overwrites
- add bool AudioMixer::enabled()
- increase log buffer sizes yet again
- enable assertion checking without ALOGV
- improve a few log messages
- check for corruption in more places
- log in all the process hooks
- add new mixer APIs so we can check for corruption of mixer state
- fix a build warning

Bug: 6490974
Change-Id: Ib0c4a73dcf606ef9bd898313b3b40ef61ab42f51
/frameworks/av/services/audioflinger/Threads.h
e186b51e0a9834b287d7a509e960eaf1b688db75 15-Feb-2013 Glenn Kasten <gkasten@google.com> Revert "Temporary additional logging to investigate bug"

This reverts commit 639482c24c911b125398b31883ba6d55faebe28b

Change-Id: I11f2829072ab11e18b0663024f27bf31192f1d39
/frameworks/av/services/audioflinger/Threads.h
639482c24c911b125398b31883ba6d55faebe28b 13-Feb-2013 Glenn Kasten <gkasten@google.com> Temporary additional logging to investigate bug

The bug appears related to continuing to use an invalid buffer provider
in fast mixer after track destruction, so focus the added logs in that area.

Also includes a bug fix: was calling log in an unsafe place
near Threads.cpp AudioFlinger::PlaybackThread::createTrack_l line 1250.

Details:
- include caller pid or client pid where appropriate
- increase log buffer size
- log mFastIndex when AudioMixer sees an invalid bufferProvider.
- log both potentially modified and actually modified tracks in FastMixer.
- fix benign bug where sq->end() was called more than once.
- log StateQueue push() call and return.
- increase StateQueue size from 4 to 8 entries
- log mixer->enable(), bufferProvider, and currentTrackMask
- log buffer provider addresses
- increase fast mixer log buffer again
- check logf format vs. argument list compatibility
- add logging to AudioMixer
- add checking of magic field in AudioMixer to detect overwrites
- add bool AudioMixer::enabled()

Bug: 6490974
Change-Id: I1f3f18aa62d9fbd35bc32285b669f5ba40efe28e
/frameworks/av/services/audioflinger/Threads.h
51eb3965caa8ba135bcdd8ffb7a2024a042ecdc0 14-Feb-2013 Glenn Kasten <gkasten@google.com> Revert "Temporary additional logging to investigate bug"

This reverts commit 0ddd56316262ac74a95e9edb595697c163136d6d

Change-Id: I180a928af6f5a38d15a5efe44cd1fe927b5d961c
/frameworks/av/services/audioflinger/Threads.h
0ddd56316262ac74a95e9edb595697c163136d6d 13-Feb-2013 Glenn Kasten <gkasten@google.com> Temporary additional logging to investigate bug

The bug appears related to continuing to use an invalid buffer provider
in fast mixer after track destruction, so focus the added logs in that area.

Also includes a bug fix: was calling log in an unsafe place
near Threads.cpp AudioFlinger::PlaybackThread::createTrack_l line 1250.

Details:
- include caller pid or client pid where appropriate
- increase log buffer size
- log mFastIndex when AudioMixer sees an invalid bufferProvider.
- log both potentially modified and actually modified tracks in FastMixer.
- fix benign bug where sq->end() was called more than once.
- log StateQueue push() call and return.

Bug: 6490974
Change-Id: Iee7c8f40e20b6000cd8286c0ec6a14fff4a37af1
/frameworks/av/services/audioflinger/Threads.h
ecd9389c8712aedeb2a79823ea0e4fb842684269 12-Feb-2013 Glenn Kasten <gkasten@google.com> Revert "Temporary additional logging to investigate bug"

This reverts commit 3051df27261e9952c0e642dec548515250e85f6a

Change-Id: I8bf5c3e91b65bd20de26f480c367c2854b62373c
/frameworks/av/services/audioflinger/Threads.h
3051df27261e9952c0e642dec548515250e85f6a 12-Feb-2013 Glenn Kasten <gkasten@google.com> Temporary additional logging to investigate bug

The bug appears related to continuing to use an invalid buffer provider
in fast mixer after track destruction, so focus the added logs in that area.

Also includes a bug fix: was calling log in an unsafe place
near Threads.cpp AudioFlinger::PlaybackThread::createTrack_l line 1250.

Details:
- include caller pid or client pid where appropriate
- increase log buffer size

Bug: 6490974
Change-Id: I4c030f171343fe4b483eae0ddea4427118d8d4b1
/frameworks/av/services/audioflinger/Threads.h
59686720182dcaa1a1a4757964df38c16f1a5246 04-Feb-2013 Eric Laurent <elaurent@google.com> Merge "AudioFlinger: fix RecordThread initial device"
d3922f72601d82c6fc067a98916fda0bd1291c5f 02-Feb-2013 Eric Laurent <elaurent@google.com> AudioFlinger: fix RecordThread initial device

A regression was introduced when the audio device enums where
modified for a 32 bit representation: the device passed when
constructing a RecordThread was still the concatenation of input
device and output device bit fields on one 32 bit value which
is not possible anymore.

The fix consists in modifying the RecordThread constructor to accept
separate values for input and output devices.

Change-Id: I81fb5f4718428b54251e65d74b86e198ce15193e
/frameworks/av/services/audioflinger/Threads.h
9e58b552f51b00b3b674102876bd6c77ef3da806 19-Jan-2013 Glenn Kasten <gkasten@google.com> AudioFlinger uses media.log service for logging

Change-Id: Ia0f8204334f6b233f644d897762a18c95d936b4b
/frameworks/av/services/audioflinger/Threads.h
81784c37c61b09289654b979567a42bf73cd2b12 19-Nov-2012 Eric Laurent <elaurent@google.com> AudioFlinger files reorganization

Audioflinger.cpp and Audioflinger.h files must be split to
improve readability and maintainability.

This CL splits the files as follows:

AudioFlinger.cpp split into:
- AudioFlinger.cpp: implementation of IAudioflinger interface and global methods
- AFThreads.cpp: implementation of ThreadBase, PlaybackThread, MixerThread,
DuplicatingThread, DirectOutputThread and RecordThread.
- AFTracks.cpp: implementation of TrackBase, Track, TimedTrack, OutputTrack,
RecordTrack, TrackHandle and RecordHandle.
- AFEffects.cpp: implementation of EffectModule, EffectChain and EffectHandle.

AudioFlinger.h is modified by inline inclusion of header files containing
the declaration of complex inner classes:
- AFThreads.h: ThreadBase, PlaybackThread, MixerThread, DuplicatingThread,
DirectOutputThread and RecordThread
- AFEffects.h: EffectModule, EffectChain and EffectHandle

AFThreads.h includes the follownig headers inline:
- AFTrackBase.h: TrackBase
- AFPlaybackTracks: Track, TimedTrack, OutputTrack
- AFRecordTracks: RecordTrack

Change-Id: I512ebc3a51813ab7a4afccc9a538b18125165c4c
/frameworks/av/services/audioflinger/Threads.h