summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Remove redundant semicolon from namespace closingGlenn Kasten2015-03-031-1/+1
| | | | Change-Id: I163f9d3d216c283ae1160ce4802e5247cf44fba7
* Merge "Do not pre-fill OutputTrack buffer for duplicating thread"Andy Hung2015-02-261-22/+1
|\
| * Do not pre-fill OutputTrack buffer for duplicating threadAndy Hung2015-01-221-22/+1
| | | | | | | | | | | | | | It is not necessary to start the downstream MixerThread early, rather allow stop() to flush the remaining frames. Change-Id: Ibcf8e7f5eda09d0f915d50697ff0c24c32fd11c4
* | Include what you useGlenn Kasten2015-02-191-0/+1
|/ | | | Change-Id: I1967861f383bb5ed6743fb69e3bd439907ed7033
* Allow duplicating thread to use native mixing audio formatAndy Hung2015-01-151-32/+21
| | | | | | | Update OutputTrack to take variable formats. Previously conversion to AUDIO_FORMAT_PCM_16_BIT was required. Change-Id: I4a96a60ddd8d8dfe651405a0bcd4f98c89bc1ade
* am 85aca658: am d33712d7: am 145cf5d8: Merge "audioflinger: implement ↵Eric Laurent2014-12-171-5/+4
|\ | | | | | | | | | | | | 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-5/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 121143d5: am bf14c62e: am 72bf901c: Merge "audio policy: new ↵Eric Laurent2014-11-261-1/+1
|\ \ | |/ | | | | | | | | | | getOutputForAttr() prototype." into lmp-mr1-dev * commit '121143d5242a790d0bd01fe1b9cec5d28a1ba1d7': audio policy: new getOutputForAttr() prototype.
| * audio policy: new getOutputForAttr() prototype.Eric Laurent2014-11-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Update getOutputForAttr() prototype and group all logic dealing with audio attributes to stream type conversion in audio policy manager. getOutputForAttr(): - specifies the audio session (for future use) - returns a status code - receives either stream type (for legacy) or audio attributes - returns an updated streamtype Remove logic dealing with legacy stream types to attributes conversion from AudioTrack. Use correct type for audio sessions in other APIs (startOutput() ...). releaseOutput() specifies the audio session (for future use). Bug: 18067208. Change-Id: I1bfbe9626c04c7955d77f8a70aecfad2cb204817
* | am 72215491: am 1a475921: am 223fd5c9: audio: new routing strategies and ↵Eric Laurent2014-11-261-3/+5
|\ \ | |/ | | | | | | | | | | stream types * commit '72215491c60fbcdb9a2f0be782e24e39cca249c5': audio: new routing strategies and stream types
| * audio: new routing strategies and stream typesEric Laurent2014-11-211-3/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am a248703b: am a3e2c146: am 4d0a5985: Merge "Prevent stopped audio tracks ↵Andy Hung2014-11-181-8/+9
|\ \ | |/ | | | | | | | | | | from mixing data" into lmp-mr1-dev * commit 'a248703b0799a9a27481f0ec13df90214a661eb5': Prevent stopped audio tracks from mixing data
| * Prevent stopped audio tracks from mixing dataAndy Hung2014-11-171-8/+9
| | | | | | | | | | | | | | | | | | Static tracks should have zero framesReady when stopping or stopped, to prevent mixer from running potentially indefinitely with loop mode. Bug: 16070883 Change-Id: Iab9968044d1a6f8543bbcbfb246f49f27d68cace
* | am 12d0cd1b: am 3a8bad2e: am be9ebd46: Merge "Fix uncertainty of one normal ↵Glenn Kasten2014-10-031-1/+10
|\ \ | |/ | | | | | | | | | | mix buffer in AudioTrack::getTimestamp" into lmp-dev * commit '12d0cd1bf756ec96755fae2e573659898bfba6d6': Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp
| * Fix uncertainty of one normal mix buffer in AudioTrack::getTimestampGlenn Kasten2014-10-021-1/+10
| | | | | | | | | | | | | | | | | | | | 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
* | am 0e42a880: am e5095be1: am a49c94ea: Merge "Revert "Fix uncertainty of one ↵Glenn Kasten2014-10-021-9/+1
|\ \ | |/ | | | | | | | | | | normal mix buffer in AudioTrack::getTimestamp"" into lmp-dev * commit '0e42a8807edec5541ecac4a050459fbb72c477dc': Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"
| * Merge "Revert "Fix uncertainty of one normal mix buffer in ↵Glenn Kasten2014-10-011-9/+1
| |\ | | | | | | | | | AudioTrack::getTimestamp"" into lmp-dev
| | * Revert "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp"Glenn Kasten2014-10-011-9/+1
| | | | | | | | | | | | | | | | | | | | | | | | This reverts commit 54464ba861aaafd11ee5645f5d1ecd1171c6e9fe. Bug: 17733142. Change-Id: I9886d40032b2f7d96bee03e600e14f78943d8052
* | | am 785da8f5: am 955e24d3: Merge "Fix uncertainty of one normal mix buffer in ↵Glenn Kasten2014-10-011-1/+9
|\ \ \ | |/ / | | | | | | | | | | | | | | | AudioTrack::getTimestamp" into lmp-dev * commit '785da8f542120e49d29289947e69aba180c1724b': Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp
| * | Merge "Fix uncertainty of one normal mix buffer in AudioTrack::getTimestamp" ↵Glenn Kasten2014-09-301-1/+9
| |\ \ | | |/ | | | | | | into lmp-dev
| | * Fix uncertainty of one normal mix buffer in AudioTrack::getTimestampGlenn Kasten2014-09-301-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | am e0270e79: am f71224ce: Merge "audioflinger: forward flush to direct ↵Eric Laurent2014-10-011-0/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | output streams" into lmp-dev * commit 'e0270e79066825bb232ef5f271ac9ef84ce91b0f': audioflinger: forward flush to direct output streams
| * | audioflinger: forward flush to direct output streamsEric Laurent2014-09-291-0/+4
| |/ | | | | | | | | | | | | | | Track flush should be forwarded to the audio HAL when playing on a direct output stream. Bug: 17704953. Change-Id: Iafc94327fe9aebf1d4eaa97b76c6767b7ac5babe
* | am f5e98702: am cf7863ea: Merge "audioflinger: fix pre processing effect ↵Eric Laurent2014-09-161-12/+14
|\ \ | |/ | | | | | | | | | | leak" into lmp-dev * commit 'f5e9870228db68d9cb927ff49f2e46dabfb7bbec': audioflinger: fix pre processing effect leak
| * audioflinger: fix pre processing effect leakEric Laurent2014-09-151-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | am 955d8f90: am 23c8cf95: Merge "Restore the ability to build tee sink for ↵Glenn Kasten2014-09-031-1/+1
|\ \ | |/ | | | | | | | | | | debugging" into lmp-dev * commit '955d8f906e920fe8da66e7943a7f2bfa98422e19': Restore the ability to build tee sink for debugging
| * Restore the ability to build tee sink for debuggingGlenn Kasten2014-09-021-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This changelist does not enable tee sink, but makes it possible to do so. Tee sink had suffered some bit rot since it is not built by default. Also fixes a crash for > 2 byte per sample or > 2 channels. Still does not write correct header for floating-point; that will be best solved by moving to libsndfile. Bug: 16990102 Change-Id: I8e92c588ccc513d7802d696fcfb324e815772df6
* | Clear the timestamp latch valid flag if no new timestamp availableGlenn Kasten2014-08-261-0/+1
|/ | | | | Bug: 11815245 Change-Id: I94885a1b4c2c7c055b8eacc7f7d0fcd064094b6d
* audio policy: add support for USB devices for voice callEric Laurent2014-08-061-2/+2
| | | | | | | | | Add possibility to use sink and source devices not on the primary HW module for voice calls (e.g. USB headsets). Bug: 15520724. Change-Id: Ib27db4ba759b6d91ea1104dc2e35c87733517b30
* audio policy: pass session ID to capture activity methodsEric Laurent2014-07-281-3/+3
| | | | | | | | Indicate the audio session ID when calling getInput(), startInput(), stopInput(), releaseInput(). Bug: 12378680. Change-Id: I763793752f93e2f4e1445a5ab217c895af011038
* audio flinger: add patch connection between hw modulesEric Laurent2014-07-241-28/+196
| | | | | | | | | | | | | | | | | | 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
* Fix copy/paste bugGlenn Kasten2014-07-181-3/+2
| | | | | | introduced by Change-Id: I4e9b7fa99858b488ac98a441fa70e31dbba1b865 Change-Id: I9a0c8800f5cf3767cc259776f95c96cad972e392
* Improve dumpsys for capture threadsGlenn Kasten2014-07-171-3/+3
| | | | | | Show per-track sample rate, and whether there is a fast capture thread Change-Id: If6a08a40d1eeba0690aa8da3c541f845ec101b7f
* Add floating point volume handling to AudioMixerAndy Hung2014-07-081-1/+1
| | | | | | | | | | | | | | | Use floating point volume in AudioMixer mixing when floating point input is used with the new mixer engine. AudioResampler is updated to take floating point volume to match. Both legacy integer and floating point mixer engines work. For now, integer volume is used when the new mixer engine runs in integer input mode, for backward compatibility with the legacy mixer. The new mixer engine will generally run in floating point input mode. When the legacy path is removed, the integer volumes will be removed. Change-Id: I79e80c292ae7c8b8bdd0aa371a1b2c3a1b618290
* Replace int bitDepth with audio_format_t in ResamplerAndy Hung2014-07-071-1/+2
| | | | | | | | Remove mBitDepth from class (not used). Replace with audio_format_t in factory method to distinguish between float and pcm 16-bit. Change-Id: I166860796c68285077ef4458d8758d19b82523f9
* AudioTrack: add support for compressed audioEric Laurent2014-06-191-4/+2
| | | | | | | | | Add support for compressed audio playback by use of an AudioTrack attached to a direct output thread. Bug: 9428304. Change-Id: I4a61be9cf0e31003ca85935d6e0ee38ca8192e03
* force command flush after releasing a reference to shared memoryEric Laurent2014-06-131-2/+2
| | | | | | | | | | | | | After releasing a reference to a shared memory interface, IPCThreadState::self()->flushCommands() must be called to ensure that the corresponding reference is also cleared immediately in the remote process. Otherwise the binder implementaiton will not push the clear systematically causing the memory region not to be freed. See issues 10711502 and 2801375. Bug: 14057166. Change-Id: If55f36f00d452d6cf00cf83bd2fba1c8f3abcb57
* Merge "Fix non-monotonic AudioTrack::getTimestamp after pause" into ↵Glenn Kasten2014-06-101-3/+30
|\ | | | | | | lmp-preview-dev
| * Fix non-monotonic AudioTrack::getTimestamp after pauseGlenn Kasten2014-06-101-3/+30
| | | | | | | | | | Bug: 15523502 Change-Id: Ifd4aa7fca197bc041c1620fc3f7d953a8902551a
* | Squashed commit of the following:Glenn Kasten2014-06-051-7/+24
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | commit 9128d6ffec43731d723f9b394f243d940f4c7e41 Author: Glenn Kasten <gkasten@google.com> Date: Tue May 13 10:38:42 2014 -0700 Use of fast capture by normal capture Will only configure fast capture path if the input buffer size is less than 10 ms and the input sample rate is same as the primary output sample rate. Change-Id: I4a7cdc6069d750845412c626d27e83f72a1ab397 commit 2e5e0806a5abe7499848358ef5fde5c26405000d Author: Glenn Kasten <gkasten@google.com> Date: Mon Jun 2 08:29:22 2014 -0700 Add mPrimaryOutputSampleRate Change-Id: I46b527fc3f2b5a5720a74b4f0b9a8f2e0d570b09 commit baf1d73467923996d1b1f2a9237260cc5697e050 Author: Andy Hung <hunga@google.com> Date: Fri May 30 10:42:03 2014 -0700 Change parameter type for volume to float in AudioMixer Change-Id: I4da1505ce852505f86f8e5b87f60e8edceeb30e0 commit 40fe20fa9760cd03c69778c2021cf7a490d75ece Author: Andy Hung <hunga@google.com> Date: Fri May 30 10:35:47 2014 -0700 Rename UNITY_GAIN to UNITY_GAIN_INT in AudioMixer Change-Id: Ic040311305026f0b4c4280a5b3bef7a447ac1da3 commit 37c9a2b49f876abc5ff537a9ec036d7f0a423775 Author: Andy Hung <hunga@google.com> Date: Thu May 29 21:33:13 2014 -0700 Refactor setVolumeRampVariables in AudioMixer Change-Id: I8fcf3101bcea292de7c65433fa578f1c9cdd0974 commit 397070eca31f121d5d3993de1bfea99aaea5d4f3 Author: Andy Hung <hunga@google.com> Date: Thu May 29 18:52:38 2014 -0700 Fix floating point output from mixer A buffer pointer was being erroneously reset to buffer start, potentially causing an audio glitch. The floating point output mode is not enabled at this time, but will be in the future. Change-Id: If8b6414d232f064f3a2e2c5a6da889a91b27fb24 commit 2e61aa5b33b2247bbc5d4eaa0b519df9accd4bbc Author: Andy Hung <hunga@google.com> Date: Fri May 23 21:22:17 2014 -0700 Add multiple format capability to FastMixer Floating point data from MixerThread into FastMixer. Multiple output format capability from FastMixer to Sink. Change-Id: I0da17810ee71381a39a006c46faec71108d22c26 commit b9ea653c702a785bbd23a66c5e588d40b4192c4e Author: Andy Hung <hunga@google.com> Date: Thu May 29 15:53:09 2014 -0700 Avoid resetting BufferProviders in mixer unnecessarily Change-Id: Iad85c4dfd21be1dbf89dc11906106b34219376f8 commit 7f1a6d6da21c616f80cf9ba21bea11b419ec561b Author: Andy Hung <hunga@google.com> Date: Tue May 27 12:32:17 2014 -0700 Update dynamic resampler buffer fetching Make the criteria tight for fetching to avoid storing excessive frame data internal to the resampler. This should reduce jitter in frame delivery computation. Bug: 14962343 Change-Id: I7adaf714d11c272696ccdbf218bda994c7217477 commit b5e4aac07b9a02f0c803c090058602b03ac09ebb Author: Glenn Kasten <gkasten@google.com> Date: Tue May 27 12:30:54 2014 -0700 Allow kFastTrackMultiplier to be specified per device Change-Id: I4eaaaf038df720cec4f5d9221d1b632970f9e3dd commit b93cd97a52af31122df2da2cc0415cda888c8c73 Author: Andy Hung <hunga@google.com> Date: Fri May 23 21:13:31 2014 -0700 Rename mixBuffer to mMixerBuffer in FastMixer Likewise mixBufferState becomes mMixerBufferState. This harmonizes with the naming in AF::MixerThread. Change-Id: I1255d7c07cc2c6ee925d7430925236d2bd163122 commit 8340758622b9711365a8801806cbdf934803c63f Author: Andy Hung <hunga@google.com> Date: Mon May 12 16:51:41 2014 -0700 Add multiple format capability to AudioMixer Change-Id: I04ac1cafd90b6ed652f8d51888ad07576678f0bc Signed-off-by: Andy Hung <hunga@google.com> commit 6b695b9d094820c232a897a3fabbe83d2b7193fe Author: Glenn Kasten <gkasten@google.com> Date: Thu Mar 13 14:59:31 2014 -0700 Start adding FastCapture based on FastThread WIP This version supports at most one fast capture client. Change-Id: Idf609bfc80ae22433433d66a5232c043c65506df commit e951ad05a2c388471d7e2806d91e7d51325a150a Author: Glenn Kasten <gkasten@google.com> Date: Mon May 12 11:06:26 2014 -0700 Move validation of frameCount from set to openRecord_l This move is needed because frameCount is validated on server side for fast tracks (as should be done for normal tracks too). Change-Id: I6d99e80869fd90fab373cf60ef348c01f075fbca commit 73e76992dbba794894837c38e5472312ea829cf3 Author: Glenn Kasten <gkasten@google.com> Date: Tue May 13 10:41:52 2014 -0700 Allow track buffer "allocation" to be from pipe Change-Id: Ib9ac170f8e8b7746b3588157a56cbee3b753a1cb commit 60de1d7ded05c6304037d4858b401094b1d2b4d3 Author: Andy Hung <hunga@google.com> Date: Fri May 9 15:02:21 2014 -0700 Add format parameter to getTrackName() and track_t Change-Id: Ia152a839014e235fbfb656104c15d7c1b456d02e Signed-off-by: Andy Hung <hunga@google.com> Change-Id: Ied0ade8b25d23e89bb03319a7e3135c238f735b9
* resolved conflicts for merge of c0bf836f to masterElliott Hughes2014-05-211-2/+3
|\ | | | | | | Change-Id: I5cf238fa56d6fff443b212870cf9dd7f1110e7da
| * am 3b6da6bf: Merge "Move frameworks/av off private API."Elliott Hughes2014-05-221-2/+3
| |\ | | | | | | | | | | | | * commit '3b6da6bfb50a1c0324fb4c87326d3a477944d5fe': Move frameworks/av off private API.
| | * Move frameworks/av off private API.Elliott Hughes2014-05-211-2/+3
| | | | | | | | | | | | | | | Bug: 11156955 Change-Id: Ib3bb9d66a2bf92977c2445b62aa074a2d7a45aea
* | | resolved conflicts for merge of b1080917 to masterElliott Hughes2014-05-211-2/+2
|\ \ \ | |/ / | | | | | | Change-Id: Iabbe3e95e29f28461ff722b550e8a9f35bd2528f
| * | am d084206d: Merge "Move frameworks/av off __futex_syscall3."Elliott Hughes2014-05-221-2/+2
| |\ \ | | |/ | | | | | | | | | * commit 'd084206d5a4a5364211af46e4201311933e83bfc': Move frameworks/av off __futex_syscall3.
| | * Move frameworks/av off __futex_syscall3.Elliott Hughes2014-05-211-2/+2
| | | | | | | | | | | | | | | Bug: 11156955 Change-Id: I943080bc51b6efa781059b48b5b5ecc4fa287512
| * | Merge commit '91820d46b5f3065c2fded3cdf65d305715b33bb1' into HEADBill Yi2014-04-291-1/+1
| |\ \ | | |/ | |/|
| | * am 3c9130a8: Merge "Make frameworks/av 64-bit compatible"Narayan Kamath2014-03-071-5/+5
| | |\ | | | | | | | | | | | | | | | | * commit '3c9130a8a12ce962dc8d22e04243b135b9e98b01': Make frameworks/av 64-bit compatible
* | | \ Merge "Use new channel count functions for audio masks"Andy Hung2014-05-191-2/+4
|\ \ \ \
| * | | | Use new channel count functions for audio masksAndy Hung2014-05-161-2/+4
| | | | | | | | | | | | | | | | | | | | | | | | | Change-Id: Ia658ab4b6320d19fdb50f123c930918724ff0ef3 Signed-off-by: Andy Hung <hunga@google.com>