Added utility functions for operating on positional
bit flags.
Moved retrieval of offload mix ports to ModuleConfig
utility class.
Clarify the names of read/write tests.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id20881c2e62bc1b95d8fc3c268f99e36337dce7a
There are still issues with importing implicit versions. Switching to explicit versions while b/188871598 is worked out.
Bug: 242678729
Test: m; AIDL_TRANSITIVE_FREEZE=true m aidl-freeze-api && AIDL_FROZEN_REL=true m
Merged-In: Ide6a90716bf042fbb925357e110bc84ddb9e96fb
Change-Id: Ide6a90716bf042fbb925357e110bc84ddb9e96fb
(cherry picked from commit 8296aa824b)
This requires a version bump to android.media.audio.common.types.
cc_defaults and java_defaults are used in order to avoid explicitly updating version references in several Android.bp files when we do future version bumps.
Bug: 242678729
Test: m
Merged-In: Id17820f210f625e370992db4f9f85e37887b088b
Change-Id: Id17820f210f625e370992db4f9f85e37887b088b
(cherry picked from commit bf94fa32cb)
This field indicates the frame size and is filled by
the HAL module, so that the client does not have
to calculate it.
As a side effect, in the VTS code, a StreamContext can
now be created solely from a StreamDescriptor.
Added unit tests for the functions from Utils.
Bug: 205884982
Test: atest libaudioaidlcommon_test
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ief836b8b2d35bacb1f9778e2462d540554149d7f
Change-Id: Ief836b8b2d35bacb1f9778e2462d540554149d7f
(cherry picked from commit 5862c1e3bc)
This patch implements audio I/O for the synchronous, non-MMAP
case.
Updated the StreamDescriptor structure to make it usable.
Clarified comments on the expectations for the client and
the HAL module.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I09651c6e80a397c80870622ac19234b4d4a38cbb
Change-Id: I09651c6e80a397c80870622ac19234b4d4a38cbb
(cherry picked from commit 01803d454a)
Fix the mistake of making StreamWorker to inherit
from the part which provides actual thread logic (Impl).
The lifetime of the logic object must be longer
than the lifetime of the StreamWorker's thread.
Otherwise, the thread could still have running while
the logic has already been destroyed (consider
the order of destructors in C++ class inheritance).
With this fix, the StreamWorker class does not have
to be a template anymore, thus reorganize the code
to move big methods into a .cpp file.
Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I5bc2c8fd9d78a0fbc9fddab67456cc5214584045
Change-Id: I5bc2c8fd9d78a0fbc9fddab67456cc5214584045
(cherry picked from commmit 84024eccee)
Change-Id: I70958f437657b574cda6480c3216a0b1ea252433
Enhance the return type of the 'workerCycle' to allow it
exiting without inducing an error on the controller side.
Also, put StreamWorker into a namespace.
Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I3b27028b10f80f27985040cae8f8b0e6ab63ddad
Change-Id: I3b27028b10f80f27985040cae8f8b0e6ab63ddad
(cherry picked from commit 5021df71c7)
Replace 'platform_apis: true' with 'sdk_version: module_current'.
The former causes compiling against SDK source code,
this is not needed for the audio HAL.
Bug: 205884982
Test: m android.hardware.audio.service-aidl.example
Change-Id: I9b9c32707ac7276f5cd077681bd1f8122bc20feb
Merged-In: I9b9c32707ac7276f5cd077681bd1f8122bc20feb
(cherry picked from commit 714e959c89)
This patch adds necessary structures and prepares for implementing
data flow for audio I/O.
Also in this patch we clarify the relationship between audio patches
and buffer size for audio I/O, and between buffer size and latency.
Bug: 205884982
Bug: 233816848
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I8522632607d4cf50a112225c19b5dd5ad8848591
Change-Id: I8522632607d4cf50a112225c19b5dd5ad8848591
(cherry picked from commit 68bee70442)
Audio threads need to be able to set their priority.
Also, traditionally these worker threads set a custom
thread name. Implement this functionality in StreamWorker.
Since initialization steps can fail, implement simple
error reporting via a string field `mError`. The state
of the string field replaces the dedicated `ERROR` worker
state.
Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: Ie9ab94922d47f277a4993a90b478a2fa76657923
Change-Id: Ie9ab94922d47f277a4993a90b478a2fa76657923
(cherry picked from commit e9e0f7c0f5)
Avoid taking a lock in high priority worker threads
without a real need.
Bug: 205884982
Test: atest libaudioaidlcommon_test --iterations
Merged-In: I8cc0f5cb58752b7b7d413a9f4e46093c39445892
Change-Id: I8cc0f5cb58752b7b7d413a9f4e46093c39445892
(cherry picked from commit d989a4b669)
This utility class has been copied from HIDL VTS.
It will be used both for the default implementation
and AIDL VTS, and might need modifications.
Bug: 205884982
Test: atest libaudioaidlcommon_test
Merged-In: I43b35b0c23ae45305dca66e15b60820cad19635e
Change-Id: I43b35b0c23ae45305dca66e15b60820cad19635e
(cherry picked from commit c17f0484bc)
* changes:
audio: Add support for compressed offload
audio: Improve debug logging in the AIDL version, fix bugs
audio: Disable the C++ backend for android.hardware.audio.core
- Add compressed offload mix port into default implementation.
- Require AudioOffloadInfo to be passed to IModule.openOutputStream
for compressed offload port configs.
- Update VTS to handle compressed offload.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I118b2c04bff12b64a7cac4dc2c88217a6a270046
Change-Id: I118b2c04bff12b64a7cac4dc2c88217a6a270046
(cherry picked from commit 975ea3ae89)
- Make sure the AIDL default implementation has debug output enabled.
- Log additional info in the AIDL VTS to facilitate debugging.
- Make resource handler classes move-only types.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: I111b72aaf12962f00b4d31b8ac87186bca5eb853
Change-Id: I111b72aaf12962f00b4d31b8ac87186bca5eb853
(cherry picked from commit f82fc6476d)
android.hardware.audio.core will need to use FMQ,
which does not support the C++ backend in the AIDL version.
Migrate VTS tests from the C++ backend to the NDK backend.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ia5d29126afdb4bb97dd063a032b96ab83b9ce36e
Change-Id: Ia5d29126afdb4bb97dd063a032b96ab83b9ce36e
(cherry picked from commit 8fcc442416)
Add methods 'IModule.connect/disconnectExternalDevice' which inform
audio HAL about connection / disconnection of an external
non-attached device. Add method 'getAudioRoutesForPort' to
retrieve only routes that include the specified port.
Update the behavior of 'getAudioPorts' and 'getAudioRoutes'
indicating that the result may change due to instantiation
of new device ports for connected external devices.
Clarify behavior of 'IModule.setAudioPortConfig' that it can not
work with device ports with no profiles.
Add debug flags structure 'ModuleDebug' and method
'IModule.setModuleDebug' to control the debugging aspects. VTS
tests use these flags to test HAL behavior which would otherwise
require human intervention.
Update the default implementation and VTS for the AIDL changes.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Iad5f7009e283729206f88b6278c8992f7f8a92a2
Change-Id: Iad5f7009e283729206f88b6278c8992f7f8a92a2
... for the same reason as cc489264af
Bug: 225941299
Test: m
Merged-In: I269d61c8c441b3db0832f5450f5e5a84a5989a99
Change-Id: I269d61c8c441b3db0832f5450f5e5a84a5989a99
(cherry picked from commit 446519a370)
Background:
android.hardware.audio.common was frozen in the upstream tm-dev.
Previously, the interface had only V1 (as the in-development version)
and it was in the VNDK. However, after the freeze, it will have V1 and
V2, and only V1 will remain in the VNDK, because we can't have multiple
versions of the same AIDL interface in VNDK (it's just waste of memory).
android.hardware.audio.core is a new AIDL interface that doesn't exist
in TM. It is also a member of VNDK and imports the audio.common
interface. So far, the import has been done without an explicit version
number (i.e. `imports: ["android.hardware.audio.common"]`). As a result,
V1 was imported before the freeze, and V2 (the latest) will be imported
after the freeze.
Problem:
audio.core depending on audio.common-V2 is NOT allowed since the former
is a member of VNDK, but the latter isn't. VNDK should form a closure.
We are actually hitting this:
```
> error: hardware/interfaces/audio/aidl/Android.bp:71:1: module
"android.hardware.audio.core-V1-ndk" variant
"android_vendor.Tiramisu_arm64_armv8-a_static" (created by module
"android.hardware.audio.core-V1-ndk-generator" (created by module
"android.hardware.audio.core_interface")): (native:vendor:vndk) should
not link to "android.hardware.audio.common-V2-ndk" (native:vendor):
VNDK-core must only depend on VNDK-core or VNDK-SP
```
To fix this, make the dependency to audio.common to be explicit about
the version. This change can't be uploaded to tm-dev as audio.core
doesn't exist there, and must be submitted before the AIDL APIs are
frozen there.
Bug: 225941299
Test: m
Merged-In: Iadc96d558d5c7431b0a2b0cbd28b99319a24ee44
Change-Id: Iadc96d558d5c7431b0a2b0cbd28b99319a24ee44
(cherry picked from commit cc489264af)
This adds basic support for enumerating capabilities
of an audio module, creation of patches, and opening of
I/O streams.
Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Merged-In: Ib1ef13c95d338b6ef1bde7d87dcd675fc1d35e85
Change-Id: Ib1ef13c95d338b6ef1bde7d87dcd675fc1d35e85
(cherry picked from commit ee27478264)
Do not rely on blocking behavior of 'IStreamOut.write',
instead use stream callbacks. Measure the time between
write start and drain complete. This makes the test
working reliably across different chipsets.
Bug: 219767875
Test: atest VtsHalAudioV7_0TargetTest:CompressedOffloadOutputStream/CompressedOffloadOutputStreamTest
Test: atest VtsHalAudioV7_1TargetTest:CompressedOffloadOutputStream/CompressedOffloadOutputStreamTest
Change-Id: I26fd4fd26914ed2a0b3273f4ae5512a87f9cca2c
Merged-In: I26fd4fd26914ed2a0b3273f4ae5512a87f9cca2c
(cherry picked from commit a0a5d4a9f6)
Update CompressedOffloadOutputStream to fail the test if
compressed offload mix port does not support gapless offload
for a new device launching on T+.
Bug: 219767875
Test: atest VtsHalAudioV7_0TargetTest
Test: atest VtsHalAudioV7_1TargetTest
Change-Id: Iaadf6e9b9bb7340ccaf5bc26c45fda9654190510
Merged-In: Iaadf6e9b9bb7340ccaf5bc26c45fda9654190510
(cherry picked from commit 1bc0dc4ceb)
Two changes that are necessary to test offloaded output:
1. Pass all mix port flags specified in the config to HAL when
opening an output stream. Previously the generator was
omitting the 'NON_BLOCKING' flag, however it is necessary
for offloaded output to work. This also now passes
the 'GAPLESS_OFFLOAD' flag to the stream opening call site.
2. Provide the DeviceAddress of the attached source/sink
device to tests that use mix ports. Some tests were looking
up the device address anyway. Also, HAL implementations
seem to prefer to have the actual output device instead
of 'DEFAULT' when opening offload streams.
Bug: 219767875
Test: atest VtsHalAudioV7_0TargetTest
Test: atest VtsHalAudioV7_1TargetTest
Test: atest HalAudioV7_0GeneratorTest
Change-Id: I0482376ecc7d6964f45f508a80716ffab18044b4
Merged-In: I0482376ecc7d6964f45f508a80716ffab18044b4
(cherry picked from commit 713d2c5590)
Some are still in VNDK because they are used in other VNDK libs.
Bug: 234181591
Test: m
Merged-In: If999df9c78a20df931177da11742b1c5de19bc08
Change-Id: If999df9c78a20df931177da11742b1c5de19bc08
Some are still in VNDK because they are used in other VNDK libs.
Ignore-AOSP-First: some libs are still in internal master only.
Bug: 234181591
Test: m
Merged-In: If999df9c78a20df931177da11742b1c5de19bc08
Change-Id: If999df9c78a20df931177da11742b1c5de19bc08
(cherry picked from commit 5527adfd7f)
There was a proposal for a backward-compatible XML schema change
(https://android-review.googlesource.com/q/I1bf31c6bf6c57c9b79f0d5751601aa77780f1f80)
which had a mistake. Express the change correctly to match
the implementation.
Bug: 231929160
Test: atest VtsHalAudioPolicyV1_0TargetTest
Change-Id: Id581e290740a3c00ba3719a339c9bc47d730f35c
(cherry picked from commit 356bb458dc)
Merged-In: Id581e290740a3c00ba3719a339c9bc47d730f35c
There was a proposal for a backward-compatible XML schema change
(https://android-review.googlesource.com/q/I1bf31c6bf6c57c9b79f0d5751601aa77780f1f80)
which had a mistake. Express the change correctly to match
the implementation.
Bug: 231929160
Test: atest VtsHalAudioPolicyV1_0TargetTest
Change-Id: Id581e290740a3c00ba3719a339c9bc47d730f35c
Merged-In: Id581e290740a3c00ba3719a339c9bc47d730f35c
(cherry picked from commit 356bb458dc)
There was a proposal for a backward-compatible XML schema change
(https://android-review.googlesource.com/q/I1bf31c6bf6c57c9b79f0d5751601aa77780f1f80)
which had a mistake. Express the change correctly to match
the implementation.
Bug: 231929160
Test: atest VtsHalAudioPolicyV1_0TargetTest
Change-Id: Id581e290740a3c00ba3719a339c9bc47d730f35c
Merged-In: Id581e290740a3c00ba3719a339c9bc47d730f35c
This function is now deprecated upstream, and their advice is to just
not call it; xmlCleanupParser() will do this stuff anyway.
Test: treehugger
Change-Id: I38a80d1f77c1beb2c1c8088a9e0df3bb0cbd9496