Commit Graph

879 Commits

Author SHA1 Message Date
Mikhail Naganov
189cd6a599 audio: Clarify that MMap h/w position must be continuous
The VTS test already verifies that the MMap hardware position
never resets or goes back, but the official wording in the AIDL
interface was lacking.

Bug: 350998390
Bug: 363139283
Test: none, doc change
Change-Id: I07b9842f53c89549fe648ee839d875d31a7a849d
2024-09-04 10:11:59 -07:00
Mikhail Naganov
10fc96386e audio: Implement more accurate timing for the stub stream
Stub output stream is like a /dev/null audio device, however
for synchronous transfers it must block for the duration of
the audio chunk being transferred. Implement more accurate
accounting for the blocking time using the same approach as
employed by the remote submix stream implementation.

Bug: 356719263
Test: atest CtsNativeMediaAAudioTestCases
      on aosp_cf_x86_64_auto target
Change-Id: I137aed397246bcf2b5ef6789aa4d2d27ead64467
2024-08-21 11:34:05 -07:00
Treehugger Robot
08c7c29c11 Merge "audio: Start Binder pool thread explicitly" into main 2024-08-19 22:46:05 +00:00
Mikhail Naganov
1840d35645 audio: Start Binder pool thread explicitly
It was noted that calling 'ABinderProcess_startThreadPool'
results in the audio HAL service having more Binder pool
threads than without it. This is preferred to having
just one thread via 'ABinderProcess_joinThreadPool'
as in the latter case clients may seemingly be blocked
instead of being served by a newly spawned thread from
the pool.

Bug: 357669241
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ia8ed52b3c5a95cea12d063a0e75ac908af9260f8
2024-08-19 14:48:28 -07:00
Mikhail Naganov
a6c2d43c79 Merge "audio: Fix stream cleanup sequence" into main 2024-08-19 16:30:45 +00:00
Mikhail Naganov
0413d077f7 audio: Fix stream cleanup sequence
Move the cleanup of the stream worker thread from '~StreamCommonImpl'
up to concrete stream implementations. This is because when
the worker thread is stopping, it calls 'DriverInterface::shutdown'
method of the stream. At the time when '~StreamCommonImpl' is
running, the concrete stream class has already been destroyed.

The cleanup actually only happens in the case when the client
did not close the stream properly via 'IStreamCommon.close', or
when the stream creation has failed in the middle.

Bug: 355804294
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie86f682af202976ed48d24338b2dffcfd20d9a76
2024-08-15 14:18:51 -07:00
Yi Kong
e62f97fb5b audio: Remove unnecessary std::move
Moving a temporary object prevents copy elision, and could reduce
performance.

This fixes -Wpessimizing-move compiler warning.

Test: presubmit
Bug: 154270751
Change-Id: Idb1a4abf4da9eb6dbe1e9a8fd66461d60985c8e1
2024-08-14 01:52:25 +08:00
Shraddha Basantwani
0a981d36cf Audio Effect : Add base implementation of commandImpl method
Removing code repeatation and moving this method to base class.
Effect implementations can override enable, disable and reset methods.

Bug: 305866207
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: Iceb7ad51185d6f6bd2b6d70a5a1dd51e7bd37276
2024-07-30 05:23:02 +00:00
Mikhail Naganov
657284d4ef audio: Use 'join' instead of 'stop' for stream workers
Calling 'stop' can cause the worker thread to terminate
before it handles the 'halReservedExit' command. This should
be avoided because a proper exit sequence may do cleanups.
Since all stream workers must handle the 'halReservedExit'
command, use of 'stop' should not be needed (if the thread
code gets stuck on a call to drivers, calling 'stop' will
not interrupt this), thus it is being replaced by 'join'.

Bug: 344482249
Test: atest CtsMediaAudioTestCases
Test: atest VtsHalAudioCoreTargetTest
Change-Id: If13f7239423657b80091239ff67e7fe350957e2e
Merged-In: If13f7239423657b80091239ff67e7fe350957e2e
2024-07-24 08:53:19 -07:00
Treehugger Robot
080d6b39ed Merge "audio: Prolong reading attempts from the remote submix pipe" into main 2024-07-22 18:08:07 +00:00
Mikhail Naganov
2be5078e25 audio: Prolong reading attempts from the remote submix pipe
In order to use the time interval for reading from the remote
submix pipe more efficiently, increase the deadline time
to the buffer duration minus a small amount. This should
minimize chances to have discontinuities in the remote submix
input.

Bug: 334363414
Test: atest --test-filter=".*RemoteSubmixTest#testRemoteSubmixRecordingContinuity" CtsMediaAudioTestCases
Change-Id: I02968d09afd8ecdad4d61e635393842d7280e55f
2024-07-22 16:04:23 +00:00
Mikhail Naganov
96c0123401 Merge "audio: Restrict reported channel masks to "mono" and "stereo"" into main 2024-07-22 14:34:22 +00:00
Mikhail Naganov
8c27e46bb9 audio: Restrict reported channel masks to "mono" and "stereo"
When translating supported channel counts into channel masks,
only use channel layouts for 1 and 2 channels: "mono" and
"stereo", while reporting all other counts via indexed
masks. This helps to support output to multichannel USB Audio
interfaces properly.

Bug: 329571487
Test: repro steps in the bug
Change-Id: Ibbbf71e7f04a6622cccaddeb3f4f140193d7f8fb
2024-07-18 17:03:53 -07:00
François Gaffie
ed095e62ab Restore Default Device Effects support with AIDL AudioHAL
Bug: 329395147
Test: atest CtsMediaAudioTestCases
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit

Change-Id: I0f4f680b4db4eaa69d6c6e9e7b897631ed94928b
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2024-07-18 23:16:43 +00:00
Treehugger Robot
553e9ecec5 Merge "audio: Increase test timeout for VtsHalAudioTargetTest" into main 2024-07-10 23:47:17 +00:00
Mikhail Naganov
842106a030 audio: Increase test timeout for VtsHalAudioTargetTest
Some tests in `VtsHalAudioCoreTargetTest` may run for a long
time because they test all combinations of stream configurations.
As a result, the test was timing out on partners' devices.
The partner has confirmed that increasing the timeout to
30 minutes fixes the problem.

Bug: 350998390
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I5eddd19f14d49e88b71134d040ebfb06a1f2d375
2024-07-10 13:02:55 -07:00
Jaideep Sharma
120aa0837f vts: skip data path reverb tests on offload effects
Skip the data path tests for offloading reverb, as offloading
effects don't publish fmqs and don't actually process the data.

Test: VtsHalEnvironmentalReverbTargetTest
Bug: 351751648

Change-Id: Ib5f37c4568d405c6c597eb27fe216e6e345a2eae
2024-07-08 14:55:53 +05:30
Treehugger Robot
f28b8e809c Merge "audio: fix mmap output" into main 2024-06-27 01:07:49 +00:00
Kuowei Li
53a8d4d62e audio: fix mmap output
1. add createMmapBuffer() for vendor to override and create mmap fd.
2. add refineMmapPosition() for vendor to override and update
latency in mmap case.
3. fix testcases position check in mmap case.

Bug: 274456992
Bug: 345591089
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie63fdd47c0ddc563d84699dfdf6d4e9b72b5af43
2024-06-26 16:51:31 -07:00
Treehugger Robot
31b4c4f88d Merge "Migrate all related audio component to media.audio.common.types V4" into main 2024-06-26 20:23:51 +00:00
François Gaffie
dab7ab0807 Migrate all related audio component to media.audio.common.types V4
-Change latest
-Unfreeze deps
-Update next compatibility matrix
-add opt sounddose v3 to fcm compat exclusions

Flag: EXEMPT HAL interface change
Bug: 307310023
Test: build & boot
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
Merged-In: I3929603471d9543febca76ef6e2959063393194f
Change-Id: I3929603471d9543febca76ef6e2959063393194f
2024-06-26 18:13:56 +00:00
Sneha Patil
8ff6035fda EnvironmentalReverb: Add Basic Validation for Density Parameter
Bug: 305866207
Test: atest VtsHalEnvironmentalReverbTargetTest
Change-Id: I846dda585d788e808b8164d09ac088edbb05f160
2024-06-26 12:31:54 +00:00
Shunkai Yao
d0dc9486c9 Merge "Update VTSHalAudioEffectTargetTest with frameSize" into main 2024-06-20 23:35:28 +00:00
Treehugger Robot
4b3c7182bc Merge "Modify the buffer size according to the framecounts" into main 2024-06-20 21:40:41 +00:00
Treehugger Robot
3310dd44c2 Merge "EnvironmentalReverbTest: Add test for diffusion parameter" into main 2024-06-20 21:39:59 +00:00
Shunkai Yao
28aff3ddc0 Update VTSHalAudioEffectTargetTest with frameSize
- create buffer and check the fmq data with frameSize
- check effect state after open/close/command

Bug: 338040049
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts
Change-Id: I45af2faec3cdcef5307fbdcf600a63d7da759261
2024-06-18 15:35:54 +00:00
Sneha Patil
807c9523e7 Modify the buffer size according to the framecounts
Bug: 305866207
Test: atest VtsHalDownmixTargetTest
      atest VtsHalLoudnessEnhancerTargetTest
Change-Id: I448875e7d79ac766a882cc3a958fb54ef76265ce
2024-06-12 17:18:18 +05:30
Sneha Patil
9aa4f9fd46 EnvironmentalReverbTest: Add test for diffusion parameter
Validate decrease in variance value when diffusion increases

Bug: 305866207
Test: atest VtsHalEnvironmentalReverbTargetTest
Change-Id: I502693a376a58e9908ff264165a13ca1e727edad
2024-06-12 17:09:16 +05:30
Treehugger Robot
7bcd9c7b13 Merge "Update the input duration to reduce the number of samples to process" into main am: 12086575b5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3125534

Change-Id: I1614dd6323da566f354596476234ce789eb42898
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-06-11 20:07:37 +00:00
Sneha Patil
a9171f9d8d Update the input duration to reduce the number of samples to process
Bug: 305866207
Test: atest VtsHalBassBoostTargetTest
      atest VtsHalVolumeTargetTest
      atest VtsHalVirtualizerTargetTest
      atest VtsHalPresetReverbTargetTest
Change-Id: I6dc4fa6006634e570d075f8099401bd3dc572da1
2024-06-11 13:11:37 +00:00
Treehugger Robot
53e8ea6f82 Merge "EnvironmentalReverbTest: Add Tests to Validate Environmental Reverb Effect" into main am: 56e050362d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3088945

Change-Id: I0273c55317a36a8b359f49b9a92e1a695f4962fe
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-05-29 18:45:44 +00:00
Treehugger Robot
56e050362d Merge "EnvironmentalReverbTest: Add Tests to Validate Environmental Reverb Effect" into main 2024-05-29 18:27:25 +00:00
Sneha Patil
37f131c244 EnvironmentalReverbTest: Add Tests to Validate Environmental Reverb Effect
Compare energy values of auxiliary output for different parameters
Remove environmental reverb default implementation from the config file.

Bug: 305866207
Test: atest VtsHalEnvironmentalReverbTargetTest
Change-Id: I261c52ff25dd63d41213f0b40df8627dbb80a95d
2024-05-29 17:26:20 +05:30
Xin Li
64e598ce2b Merge Android 24Q2 Release (ab/11526283) to aosp-main-future
Bug: 337098550
Merged-In: I53a278f1317f5307441103dc42dc5be6f20d7075
Change-Id: I3a53ebf7339cdb886d3c1b733b8eee1847f8832a
2024-05-24 08:28:04 -07:00
Mikhail Naganov
ab222c63bc audio: Allow onError callback in any state
In practice, the AoC can crash while the stream is in
any state, thus this should be allowed for correct
handling of error conditions in the framework.

The list of states when `IStreamCallback.onError` can
be received is not enforced in VTS tests, thus no
test regressions are expected.

Bug: 339400414
Test: repro steps for simulating AoC crash in b/339400414
Change-Id: I9a52779f773307882109e159d715072de5af2ece
2024-05-21 14:31:56 -07:00
Treehugger Robot
b5d5a9fa01 Merge "audio: Fix after aosp/2908743 (exit command handling)" into main 2024-05-14 00:49:27 +00:00
Mikhail Naganov
6a5748a02e audio: Fix after aosp/2908743 (exit command handling)
In aosp/2908743, the intended behavior of the "halReservedExit"
command (stream exit) was inadventedly changed. Instead of
exiting from the thread's loop only when the cookie has
the expected value, it was actually exiting when the cookie
value is any but zero. The intended behavior is as follows:

 - the cookie has expected value: do not send reply, exit loop;
 - the cookie has unexpected but non-zero value: ignore,
     do not send reply (that's the point of using the cookie);
 - the cookie has a zero value: ignore, send a reply (this is
     for VTS testing).

Bug: 300181540
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I9945eb0ba9042993adac8599b18f241c4f69ca7a
2024-05-13 16:38:11 -07:00
Shunkai Yao
e26729ae76 Merge "Improve effect AIDL HAL logging" into main 2024-05-10 01:43:23 +00:00
Shunkai Yao
fbb29ced9f Improve effect AIDL HAL logging
Bug: 333407024
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: Ie983c4360488a6047bd284c20bf9899d38b4273e
2024-05-09 22:34:10 +00:00
Shunkai Yao
61f9dd21bd Update VTS to open Spatializer with supported input channel layout
Bug: 338040049
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts
Change-Id: I2e3457771617ff9425672f4db5e151658e47c827
2024-05-09 20:28:08 +00:00
Mikhail Naganov
2222e7d599 Merge "audio: Abort on data FMQ pointer corruption" into main 2024-05-09 16:54:31 +00:00
Shunkai Yao
ef683a9c60 Use customized event flag for data FMQ not_empty to avoid conflict
also update VTS data path test skipping for offload effects

Bug: 335547630
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: Ie92f04091658e210dccb7a2d60ebbab14c49fb58
Merged-In: Ie92f04091658e210dccb7a2d60ebbab14c49fb58
2024-05-09 01:07:34 +00:00
Mikhail Naganov
7b6951eed8 audio: Abort on data FMQ pointer corruption
Issue a fatal error when the data FMQ detects internal pointers
corruption. This condition indicates some low level problems
and should be diagnosed as fast as possible.

Bug: 338974476
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I962eba620149c7169f0f0a2dad4c4064232966d7
2024-05-08 16:50:01 -07:00
Shunkai Yao
f7391d5ac4 Merge "Effect AIDL VTS: relax dynamics processing effect parameter validations" into main 2024-04-22 23:52:06 +00:00
Shunkai Yao
972b465a0e Effect AIDL VTS: relax dynamics processing effect parameter validations
relaxing several parameter checking to align with HIDL
 - no need to have stage in use to set bands/channels
 - band settings no need to be sorted by frequency

Bug: 328012516
Test: atest VtsHalDynamicsProcessingTargetTest
Change-Id: If12d978ee69ee7f087a7e8758513a9c6bacf817f
Merged-In: If12d978ee69ee7f087a7e8758513a9c6bacf817f
2024-04-22 22:44:57 +00:00
Treehugger Robot
53eb12245b Merge "audio: Use more bursts in audio I/O VTS tests" into main 2024-04-19 23:25:33 +00:00
Mikhail Naganov
a2a9fa5003 audio: Use more bursts in audio I/O VTS tests
Some audio outputs use A/V sync and requre mode bursts
in order to start reporting the presentation position.

Bug: 300735639
Bug: 328010709
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Icad0942f2ba1dcd6f030a7dc4f37e22fdbd6dd71
2024-04-19 21:56:00 +00:00
Treehugger Robot
0dccb6e265 Merge changes Icd33f3cb,I737479d8 into main
* changes:
  audio: Fix AudioPatchTest/AudioModulePatch#UpdateInvalidPatchId VTS test
  audio: Skip stream I/O test for "echo reference" input device
2024-04-19 01:44:52 +00:00
Mikhail Naganov
22e17d43bd audio: Update 'PauseSync' scenario in AudioStreamIoOutTest
According to the definition of the 'PAUSED' state
in StreamDescriptor.aidl, s/w (the client) stops
writing once the buffer is filled up. That means, it is
allowed for an output stream not to consume data
from the MQ while in the paused state, so allow that
in the test.

Also, update the state transition sequence in the test
to flush any data after making a burst while in the 'PAUSED'
state.

Bug: 328010709
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Icb5fd02ca4ede63d7ae33613ab66cb96f3e6df29
2024-04-18 14:36:50 -07:00
Mikhail Naganov
8dd96d4c41 audio: Fix AudioPatchTest/AudioModulePatch#UpdateInvalidPatchId VTS test
The test was using '0' as an "invalid" patch ID value, however
this value is valid in the context of 'IModule.setAudioPatch'
method and means "create a new patch and allocate and ID for it".

Bug: 328010709
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Icd33f3cbd1602ec5aa162fa72fc3ddd59ccffbef
2024-04-18 13:23:05 -07:00