[BUG] AudioFlinger: Patch Panel: Fix SwBridge Patch leak
Audio HAL implementors have to manage unique patch ID.
It was observed that some patches were leaking, aka created but never
released. These patches are the playback patch of SW Bridges.
This CL fixes this leak by preventing to remove Plaback patch of a SW Bridge
When a SW Bridge is created, 2 patches are created. The patch involving
the SwOutput and the sink device is attached to the SwOutput mix handle.
When this SwOutput is routed/rerouted, the setOutputDevices will create
also a new Patch on AudioFlinger.
The remove stale audio patch section may destroy this patch.
Thus, when releasing the SwBridge patch, the Playback patch is not found
and releaseAudioPatch is never called on AudioHAL.
This CL prevents to erase the AF Playback Patch of a Sw Bridge.
It also prevents to erase the AF Patch used to route the SwOutput that may
be also involved in a SwBridge.
Bug: 187173301
Test: (manuel) make a first playback on an SwOutput, stop it, create a SwAudio
Patch, and release it twice. Playback Patch shall always be released,
hense HAL API called.
(functional on emulator):
adb shell ./data/AudioPolicyEmulatorTests --gtest_filter=*AudioPatchTest*
adb shell ./data/AudioPolicyEmulatorTests --gtest_filter=*AudioSourceTest*
Signed-off-by: Francois Gaffie <francois.gaffie@renault.com>
Change-Id: I24e371cd69e04aba2bf74b88336f6323cd88ad8b
Loading
Please register or sign in to comment