Commit Graph

89 Commits

Author SHA1 Message Date
Shraddha Basantwani
cac2e68b40 Audio AIDL : Add placeholder implementation and VTS test case for AGC1
Bug: 258124419
Test: atest VtsHalAGC1TargetTest
Change-Id: Ia9894ac21b284a554f8c2d66966d07e5e4621ccd
2023-02-15 23:36:06 +05:30
Shraddha Basantwani
84ea32e419 Audio AIDL : Rename AutomaticGainControl to AutomaticGainControlV2
Bug: 258124419
Test: atest VtsHalAGC2TargetTest
Change-Id: Ia3de57a109852e21d2f6e2b003e8f4286f8278b3
2023-02-15 18:11:11 +05:30
Shunkai Yao
8781102d74 Effect AIDL: Refactor effect capability with Range implementation
Bug: 258124419
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: Ie76270e91471a30f7dda1883c510cd318745855f
2023-02-14 20:39:22 +00:00
Shunkai Yao
b49631f4c2 Effect AIDL: Move EffectThread process into mutex
To avoid the case of receive thread stop right before process, in this
case test case AudioEffectTest#ConsumeDataAfterRestart will fail.

Bug: 264618800
Test: atest VtsHalAudioEffectTargetTest
Change-Id: I3c00361a537bc7010e6cd138f637f68b963e8033
2023-02-08 17:48:52 +00:00
jiabin
253bd32b04 AOSP AIDL USB audio HAL implementation.
Bug: 266216550
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I82e053d3f6a918cafe0d43b030f724f63a99eb2a
2023-02-02 18:39:26 +00:00
Shunkai Yao
52ba4dc148 Effect AIDL: remove the shared_lib dependency for example binary
They will be dlopen so no need to add the shared_lib dependency.
But we need to add them as PRODUCT_PACKAGES in base_vendor.mk

Bug: 258124419
Test: build and boot cuttlefish, change effect lib path in Android.bp
and audio_effects_config.xml and bootup.

Change-Id: Ia3b9bef9b5ed86921d80adcc0ce2296f50939370
2023-02-02 03:19:53 +00:00
Shunkai Yao
1d2d51a55d audio: Add API to get io handle
Add new API to fetch IO handle which is
used for offloaded effects.

Test: atest VtsHalAudioEffectFactoryTargetTest
Test: atest VtsHalAudioEffectTargetTest

Change-Id: I82abe76036507e770f0e2aed2feef7905d85a5c9
2023-01-26 18:18:32 +00:00
jiabin
b309d8dd36 Stub implementation for USB audio HAL.
Bug: 266216550
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ida4b3dbdb684dfc880a907651ae0fc398addbffc
2023-01-20 21:43:52 +00:00
jiabin
b76981e2a7 Add interfaces to query aaudio hardware information.
Add interfaces to query aaudio hardware information. The new interfaces
are supposed to replace the system properties. The information includes
aaudio mixer burst count and aaudio hardware burst minimum usec.

Bug: 193275465
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id3442dae15937baba84f053f2e244bc294f4d718
2023-01-19 18:06:22 +00:00
Eric Laurent
e2432ea1a7 audio: Add supportsBluetoothVariableLatency API to IModule
Add API to query if the Module supports control of variable latency over
playback paths.

Bug: 197823000
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I3a08d682a1a639d8373869725e12702fff962d53
2023-01-16 11:32:02 +01:00
jiabin
9a8e686628 Add API to query mmap policy information.
Bug: 193275465
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I8374a6e7942d68259d820b5de1f4ec597f1b6473
2023-01-13 22:57:34 +00:00
Mikhail Naganov
04ae822302 audio: Remove android.hardware.audio.core.AudioMode type
I missed that there is already android.media.audio.common.AudioMode.
However, due to use by the framework, it contains more values
(all of them are SYS_RESERVED), thus the implementation and VTS
have to be updated as well.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: If260413b1f774a69514de978792d5ad2eb46481a
Merged-In: If260413b1f774a69514de978792d5ad2eb46481a
2023-01-12 17:42:02 +00:00
Shunkai Yao
f1f15a1e86 Merge "Audio AIDL : Add libeffects reverb implementation uuids" 2023-01-11 19:06:32 +00:00
Shunkai Yao
5df4e6c4b0 AIDL effect: update AudioDeviceDescription to list
Bug: 261129656
Test: atest VtsHalAudioEffectTargetTest
Change-Id: I424afb287fa97a6bf39221ba64d6af50c1d697eb
2023-01-11 17:02:21 +00:00
Shunkai Yao
b490783ad7 Merge "AIDL effect: add dynamic libraries open check" 2023-01-11 04:44:51 +00:00
Mikhail Naganov
f429c03d49 audio: Generalize stream implementations
This allows for more code reuse and composability when
implementing streams for a particular audio "backend."

The existing "stub" code has been moved to StreamStub* files.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I97fd41f87eb6d01e1d57f0d70a86d3b2b3555837
2023-01-10 19:18:42 +00:00
Shunkai Yao
e221e712f9 AIDL effect: add dynamic libraries open check
Bug: 258124419
Test: atest VtsHalAudioEffectFactoryTargetTest
Change-Id: Id6fbb7b47422eed65635e137d1b97218d6b18a91
2023-01-10 17:31:50 +00:00
Shraddha Basantwani
b83ec07797 Audio AIDL : Add libeffects reverb implementation uuids
Bug: 258124419
Test: atest VtsHalEnvironmentalReverbTest
      atest VtsHalPresetReverbTargetTest

Change-Id: Ifa858ab002ee815f59b8582e5427eca566226fa2
2023-01-10 15:50:11 +05:30
Mikhail Naganov
8651b364b8 audio: Plumb IStreamOutEventCallback to the stream
The plumbing was missing from the CL which has added
the callback (aosp/2256190).

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Iab3c970b3efd0281e34e07f98864531acc4c519e
2023-01-09 19:53:06 +00:00
Treehugger Robot
99d4458c3b Merge changes Ic8eaee53,Ide961d91,Ie97f3ce9
* changes:
  audio: Allow going to 'IDLE' for synchronous drain
  audio: Improve test coverage
  audio VTS: Refactor support for non-deterministic SM behavior
2023-01-09 08:51:53 +00:00
Ram Mohan
e4064cebba DynamicsProcessing: Add AIDL placeholder implementation and its unit test
Update audio_effects_config.xml to use libeffect dynamicsProcessing
implementation.

Bug: 258124419
Test: atest VtsHalDynamicsProcessingTargetTest
Test: atest VtsHalAudioEffectTargetTest

Change-Id: If93d084be383b716ff950faf1c3e23d6c1edaa66
2023-01-06 23:00:09 +00:00
Mikhail Naganov
194daaac57 audio: Allow going to 'IDLE' for synchronous drain
For small buffers, the driver can perform draining
synhronously, returning control to the HAL only after
the buffer is empty. This makes going through
the 'DRAINING' state artificial. Thus, we allow going
to the 'IDLE' state directly.

In order to make sure that VTS handles both transitions:
to 'DRAINING' and to 'IDLE', correctly, add an "AOSP as
vendor" parameter "aosp.forceSynchronousDrain" to induce
this behavior in the default implementation.

Bug: 262402957
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ic8eaee53cb4596afb5317b4b905e004af3f112aa
2023-01-06 19:43:14 +00:00
Mikhail Naganov
20047bc1d9 audio: Improve test coverage
Add a vendor-specific parameter "aosp.forceTransientBurst"
which helps to cover the case of non-full async writes.
This parameter is specific to the "AOSP as vendor" implementation,
other vendors are not required to have it—that's why it's
not in AIDL.

Fix minor issues in VTS found after revisiting the code, and by
looking at logs during testing.

Bug: 262402957
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ide961d91a8d9da24392561654f04eb8207b7b781
2023-01-06 19:43:13 +00:00
Mikhail Naganov
10c6fe2b8f audio: Add IBluetooth core interface
This interface corresponds to BT-specific functions
of the IPrimaryDevice in the HIDL HAL.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I5f52d65e06f42e1a5fb2e51d27b79e94fe423eaa
2023-01-03 18:23:33 +00:00
Mikhail Naganov
0f8849795f Merge "audio: Implement ITelephony core interface for telecom" 2023-01-03 18:10:13 +00:00
Vlad Popa
2afbd1e549 Refactor the ISoundDose.aidl interface
This refactoring is fixing the hal_implementation_test workaround from
aosp/2363076. Adjusted the package name to match the aidl_interface and
declared the ISoundDose interface types only.

Test: VtsHalSoundDoseFactoryTargetTest, VtsHalAudioCoreTargetTest,
hal_implementation_test
Bug: 263388737

Change-Id: Ibce4cd95aaf600de2096179f137243939114ba6a
Merged-In: Ibce4cd95aaf600de2096179f137243939114ba6a
2022-12-28 18:01:01 +01:00
Mikhail Naganov
ae0e88ca5c Merge "audio: Add presentation and latency control to IStreamOut" 2022-12-27 23:10:53 +00:00
Mikhail Naganov
a7f4e05357 audio: Implement ITelephony core interface for telecom
Implement telecom functions in ITelephony corresponding
to the IPrimaryDevice in the HIDL HAL.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ia83fa4341dd50919d885ac1e10fb31c9a30c5a86
2022-12-27 20:30:03 +00:00
Mikhail Naganov
7492720e49 audio: Add presentation and latency control to IStreamOut
Add the following methods to IStreamOut:
  - get/setAudioDescriptionMixLevel;
  - get/setDualMonoMode;
  - getRecommendedLatencyModes/setLatencyMode;
  - get/setPlaybackRateParameters;
  - selectPresentation.

Add IStreamOutEventCallback interface for async notifications
of the client about playback-related events. This callback
can be provided to IModule.openOutputStream.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I8974102d232cdd121a53edccbf26c33778a94e5e
2022-12-23 02:22:38 +00:00
Shunkai Yao
e39cd36545 Effect AIDL Add visualizer libeffect implementation
Bug: 258124419
Test: atest VtsHalVisualizerTargetTest
Change-Id: I4ad827a4e8951a16738580ecf91fe1b9cf65cc20
2022-12-22 17:10:03 +00:00
Shunkai Yao
18c9dd8acc Merge changes from topic "aidl_audio_effect_volume_impl"
* changes:
  Audio AIDL : Add libeffects volume implementation uuid
  Volume: Add AIDL placeholder implementation and vts test
2022-12-22 05:20:54 +00:00
Sham Rathod
51d16c619c Audio AIDL : Add libeffects volume implementation uuid
Bug: 258124419
Test: atest VtsHalVolumeTargetTest

Change-Id: I7c87f27d08b2c037ee9c9edd8173138aae97e670
2022-12-21 23:15:25 +00:00
Shraddha Basantwani
ae7dde5d10 Audio AIDL : Add libeffects haptic generator implementation uuid
Bug: 258124419
Test: atest VtsHalHapticGeneratorTargetTest

Change-Id: I09abbc7a74d1e75f18bd1fbb4f1c2276a420eb20
2022-12-22 01:01:18 +05:30
Treehugger Robot
686c214a38 Merge changes from topic "aidl_audio_effect_virtualizer_impl"
* changes:
  Audio AIDL : Add libeffects virtualizer bundle uuid
  Virtualizer: Add AIDL placeholder implementation and vts test
2022-12-21 04:45:22 +00:00
Sham Rathod
5fd232fc79 Audio AIDL : Add libeffects virtualizer bundle uuid
Bug: 258124419
Test: atest VtsHalVirtualizerTargetTest

Change-Id: Id7ab913765e43d96199562af2766dfc6799a046e
2022-12-20 18:10:04 +00:00
Shunkai Yao
bd862b8287 Effect AIDL: Add AEC, AGC and NS AIDL and placeholder implmentation
Bug: 238913361
Test: atest VtsHalAECTargetTest
Test: atest VtsHalAGCTargetTest
Test: atest VtsHalNSTargetTest

Change-Id: I13de3fb554a3161d993fbe69942019546c7a96a6
2022-12-20 18:09:27 +00:00
Treehugger Robot
b02f80b5c4 Merge "Audio AIDL : Add libeffects downmix implementation uuid" 2022-12-20 15:08:55 +00:00
Mikhail Naganov
6fdc6e700f Merge "audio: Add effect attachment to devices and streams" 2022-12-20 03:01:01 +00:00
Shunkai Yao
2af598bfa5 Merge "Audio AIDL : Add libeffects loudness enhancer implementation uuid" 2022-12-19 21:15:33 +00:00
Mikhail Naganov
0ae5167223 Merge "audio: Add methods for controlling hw volume" 2022-12-19 17:31:52 +00:00
Mikhail Naganov
fb1acdec67 audio: Add effect attachment to devices and streams
Add the following methods:
  - IModule.{add|remove}DeviceEffect;
  - IStream.{add|remove}Effect.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I4066e2d10a8e08d634010cfe9eb8f832157e725f
2022-12-19 17:23:30 +00:00
Shraddha Basantwani
4ff8698a25 Audio AIDL : Add libeffects downmix implementation uuid
Bug: 258124419
Test: atest VtsHalDownmixTargetTest

Change-Id: I32d415d83e0a068efbea93ef4c2af3403db0f0a5
2022-12-19 15:31:54 +05:30
Treehugger Robot
2e9fe5d8d2 Merge "Audio AIDL : Add libeffects bass boost bundle uuid" 2022-12-17 09:32:04 +00:00
Mikhail Naganov
383cd4277a audio: Add methods for controlling hw volume
Add the following methods:
 - IStreamIn.get/setHwGain;
 - IStreamOut.get/setHwVolume.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I8fc48c15a9211b5f0bf8bb4b5b0e50d414b859c2
2022-12-16 22:19:32 +00:00
Mikhail Naganov
e9f10fc9dc audio: Provide operations common to input and output streams
Introduce IStreamCommon which contains methods that apply
both to input and output streams. Move the 'close' method
to it. Add 'IStreamIn/Out.getStreamCommon' method to retrieve
the common interface.

Add methods for dealing with HW AV Sync and vendor parameters.

Bug: 205884982
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie1a7b32e28425f5398afc95192fcbc5403b5c332
2022-12-16 16:40:28 +00:00
Mikhail Naganov
df5feba141 audio: Retain IBinder for instances with MinSchedulerPolicy
The binder passed to AIBinder_setMinSchedulerPolicy must also be
returned to the client, otherwise setting the policy for it does
not make any sense. However, server side interface instance
classes only hold a weak binder reference. It's the caller of the
'asBinder' method who must retain a strong reference. This
reference must be retained past exiting from the method which
returns the instance to the client.

To solve this issue, add storing of binders along with server
object references. These binders get released after the client
calls a 'close'/'destroy'-type method to release instance
resources.

Bug: 205884982
Test: run `atest VtsHalAudioCoreTargetTest` and effect VTS,
      and grep logcat for
     'destroyed after setMinSchedulerPolicy before being parceled'
Change-Id: I8b905b85cb8263c85edae8839a126ffe4e4d1e69
2022-12-16 15:27:10 +00:00
Treehugger Robot
2100e6323c Merge changes Ib89e0924,Id2816580
* changes:
  Add default implementation and VTS for ISoundDose
  Add HAL interface definition for sound dose
2022-12-16 15:06:16 +00:00
Shunkai Yao
cb0fc410d7 Effect AIDL: Add VTS test cases cleanup in TearDown
Remove output FMQ reset in EffectImpl
Update vts cases with ASSERT_* for critical errors
And update vts case naming

Bug: 261646550
Test: atest VtsHalAudioEffectTargetTest
Test: atest VtsHalEqualizerTargetTest
Test: atest VtsHalBassBoostTargetTest
Test: atest VtsHalLoudnessEnhancerTargetTest
Test: atest VtsHalAudioEffectFactoryTargetTest

Change-Id: If8d8aab0d4a68b13c488c053af1f36b58b7c99a1
2022-12-16 02:10:10 +00:00
Vlad Popa
943b7e2b91 Add default implementation and VTS for ISoundDose
The ISoundDose HAL interface is used for reporting the sound dose
relevant information from/to the HAL. This is necessary for all devices
that certify with the IEC62368-1 3rd edition and EN50332-3 standard
for safe hearing.

Bug: 248567177
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ib89e09243a01cebc2f7996b6b572384a1471867a
Merged-In: Ib89e09243a01cebc2f7996b6b572384a1471867a
(cherry picked from commit 83a2146546)
2022-12-15 19:41:32 +00:00
Vlad Popa
83a6d82793 Add HAL interface definition for sound dose
The interface is used to configure the sound dose parameters and
retrieve new changes that can affect the dose. Used for the
certification with IEC62368-1 3rd edition.

Test: TODO
Bug: 257937004
Change-Id: Id2816580fdbfbf09c2278720b4d78d0b3604fbf4
Merged-In: Id2816580fdbfbf09c2278720b4d78d0b3604fbf4
(cherry picked from commit 10905ef92e)
2022-12-15 19:41:03 +00:00