Since libaudiohal@aidl reports that the most current legacy C API
version is supported by the HAL, the audio server uses a different
logic for telephony scenarios than for the HIDL HAL. This involves
opening more streams on the same mix port. Allow opening
an unlimited number of streams. However, keep the number of active
streams to be `1`.
Bug: 302132812
Test: atest CtsMediaAudioTestCases --test-filter=".*AudioNativeTest.*"
Test: atest CtsMediaAudioTestCases --test-filter=".*CallAudioInterceptionTest.*"
Change-Id: I896398fca73f28d28d9397d00751394c969531b4
Replace the incorrect logic which was considering each
port individually with the correct logic which considers
a connection of a mix port to device ports.
Bug: 302573756
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I7df6e32315945897d88923ea4d9744e590e85dfd
The code for updating the existing patch did not modify
the patch stored in the module's list of patches.
Added a test which switches the patch to another port
config and validates that 'Module.getAudioPatches' returns
the updated patch.
Bug: 302573756
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I0e3412b9387cd451436a48af116dc5a940d868cf
When there are no device ports supporting MMAP,
Module::getMmapPolicyInfos have to return 'Policy::NEVER'
so that the AAudio code does not attempt to use
the AAudio service. This aligns with the use of sysprops
by the HIDL implementation.
Update AudioCoreModule#GetMmapPolicyInfos test to use
the same logic for determining MMAP support as the framework
uses.
This makes CtsNativeMediaAAudioTest cases passing with
the AIDL HAL on Cuttlefish.
Bug: 302049825
Test: atest VtsHalAudioCoreTargetTest
Test: atest CtsNativeMediaAAudioTest [w/AIDL enabled on CF]
Change-Id: Ie58c408f6f648a8a03b6a5d92118b90061389c50
alsa_device_proxy keeps a pointer to alsa_device_proxy,
but does not own it. Thus, the lifetime of the proxy must
be no less than of the proxy. In the legacy USB HAL impl
they were stored together (struct alsa_device_info).
Implement an equivalent class (DeviceProxy) in ALSA utils.
Bug: 264712385
Bug: 298712227
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I4e36701752afb3f35664b6f2ad1acda5719be1ea
When a effect is closed and reopened from framework,
mExit and mStop states are not reset,that causes
threadloop to exit and eventually blocks framework
as FMQs are never filled from effects HAL.
Reset the state of mExit and mStop on every time when
thread is created, so open->close->open kind of
scenarios can be handled.
Bug: 301214647
Test: run vts-hal-audio
Change-Id: If54c8fa62827e5f28e620dd841d638028149b1b8
Check audioModeIndication/audioSourceIndication/volume flags and only
test if they are supported
Bug: 300735428
Test: atest VtsHalAudioEffectTargetTest
Change-Id: I539b408fcdb73c25984ec8f39b401475a3ccab69
The legacy configuration was interesting because although the
xml config file only listed 48000 Hz SR and
AUDIO_CHANNEL_OUT_STEREO channel mask, the implementation
allowed a range of SRs and MONO channel mask. The framework was
liberally allowing requests for other SRs to go to the r_submix
HAL, even without having them listed in the xml config
file. However, since libaudiohal@aidl is more strict in matching
configuration requests to port capabilities, we need to list all
channels masks and SRs suported by the legacy HAL explicitly.
However, we need to limit the amount of profiles to avoid
extra load when passing them via AudioPolicyService.listAudioPorts,
thus remove other PCM types.
Also, to match the hard limit on the number of routes in the legacy
implementation, set "maxOpen/ActiveStreamCount" for mix ports.
Bug: 286914845
Bug: 300990644
Test: atest VtsHalAudioCoreTargetTest
Test: atest android.media.audio.cts.AudioPlaybackCaptureTest
Change-Id: I4a8c7d016662d92ab5e73bc67d94aaac6570e59a
Point-to-point connections (analog, HDMI, SPDIF) do not use
a device address. Reflect that in `GenerateUniqueDeviceAddress`.
Add an analog headset into the test configuration.
Bug: 300648357
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id1d0b1b60df40c2474fe3151067152b8e0a261c3
A mix port can be patched to multiple connected device ports. Thus, when
disconnecting an external device and removing the connected port, the
profiles of the mix port can only be cleared iff there are no more
connected device ports patched to it, and it did not have profiles prior to
connection of the first device.
Enhanced VTS tests to catch this problem in the HAL implementations. Also,
ensure that audio ports and audio routes do not change after the test
finishes. This ensures that tests can't affect each other.
Bug: 298175108
Test: atest audiosystem_tests
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ia666b874958fb260513fc2b8cd20a823953ec679
In rare cases, a worker thread from a new stream created
via StreamSwitcher can read again from the command FMQ
the "exit" command which was sent to the worker of
the previous stream.
The underlying reason for that has to be investigated.
For now, mitigate the issue by salting the cookie of
the "exit" command with the worker's TID.
Bug: 300130515
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie7d2e847e8b39414ffd31afd64e32d4c9a292c03
External device ports might not have dynamic profiles, for example,
ports for BT devices. Properly handle this case in the default
implementation.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Test: atest audiosystem_tests
Change-Id: I8d4bcbf6ccf2ba05436e68e3ba94567fc7610eb7