Add overloads for UpdateSink/SourceMetadata that
accept android.hardware.audio.common.Sink/SourceMetadata types.
Move include of hardware/audio.h to BluetoothAudioSession.cpp.
This allows to use this code from "pure AIDL" modules.
Bug: 228804498
Test: m
Change-Id: Ib0b8c6d1c7db9b846a508d6d4001f67feb2111c6
(cherry picked from commit d5f0d13ef0)
Merged-In: Ib0b8c6d1c7db9b846a508d6d4001f67feb2111c6
Make android.hardware.bluetooth.audio-V3 and
VtsHalBluetoothAudioTargetTest to depend on
android.hardware.audio.common-V2. This is needed so that
the audio HAL service can depend on
android.hardware.bluetooth.audio-V3.
Bug: 228804498
Test: m
Change-Id: Ic001e651de4cc6ef6920f1d6d80ab272c45aefe2
Merged-In: Ic001e651de4cc6ef6920f1d6d80ab272c45aefe2
(cherry picked from commit f6497dd78c)
Use stream switcher to obtain device address for creation
of a remote submix stream.
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I8dde3d59e488c9621dce78ffd5249254ecfc0b1a
(cherry picked from commit 2e460345a2)
Merged-In: I8dde3d59e488c9621dce78ffd5249254ecfc0b1a
Since in the C and HIDL APIs the method for opening a stream
receives the device to connect to, some legacy HAL implementations
took an advantage of that. In AIDL APIs device port connection
process is more dynamic and independent of the stream creation.
To simplify porting of legacy implementations to AIDL, a helper
class StreamSwitcher is added. It emulates the legacy behavior
by allowing to postpone the stream implementation creation until
the connected device is known. Until that moment, it exposes
to the client a stub implementation of the stream interface.
Bug: 264712385
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie8ae0338fd22f705e00a34e56a7fa235eda5ed9e
(cherry picked from commit 43a85cfb2b)
Merged-In: Ie8ae0338fd22f705e00a34e56a7fa235eda5ed9e
Moving frame counter to the StreamContext class enables
switching stream drivers on the fly while keeping the frame
count monotonically increasing.
StreamWorkerCommonLogic now holds a pointer to StreamContext,
which makes redundant storing copies of the fields of the latter.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: If6716f4051c484b52927cbfe4032df7c907eb3a5
(cherry picked from commit 1eedc130e8)
Merged-In: If6716f4051c484b52927cbfe4032df7c907eb3a5
Since the client may end up never retrieving the interface
instance for sending it over Binder, postpone setting
of the scheduler policy to until that very moment.
Rename 'ChildInterface::getPtr' to 'getInstance' for clarity.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I31f9dd832c7f85f9632d1d389a8b1063d237d4c1
(cherry picked from commit 780fefb331)
Merged-In: I31f9dd832c7f85f9632d1d389a8b1063d237d4c1
Upcoming implementations of the streams of the primary module
will need to change the underlying stream type depending on
the current connected device. The stream context must persist,
thus its life time must be bound to the IStreamIn/Out implementation.
Move the StreamContext instance under ownership of StreamIn/Out.
Add StreamCommonImpl::onClose so that the owner of the context
may know when it is safe to reset it.
Re-arrange the order of the arguments when creating a stream
so that the context always comes first.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Iaf13d4bc3a53cbfc27264d3abd1f6c417ece3941
(cherry picked from commit 6ddefdbcdf)
Merged-In: Iaf13d4bc3a53cbfc27264d3abd1f6c417ece3941
Replace the pair of 'shared_ptr<>, Binder' with
the equivalent ChildInterface.
Fix logging of returned sub-objects to print their
Binder value instead of the local pointer.
Bug: 264712385
Test: m
Change-Id: I1350e7b3720c6244cd8527e1d021ee9577399291
(cherry picked from commit 2eabaf995b)
Merged-In: I1350e7b3720c6244cd8527e1d021ee9577399291
Remove alsa::MixerControl. tinyALSA contains utility
functions for setting values in percents, they use
the same logic as used to be there for handling
the "volume" control. Use access serialization at
the mixer level, rather than for each control.
Move the call to 'mixer_open' to alsa::Mixer.
Add controls for capture (mic) mute and gain. They
will be used by the primary HAL.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I0fad994153de96aceec3eb8f2fec19805ec912f8
(cherry picked from commit f12d4a1ef8)
Merged-In: I0fad994153de96aceec3eb8f2fec19805ec912f8
In UML, the initial state is a solid circle, the final
state is a double circle. In the Core HAL diagrams it
was the opposite.
Test: dot -Tpng stream-{in|out}-[async-]sm.gv -o ...
Change-Id: Id69f17d0a47227e744eb6dadcb5fee08c07bb0bd
(cherry picked from commit f082902b41)
Merged-In: Id69f17d0a47227e744eb6dadcb5fee08c07bb0bd
When a vendor HAL reuses libaudioserviceexampleimpl,
a subclass of Module cannot change Configuration.
This change adds virtual method Module::initializeConfig(),
then a vendor HAL can override it to load custom Configuration.
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I63fa8d70f3c4e13c8938070ee5431ebefd36bb58
(cherry picked from commit 918a6a5ce9)
Merged-In: I63fa8d70f3c4e13c8938070ee5431ebefd36bb58
This is a method which can be optionally implemented
by a stream in case it can provide more exact position,
for example by taking into account data in intermediate
buffers.
Implemented this method for StreamAlsa and StreamRemoteSubmix.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I392933f8f6b22d784726925199db00dcb0313648
(cherry picked from commit 704aec434e)
Merged-In: I392933f8f6b22d784726925199db00dcb0313648
Make 'Module' more abstract by moving stream creation
methods to more concrete 'ModulePrimary' and 'ModuleStub'.
'ModulePrimary' is now closer to the CF primary module:
it was stripped off USB devices from its configuration,
these got moved to 'ModuleUsb', and got rid of BT A2DP
and LE interfaces, these will be on 'ModuleBluetooth'.
Note that 'ModulePrimary' still uses stub streams, this
will be changed in subsequent patches.
'ModuleStub' is what 'Module' used to be, just a module
for improving test coverage. It includes simulation of
offload streams and dummy BT objects.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I5e4da0c32c00d65688f2eda78b2c79594e4e4671
(cherry picked from commit 521fc49fba)
Merged-In: I5e4da0c32c00d65688f2eda78b2c79594e4e4671
Extract code interacting with tinyALSA which is not
specific to USB into "abstract" module and stream
implementations ModuleAlsa and StreamAlsa. Also, move
utility code which does not need module or stream
context into Utils.
This facilitates implementation of the CF core HAL which
also uses tinyALSA, allowing to share common code.
Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I2134b15e970c78e8a48b254e15199b8207a8ab34
(cherry picked from commit c337a8799b)
Merged-In: I2134b15e970c78e8a48b254e15199b8207a8ab34
Ensure that all formats returned by
AudioPolicyConfigXmlConverter::getDefaultSurroundSoundConfig
can be converted into legacy values.
Bug: 290116634
Test: atest audio_policy_config_xml_converter_tests
Change-Id: I3a46ea5ee4805f719c8977064c9d8d681a75cff2
(cherry picked from commit 724b24f895)
Merged-In: I3a46ea5ee4805f719c8977064c9d8d681a75cff2
Instead of relying on the device type, use the 'AudioPort.flags'
field to determine the device direction.
Remove 'isUsbInputDeviceType' and 'isUsbOutputtDeviceType'
as they are too specific to particular device type and just
add a maintenance burden.
Bug: 266216550
Test: m
Change-Id: Ia1b9330c2b419a1a4048ed78d914d05c1caf523f
(cherry picked from commit 64fd6bd779)
Merged-In: Ia1b9330c2b419a1a4048ed78d914d05c1caf523f
To be consistent with the timeout set in IRadio 1.0/1.1 VTS
This increases the timeout per-test, but there is still a timeout
for all tests in the module to complete.
Test: atest VtsHalRadioV1_*TargetTest for all
Bug: 292197532
Change-Id: I421c13e65efa565753337dc21e6520682e726e81