History log of /frameworks/av/services/audioflinger/PatchPanel.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
b997d3a3d61a86dc9525860e863c7b690356d405 08-Jun-2016 Eric Laurent <elaurent@google.com> audioflinger: fix reused audio patch resource release

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
/frameworks/av/services/audioflinger/PatchPanel.cpp
050677873c10d4da308ac222f8533c96cca3207e 02-Jun-2016 Eric Laurent <elaurent@google.com> Add AudioTrack and AudioRecord flag checks

Verify that the requested flags are compatible with the input
or output flags when creating and AudioRecord or AudioTrack

Get rid of IAudioFlinger::track_flags_t which was redundant
with audio_input_flags_t and audio_output_flags_t.

Change-Id: I0dd9232f857b2737e99a8c668806e45bce09cdbd
/frameworks/av/services/audioflinger/PatchPanel.cpp
0666cc5b6b430cc5a815dab0bcba3dd73da8061a 15-Dec-2015 Eric Laurent <elaurent@google.com> audio flinger: fix audio patch release

Release playback and capture threads associated to a softwware
audio patch when the patch handle is reused.

Bug: 25638953.
Change-Id: Ie832513043525dda9089f8e83018810add2a4d6e
/frameworks/av/services/audioflinger/PatchPanel.cpp
8ae73129e7e79d826b293238c2f037f723d0e6e8 12-Apr-2016 Eric Laurent <elaurent@google.com> audio policy: fix call audio over 24 bit USB device

Take into account voice RX source device properties when
configuring the audio patch bridging the voice RX device
to the USB output device.

Bug: 25643110

Change-Id: I06f282d3cc12493f21500bf9ab35a3ceb93f14af
/frameworks/av/services/audioflinger/PatchPanel.cpp
a13cde98a880341f0a56d91da6364b093fb5d24e 29-Mar-2016 Glenn Kasten <gkasten@google.com> Use audio_module_handle_t and audio_patch_handle_t consistently

Bug: 27814144
Change-Id: I54b7a73ec318779fd3addb060998f4d94141152d
/frameworks/av/services/audioflinger/PatchPanel.cpp
c42e9b462661673dff480ee71757a58b0f806370 21-Mar-2016 Glenn Kasten <gkasten@google.com> Fix build warnings

Change-Id: Idfdaff3a7a8f60cd8817bd306bfba28020a391c8
/frameworks/av/services/audioflinger/PatchPanel.cpp
57c4e6f7464d458eb52d209c2a63524913d6406d 18-Mar-2016 Glenn Kasten <gkasten@google.com> Fix build warnings

Change-Id: I33178dbe0bfc087d6599579ca0529ad853c669ed
/frameworks/av/services/audioflinger/PatchPanel.cpp
d848eb48c121c119e8ba7583efc75415fe102570 08-Mar-2016 Glenn Kasten <gkasten@google.com> Use audio_session_t consistently

Bug: 27562099
Change-Id: I328d8226191386b163f2ace41233607294c50dcd
/frameworks/av/services/audioflinger/PatchPanel.cpp
f27ce4051c81a90f8f937a1b381e9e6ffa2bfa6b 14-Mar-2016 Greg Kaiser <gkaiser@google.com> PatchPanel: Avoid null pointer dereferences.

We wait until after checking 'handle' and 'patch' for NULL before
dereferencing those pointers for logging.

Change-Id: I5b90b87536f83c8f809b390951471d40cd8c27a4
/frameworks/av/services/audioflinger/PatchPanel.cpp
eeecb980ff4c202d0a3c4b0bfe040dce2f73336d 26-Feb-2016 Glenn Kasten <gkasten@google.com> Add use for audio_unique_id_t

Bug: 25641253
Bug: 21019153
Change-Id: I65dc128e760c245f3d90559635a8981b186c87d7
/frameworks/av/services/audioflinger/PatchPanel.cpp
d60560af7cb559762593161c8202459cc01fb0f5 10-Apr-2015 Eric Laurent <elaurent@google.com> audio policy: add support for external audio sources

Add support for activity on external audio sources.
An external source reflects activity on an input audio device
that must be controlled (both routing and volume) by the
audio policy manager.
First, the input device must be connected with setDeviceConnectionState().
Then, the source activity is indicated with startAudioSource() and
stopAudioSource() APIs.
startAudioSource() indicates the source device with an audio port configuration
and the use case by the audio attributes.

Once a source is active, its routing and volume are controlled by the policy manager
as it would for a software source (AudioTrack).

Change-Id: If5805d58a4356b2f681f1aabf54375f62b55b98a
/frameworks/av/services/audioflinger/PatchPanel.cpp
a0169a073d88efefbfb35fa0ea8e94f7b31d7469 07-Jul-2015 Eric Laurent <elaurent@google.com> audio: Do not delete PatchRecord before Peer is stopped

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
/frameworks/av/services/audioflinger/PatchPanel.cpp
054d9d3dea1390294650ac704acb4aa0a0731217 24-Apr-2015 Eric Laurent <elaurent@google.com> PatchPanel: do not use setParameters() internally.

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
/frameworks/av/services/audioflinger/PatchPanel.cpp
3bcf8597189c592713675ec58326ecbef0ac4ae9 03-Apr-2015 Eric Laurent <elaurent@google.com> audio flinger: improve device to device audio patches

Allow creation of audio patches between input and output
devices managed by the same audio HW module.

Change-Id: I4b83268a4d5c41f3d5905d7581202cf5193efd32
/frameworks/av/services/audioflinger/PatchPanel.cpp
63238efb0d674758902918e3cdaac322126484b7 03-Mar-2015 Glenn Kasten <gkasten@google.com> Remove redundant semicolon from namespace closing

Change-Id: I163f9d3d216c283ae1160ce4802e5247cf44fba7
/frameworks/av/services/audioflinger/PatchPanel.cpp
d8cd47792bac11a44096ef8233bb5268a6674bec 05-Jan-2015 soon1.choi <soon1.choi@lge.com> fix memory leak in PatchPanel

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
/frameworks/av/services/audioflinger/PatchPanel.cpp
f8fd8d6daab5ced86ce950be68070d27c24d487f 10-Sep-2014 Eric Laurent <elaurent@google.com> audioflinger: fix audio patch release

Fix error in PatchPanel:releaseAudioPatch() causing
the wrong patch handle to be passed to the audio HAL.

Bug: 17368621.
Change-Id: I037fd2e6273508c830414b5900d07c0178b96dae
/frameworks/av/services/audioflinger/PatchPanel.cpp
874c4287a4e49c59ac88767751dce00fcd3edb73 09-Aug-2014 Eric Laurent <elaurent@google.com> audio policy: enable more than one sink per audio patch.

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
/frameworks/av/services/audioflinger/PatchPanel.cpp
cf2c0210c8afbe7d0661ccbbae3835b5ce73c0bf 26-Jul-2014 Eric Laurent <elaurent@google.com> AudioFlinger: update openInput() and openOutput()

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
/frameworks/av/services/audioflinger/PatchPanel.cpp
83b8808faad1e91690c64d7007348be8d9ebde73 21-Jun-2014 Eric Laurent <elaurent@google.com> audio flinger: add patch connection between hw modules

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
/frameworks/av/services/audioflinger/PatchPanel.cpp
24478d47fc631ab33208f4dd9d034abb6839c992 05-Jun-2014 Eric Laurent <elaurent@google.com> AudioFlinger: fix PatchPanel debug log.

Bug: 14815883.
Change-Id: I71cf2ef74a96d3cdb27f2beb1b76b8979c738335
/frameworks/av/services/audioflinger/PatchPanel.cpp
62aaabb3905c61bb7acd6037414c206240a31c32 02-Jun-2014 Eric Laurent <elaurent@google.com> audio policy: fix unitialized hw module in audio port

The hw module handle was not initialized when creating
and audio port configuration from an input stream descriptor.

Bug 15376641.

Change-Id: I6c784cded68a5c665fd22c3643765c63f70eb241
/frameworks/av/services/audioflinger/PatchPanel.cpp
e1715a465a29db625da9d0ea365edf371e39e201 20-May-2014 Eric Laurent <elaurent@google.com> audio policy: add audio port gain control

Implement setAudioPortConfig() API to configure an
audio port.
Currently limited to gain control.

Bug: 14815883.

Change-Id: Ic1b268e5ba5c277e9f5b8fa63c81dd7c0b250024
/frameworks/av/services/audioflinger/PatchPanel.cpp
6a94d69dc4f32abb53c466a96f905bb199be6417 20-May-2014 Eric Laurent <elaurent@google.com> audio policy: implement routing control

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
/frameworks/av/services/audioflinger/PatchPanel.cpp
951f455566775e5f01e67c5ee26863d7d19209d7 20-May-2014 Eric Laurent <elaurent@google.com> DO NOT MERGE - audioflinger: first patch panel implementation.

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
/frameworks/av/services/audioflinger/PatchPanel.cpp