Commit Graph

2683 Commits

Author SHA1 Message Date
Treehugger Robot
dabe4a7902 Merge "audio: Fix handling of a thread exit command with a bad cookie" into main am: 759fb98667 am: 0ad71fd5fc am: 0e1a0a9328
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2908743

Change-Id: I73571a0d39b488d5aedd8162a4ffaa2cb673aef6
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-13 03:30:37 +00:00
Treehugger Robot
759fb98667 Merge "audio: Fix handling of a thread exit command with a bad cookie" into main 2024-01-13 00:40:04 +00:00
Treehugger Robot
11646feb65 Merge "audio: Skip AudioModuleRemoteSubmixTest on Android U" into main am: 7f25c70740 am: 2681bdedf0 am: 2a0716f4cb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2908298

Change-Id: I4f96c7848f0b5d40688dbe5806074f9ddd2603ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-12 23:20:45 +00:00
Mikhail Naganov
1850779bc4 audio: Fix handling of a thread exit command with a bad cookie
In case when the command was sent by the HAL itself (from another
thread), the worker thread must not post a reply. The only case
when a reply needs to be posted is in the case when the command
was sent from a VTS test. This case is identified by the fact that
the cookie has value '0'.

Bug: 300181540
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ifeb0722b5cf7346a694c5a938f6b324f5fa825f1
2024-01-12 13:59:24 -08:00
Treehugger Robot
3dd5a20ef5 Merge "Add android.virtualdevice.cts.VirtualAudioTest to postsubmit" into main am: 1fd5aef410 am: be7b1f22f0 am: 6be17c5eb2
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2907295

Change-Id: I341f2f3dac6321769d29eaa6b5584e8a77cfa001
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-12 21:36:08 +00:00
Treehugger Robot
7f25c70740 Merge "audio: Skip AudioModuleRemoteSubmixTest on Android U" into main 2024-01-12 21:10:04 +00:00
Shunkai Yao
3eb2a2c14f Merge changes from topic "effect_reopen" into main
* changes:
  Effect AIDL: implement IEffect.reopen
  Effect AIDL: add IEffect.reopen to update the effect instances data FMQ
2024-01-12 21:06:08 +00:00
Shunkai Yao
b34f133544 Merge "Effect VTS: update VtsHalDownmixTargetTest for data validation" into main 2024-01-12 21:01:51 +00:00
Mikhail Naganov
b2dab17b1e audio: Skip AudioModuleRemoteSubmixTest on Android U
This test was developed after Android U was cut, and it assumes
the new way of encoding of the remote submix device type.

Bug: 300181540
Test: run `atest VtsHalAudioCoreTargetTest` on UDC GSI
Change-Id: If53f92a55734e18a2acce6c790f9e5e259246684
2024-01-12 10:38:03 -08:00
Shunkai Yao
65c7c7051d Effect AIDL: implement IEffect.reopen
- add IEffect.reopen implementation
- now data MQs can update at runtime, sync
  EffectContext access
- add clang thread annotation

Bug: 302036943
Test: atest VtsHalAudioEffectTargetTest
Test: build and test audio effect on Pixel
Change-Id: I3e9fdc2d5eb50b8c1377e0da75573f0eba7ea3f1
Merged-In: I3e9fdc2d5eb50b8c1377e0da75573f0eba7ea3f1
2024-01-12 17:23:28 +00:00
Shunkai Yao
5b15e005a9 Effect AIDL: add IEffect.reopen to update the effect instances data FMQ
The effect instance may choose to reallocate the input data message
queue under specific conditions. For example, when the input format
changes, requiring an update to the data message queue allocated during
the open time.
In such cases, the effect instance can destroy the existing data message
queue, when the audio framework see a valid status MQ and invalid data MQ,
it call reopen to get the new data message queue.

Bug: 302036943
Test: m android.hardware.audio.effect-update-api, m
Change-Id: Ia245b154176f64bc3cc6e6049bca4f9c68ad482d
Merged-In: Ia245b154176f64bc3cc6e6049bca4f9c68ad482d
2024-01-12 17:23:14 +00:00
Shunkai Yao
0061ab1ae7 Merge "Effect AIDL: implement IEffect.reopen" into main 2024-01-12 16:26:19 +00:00
Mikhail Naganov
18fcb688bc Add android.virtualdevice.cts.VirtualAudioTest to postsubmit
These tests exercise audio playback and capture on CF and are
useful in spotting issues in the audio pipeline end-to-end.

Bug: 316017930
Test: atest CtsVirtualDevicesTestCases
Change-Id: If625cec5bc2d281f1e0d99b820f604f1bac7b621
2024-01-11 09:54:50 -08:00
Treehugger Robot
ee411a9b3a Merge "audio: Add libaudioclient tests to postsubmit for the AIDL HAL" into main am: 7fe11fd93d am: 4b454b6e9e am: e188448e49
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2904415

Change-Id: Iba604161761aae383fb5f5b99fd80e4583dff369
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-11 01:08:38 +00:00
Shunkai Yao
7d96d9e0ff Effect VTS: update VtsHalDownmixTargetTest for data validation
For downmix, the output buffer size can be diff with input

Bug: 318926783
Bug: 317946442
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: I0dc0009e1779b842a4f3cdcc047d225310a304f9
2024-01-11 00:44:16 +00:00
Shunkai Yao
81bfcda77a Effect AIDL: implement IEffect.reopen
- add IEffect.reopen implementation
- now data MQs can update at runtime, sync
  EffectContext access
- add clang thread annotation

Bug: 302036943
Test: atest VtsHalAudioEffectTargetTest
Test: build and test audio effect on Pixel
Change-Id: I3e9fdc2d5eb50b8c1377e0da75573f0eba7ea3f1
2024-01-10 23:05:43 +00:00
Treehugger Robot
7fe11fd93d Merge "audio: Add libaudioclient tests to postsubmit for the AIDL HAL" into main 2024-01-10 23:02:04 +00:00
Mikhail Naganov
ff52e4fcba audio: Add libaudioclient tests to postsubmit for the AIDL HAL
These framework-side tests are helpful in detecting breakages
caused by changes in the HAL code.

Add to postsubmit first because the presubmit check does not
allow adding to presubmit without accumulating some history first.

Bug: 311830316
Test: atest
Change-Id: I1f946c71a89117d25f39fde34877988ea7e1d466
2024-01-10 13:47:57 -08:00
Mikhail Naganov
3daa193aa1 Merge "audio: Improve logging in remote submix module" into main am: 198e8f747c am: 13993da38a am: b3d65cec6c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2901102

Change-Id: Iff8c545935a838b9ca593f2c0344042b115b2d90
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 21:12:38 +00:00
Mikhail Naganov
198e8f747c Merge "audio: Improve logging in remote submix module" into main 2024-01-10 17:53:05 +00:00
Treehugger Robot
ac6b2febe4 Merge "Audio Effect : Add checks to validate the channel count" into main am: a10d3c536f am: 7f56477a4e am: cb2e389605
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2902252

Change-Id: I18ec37e502764ea63b7a04fb65f8af69f0b1ac44
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-10 02:50:59 +00:00
Treehugger Robot
a10d3c536f Merge "Audio Effect : Add checks to validate the channel count" into main 2024-01-10 01:46:59 +00:00
Mikhail Naganov
9eb3314a24 audio: Improve logging in remote submix module
Implement IModule::dump to display the current state in
the audioflinger dump.

Throttle repetitive logging when there is nothing to read.

Remove stale comment for already fixed b/307586684.

Bug: 307586684
Test: adb shell dumpsys media.audio_flinger
Change-Id: I1f1f6e1658d035d46af3a933a825b20a78c7f297
2024-01-09 14:13:15 -08:00
Vlad Popa
e32ffaec3b Merge "CSD: Adjust code to new MelCallback interface" into main 2024-01-09 17:17:32 +00:00
Shraddha Basantwani
a3d4847794 Audio Effect : Add checks to validate the channel count
Bug: 302036943
Test: atest audioeffect_analysis
Change-Id: Ic64394e646fa23e02e499c2f01ef3bd4490450d2
2024-01-09 10:37:54 +00:00
Shunkai Yao
4ee5ce9b0b Merge "Effect AIDL: add IEffect.reopen to update the effect instances data FMQ" into main 2024-01-09 03:50:59 +00:00
Shunkai Yao
e400c835a2 Effect AIDL: add IEffect.reopen to update the effect instances data FMQ
The effect instance may choose to reallocate the input data message
queue under specific conditions. For example, when the input format
changes, requiring an update to the data message queue allocated during
the open time.
In such cases, the effect instance can destroy the existing data message
queue, when the audio framework see a valid status MQ and invalid data MQ,
it call reopen to get the new data message queue.

Bug: 302036943
Test: m android.hardware.audio.effect-update-api, m
Change-Id: Ia245b154176f64bc3cc6e6049bca4f9c68ad482d
2024-01-05 22:51:15 +00:00
Vlad Popa
3ee7690028 CSD: Adjust code to new MelCallback interface
Added the attenuated bool to the callback interface. Not used

Test: trivial
Bug: 315218453
Change-Id: Ibd5e90b0537bfce7d01ee7a3a0e55bc53850a216
2024-01-04 01:53:41 -08:00
Mikhail Naganov
5f8f8cc16b Merge "audio: Fix the type used for timekeeping" into main am: e3ed739865 am: da3b33a4f4 am: 6178a82724
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2894924

Change-Id: I6dead6af17b8364d52548c5d73e0984e1341d18e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-04 02:38:49 +00:00
Mikhail Naganov
e3ed739865 Merge "audio: Fix the type used for timekeeping" into main 2024-01-04 01:26:12 +00:00
Shunkai Yao
9d6d93f163 Merge "Update comment about headTrackingSensorId" into main am: 42876b8011 am: 04a73fca69 am: 0432cf90ee
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2896201

Change-Id: I81af62d38e03be4bafcad7bef7c4bb45154df065
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-03 23:02:55 +00:00
Treehugger Robot
823f5d44b7 Merge "Audio Effect VTS: run Dowmmix data path test only after HAL version 2" into main am: 8c00013594 am: 76268cc57d am: e1fced6967
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2894923

Change-Id: I5ab34e02e0113d34b7051b5be6e8177b10ec993d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2024-01-03 21:42:33 +00:00
Shunkai Yao
d090afe1af Update comment about headTrackingSensorId
Bug: 317405349
Test: m, aidl-format
Change-Id: I5f4b0e931c073d87b1a30a55c39e614d24a63030
2024-01-03 19:50:15 +00:00
Mikhail Naganov
878afae8f8 audio: Fix the type used for timekeeping
On 32-bit builds, the 'long' type is 32 bit. Thus, it can not
be used to store the value returned from 'uptimeNanos'.

Bug: 318055805
Test: atest CtsMediaAudioTestCases
Change-Id: I4abf72415b7241728d3ddb1d11043dfd59a8d08a
2024-01-03 11:27:31 -08:00
Shunkai Yao
6b7784edfe Audio Effect VTS: run Dowmmix data path test only after HAL version 2
Bug: 315074570
Test: VtsHalDownmixTargetTest
Change-Id: Iaa17519521f136901ec217f7d5b5fd0d03889533
2024-01-03 18:46:00 +00:00
Mikhail Naganov
ed2e67a0d7 Merge changes from topic "cuttlefish_aidl_audio-3" into main am: 5f50cd6320 am: 663f355b7a am: 9edfcbea4a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2889786

Change-Id: I022f37428bc188fdfa07647bd9e9b8a753f31d72
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-29 00:34:07 +00:00
Mikhail Naganov
a392968d37 audio: Add test configs for effects VTS tests am: b80de7bcd7 am: ca98d3982f am: 085ccd9f91
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2890072

Change-Id: I0e497aa1d407b745616658d073a0a2dd0d1a0a24
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-29 00:34:02 +00:00
Mikhail Naganov
b80de7bcd7 audio: Add test configs for effects VTS tests
The main purpose of the config is to shut down the framework
audioserver while the VTS test is running. This is achieved by
setting 'vts.native_server.on' to '1'. Without this, restarts
of the effects HAL process which are a normal part of tests
affect the audioserver and may lead to failures of framework
tests that run interleaved with these VTS tests.

Bug: 264712385
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts
Change-Id: I2515cb62e46ef8e93cbddb2c0219f4523d2ecda5
2023-12-27 15:54:30 -08:00
Mikhail Naganov
27719f12e8 Revert "Add remote submix direct paths"
This reverts commit ce9767a966.

Please see the comment on aosp/2832731. This configuration
leads to anomalous framework behavior.

Bug: 311830316
Test: atest audiorouting_tests
Change-Id: I5be3ac18819e297aa199c5a0f5d2e85758448b4b
2023-12-27 15:54:30 -08:00
Mikhail Naganov
e6612a500c Merge changes from topic "fix-aidl-mix-ports-and-bt" into main am: eafa78c929 am: 002c58fafd am: 78d8c4dd50
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2877679

Change-Id: I0e0869b0ad13637ee5c53a865a7a34ea13f5560d
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-27 05:09:31 +00:00
Mikhail Naganov
d1e45d1bf5 audio r_submix: Suggest configuration from the peer am: 3b732895a8 am: de6a93d47d am: f48e129f55
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2886671

Change-Id: Icda9e4ef2cdd124e67222bf3401f722770a1179e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-27 05:09:26 +00:00
Mikhail Naganov
67bc25ca14 audio: Refactor configuration population am: a92039ac48 am: 8cb953b071 am: a667344e8c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2886670

Change-Id: Idf16a09027b4fb61d71c6f23cc620edf8264a1dd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-27 05:09:21 +00:00
Mikhail Naganov
de6a93d47d audio r_submix: Suggest configuration from the peer am: 3b732895a8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2886671

Change-Id: I6f7aecbe65da1a4ea555e812c640a2b3b43f7fff
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-27 04:05:12 +00:00
Mikhail Naganov
8cb953b071 audio: Refactor configuration population am: a92039ac48
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2886670

Change-Id: I3594561197a36aa377816458ab1a324ee61410da
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-27 04:05:07 +00:00
Mikhail Naganov
eafa78c929 Merge changes from topic "fix-aidl-mix-ports-and-bt" into main
* changes:
  audio: Fix BT AIDL HAL module implementation
  audio r_submix: Suggest configuration from the peer
  audio: Refactor configuration population
2023-12-27 03:42:02 +00:00
Mikhail Naganov
a88cf60b87 audio: Fix BT AIDL HAL module implementation
In order to align with legacy behavior, when opening a stream,
the module must suggest the current configuration of the BT session.
For that to work, the BT device proxy must be opened prior
to creating a stream, code moved to ModuleBluetooth.

Fix minor inconsistencies and bugs found during testing.

Bug: 301213930
Bug: 316027906
Test: atest pts-bot
Change-Id: I04ddaf73be82f872a3f32a789563c3cbd648eb61
2023-12-26 16:34:58 -08:00
Mikhail Naganov
3b732895a8 audio r_submix: Suggest configuration from the peer
When there is a pipe established for a remote submix
device, suggest the configuration of the peer when opening
the other end.

Refactor SubmixRoute management to move it out from
StreamRemoteSubmix so that ModuleRemoteSubmix could also
use it.

Bug: 294962274
Test: atest audiorouting_tests
Change-Id: Ib31a662e7b65b92c614dc441a01160cae3485f3a
2023-12-26 10:31:43 -08:00
Treehugger Robot
ca7cb762b4 Merge "AHAL: update doc for prepareToDisconnectExternalDevice." into main am: f1db884971 am: ddb1c493f9 am: 2eb60daf1d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2889309

Change-Id: Idff2e5048f1f9857aa024d8edcba4b43bae6ca09
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-12-22 01:50:20 +00:00
jiabin
d470926597 AHAL: update doc for prepareToDisconnectExternalDevice.
Bug: 317405349
Test: make
Change-Id: If6c61a851c2e565ab16eb738b9dc0d42ebc04b05
2023-12-21 23:20:56 +00:00
Mikhail Naganov
a92039ac48 audio: Refactor configuration population
In 'Module::setAudioPortConfig' allow subclasses to provide
their own suggested configuration.

In 'Module::populateConnectedDevicePort' provide the ID of
the device port instance that will be created as a result
of connecting an external device.

Also, expose 'ModuleDebug' flags to subclasses so that they
can know when device connections are simulated.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Iceb2bdeb61c3470554b592fe197efa54d3b9e578
2023-12-20 14:31:47 -08:00