summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.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>
* AudioFlinger: add specific mutex for client listsEric Laurent2014-05-131-40/+62
| | | | | | | | | | | | | 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
* Merge "audioflinger: refactor thread config events"Eric Laurent2014-05-091-9/+14
|\
| * audioflinger: refactor thread config eventsEric Laurent2014-05-091-9/+14
| | | | | | | | | | | | | | | | | | | | | | 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
* | IAudioFlinger::openRecord returns IMemory(s)Glenn Kasten2014-05-091-0/+8
|/ | | | | | | | 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
* Fix bug for direct track with PCM != 16-bitGlenn Kasten2014-05-021-4/+2
| | | | | | | | | | | | The AUDIO_FORMAT_PCM_8_BIT format was being converted to AUDIO_FORMAT_PCM_16_BIT on client side even for direct tracks. That conversion was incorrect; it should only be done for mixed tracks. Also remove checks for specific PCM formats in the generic part of server side of createTrack. Those format checks should only be done by the thread. This will allow direct tracks for PCM 8-bit, PCM 24-bit, etc. Change-Id: If5b9fd79f8642ed93e2aeabcaf4809b2ed798978
* am e80631aa: am 839d11d1: Merge changes I0a744dc7,Id993a70dMark Salyzyn2014-04-151-2/+2
|\ | | | | | | | | | | * commit 'e80631aa1992ca50af679cd6a018c0ffda7f9b17': 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-2/+2
| | | | | | | | Change-Id: I0a744dc7815a86a993df9b0623440be620ec8903
| * audioflinger: Fix for a deadlock in track creationHaynes Mathew George2014-03-061-1/+3
| | | | | | | | | | | | | | | | | | AudioFlinger enters a deadlock (with itself) on trying to free a RecordTrack or Track object that failed initialization. Clear this bad object from the caller instead. Bug: 12423233 Change-Id: I926f2beb922a70f6924e593e2bbf1a5b5df85b16
* | Merge "Mark the logging heap read-only to media.log service"Glenn Kasten2014-03-281-1/+1
|\ \
| * | Mark the logging heap read-only to media.log serviceGlenn Kasten2014-03-181-1/+1
| | | | | | | | | | | | Change-Id: Ie26a9e7e37c951774c71d2c53886db52dd5479aa
* | | Use symbol AUDIO_IO_HANDLE_NONE from <system/audio.h>Glenn Kasten2014-03-261-12/+12
| | | | | | | | | | | | Change-Id: Id6b1aa17558eb73e17f22b8eab6cd02e00a96dff
* | | Merge "Use symbol AUDIO_DEVICE_NONE from <system/audio.h>"Glenn Kasten2014-03-261-2/+2
|\ \ \
| * | | Use symbol AUDIO_DEVICE_NONE from <system/audio.h>Glenn Kasten2014-03-251-2/+2
| |/ / | | | | | | | | | Change-Id: I61f882c5e7c949bf00d3bfc745ebf3b5e1c42a58
* | | Merge "Fix uses of KeyedVector"Glenn Kasten2014-03-261-0/+1
|\ \ \
| * | | Fix uses of KeyedVectorGlenn Kasten2014-03-251-0/+1
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Constructor for AudioFlinger::mAudioHwDevs was missing, and so AudioFlinger::findSuitableHwDev_l() could return an undefined pointer if a non-0 module wasn't found. A KeyedVector of Plain Old Data (POD) element type must specify the default value in the constructor, or else the default will be undefined. Minor: - Parameter had wrong type in constructor for AudioSystem::gOutputs. - Remove obsolete AudioSystem::gStreamOutputMap. Change-Id: I9841493e018440e559d8b8b0e4e748ba2b2d365b
* | | Document AudioFlinger::nextUniqueId()Glenn Kasten2014-03-251-1/+1
|/ / | | | | | | Change-Id: Iafe96f1c10bd85cb23a2553945ca68aa601dc2eb
* | Make error handling more similar for output and captureGlenn Kasten2014-03-141-5/+7
| | | | | | | | | | | | And simplify error case Change-Id: I0bb1ec252945d672cc4cef137977b912f1b23d51
* | Make session ID code similar between output and captureGlenn Kasten2014-03-141-5/+5
| | | | | | | | Change-Id: I873a97d0e36e1a452421df4f749d51e1916797a5
* | Move declarations to where neededGlenn Kasten2014-03-141-5/+2
| | | | | | | | | | | | Also remove unnecessary ALOGV and dead variable inFrameCount Change-Id: I34547fb0fd2ff142fc60277bedfa4064e7356611
* | Remove name output parameter from createTrackGlenn Kasten2014-03-141-4/+0
| | | | | | | | | | | | | | It was only used for one log. A better solution will be a per-track unique ID. Change-Id: Ia440e02ae4a5a4019a9a2d08970e1ee93ac4c3a3
* | Whitespace and commentsGlenn Kasten2014-03-141-3/+1
| | | | | | | | Change-Id: I99752cca74a459c4746ea4718acb0115439e50bd
* | Prepare for additional capture formatsGlenn Kasten2014-03-141-3/+3
| | | | | | | | Change-Id: Ib10b004f0029191b33a97671e41b0d86ebfbe0b9
* | Rename setStreamOutput to invalidateStreamGlenn Kasten2014-02-281-2/+2
| | | | | | | | | | | | And simplify by removing the unused I/O handle parameter 'output'. Change-Id: Ie9c4df17a7378066312d4ed8790fda7a9125c95e
* | Move up AudioFlinger::createTrack and openRecord parameter checksGlenn Kasten2014-02-271-1/+32
| | | | | | | | | | | | | | | | Perform the basic sample rate, format, and channel masks tests as early as possible. Now the thread methods only need to do the thread type-specific checks. Change-Id: I57d8319a228dda0446ca9b3ddcb7c9f67f28238c
* | Merge "Make tee sink work again"Glenn Kasten2014-02-211-1/+2
|\ \
| * | Make tee sink work againGlenn Kasten2014-02-211-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was broken by this earlier change to NBAIO: > Change-Id: I5eda412648b094358f5eefc38300e9ec8a734cd3 But the code was not being compiled, so the error was not caught earlier. Also increase the default size of per-track pipe to a reasonable value. Change-Id: Ica05017e6c6533e1fea9df379a9b204eebed4a1f
* | | audioflinger: fix race condition in SyncEvent callbackEric Laurent2014-02-201-1/+1
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Now that the SyncEvent callback is implemented by the RecordTrack instead of the RecordThread, there is a possibility that the callback is called after the track deletion. SyncEvent callback now uses a weak pointer instead of a raw pointer as cookie. This allows the callback implementer to acquire a strong reference on the object pointed to by the cookie. Bug: 13114128. Change-Id: Id61b8f06044ed1e52c6f7e7c666cdede68340de2
* | Multi-client recording continuedGlenn Kasten2014-02-181-2/+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
* | Track pid for each sessionMarco Nelissen2014-02-111-5/+11
| | | | | | | | | | | | so they can be properly freed. Change-Id: I6f389035bc29e74e7c367c1c6d0252b180f666b3
* | 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-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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-2/+23
|\ \
| * | Pretty up audioflinger dumpsysMarco Nelissen2014-02-101-2/+23
| | | | | | | | | | | | Change-Id: I57e44b4c36b99f7149542bbcf9645521c6152dfa
* | | Merge "Use printf format %#x for audio_format_t in logs"Glenn Kasten2014-02-101-3/+3
|\ \ \ | |/ / |/| |
| * | Use printf format %#x for audio_format_t in logsGlenn Kasten2014-02-071-3/+3
| | | | | | | | | | | | Change-Id: I1c611d1037685d52ccc84efe0fccd6413ec938e9
* | | 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
* | | Merge "audioflinger: Fix for a deadlock in track creation"Glenn Kasten2014-02-051-2/+2
|\ \ \
| * | | audioflinger: Fix for a deadlock in track creationHaynes Mathew George2014-01-301-2/+2
| |/ / | | | | | | | | | | | | | | | | | | | | | | | | AudioFlinger enters a deadlock (with itself) on trying to free a RecordTrack or Track object that failed initialization. Clear this bad object from the caller instead. Bug: 12423233 Change-Id: I926f2beb922a70f6924e593e2bbf1a5b5df85b16
* | | Fix unused parameter warnings in audioGlenn Kasten2014-02-031-4/+4
|/ / | | | | | | Change-Id: I665ba3358dd9502f0adec70d486e7bf8a2e1b0fe
* | Merge "Replace control block frameCount_ by explicit in/out parameter"Glenn Kasten2014-01-241-2/+2
|\ \
| * | Replace control block frameCount_ by explicit in/out parameterGlenn Kasten2013-12-201-2/+2
| | | | | | | | | | | | | | | | | | in IAudioFlinger::createTrack and IAudioFlinger::openRecord Change-Id: I09c644c80e92c8e744b1b99055988a2588b2a83d
* | | Merge "Cleanup createTrack error handling"Glenn Kasten2014-01-171-0/+1
|\ \ \
| * | | Cleanup createTrack error handlingGlenn Kasten2014-01-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar to cleanup done earlier for openRecord in this CL: > Change-Id: I84897dd7d30b370640b54e928f230604b873cb68 Bug: 10888816 Change-Id: I804a47f898e0319a60a9bd58906bbb037e45cc25
* | | | AudioRecord::getInputFramesLost() cleanupGlenn Kasten2014-01-141-1/+1
|/ / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fixed bug that if the binder call failed (for example if the IAudioFlinger binder is dead), then getInputFramesLost was returning garbage. Now it correctly returns zero, which is the error value for this method. The type declarations for getInputFramesLost were inconsistent: a mixture of unsigned int, size_t, and uint32_t. Now it returns uint32_t everywhere, which is what the underlying HAL API returns. Added a FIXME about the side effect behavior. This will need review for multi-client. Change-Id: Ifa2e117a87dbd0c1f2c892a31d1c3dd919bf1a0a
* | | Use AUDIO_SESSION_ALLOCATE instead of 0Glenn Kasten2013-12-201-2/+2
|/ / | | | | | | | | | | | | Also fix a couple of places where we were using AUDIO_SESSION_OUTPUT_MIX, which happens to also be equal to 0, but has a different meaning. Change-Id: I90e39be3b89f5021a96d9e3b8d10929013ca977f
* | Add RecordThread media.log and deferred deallocationGlenn Kasten2013-12-051-12/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This change allows a media.log buffer for RecordThread. Unlike playback threads which stick around forever, the RecordThread comes and goes for every capture session. This means that the media.log buffer for a RecordThread would disappear too, and so was useless. Now when a thread exits, it's associated media.log buffer is just marked for deferred deallocation. It is only actually freed when the memory is needed. Other changes: - Fix bug in unregistering comparison, it was comparing the wrong pointers - Increased size of log area so we can log for RecordThread also Change-Id: If45d4c03a793b86390a0112ec3acc5d41b2e3635
* | Consistent error checking for sp<IMemory> and pointer()Glenn Kasten2013-11-201-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* | Pull HAL reads out of RecordThread resampleGlenn Kasten2013-11-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the resample was indirectly calling HAL read from within the BufferProvider's getNextBuffer. Now the HAL read is done ahead of time into a circular buffer, and the getNextBuffer just reads out of that memory. This change will permit some future planned features. Also removed the mono to mono resampling optimization, as that optimization will no longer be valid in the future. Change-Id: I59f5016a2df91078d697c37a7dec2d9d9f44542e