summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/PatchPanel.h
Commit message (Collapse)AuthorAgeFilesLines
* audioflinger: Fix crash on patch creation attemptMikhail Naganov2019-03-111-0/+1
| | | | | | | | | | The code for clearing software patch connections was missing a check for a null track pointer. Bug: 126789266 Bug: 128269566 Test: see repro steps in b/128269566 Change-Id: Ice6887622d5fa2fa3198ce15146bff3cb05f7451
* PatchPanel: Keep peer alive during use.Andy Hung2019-03-081-3/+3
| | | | | | Test: BT call, switch from hearing aid to headset Bug: 126789266 Change-Id: I589e5ecaac25c1ce1d504a387662b96cf50f63ba
* audioflinger: Fix move semantics in PatchPanelMikhail Naganov2019-02-051-8/+20
| | | | | | | The old code was not implemented correctly. Test: make and run TV with MSD device Change-Id: I64eec7c0c78705fd0497022ff86fa1aef05745b2
* AudioFlinger: Incorporate downstream patch latency into timestampsAndy Hung2018-08-131-0/+1
| | | | | | | | Available for MSD BUS devices. Test: MSD YouTube playback and audioflinger dumpsys Bug: 112435419 Change-Id: Ifd35b68a77464e0db79ad1ed50b72b00a616c253
* PatchPanel: store "downstream" patches for a deviceMikhail Naganov2018-07-131-2/+64
| | | | | | | | | | | | | | | | | | When the system inserts an intermediate processing module between audio flinger and hardware HAL, and they are connected via a software patch, the threads of this patch need to receive metadata passed to the thread serving the "upstream" device of the processing module. PatchPanel stores an association between "upstream" streams and the software patch. This allows audio flinger to access the patch threads. For more info, see the comments in PatchPanel.h Bug: 63901775 Test: manual Change-Id: I60e578c37a1bc7385daf32d379ea143120584a31
* PatchPanel: Add latency information for software patchesAndy Hung2018-06-041-0/+4
| | | | | | Test: audioflinger dumpsys when patches present Bug: 80546849 Change-Id: Ib5b26e065ab20b5f8d530db57398e7b4a59ed1f1
* audioflinger: Dump software patchesMikhail Naganov2018-05-171-0/+4
| | | | | | | | | | | | Example output: Software patches: Patch 44: thread 0xa6d83900 => thread 0xa7dfe000 This helps to identify threads used for the patch. Test: adb shell dumpsys media.audio_flinger Change-Id: I6c70945abd8e4abd46cd0311559d35efb6127555
* PatchPanel: follow up to remove false warning from ~PatchMikhail Naganov2018-05-101-0/+17
| | | | | | | | | | | | | | | | | | | | When a new patch is being added to mPatches in this line: mPatches.insert(std::make_pair(*handle, std::move(newPatch))); the source of the move--`newPatch` remains intact, and if it is a software patch, it has playback and record patch handles remaining to be non-NONE values. Thus, on destruction it falsely warns that it hasn't been cleared. The solution is to define a move constructor for Endpoint which "transfers" patch handle ownership. Also delete copy constructors to make sure that each Patch is a unique resource. Test: create a software patch, watch logcat Change-Id: I41ea2dff087696252132e79d827e705378baaf8f
* PatchPanel: Cleanup and refactoringMikhail Naganov2018-05-041-9/+55
| | | | | | | | | | | | | | | | * Unified software patch endpoints management code. * Noticed that Patch::clearConnections is only called before getting rid of Patch instance, so there is no need to explicitly clear references to endpoints' Track and Thread. * Fixed out-of-memory handling when creating tracks for a software patch. * Factored out finding HAL Device by module handle. Test: verify transitions to/from BT while playing media and making calls Change-Id: If6459c477054d6dff60dfa13f2d99ee2d6e887ad
* Refactor PatchPanelMikhail Naganov2018-04-261-32/+16
| | | | | | | | | | | | | | | | | | | Major changes: * since PatchPanel is internal to AudioFlinger, and has the same lifetime period, there is no need to use reference counting; * setAudioPortConfig moved to AudioFlinger; * store Patches in std::map instead of SortedVector, and directly--not as pointers; * move {create|clear}PatchConnections into Patch class; * use __func__ in logging. Test: test basic audio functionality on taimen Change-Id: I813fd8430a0e97cd01cc74e6b3b828b10ff5acd4
* Fix clang-tidy warnings in audio and playerservice.Chih-Hung Hsieh2016-08-101-2/+2
| | | | | | | | | | * Add explicit keyword to conversion constructors. Bug: 28341362 * Use const reference type for read-only parameters. Bug: 30407689 Test: build with WITH_TIDY=1 Change-Id: I265f3b094e08d5705b506b3fbba51439c134af84
* audioflinger: fix reused audio patch resource releaseEric Laurent2016-06-081-0/+12
| | | | | | | | | | Add missing explicit release of audio HAL patch when a patch is created reusing the same patch handle but the source or sink devices are not on the same HW module. Bug: 28953359 Change-Id: Ib751a4b5b2badd745f3b43e69734dd6a3e60eabe
* audio flinger: add patch connection between hw modulesEric Laurent2014-07-241-6/+24
| | | | | | | | | | | | | | | | | | 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: first patch panel implementation.Eric Laurent2014-05-271-0/+60
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