summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Threads.h
Commit message (Collapse)AuthorAgeFilesLines
* Add floating and multichannel record to AudioFlingerAndy Hung2015-04-221-6/+11
| | | | Change-Id: Ia388fb012a0b6d81613ef87142a97d76836338f9
* Make record buffer in RecordThread variable formatAndy Hung2015-04-211-1/+1
| | | | Change-Id: Id4bb9b973eeea16946fba3bc084c7ac270d9fa33
* Improve ResamplerBufferProviderAndy Hung2015-04-081-2/+31
| | | | Change-Id: I3cc3af221ad5797ff219d75227350733afa180db
* Add RecordBufferConverter for RecordThread data processingAndy Hung2015-04-081-0/+81
| | | | Change-Id: Ia3aab8590cd41e8a7cba0a7345d70d2866d92045
* Update commentsGlenn Kasten2015-03-131-1/+1
| | | | Change-Id: I37d3c4ce22b74fe8581a886fe5a7f9fef8266dad
* Rename mName to mThreadName and kNameLength to kThreadNameLengthGlenn Kasten2015-03-061-2/+2
| | | | Change-Id: I0adfcdcab7923a07a840ec0e04528cb8bfc41f10
* am 69158e3e: am 6ab33981: am 610255e8: Merge "audioflinger: pause HW A/V ↵Eric Laurent2015-01-071-0/+3
|\ | | | | | | | | | | | | sync output when AudioTrack underruns" into lmp-mr1-dev * commit '69158e3e7b565a5ca131a2efaa9b76615ca80cbb': audioflinger: pause HW A/V sync output when AudioTrack underruns
| * audioflinger: pause HW A/V sync output when AudioTrack underrunsEric Laurent2014-12-191-0/+3
| | | | | | | | | | | | | | | | | | 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
* | Line length 100Glenn Kasten2014-12-301-1/+2
| | | | | | | | Change-Id: I6c8fe626a3825fa9e139319656d682a57b887c97
* | am 85aca658: am d33712d7: am 145cf5d8: Merge "audioflinger: implement ↵Eric Laurent2014-12-171-4/+5
|\ \ | |/ | | | | | | | | | | pause/resume for direct outputs" into lmp-mr1-dev * commit '85aca658ac7d20584b0647427256df50a5f243ef': audioflinger: implement pause/resume for direct outputs
| * audioflinger: implement pause/resume for direct outputsEric Laurent2014-12-161-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 72215491: am 1a475921: am 223fd5c9: audio: new routing strategies and ↵Eric Laurent2014-11-261-3/+1
|\ \ | |/ | | | | | | | | | | stream types * commit '72215491c60fbcdb9a2f0be782e24e39cca249c5': audio: new routing strategies and stream types
| * audio: new routing strategies and stream typesEric Laurent2014-11-211-3/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Improve dumpsys for output threadsGlenn Kasten2014-10-221-0/+3
|/ | | | | | | Display output thread type and flags. Also add units and use consistent spelling. Change-Id: I19eb627f41c4887b6ad0543024a8477a99890798
* Fix uncertainty of one normal mix buffer in AudioTrack::getTimestampGlenn Kasten2014-10-021-1/+4
| | | | | | | | | | 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
* Merge "Revert "Fix uncertainty of one normal mix buffer in ↵Glenn Kasten2014-10-011-1/+0
|\ | | | | | | AudioTrack::getTimestamp"" into lmp-dev
| * Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"Glenn Kasten2014-10-011-1/+0
| | | | | | | | | | | | | | | | This reverts commit 54464ba861aaafd11ee5645f5d1ecd1171c6e9fe. Bug: 17733142. Change-Id: I9886d40032b2f7d96bee03e600e14f78943d8052
* | Merge "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp" ↵Glenn Kasten2014-09-301-0/+1
|\ \ | |/ | | | | into lmp-dev
| * Fix uncertainty of one normal mix buffer in AudioTrack::getTimestampGlenn Kasten2014-09-301-0/+1
| | | | | | | | | | | | | | | | | | | | 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
* | audioflinger: forward flush to direct output streamsEric Laurent2014-09-291-3/+2
|/ | | | | | | | Track flush should be forwarded to the audio HAL when playing on a direct output stream. Bug: 17704953. Change-Id: Iafc94327fe9aebf1d4eaa97b76c6767b7ac5babe
* audioflinger: fix pre processing effect leakEric Laurent2014-09-151-3/+0
| | | | | | | | | | | | | | | | | | | | 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
* audio flinger: add patch connection between hw modulesEric Laurent2014-07-241-1/+14
| | | | | | | | | | | | | | | | | | 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
* Return negotiated format with HAL in AudioFlingerAndy Hung2014-07-101-2/+6
| | | | | | | | 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
* Merge "IAudioFlinger::openRecord now suggests notificationFrames"Glenn Kasten2014-07-021-0/+1
|\
| * IAudioFlinger::openRecord now suggests notificationFramesGlenn Kasten2014-07-031-0/+1
| | | | | | | | Change-Id: I08885cc381d03c522a23289e74f0e1ed46563863
* | Merge "Remove obsolete IAudioFlinger::channelCount()"Glenn Kasten2014-07-021-1/+0
|\ \ | |/ |/|
| * Remove obsolete IAudioFlinger::channelCount()Glenn Kasten2014-06-021-1/+0
| | | | | | | | Change-Id: Ie623edae2e795f9155f1f452fe4e6c7217a4a4c8
* | Use sp<> instead of raw pointer for FastMixerGlenn Kasten2014-06-241-2/+2
| | | | | | | | | | | | | | This avoids worry about the thread lifetime during tear-down. Bug: 15858655 Change-Id: I896d24317bd6f53a574645cdf4cd514eaa205dd5
* | Use of fast capture by normal captureGlenn Kasten2014-06-021-1/+39
|/ | | | | | | 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
* audioflinger: first patch panel implementation.Eric Laurent2014-05-271-0/+62
| | | | | | | | | | | | | | | | | | | | | | | | | 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
* Merge "Add format parameter to getTrackName() and track_t"Andy Hung2014-05-231-3/+6
|\
| * Add format parameter to getTrackName() and track_tAndy Hung2014-05-191-3/+6
| | | | | | | | | | Change-Id: Ia152a839014e235fbfb656104c15d7c1b456d02e Signed-off-by: Andy Hung <hunga@google.com>
* | Allow track buffer "allocation" to be from pipeGlenn Kasten2014-05-221-0/+2
|/ | | | Change-Id: Ib9ac170f8e8b7746b3588157a56cbee3b753a1cb
* AudioFlinger: add specific mutex for client listsEric Laurent2014-05-131-15/+4
| | | | | | | | | | | | | 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
* audioflinger: refactor thread config eventsEric Laurent2014-05-091-57/+114
| | | | | | | | | | | 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
* Add a per-thread heap that is read-only to clientsGlenn Kasten2014-05-071-0/+11
| | | | Change-Id: I401263566ca20fbfb565689c8fa99458d3b283b2
* Add FIXMEs to createRecord for fast captureGlenn Kasten2014-03-311-1/+1
| | | | Change-Id: I759be200fae32969212c52a409f46f2e704081e3
* Revert "Revert "Convert AudioFlinger mSinkBuffer to flexible format""Andy Hung2014-03-131-3/+6
| | | | This reverts commit e2a9c29f35e0c09782558542fc4cf9823779590e.
* Revert "Convert AudioFlinger mSinkBuffer to flexible format"Eric Laurent2014-03-131-6/+3
| | | | | | | This reverts commit e7e676fd2866fa4898712c4effa9e624e969c182. Bug: 13450717. Change-Id: Ib80b0d14428fecce33c62003a1fcf83f71cee03b
* Convert AudioFlinger mSinkBuffer to flexible formatAndy Hung2014-03-101-3/+6
| | | | | Change-Id: I618d9c99a5f6f8c8d6a9f4b2d19e82c9ddc3b06e Signed-off-by: Andy Hung <hunga@google.com>
* Add mEffectBuffer to AudioFlingerAndy Hung2014-03-101-0/+35
| | | | | Change-Id: Icf97c50040bc127723d56eb4d2fb6e790a7253d9 Signed-off-by: Andy Hung <hunga@google.com>
* Add MixerBuffer for accumulation of float audioAndy Hung2014-02-271-0/+23
| | | | | | | | Path into and out of MixerBuffer is set up, but not currently enabled. Change-Id: I9d50752607d22dd2a3d9cc7e053babf8dfb22958 Signed-off-by: Andy Hung <hunga@google.com>
* Rename mixBufferSize to mSinkBufferSize in AudioFlingerAndy Hung2014-02-271-1/+1
| | | | | Change-Id: I4d1d18d716fa3ad8c0e7cc87f5a2823422f504eb Signed-off-by: Andy Hung <hunga@google.com>
* Rename mMixBuffer to mSinkBuffer in AudioFlingerAndy Hung2014-02-271-2/+3
| | | | | Change-Id: I1f55630425b8ce36e9df2aaf64e06a8960b69a47 Signed-off-by: Andy Hung <hunga@google.com>
* Multi-client recording continuedGlenn Kasten2014-02-181-6/+0
| | | | | | | | | 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
* Move handleSyncStartEvent and clearSyncStartEvent to RecordTrackGlenn Kasten2014-02-181-3/+0
| | | | Change-Id: I611a63e63acf3eb17e2072c1a77b91fe9e62e36a
* Add _l suffix to readInputParameters/OutputParametersGlenn Kasten2014-02-181-5/+5
| | | | | | | They are always called while thread mutex is locked, or in the thread constructor. Change-Id: I56df71563a52a5cd6cea6fc0914df993519e1b74
* Multi-client recordingGlenn Kasten2014-02-181-26/+19
| | | | | | Supports multiple clients both at native sample rate and with resampling. Change-Id: Icea55b4fd30751761b7debaa3ce016c79e712d8d
* resolved conflicts for merge of 566be7c3 to masterNarayan Kamath2014-02-111-1/+1
|\ | | | | | | Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
| * Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | 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