summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/PatchPanel.cpp
Commit message (Collapse)AuthorAgeFilesLines
* audio: Do not delete PatchRecord before Peer is stoppedEric Laurent2015-07-061-3/+12
| | | | | | | | | | | | PatchPanel::clearPatchConnections deletes PatchRecord before the peer PatchTrack is stopped. This can cause an access to already free'ed memory leading to a crash in PatchTrack::getNextBuffer. Fix is to delete PatchRecord and PatchTrack only after removing both of them from active tracks list Bug: 22304526. Change-Id: I7003756d3d2dd8912ce5e3b2fc31f5e82f455888
* PatchPanel: do not use setParameters() internally.Eric Laurent2015-04-281-96/+36
| | | | | | | | | | | | | | Do not use setParameters() with AUDIO_PARAMETER_STREAM_ROUTING when communicating the input or output device selected to playback or record threads, even for HAL version less than 3.0. Use createAudioPatch()/releaseAudioPatch() instead. This allows to send more information on the output or input device being selected. Also fix a regression introduced in L where the output device selection was not communicated to effects on record threads. Change-Id: I4780ada53241d56694b005c992171e173c3bf8f5
* audio flinger: improve device to device audio patchesEric Laurent2015-04-081-21/+17
| | | | | | | Allow creation of audio patches between input and output devices managed by the same audio HW module. Change-Id: I4b83268a4d5c41f3d5905d7581202cf5193efd32
* Remove redundant semicolon from namespace closingGlenn Kasten2015-03-031-1/+1
| | | | Change-Id: I163f9d3d216c283ae1160ce4802e5247cf44fba7
* fix memory leak in PatchPanelsoon1.choi2015-01-051-0/+2
| | | | | | | Before the audio patch is created, audio patch with same handle is removed from vector for patches. At this time, Patch allocated in the heap is not freed. This causes memory leaks in the mediaserver. Change-Id: Id0d28c36a7e7fbf473753bf4ead7518f28c1b998
* audioflinger: fix audio patch releaseEric Laurent2014-09-091-3/+3
| | | | | | | | Fix error in PatchPanel:releaseAudioPatch() causing the wrong patch handle to be passed to the audio HAL. Bug: 17368621. Change-Id: I037fd2e6273508c830414b5900d07c0178b96dae
* audio policy: enable more than one sink per audio patch.Eric Laurent2014-08-081-29/+35
| | | | | | | | | | | | Allow creation of audio patches with more than one sink. More than one sink is enabled when: - Connecting an input device to output devices on the same audio HW module. - Connecting an output mix to output devices on the same audio HA module. All other patches are limited to one sink. Bug: 16879363. Change-Id: I95be6948ef29df64e51e5b8ace38c2db7f3e89f2
* AudioFlinger: update openInput() and openOutput()Eric Laurent2014-07-281-17/+41
| | | | | | | | | | 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
* audio flinger: add patch connection between hw modulesEric Laurent2014-07-241-64/+288
| | | | | | | | | | | | | | | | | | 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
* AudioFlinger: fix PatchPanel debug log.Eric Laurent2014-06-041-2/+2
| | | | | Bug: 14815883. Change-Id: I71cf2ef74a96d3cdb27f2beb1b76b8979c738335
* audio policy: fix unitialized hw module in audio portEric Laurent2014-06-021-1/+1
| | | | | | | | | The hw module handle was not initialized when creating and audio port configuration from an input stream descriptor. Bug 15376641. Change-Id: I6c784cded68a5c665fd22c3643765c63f70eb241
* audio policy: add audio port gain controlEric Laurent2014-05-301-3/+28
| | | | | | | | | | Implement setAudioPortConfig() API to configure an audio port. Currently limited to gain control. Bug: 14815883. Change-Id: Ic1b268e5ba5c277e9f5b8fa63c81dd7c0b250024
* audio policy: implement routing controlEric Laurent2014-05-291-5/+12
| | | | | | | | | | | | | | | | | | | | | | Add implementation of audio routing control via AudioSystem APIs. The following APIs are implemented: - listAudioPorts(): return a list of devices and output/input mixers ports that can be used as sources or sinks for audio patches. - createAudioPatch()/releaseAudioPatch(): create/release a connection patch between two audio ports (e.g. to connect input from an HDMI device to a speaker output device). Only one client application can own a patch from a given source. When an audio port (device or mix) is part of an application created patch, its routing cannot not be changed by a policy decision. - listAudioPatches(): return a list of existing patches. Each audio port addition/removal and each audio patch creation/release increments a generation count. This generation count is used to ensure consistency betwen calls to listAudioPorts() and listAudioPatches(). Bug: 14815883. Change-Id: I022b638c2f5f0bb41543c7cfca7488fb45cfdd80
* DO NOT MERGE - audioflinger: first patch panel implementation.Eric Laurent2014-05-281-0/+409
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