summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/Tracks.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use new channel count functions for audio masksAndy Hung2014-05-161-2/+4
| | | | | Change-Id: Ia658ab4b6320d19fdb50f123c930918724ff0ef3 Signed-off-by: Andy Hung <hunga@google.com>
* 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
|\ \
| * | Replace control block frameCount_ by explicit in/out parameterGlenn Kasten2013-12-201-3/+2
| | | | | | | | | | | | | | | | | | in IAudioFlinger::createTrack and IAudioFlinger::openRecord Change-Id: I09c644c80e92c8e744b1b99055988a2588b2a83d
* | | audioflinger: update track ready conditionHaynes Mathew George2014-01-081-1/+1
|/ / | | | | | | | | | | | | Signal track ready if the track isStopping(). Bug: 12423190 Change-Id: Ie279995d5f90fa8211a20dfbeacc1cf9b921d0bf
* | Consistent error checking for sp<IMemory> and pointer()Glenn Kasten2013-11-201-5/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There have been concerns that an sp<IMemory> could be non-0, but the associated pointer() still be NULL. There are rumors this may happen when a non-0 sp<IMemory> is passed in by client but the shared memory cannot be re-mapped into mediaserver. There's also evidence in the early (2009/03/03) pre-git code of checking pointer() for NULL, after a local allocate() returned a non-0 sp<IMemory>. It's not clear if this is "cargo cult" paranoia, or if there was a genuine reason for the check. In any case, we now consistently check pointer() for sp<IMemory> input parameters in createTrack() and queueTimedBuffer(). We also check after successful allocate(). If allocate() returns a non-0 sp<> but NULL pointer(), then treat it as if the allocate() had returned 0. Change-Id: I3013ac5766b493d443ecef71711ec861076a623e
* | Code simplification for timed allocateGlenn Kasten2013-11-201-5/+2
| | | | | | | | Change-Id: I5acccd7418c5b4a4dc0112147c750fef9f74bf33
* | am ce275b7d: am 1c594b63: Merge "audioflinger: enable effects after ↵Eric Laurent2013-10-291-0/+1
|\ \ | |/ | | | | | | | | | | registration if needed" into klp-dev * commit 'ce275b7dd20e3d4781a46126c753e6eb998e6c0f': audioflinger: enable effects after registration if needed
| * Merge "audioflinger: enable effects after registration if needed" into klp-devEric Laurent2013-10-301-0/+1
| |\
| | * audioflinger: enable effects after registration if neededEric Laurent2013-10-121-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | This fixes a bug where effects were not properly reenabled after being moved from one playback thread to another. The effect is enabled but the audio policy manager sees it as disabled. Bug: 11181933. Change-Id: I19cac7acbaf61c546e667fd85ed7d4eda1c716d8
| * | Assign blame for playback wakelocks.Marco Nelissen2013-10-251-9/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | | Assign blame for playback wakelocks.Marco Nelissen2013-10-251-9/+27
| | | | | | | | | | | | | | | | | | | | | 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
* | | am 77177fa2: am 95c03858: Merge "Allow releaseBuffer after flush" into klp-devGlenn Kasten2013-10-181-1/+1
|\ \ \ | |/ / | | | | | | | | | * commit '77177fa20773d02b4f9c4147ecb98107f019fa7d': Allow releaseBuffer after flush
| * | Allow releaseBuffer after flushGlenn Kasten2013-10-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | After AudioTrack start checks for pending flush, allow releaseBuffer on any previously obtained buffer. For example, this can happen if the resampler has obtained a buffer but not released the whole buffer yet. Note that the resampler will be reading obsolete data. Bug: 11285590 Change-Id: I0614fbb62e43604aac3089cce4b7797c87a306b5
* | | am e45796de: am dedc7b0f: Merge "Fix flush() followed by start()" into klp-devGlenn Kasten2013-10-171-0/+9
|\ \ \ | |/ / | | | | | | | | | * commit 'e45796dee9c072cdb13a00b407e68be2cd55e2f2': Fix flush() followed by start()
| * | Fix flush() followed by start()Glenn Kasten2013-10-171-0/+9
| |/ | | | | | | | | Bug: 11259166 Change-Id: I72526cdfd4e3ff4b06e6a317e577f57cc285205d
* | am 3424d6e1: am 1adf20ce: Merge "fix volume and effect enable delay on ↵Eric Laurent2013-10-011-0/+16
|\ \ | |/ | | | | | | | | | | offloaded tracks" into klp-dev * commit '3424d6e17637e0743ddf3bf4688af8ee36e69264': fix volume and effect enable delay on offloaded tracks
| * fix volume and effect enable delay on offloaded tracksEric Laurent2013-09-301-0/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | Volume: add a method to wake up the mediaserver playback thread when a volume command is received on an offloaded track. Effects: call effect chain process on offloaded playback threads asynchronously from writes to allow effect state updates while waiting for async write callback. Bug: 10796540. Change-Id: Id2747ae88783575d1d7ffd6fc86fbd054ab2c739
* | am c6bed216: am a3b97ad2: Merge "audioflinger: implement getTimestamp() for ↵Eric Laurent2013-09-201-12/+16
|\ \ | |/ | | | | | | | | | | offloaded tracks" into klp-dev * commit 'c6bed216e3a759a855ac4b9b743fbaed2d5929c1': audioflinger: implement getTimestamp() for offloaded tracks
| * Merge "audioflinger: implement getTimestamp() for offloaded tracks" into klp-devEric Laurent2013-09-201-12/+16
| |\
| | * audioflinger: implement getTimestamp() for offloaded tracksEric Laurent2013-09-201-12/+16
| | | | | | | | | | | | | | | Bug: 9587132. Change-Id: Ie9d5f4cca96306d08bc9a2dbd6edd8953096702d
* | | am ce3e7cb0: am fbb2609f: Merge "audioflinger: fix lost offload thread ↵Eric Laurent2013-09-201-2/+2
|\ \ \ | |/ / | | | | | | | | | | | | | | | resume event" into klp-dev * commit 'ce3e7cb0bd09e7861d417b7d45c1e5921f10a93f': audioflinger: fix lost offload thread resume event
| * | audioflinger: fix lost offload thread resume eventEric Laurent2013-09-191-2/+2
| |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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