Commit Graph

2518 Commits

Author SHA1 Message Date
Bart Van Assche
c88855d3a1 audio: Simplify AudioHalBinderServiceUtil::waitForFired() am: a76d4d8899 am: fcf3a1b36b am: f9f2412cef
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2819039

Change-Id: Ic20f3123c0fefa0c57eddfed897b4f3f3687febe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-07 02:59:48 +00:00
Bart Van Assche
f9f2412cef audio: Simplify AudioHalBinderServiceUtil::waitForFired() am: a76d4d8899 am: fcf3a1b36b
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2819039

Change-Id: Icb56f383aecaa0be9d9567df68108104edc4a280
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-07 02:16:12 +00:00
Bart Van Assche
a76d4d8899 audio: Simplify AudioHalBinderServiceUtil::waitForFired()
Return the std::condition::wait_for() return value instead of reading
the variable 'fired' again. See also
https://en.cppreference.com/w/cpp/thread/condition_variable/wait_for.

Change-Id: I48c270f5446f61b2ad828b19a1fc294737a123dd
Signed-off-by: Bart Van Assche <bvanassche@google.com>
2023-11-06 16:01:16 -08:00
Mikhail Naganov
6bb8fc76b2 Merge changes Ic51d603d,Ia50def0d,I22f65b8b,I8ce9f230,Id8455eb1, ... into main am: 3143e6930b am: 1afd920ac6 am: 5fde3c5693
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2811595

Change-Id: I02b9286f7b4d1702f3474094fdfbfdd8486a4e3a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-06 18:51:45 +00:00
Mikhail Naganov
5fde3c5693 Merge changes Ic51d603d,Ia50def0d,I22f65b8b,I8ce9f230,Id8455eb1, ... into main am: 3143e6930b am: 1afd920ac6
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2811595

Change-Id: Iacdb9a69a3f63f0b6d157d9f4b34146b50969fba
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-06 18:06:42 +00:00
Mikhail Naganov
8461399c44 CSD: Add default AIDL HAL implementation am: 3c8b6ce171 am: c72d9bd433
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2813173

Change-Id: I074b26c2c2922e21f0122cd93a45f1373e13f553
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-06 18:06:39 +00:00
Mikhail Naganov
c72d9bd433 CSD: Add default AIDL HAL implementation am: 3c8b6ce171
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2813173

Change-Id: I82cff6b87ed3f06cd9234c3c249a47a64e2f1028
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-11-06 17:37:20 +00:00
Mikhail Naganov
3143e6930b Merge changes Ic51d603d,Ia50def0d,I22f65b8b,I8ce9f230,Id8455eb1, ... into main
* changes:
  audio: Query minimum buffer size before opening streams
  audio: Implement getters for hardware mixer controls
  audio: Clean up and fix the bluetooth HAL module
  audio: Provide a way for Module to specify nominal latency
  audio: Fix default remote submix HAL implementation and VTS
  CSD: Add default AIDL HAL implementation
2023-11-06 17:01:00 +00:00
William Escande
a78b77ed83 Merge "Add defaults for audio AIDL interfaces" into udc-qpr-dev-plus-aosp 2023-11-04 03:59:19 +00:00
Mikhail Naganov
95f2277730 audio: Query minimum buffer size before opening streams
The proper way to obtain the minimum buffer size when
opening a stream is to retrieve it from the patch. Thus,
a patch must be established prior to opening a stream.
This step was often skipped by VTS tests, they were
providing a fixed stream buffer size which might not
work for all HAL module implementations.

Created a helper class `StreamFixture` which handles
all necessary steps for opening a stream. Overhauled
tests to use this class.

Also, remove special treatment of remote submix devices
by ModuleConfig.

Bug: 300735639
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ic51d603d2bb8ff0fd62434bd16fc02c51326fc42
2023-11-03 14:11:09 -07:00
Mikhail Naganov
49bcb92670 audio: Implement getters for hardware mixer controls
The VTS test for volume accessors first determines whether
the accessor is supported by calling the getter. The getter
must return `UNSUPPORTED_OPERATION` if the control is not
supported. For this reason, wire the getter to the hardware
mixer implementation.

Bug: 302132812
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ia50def0d076b6d3c46db55123186eab34bbbb954
2023-11-03 13:57:36 -07:00
Mikhail Naganov
55045b5fce audio: Clean up and fix the bluetooth HAL module
Fix the issue with retrieving BluetoothA2dp and BluetoothLe
instances access.

In 'Module::connectExternalDevice', always call
'populateConnectedDevicePort' to allow the module implementation
to cancel device connection.

Move frame count calculation into Utils.
Clean up includes and 'using' directives.

Bug: 302132812
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I22f65b8bcdcdd9bcd67a8290520eb4a465d4c720
2023-11-03 13:57:20 -07:00
Mikhail Naganov
1350187c6b audio: Provide a way for Module to specify nominal latency
The latency figure depends on the module implementation.
Instead of using a hardcoded value, each module should be
able to specify its own value. This value is then used
for calculating the minimum buffer size.

Set the nominal latency of the primary (CF) module to a high
value since the virtual device implementation fails CTS tests
if it attempts to pretend that it provides low latency.

Bug: 302132812
Test: atest CtsMediaAudioTestCases --test-filter=".*AudioTrackTest.*"
Test: atest CtsMediaAudioTestCases --test-filter=".*AudioRecordTest.*"
Change-Id: I8ce9f230378eea787c9b3c7ce3660c1e4e7bc895
2023-11-03 13:50:07 -07:00
Mikhail Naganov
2aab766d05 audio: Fix default remote submix HAL implementation and VTS
The implementation had duplicated code in 'transfer', which already
present in 'outWrite'.

Cleaned up delay calculations and logging.

Fixed the VTS to send 'prepareToClose' before attempting to join
the worker. Otherwise, the worker could be stuck on a blocking
operation due to inactivity of the other party and join would never
happen.

Bug: 302132812
Test: atest VtsHalAudioCoreTargetTest --test-filter="*AudioModuleRemoteSubmix*"
Change-Id: Id8455eb12d1d2999dc0bc7b64f0d70a61a177598
2023-11-03 13:49:59 -07:00
Treehugger Robot
c3bada822d Merge "CSD: remove unused library" into main 2023-11-03 04:02:31 +00:00
Shunkai Yao
6f1af8f9f7 Add defaults for audio AIDL interfaces
- with defaults user don't have to change their Android.bp when there is
  a update
- update AIDL audio interfaces with android.media.audio.common.types
- update Spatialization and HeadTracking AIDL usage

Bug: 273373363
Bug: 293370815
Test: m
Test: lunch panther-trunk_staging-userdebug; m; test Bluetooth Audio
Change-Id: Ic9d8afc1d4e19e4243c66065b0a5d29156632851
Merged-In: Ic9d8afc1d4e19e4243c66065b0a5d29156632851
2023-11-01 21:38:39 +00:00
Vlad Popa
7c6c214049 CSD: remove unused library
Test: manual build
Bug: 209491695

Change-Id: I4eabeb92c0882db61bb530b438e59fb990d3c351
Merged-In: I4eabeb92c0882db61bb530b438e59fb990d3c351
2023-11-01 02:40:25 +00:00
Vlad Popa
d59b506c84 CSD: remove unused library
Test: manual build
Bug: 209491695
Change-Id: I4eabeb92c0882db61bb530b438e59fb990d3c351
2023-10-31 12:33:20 -07:00
Mikhail Naganov
3c8b6ce171 CSD: Add default AIDL HAL implementation
** Partial upstream of ag/24854732. Only the interface part is
** included.

This should enable the sound dose gts on cuttlefish devices. The sound
dose HAL uses the internal MelProcessor to compute the MELs which are
reported to the framework.

Test: atest GtsAudioTestCases:SoundDoseTest
Bug: 301527435
Change-Id: Ifc505a0171bc8b4d3f5cf65d950fa5c0f812087f
Merged-In: Ifc505a0171bc8b4d3f5cf65d950fa5c0f812087f
2023-10-31 11:38:43 -07:00
Treehugger Robot
3baa9d34d6 Merge "LoudnessEnhancer: Added test cases to validate effect processing." into main am: 309d65f0c4 am: 735bab03bf am: c2c32252dd
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2792432

Change-Id: If5d19d6dec369d747165dac671356e02574cdd88
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-31 18:37:36 +00:00
Treehugger Robot
309d65f0c4 Merge "LoudnessEnhancer: Added test cases to validate effect processing." into main 2023-10-31 17:04:05 +00:00
Sneha Patil
496e4415b0 LoudnessEnhancer: Added test cases to validate effect processing.
Added test to verify increase in loudness with gains.
Added test to verify that outputs are 0 for INT_MIN gain value.

Bug: 305866207
Test: atest VtsHalLoudnessEnhancerTargetTest
Change-Id: I6e87f5bf6f268980b6cc9af4b7a191657f117eb5
2023-10-31 11:58:02 +05:30
Shunkai Yao
d77662e03c Merge "audio: Add VTS execution tracer" into main am: 4a0e25ba6f am: a447b8092a am: 2b675b8283
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2749888

Change-Id: I624aa2f0b1cf3715775073163e769d3fbf6bfd0b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-30 17:53:42 +00:00
Shunkai Yao
4a0e25ba6f Merge "audio: Add VTS execution tracer" into main 2023-10-30 16:13:44 +00:00
Sadaf Ebrahimi
5738fe2434 Merge "Edit tests to adjust with changes in libxml2 upgrade" into main am: 0fd834c749 am: 0ee843a61f am: c43826d143
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2794127

Change-Id: I565de7621b029621a8e75c94048836f2d4f88f21
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-30 16:08:03 +00:00
Sadaf Ebrahimi
92e426a31f Adjust with changes in libxml2 upgrade am: 8029a0567c am: 78f7efc963 am: 8ad6130dbe
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2772704

Change-Id: I43a1181ce39454deafcf66beecd6afb3fc51e502
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-30 16:07:53 +00:00
Sadaf Ebrahimi
0fd834c749 Merge "Edit tests to adjust with changes in libxml2 upgrade" into main 2023-10-30 15:06:55 +00:00
Sadaf Ebrahimi
8029a0567c Adjust with changes in libxml2 upgrade
Bug: http://b/307806447
Test: TreeHugger
Change-Id: I474ca3539a2443ad0b1f590f27aa53a7279798e1
2023-10-30 15:06:32 +00:00
Sadaf Ebrahimi
351f681ec8 Edit tests to adjust with changes in libxml2 upgrade
Bug: http://b/307806447
Test: TreeHugger
Change-Id: I5978fb6b11538ac254b971fada17cfbbcc5360cf
2023-10-30 15:06:26 +00:00
Jaideep Sharma
7449841dc5 audio: Add VTS execution tracer
Add Execution listener in VTS tests to get information
about test execution steps like, start, stop and failure messages
in logcat message.

Bug: 287168985
Test: run vts-hal-audio

Change-Id: Ie69a7bf78076c17d7b623d75748fa0fdbdba6b1e
2023-10-27 20:02:42 +00:00
Shunkai Yao
fb263ea992 Merge "Add defaults for audio AIDL interfaces" into main 2023-10-19 23:14:22 +00:00
Shunkai Yao
0208a2df48 Merge "Fix cts Pre/post Processing failures on Cuttlefish aidl" into main am: 48415986d9 am: 29e06e20a0 am: 622dc28c6d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2794102

Change-Id: I91394b2e77719d50373afe56833227fc75407b61
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-19 01:22:57 +00:00
Shunkai Yao
48415986d9 Merge "Fix cts Pre/post Processing failures on Cuttlefish aidl" into main 2023-10-18 23:01:54 +00:00
Shunkai Yao
0d523099ac Add defaults for audio AIDL interfaces
- with defaults user don't have to change their Android.bp when there is
  a update
- update AIDL audio interfaces with android.media.audio.common.types
- update Spatialization and HeadTracking AIDL usage

Bug: 273373363
Bug: 293370815
Test: m
Change-Id: Ic9d8afc1d4e19e4243c66065b0a5d29156632851
2023-10-18 19:29:12 +00:00
Mikhail Naganov
660c8f7a8d audio: Use hardcoded r_submix configuration with XML am: fc35ca3d32 am: 067d106779 am: 9d6f832b8e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2794109

Change-Id: I51a84be684a0a450947b28fdd9ebed2a74b31ac7
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-18 19:16:45 +00:00
Lorena Torres-Huerta
9bee81e56b audio: Set connectedProfiles for non-attached device ports. am: f7492518c7 am: 6788dcd1f8 am: abcc5cd2c8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2794108

Change-Id: Ia00d4ea2e89d6fcb2ab4436d0daca57957ce673c
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-18 19:16:40 +00:00
Lorena Torres-Huerta
e6f63b2d4e audio: Populate MicrophoneInfo with vendor data am: 533cc78aab am: 3c0bd942f5 am: 87fe5c6ffa
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2794107

Change-Id: Ic91c67d2bfea0aa39caec0fb68c507a09a5338b3
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-18 19:16:35 +00:00
Mikhail Naganov
706a243cca audio: Implement proper parsing of masks in XsdcConversion am: cc21b6f2e6 am: 19ca45f533 am: 5e57d9da81
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2794106

Change-Id: I54f1e6faf36e1d381157173d87e8d80b8cda5ea8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-18 19:16:30 +00:00
Lorena Torres-Huerta
dc40dfd675 audio: Parse module configurations from the APM XML files am: 394e2527b5 am: 55acd0beaf am: e67e7a04f4
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2794105

Change-Id: I81ba6bf19cf60d1c5360ef6b84abefe29b95fc2d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-18 19:16:24 +00:00
Shunkai Yao
12179c335f Fix cts Pre/post Processing failures on Cuttlefish aidl
Bug: 295055755
Test: atest android.media.audio.cts.AudioPreProcessingTest
Test: atest android.media.audio.cts.DynamicsProcessingTest
Change-Id: Ia887a6c51ec13b9bb01581065c9272a7e02dad1f
2023-10-18 15:46:05 +00:00
Mikhail Naganov
fc35ca3d32 audio: Use hardcoded r_submix configuration with XML
There are several reasons why parsing the canonical XML
configuration for the remote submix module will not work
correctly (see the commend in the code).

Since de facto all vendors use the canonical configuration
XML for the remote submix, substitute parsing it with
a correct hardcoded version.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
(cherry picked from commit ea604d50de)
Change-Id: Ib9d9da25d315ff4ce36c1870241fb61d95fcca88
2023-10-17 19:54:38 -07:00
Lorena Torres-Huerta
f7492518c7 audio: Set connectedProfiles for non-attached device ports.
For external (non-attached) device ports that have dynamic
profiles, 'connectedProfiles' must be provided. They are
used when 'ModuleDebug.simulateDeviceConnections' is enabled.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
(cherry picked from commit a29393db39)
Change-Id: I69707d610c34f8f1eae9ef81768b76c40e985c0f
2023-10-17 19:54:29 -07:00
Lorena Torres-Huerta
533cc78aab audio: Populate MicrophoneInfo with vendor data
Added a virtual method Module::getMicrophoneInfos
so that vendor implementations can provide actual
data about device microphones. This information
is not part of the APM config file.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTestTest
(cherry picked from commit dc9d1a4b42)
Change-Id: I3ea9ba8da79fd29f8d69c5a575a57851d73df7b8
2023-10-17 19:54:13 -07:00
Mikhail Naganov
cc21b6f2e6 audio: Implement proper parsing of masks in XsdcConversion
Since the parsed XML uses compliant separator for lists
in attribute values, there is no need to use legacy
'maskFromString' function.

Bug: 305281224
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ib257fd010b923ac651931e5976f9b1363d693f1b
2023-10-17 19:53:55 -07:00
Lorena Torres-Huerta
394e2527b5 audio: Parse module configurations from the APM XML files
The default implementation now loads the HAL configuration
from the legacy XML configuration file which was previously
consumed by the framework directly.

Note that errors in the config file will lead to crash
of the XML parser, pointing out to the source of the problem.

IMPORTANT NOTES:
  - Never use untested legacy config files with production
    devices.
  - Make sure that all possible configurations (for example,
    BT offload on/off) are tested.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
(cherry picked from commit 00a7307862)
Change-Id: Id1002cb065e7cc19bdd520aca15b3fe5d39e5853
2023-10-17 19:48:24 -07:00
Mikhail Naganov
1261ff4f9b Merge changes from topic "revert-2770886-AidlAudioHalModuleConfig-FQCMWOWMCH" into main am: 03a2fbc6a3 am: fb1d459f09 am: 9868600b48 am: 9ed9a05578 am: 0cfcc0f2f9
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2786757

Change-Id: I6b5a7c2db6ee69a63abc9897bb9c1716157f641e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-14 01:35:36 +00:00
Mikhail Naganov
4f8a121dd7 Revert "audio: Populate MicrophoneInfo with vendor data" am: 5eea7fb0d7 am: ca9d26dc44 am: ab0818f638 am: 96baf7e609 am: 40d47b9456
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2786756

Change-Id: I3ed92f5ac5acc7bc9a7d33dfc313f30bc81d2a1b
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-14 01:35:32 +00:00
Mikhail Naganov
791a5d19b9 Revert "audio: Set connectedProfiles for non-attached device ports." am: 006a136ea7 am: bfe40ea2b0 am: 238ac10089 am: 21da9979f0 am: 3d8be4767a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2786755

Change-Id: I4c2c62270787f883b86424c9c80d65fb03783b85
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-14 01:35:29 +00:00
Mikhail Naganov
7cd6857a85 Revert "audio: Use hardcoded r_submix configuration with XML" am: 567d0de485 am: a37a4feed2 am: 3727401bcb am: 06dc621b86 am: c33c5cdc24
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2786754

Change-Id: Ie4578a2bd6e006a9b18b383036890f7e55d27ef0
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-10-14 01:35:24 +00:00
Mikhail Naganov
5eea7fb0d7 Revert "audio: Populate MicrophoneInfo with vendor data"
Revert submission 2770886-AidlAudioHalModuleConfig

Reason for revert: Breaks BluetoothInstrumentationTests on main downstream

Reverted changes: /q/submissionid:2770886-AidlAudioHalModuleConfig

Bug: 305291602
Change-Id: I01a4d22056507f9047c4fead21c9a75bfa153a46
2023-10-13 23:38:25 +00:00