summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioFlinger.cpp
Commit message (Collapse)AuthorAgeFilesLines
...
* Restore the ability to build tee sink for debuggingGlenn Kasten2014-09-021-10/+14
| | | | | | | | | | | | 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
* AudioSystem: add API to query audio HW sync sourceEric Laurent2014-08-061-0/+19
| | | | | | | | | | | Add a method to query from the audio HAL the HW sync source used for a given audio session. Modify audio policy to select a direct output with HW sync when requested. Bug: 16132368. Change-Id: I03038f9188f2d389f8a5fd76a671854013a4513e
* audio flinger: fix service fuzz test crashEric Laurent2014-08-041-0/+6
| | | | | Bug: 13744704. Change-Id: I572c89f88dcab2b8b612ec6860983306f9f159ab
* rename AudioSystem::newAudioSessionId()Eric Laurent2014-07-281-1/+1
| | | | | | | | | Rename AudioSystem::newAudioSessionId() to AudioSystem::newAudioUniqueId() as it can be used also for I/O handles. Bug: 12378680. Change-Id: I611ea3b5eb57a4b0774437f477ee87dc4ccc2cc2
* AudioFlinger: update openInput() and openOutput()Eric Laurent2014-07-281-117/+85
| | | | | | | | | | Add parameters to openInput() and openOutput(): device address, input source. Allow caller to specify a given I/O handle Group parameters in a struct audio_config. Bug: 12378680. Change-Id: I7e9af74c0d996561cc13cbee7d9012d2daf33025
* Add multichannel capability to AudioFlingerAndy Hung2014-07-241-13/+31
| | | | | | But not enabled (kEnableExtendedChannels == false). Change-Id: I62f7e31fbd29ad703a9a02f5d1a280b6972dd423
* audio flinger: add patch connection between hw modulesEric Laurent2014-07-241-87/+140
| | | | | | | | | | | | | | | | | | 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
* Add audio_input_flags_t to IAudioFlinger::openInputGlenn Kasten2014-07-171-3/+4
| | | | | | | For backward compatibility, until flags are correctly calculated, we will assume that the request is for a low latency input stream. Change-Id: I76746834e870df00833dc77cbdaa2edd2ffeec95
* Add audio_input_flags_t to HAL open_input_streamGlenn Kasten2014-07-151-2/+3
| | | | | | | For backward compatibility, until flags are added to openInput(), we will assume that the request is for a low latency input stream. Change-Id: I5e6f7e574418917ff1b41b0a47199203c69cb40f
* stagefright: Pass audio aac sub formats in offloadinfoaarti jadhav-gaikwad2014-07-111-7/+16
| | | | | | | | Pass audio aac sub formats in offloadinfo according to aac profile. Audio HAL can take decision about offload using DSP capabilities Change-Id: If269a3654b5d2b09c183212b0646ef03e06f2d8f
* Merge "IAudioFlinger::openRecord now suggests notificationFrames"Glenn Kasten2014-07-021-1/+2
|\
| * IAudioFlinger::openRecord now suggests notificationFramesGlenn Kasten2014-07-031-1/+2
| | | | | | | | Change-Id: I08885cc381d03c522a23289e74f0e1ed46563863
* | Merge "Remove obsolete IAudioFlinger::channelCount()"Glenn Kasten2014-07-021-11/+0
|\ \ | |/ |/|
| * Remove obsolete IAudioFlinger::channelCount()Glenn Kasten2014-06-021-11/+0
| | | | | | | | Change-Id: Ie623edae2e795f9155f1f452fe4e6c7217a4a4c8
* | Add enabling variable for extended precision audioAndy Hung2014-06-251-3/+16
| | | | | | | | | | | | | | | | Set AudioFlinger::kEnableExtendedPrecision = true to enable extended precision. Enabling will be required for devices (such as USB) which report 24 bit or 32 bit sink formats. Change-Id: I0dc1d7a4f7607086d7b536ea0e43aef0e696f2ee
* | Add mPrimaryOutputSampleRateGlenn Kasten2014-06-021-1/+4
|/ | | | Change-Id: I46b527fc3f2b5a5720a74b4f0b9a8f2e0d570b09
* Merge "audioflinger: first patch panel implementation."Eric Laurent2014-05-281-0/+3
|\
| * audioflinger: first patch panel implementation.Eric Laurent2014-05-271-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added a new PatchPanel subclass to AudioFlinger to handle audio ports and audio patches configuration and connection. The first implementation does not add new functionnality. AudioPolicyManager uses patch panel interface to control device routing. AudioFlinger: - Added PatchPanel class. The first implementation does not add new functionnality. PatchPanel handles routing commands for audio HAL after 3.0 or converts to setParameters for audio HALs before 3.0. - Added config events to ThreadBase to control synchronized audio patch connection. AudioPolicyManager: - Use PatchPanel API to control device selection isntead of setParameters. - New base class AudioPort common to audio device descriptors and input output stream profiles. This class is RefBase and groups attributes common to audio ports. - Use same device selection flow for input as for outputs: getNewInputDevice -> getDeviceForInptusiource -> setInputDevice Change-Id: Idaa5a883b19a45816651c58cac697640dc717cd9
* | audioflinger: fix deadlock upon AudioRecord creation errorEric Laurent2014-05-261-5/+18
|/ | | | | | | | | | | | | | AudioFlinger:openRecord() should not hold mClientLock when releasing the local reference on AudioRecord as the destructor will also lock mClientLock. Same fix for AudioFlinger::createTrack(). Also make sure that AudioFlinger::createEffect() holds mClientLock when clearing local reference to the Client in case of error. Regression introduced by 021cf9634ab09c0753a40b7c9ef4ba603be5c3da Bug: 15118096. Change-Id: Ie961c398c8e0460bca9b95e2ee4ce6859316c275
* audioflinger: test min HAL version instead of currentEric Laurent2014-05-221-1/+1
| | | | Change-Id: Ibce2353b4390329b4c1a453e829178e3986c25a7
* resolved conflicts for merge of f285c91e to masterElliott Hughes2014-05-221-4/+4
|\ | | | | | | Change-Id: I4c995e297d09c0854a42142cc57dce8b771acf65
| * Move frameworks/av from fdprintf to POSIX dprintf.Elliott Hughes2014-05-221-4/+4
| | | | | | | | | | Bug: 11156955 Change-Id: Ia98cd16b4c1f7be87cf060b7456de4f40896bacb
* | 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