summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* 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>
* | | | | Pass stereo gains as packed minifloatGlenn Kasten2014-05-191-14/+15
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This will allow (eventually) a greater dynamic range for gains. However there are still a few remaining places in effects and mixer that will also need to be changed in order to get the full benefit. Also fixes a minor bug: was not checking for NaN in AudioTrack C++. Change-Id: I63bce9e82e0a61546d8ff475fb94bcb700d99c96
* | | | Merge "Pull up mFlags and isFastTrack from Track to TrackBase"Glenn Kasten2014-05-141-5/+7
|\ \ \ \
| * | | | Pull up mFlags and isFastTrack from Track to TrackBaseGlenn Kasten2014-05-131-5/+7
| | | | | | | | | | | | | | | | | | | | Change-Id: I6bd48292310be4e05758a11f617f50585904422d
* | | | | AudioFlinger: add specific mutex for client listsEric Laurent2014-05-131-2/+2
|/ / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | | Remove obsolete IAudioRecord::getCblk()Glenn Kasten2014-05-091-4/+0
| | | | | | | | | | | | | | | | Change-Id: Id20b5efd765b9796b0e391610e06dc928a829ebf
* | | | IAudioFlinger::openRecord returns IMemory(s)Glenn Kasten2014-05-091-9/+28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | openRecord() now explicitly returns the control block and data buffer as separate IMemory references. If the IMemory for data buffer is 0, this means it immediately follows the control block. Change-Id: Ic098f88f0e037f8fbe30006689e18cacacf09d06
* | | | am e80631aa: am 839d11d1: Merge changes I0a744dc7,Id993a70dMark Salyzyn2014-04-151-1/+1
|\ \ \ \ | | | | | | | | | | | | | | | | | | | | | | | | | * commit 'e80631aa1992ca50af679cd6a018c0ffda7f9b17': media: use size_t for integer iterator to Vector::size() media: 64 bit compile issues
| * \ \ \ am 839d11d1: Merge changes I0a744dc7,Id993a70dMark Salyzyn2014-04-151-1/+1
| |\ \ \ \ | | |/ / / | | | | | | | | | | | | | | | | | | | | * commit '839d11d1f7be9dff2f06c7d30a9eb39cb6782078': media: use size_t for integer iterator to Vector::size() media: 64 bit compile issues
| | * | | media: use size_t for integer iterator to Vector::size()Mark Salyzyn2014-04-151-1/+1
| | | |/ | | |/| | | | | | | | | Change-Id: I0a744dc7815a86a993df9b0623440be620ec8903
| * | | am 632c3790: am 7c206e5b: am e0cd1051: audioflinger: update track ready ↵Haynes Mathew George2014-03-051-1/+1
| |\ \ \ | | |/ / | |/| / | | |/ | | | | | | | | | condition * commit '632c3790523896260dc43fd6cd40a158765cdb15': audioflinger: update track ready condition
| | * audioflinger: update track ready conditionHaynes Mathew George2014-03-041-1/+1
| | | | | | | | | | | | | | | | | | | | | Signal track ready if the track isStopping(). Bug: 12423190 Change-Id: I95e14905df10ebf301e398263478c8ca25d7e2ce
* | | Use LOG_ALWAYS_FATAL instead of LOG_FATALGlenn Kasten2014-03-261-1/+1
| | | | | | | | | | | | | | | | | | | | | LOG_FATAL is compiled out in most builds, so the assertion checks were not being performed. Change-Id: I774f0985ab9c5ccecd8989a0f1c940386b73fc35
* | | audioflinger: OffloadThread fix for resume underrunHaynes Mathew George2014-03-171-1/+5
| | | | | | | | | | | | | | | | | | | | | | | | AudioFlinger can miss resuming h/w on a pause->resume transition if sufficient data isn't available Bug: 11358524. Change-Id: Ic3c75256290d3515fd4a96dfcc900909fbe5bc15
* | | AudioFlinger: Change track ready condition in STOPPING_1 stateEric Laurent2014-03-171-2/+4
| | | | | | | | | | | | | | | | | | Set FS_FILLED only if framesReady() > 0 Change-Id: Ibb1d2e988ff17fcf3a7ab61031a3f85df82f18d5
* | | audioflinger: Handle pause /resume in stopping stateKrishnankutty Kolathappilly2014-03-171-2/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | -Pre-requisite: Perform seek on the clip. After seek the data remaining till EOS is little more than the driver and common block buffering. -Framework state: Offload thread is waiting for signal from the HAL for a free buffer. Audio Player calls sink stop on reaching EOS. Audio track is waiting on obtain buffer for a free space in common block to send the last buffer. The track is moved to stopping state as input EOS is reached. -Issue: Perform pause/ resume in this state(STOPPING), Audio playback does not resume. -Fix Ensure resume is called in stopping state if frames ready is greater than zero. Bug: 12870871 Change-Id: Ib1378c4ee5ce4bea655691e93de0775f7b1d2804 Signed-off-by: Glenn Kasten <gkasten@google.com>
* | | Make error handling more similar for output and captureGlenn Kasten2014-03-141-35/+36
| | | | | | | | | | | | | | | | | | And simplify error case Change-Id: I0bb1ec252945d672cc4cef137977b912f1b23d51
* | | Whitespace and commentsGlenn Kasten2014-03-141-1/+1
| | | | | | | | | | | | Change-Id: I99752cca74a459c4746ea4718acb0115439e50bd
* | | Move handleSyncStartEvent and clearSyncStartEvent to RecordTrackGlenn Kasten2014-02-181-0/+23
| | | | | | | | | | | | Change-Id: I611a63e63acf3eb17e2072c1a77b91fe9e62e36a
* | | Multi-client recordingGlenn Kasten2014-02-181-4/+23
| | | | | | | | | | | | | | | | | | 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-5/+5
|\ \ \ | |/ / | | | | | | Change-Id: I7b1cc71057b2bd4f771e7bcf508a8c3abd6017ce
| * | Make frameworks/av 64-bit compatibleKévin PETIT2014-02-111-5/+5
| |/ | | | | | | | | | | | | | | | | | | | | | | 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
* | Merge "Pretty up audioflinger dumpsys"Marco Nelissen2014-02-101-8/+12
|\ \
| * | Pretty up audioflinger dumpsysMarco Nelissen2014-02-101-8/+12
| | | | | | | | | | | | Change-Id: I57e44b4c36b99f7149542bbcf9645521c6152dfa
* | | Merge "Fix whitespace"Glenn Kasten2014-02-071-1/+2
|\ \ \ | |/ / |/| |
| * | Fix whitespaceGlenn Kasten2014-02-071-1/+2
| | | | | | | | | | | | Change-Id: I9add0872030a26933f6b6dad1be299154611cc56
* | | Merge "Use Format_isValid() and Format_isEqual() instead of direct comparison"Glenn Kasten2014-02-071-1/+1
|\ \ \ | |/ / |/| |
| * | Use Format_isValid() and Format_isEqual() instead of direct comparisonGlenn Kasten2014-02-031-1/+1
| | | | | | | | | | | | Change-Id: Ie87607aa514976947540a77775e6425c4e56e7d9
* | | AudioFlinger: Modify flush handling for offload pathHaynes Mathew George2014-02-061-2/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Fix unused parameter warnings in audioGlenn Kasten2014-02-031-5/+5
|/ / | | | | | | Change-Id: I665ba3358dd9502f0adec70d486e7bf8a2e1b0fe
* | Merge "Replace control block frameCount_ by explicit in/out parameter"Glenn Kasten2014-01-241-3/+2
|\ \