summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Merge tag 'android-6.0.1_r3' of ↵Steve Kondik2015-12-071-0/+1
|\ | | | | | | | | | | | | | | https://android.googlesource.com/platform/frameworks/av into cm-13.0 Android 6.0.1 release 3 Change-Id: I2f2a1fe1b58c828e8341556996211562d6e195ab
| * For static obtainBuffer(), do not set mUnreleased if acknowledging flush.Andy Hung2015-10-131-0/+1
| | | | | | | | | | | | | | static audio tracks use obtainBuffer() to update position in start(). Bug: 22938515 Change-Id: I8ae32f6cce4d122386d2cf8982e158049b04ba9a
* | AudioFlinger: Fix re-use of fast-trackSumit Bhattacharya2015-12-071-4/+8
| | | | | | | | | | | | | | | | | | | | When a fast-track using shared buffer is restarted, we need to call obtainbuffer if frameReady has already become zero, even if track is still active. This is required to reset mFramesReadySafe. Otherwise mFramesReadySafe remain at 0 and fastmixer can't consume data from the track when it is re-used. Change-Id: I5d6f364f8f31baad3341bd4f51bf8a8b147cd7d7
* | Merge tag 'android-6.0.0_r26' into cm-13.0Ricardo Cerqueira2015-11-051-1/+4
|\ \ | |/ | | | | | | | | Android 6.0.0 release 26 Change-Id: I8a57007bf6efcd8b95c3cebf5e0444345bdd4cda
| * Workaround static fast track start-after-stop issueAndy Hung2015-09-111-1/+4
| | | | | | | | | | | | | | Bug: 23291988 Bug: 23614327 Bug: 23924081 Change-Id: Id1a519ed4bb2a6f4cb197da8450f7069b55c0d48
| * Revert "Do not acknowledge flush() on start() for static tracks"Eric Laurent2015-09-091-6/+3
| | | | | | | | | | | | | | This reverts commit cafe86a9cb6625bb1ec6383e16e28e4c9e455f87. Bug: 23924093. Change-Id: I186d1013b06a286eca93c30bb9b3545dc36695ff
| * Do not acknowledge flush() on start() for static tracksAndy Hung2015-08-241-3/+6
| | | | | | | | | | Bug: 22938515 Change-Id: I1de653de169a3fbbaa693da6057897ea57772447
* | Stagefright: Add Checks for allocationsSathishKumar Mani2015-10-061-0/+2
|/ | | | | | | Warn allocation failures explicitly rather than crash trying to access unallocated memory Change-Id: Ie86c3ac130917e1f4030eb8207ac8350cba7711d
* Fix AudioRecord cleanup if construction failsAndy Hung2015-06-121-1/+3
| | | | | Bug: 11671194 Change-Id: Id48350264f8b5ce53bf7ce2b308bf4ba21e59241
* AudioTrack: fix spurious retrograde messagesPhil Burk2015-04-291-45/+2
| | | | | | | | | | | The retrograde motion was confused by some positions coming from the DSP on offloaded tracks. So the retrograde check was moved up into AudioTrack.cpp. This allows us to take advantage of the checks for invalid positions based on timing. Bug: 2047891 Change-Id: Ifcad2349201443a7f1711347c203297100449536 Signed-off-by: Phil Burk <philburk@google.com>
* Use AudioPlaybackRate to hold TimestretchBufferProvider parametersRicardo Garcia2015-04-221-5/+3
| | | | | | | | Use this struct to handle the parameters for TimestretchBufferProvider all across the system. Add stretch mode and fallback mode to TimestretchBuffer Provider. Change-Id: I19099924a7003c62e48bb6ead56c785cb129fba2
* Add playback rate to AudioTrackAndy Hung2015-04-091-2/+7
| | | | | Bug: 19196501 Change-Id: I6411e1d3ce652b711a71a6d9df020cb5f60d4714
* Merge "Improve ResamplerBufferProvider"Andy Hung2015-04-081-2/+1
|\
| * Improve ResamplerBufferProviderAndy Hung2015-04-081-2/+1
| | | | | | | | Change-Id: I3cc3af221ad5797ff219d75227350733afa180db
* | Merge "Add RecordBufferConverter for RecordThread data processing"Andy Hung2015-04-081-16/+26
|\ \ | |/
| * Add RecordBufferConverter for RecordThread data processingAndy Hung2015-04-081-16/+26
| | | | | | | | Change-Id: Ia3aab8590cd41e8a7cba0a7345d70d2866d92045
* | audio flinger: improve device to device audio patchesEric Laurent2015-04-081-1/+2
|/ | | | | | | Allow creation of audio patches between input and output devices managed by the same audio HW module. Change-Id: I4b83268a4d5c41f3d5905d7581202cf5193efd32
* audio flinger: fix standby on output with HW A/V syncEric Laurent2015-04-011-0/+1
| | | | | | | | | | Fix a bug in audio HAL pause logic on output threads with HW A/V sync preventing the HAL to enter standby when the audio track is stopped and detroyed. Bug: 19980184. Change-Id: Ia497dad23159038b447fcbc18a67bb61b70b79cc
* AudioFlinger: prevent retrograde timestamps for direct modePhil Burk2015-03-231-29/+48
| | | | | | | | | Prevent retrograde motion in the HAL or drivers from making it up through the AudioFlinger to the app. Bug: 19604395 Change-Id: I11d6c0f7cab69e75fd4b4a2a90f64960b4bb6d5a Signed-off-by: Phil Burk <philburk@google.com>
* audioflinger: refresh fast track underrun state upon startHaynes Mathew George2015-03-161-2/+6
| | | | | | | | | | | | | | | False underrun is detected when starting recycled fast tracks, which leads to continuous fatal assertion failures and even AP reboot. Track's last mObservedUnderruns isn't updated one at previous stop() call. Hence, when we start the same track again, we should synchronize it to the latest state instead of relying on stale one. authored-by: Weiyin Jiang<wjiang@codeaurora.org> CRs-Fixed: 803389 Bug: 19635137 Signed-off-by: Andy Hung <hunga@google.com> Change-Id: Ia003a49c6896dba965798c062c98b8c367ef8369
* 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