* changes:
Use PassthruPatchRecord for DIRECT to DIRECT connections
Add PassthruPatchRecord for low latency software patches
Abstract access to HAL stream via Source in RecordThread
Move PlaybackThread::Track::writeFrames to PatchRecord
When both input and output connected by a software patch
are in 'DIRECT' mode (no framework processing), use
PassthruPatchRecord as it helps to reduce the latency
significantly by avoiding intermediate buffering.
Remove 'std::nothrow' from tracks creation in PatchPanel
for consistency with other code.
Bug: 117564323
Test: MS12 MSD, AOSP MSD
Change-Id: I52ec5b02a207548ebc4073c1033e396f444c041c
Implement a subclass of PatchRecord that uses PatchTrack's
thread for reading from HAL. This eliminates the need for
buffering that adds latency.
The only modification needed for PatchTrack is to indicate
unlimited amount of available frames to the playback thread.
This is to prevent PatchTrack from being deactivated by
DirectOutputThread due to lack of frames available.
RecordThread believes it reads audio data on its thread,
and manages timestamps as usual. The data that it "reads"
and passes to PassthruPatchRecord is discarded by the latter.
Bug: 117564323
Test: MS12 MSD, AOSP MSD
Change-Id: I376656e3c791e91e2196331ecdf2b425697c4e18
Add AUDIO_OUTPUT_FLAG_MMAP_NOIRQ flag in the relavant flags to check
for if the relavant profiles are present or not
Bug: 136493985
Test: make
authored-by: Samyak Jain <samyjain@codeaurora.org>
Change-Id: I8b8b9fdfca2bb6e5f824f3b79ac42b7de5545706
Merged-In: I8b8b9fdfca2bb6e5f824f3b79ac42b7de5545706
This allows to replace direct reading from HAL with obtaining
audio data from another source.
It should be possible to encapsulate reading from FastCapture
in the same manner, but it's not required for direct inputs.
Test: make
Change-Id: I3f005583410cc9c5d4b07c127d95e236abb4a85f
This code logically belongs to PatchRecord because it emulates
obtaining recorded data from a client.
Test: make
Change-Id: Icba4e33d9d0ca57e6ad964aaf3209e7db766f284
The error must not be ignored as otherwise the Java layer
thinks that recording has started successfully.
Bug: 136279123
Test: reproduce AudioRecordingConfigurationTest failure on cuttlefish,
check test failure output, the failure must be
"junit.framework.AssertionFailedError: expected:<3> but was:<1>"
Change-Id: I82bc3a43bf679cfb03d4246d07615d3fd4dac409
Merged-In: I82bc3a43bf679cfb03d4246d07615d3fd4dac409
First test for audio health check. The test checks if all declared
devices found by checking if the audio device types of attached devices
can be seen by audio policy.
Bug: 141580284
Test: atest audio_health_tests audiopolicy_tests
Change-Id: I0374f382eaab7b36ab623b11a59e0634565f2187
The deprecated method AudioManager.isBluetoothA2dpOn() calls
getDeviceConnectionState on APM with an empty address, which
caused HwModuleCollection::getDeviceDescriptor to set an empty
address on the DeviceDescriptor for the currently connected
A2DP device. This method is called by MediaRouter.
When the address was reset, the java listener for audio device
connection monitoring was reporting the connection of an A2DP
device with an empty address, which in turn caused AvrcpManager
to behave as if the audio device connection failed.
If MediaRouter called isBluetoothA2dpOn() before AvrcpManager
received its called for device connection, the error would occur.
Bug: 132416679
Test: call isBluetoothA2dpOn() and check for valid address in dumpsys media.audio_policy
Test: atest AudioServiceHostTest#testInjectForRecord ; atest AudioHostTest ; atest AudioPlaybackCaptureTest
Change-Id: I1370edbbca46657506a990855d06a176f07c54d3
Merged-In: I1370edbbca46657506a990855d06a176f07c54d3
Android provides 2 audio policy engines:
libaudiopolicyenginedefault and
libaudiopolicyengineconfigurable. This change makes the engine
to be loaded dynamically based on the configuration (currently
the engine name is hardcoded into AudioPolicyConfig). Dynamic
loading allows building and installing of both libraries without
any conflicts.
Technical changes:
- AudioPolicyManagerInterface renamed to EngineInterface
for clarity;
- For the purpose of dynamic loading, APM does not depend
anymore on the EngineInstance class. The class got removed
from the default AP engine, but left in the configurable engine
because it is also used by its plugins;
- Added EngineLibrary class to encapsulate dynamic loading
of the AP engine. The class name EngineInstance is repurposed
for a smart pointer to EngineInterface;
- services/audiopolicy/managerdefault/Android.mk converted
into Android.bp;
- Added engine loading failure test;
Bug: 132639720
Test: sanity tests for audio; audiopolicy_tests
Change-Id: I0581569a172f810e030aec879225e817bfa7851a
Merged-In: I0581569a172f810e030aec879225e817bfa7851a
Remove the "template" configuration file and the header file.
Bug: 132435217
Test: make
Change-Id: I0b8ae921ac046e11b020d5766a60f9b341e1d6ee
Merged-In: I0b8ae921ac046e11b020d5766a60f9b341e1d6ee