Commit graph

2284 commits

Author SHA1 Message Date
Treehugger Robot
ba5b434808 Merge "audio: Make renamings suggested by reviewers" into main am: e8d695d9b2 am: d621a32f12
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2693226

Change-Id: I5791383f801a2b014b6433810eae132e11201010
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-04 17:15:40 +00:00
Mikhail Naganov
459b7331e9 audio: Make renamings suggested by reviewers
Rename DriverInterface::getPosition -> refinePosition. This reflects
the fact that the driver may provide more precise position, however
this is an optional operation.

Rename StreamIn/Out::mContext -> mContextInstance. This is
to emphasize that StreamIn/Out actually own the context and they
hold the real context instance, not just a reference/pointer
to it, like other classes involved in the inheritance chain.

Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id7159f9bf3ee020dc7cf594ec35f5d59d23d7e31
2023-08-03 10:31:12 -07:00
Mikhail Naganov
ca31f56bca Merge "audio: Address comments from an internal review" into main am: 09d45c473e am: 581cd68e17
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2691166

Change-Id: I99289412fec3846d198483bfcd6bfd4c05fc9a6a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-03 17:28:59 +00:00
Mikhail Naganov
09d45c473e Merge "audio: Address comments from an internal review" into main 2023-08-03 15:58:56 +00:00
Treehugger Robot
731058e036 Merge "Audio r_submix : Handle the usecase when no data is available to read." into main am: 0bc307a5dd am: 830e95f8dd
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2686486

Change-Id: I416ac9712401cf403bd4698d5a34c646945bdc01
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-02 20:28:53 +00:00
Mikhail Naganov
0faf339425 audio: Address comments from an internal review
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I2f636c77f67fdd8eeac70dd304848bf7f76db4e5
2023-08-02 12:24:47 -07:00
Treehugger Robot
0bc307a5dd Merge "Audio r_submix : Handle the usecase when no data is available to read." into main 2023-08-02 18:51:53 +00:00
Treehugger Robot
178734d7ec Merge changes from topic "bluetoothmodule" into main am: 169be3476d am: d505445445
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2640450

Change-Id: I8dead7aba1537f0cc2f4920939fd44bcf3629a27
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-02 18:40:51 +00:00
Mikhail Naganov
b9b937cce7 aosp aidl bluetooth audio hal implementation am: b03b5c4a06 am: 412aafd1eb
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2624193

Change-Id: I1ef6b0bed47715b290487d46dcb5adc7d7899a45
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-02 18:40:45 +00:00
François Gaffie
9f063339aa Audio: add system usage to audio policy engine schemas am: acd4a677f0 am: 2b10decfc0
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2689186

Change-Id: I376b0c6278a1551cb1e2d753d40e79b1b1c1d2ac
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-02 18:39:53 +00:00
Mikhail Naganov
412aafd1eb aosp aidl bluetooth audio hal implementation am: b03b5c4a06
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2624193

Change-Id: Ic1acd04cc6c73a96b40329524e45740f8660efbf
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-02 18:01:55 +00:00
Treehugger Robot
169be3476d Merge changes from topic "bluetoothmodule" into main
* changes:
  aosp aidl bluetooth parameter support
  aosp aidl bluetooth audio hal implementation
2023-08-02 17:41:07 +00:00
Mikhail Naganov
b03b5c4a06 aosp aidl bluetooth audio hal implementation
Bug: 228804498
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id5fb60fe53ead9f5d2e6ecbb9988a23835cf2509
2023-08-02 21:42:01 +05:30
Ram Mohan
18f0d5121a aosp aidl bluetooth parameter support
Bug: 228804498
Test: atest VtsHalAudioCoreTargetTest
Change-Id: If1820018d5a6750eed0d0b486e15fc7c717aa11c
2023-08-02 21:42:01 +05:30
François Gaffie
acd4a677f0 Audio: add system usage to audio policy engine schemas
Bug: 293917986
Test: m

Change-Id: I49a8d3cfeb45eddc95ad6ab4a33b0adf0585cde2
Signed-off-by: François Gaffie <francois.gaffie@renault.com>
2023-08-02 10:47:00 +02:00
Shraddha Basantwani
675cce24d6 Audio r_submix : Handle the usecase when no data is available to read.
Bug: 290116295
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ifd6706d593f890dd8ae148523a37177774c8ffd4
2023-08-02 05:19:24 +00:00
Shraddha Basantwani
75417bfe60 Audio r_submix : Replace usage of portId by device address am: 2e460345a2 am: 335037031d
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2677975

Change-Id: I6f8c04d746cc48859092a5fb7dc12943e8374ddb
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 18:02:09 +00:00
Shraddha Basantwani
e54466ff88 Audio : Fix a few minor issues with stream switcher class am: 035beba203 am: f901f6a465
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2680756

Change-Id: Idf6d4682688311952a4a04019e971f80595f0e3a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-08-01 18:01:05 +00:00
Shraddha Basantwani
2e460345a2 Audio r_submix : Replace usage of portId by device address
Use stream switcher to obtain device address for creation
of a remote submix stream.

Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I8dde3d59e488c9621dce78ffd5249254ecfc0b1a
2023-08-01 12:06:38 +00:00
Shraddha Basantwani
035beba203 Audio : Fix a few minor issues with stream switcher class
1. Constructor should forward variable arguments
2. mContext initialization was missing
3. Add nullptr check for addEffect and removeEffect methods

Bug: 264712385
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I4037292bf497be186b26508bd16846886fa4fe55
2023-08-01 12:06:20 +00:00
Mikhail Naganov
0b1e574946 audio: Add a helper class to simplify legacy HALs migration am: 43a85cfb2b am: 24d182487c
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2674340

Change-Id: I738766e76dbcb954f346b8f989eba2b7bf330ee8
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 19:12:06 +00:00
Mikhail Naganov
0935dc482e audio: Move frame counter to StreamContext am: 1eedc130e8 am: 3b553744e5
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2674339

Change-Id: Ib8fa736b81ba2cc14f7e2f57921d646830c1778a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 19:12:02 +00:00
Mikhail Naganov
1a1a6731a8 audio: Update ChildInterface to set scheduler policy lazily am: 780fefb331 am: e35c2c8368
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2674338

Change-Id: Ia3d33ab611d4fb766450a5070f6888f6fd127e28
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-25 19:11:56 +00:00
Mikhail Naganov
43a85cfb2b audio: Add a helper class to simplify legacy HALs migration
Since in the C and HIDL APIs the method for opening a stream
receives the device to connect to, some legacy HAL implementations
took an advantage of that. In AIDL APIs device port connection
process is more dynamic and independent of the stream creation.

To simplify porting of legacy implementations to AIDL, a helper
class StreamSwitcher is added. It emulates the legacy behavior
by allowing to postpone the stream implementation creation until
the connected device is known. Until that moment, it exposes
to the client a stub implementation of the stream interface.

Bug: 264712385
Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ie8ae0338fd22f705e00a34e56a7fa235eda5ed9e
2023-07-24 16:40:39 -07:00
Mikhail Naganov
1eedc130e8 audio: Move frame counter to StreamContext
Moving frame counter to the StreamContext class enables
switching stream drivers on the fly while keeping the frame
count monotonically increasing.

StreamWorkerCommonLogic now holds a pointer to StreamContext,
which makes redundant storing copies of the fields of the latter.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: If6716f4051c484b52927cbfe4032df7c907eb3a5
2023-07-24 16:37:18 -07:00
Mikhail Naganov
780fefb331 audio: Update ChildInterface to set scheduler policy lazily
Since the client may end up never retrieving the interface
instance for sending it over Binder, postpone setting
of the scheduler policy to until that very moment.

Rename 'ChildInterface::getPtr' to 'getInstance' for clarity.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I31f9dd832c7f85f9632d1d389a8b1063d237d4c1
2023-07-24 16:36:51 -07:00
Treehugger Robot
69a3a68bac Merge changes from topic "fix-b-264712385-primary-module" into main am: 12c4bf6ba1 am: cbd5c15f52
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2666399

Change-Id: I1e79c1a41fe73e483b91fd32159bea8f904c4fb5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-21 00:24:06 +00:00
Treehugger Robot
12c4bf6ba1 Merge changes from topic "fix-b-264712385-primary-module" into main
* changes:
  audio: Move StreamContext ownership out from StreamCommonImpl
  audio: Use ChildInterface in StreamCommonImpl
  audio: Update StreamAlsa and alsa utils for built-in devices
  audio: Simplify and extend alsa::Mixer
2023-07-20 23:09:50 +00:00
Mikhail Naganov
6ddefdbcdf audio: Move StreamContext ownership out from StreamCommonImpl
Upcoming implementations of the streams of the primary module
will need to change the underlying stream type depending on
the current connected device. The stream context must persist,
thus its life time must be bound to the IStreamIn/Out implementation.
Move the StreamContext instance under ownership of StreamIn/Out.

Add StreamCommonImpl::onClose so that the owner of the context
may know when it is safe to reset it.

Re-arrange the order of the arguments when creating a stream
so that the context always comes first.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Iaf13d4bc3a53cbfc27264d3abd1f6c417ece3941
2023-07-19 17:49:28 -07:00
Mikhail Naganov
2eabaf995b audio: Use ChildInterface in StreamCommonImpl
Replace the pair of 'shared_ptr<>, Binder' with
the equivalent ChildInterface.

Fix logging of returned sub-objects to print their
Binder value instead of the local pointer.

Bug: 264712385
Test: m
Change-Id: I1350e7b3720c6244cd8527e1d021ee9577399291
2023-07-19 17:36:37 -07:00
Mikhail Naganov
422f7e6b1b audio: Update StreamAlsa and alsa utils for built-in devices
Use new functions added to alsa proxy layer for opening
attached (built-in) devices.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Ia2a47ff96fa62f99ce4ec4a0993ca3fd86f82c9d
2023-07-19 17:35:39 -07:00
Mikhail Naganov
f12d4a1ef8 audio: Simplify and extend alsa::Mixer
Remove alsa::MixerControl. tinyALSA contains utility
functions for setting values in percents, they use
the same logic as used to be there for handling
the "volume" control. Use access serialization at
the mixer level, rather than for each control.

Move the call to 'mixer_open' to alsa::Mixer.

Add controls for capture (mic) mute and gain. They
will be used by the primary HAL.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I0fad994153de96aceec3eb8f2fec19805ec912f8
2023-07-19 17:35:38 -07:00
Shraddha Basantwani
41d85448d0 Audio : Fix minor comments in r_submix module am: 7770c158a1 am: f0506fad7e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2664716

Change-Id: I4e38aad49e548070af5ba498c6426a8e01482097
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-19 18:03:21 +00:00
Shraddha Basantwani
7770c158a1 Audio : Fix minor comments in r_submix module
Add missing check for StandbyTransition variable
Add missing & in const arguments

Bug: 286914845
Test: atest VtsHalAudioCoreTargetTest
Change-Id: Id7a30e0697da80a272768bbf2aa8e3ed748e93f4
2023-07-19 16:43:50 +05:30
Treehugger Robot
5c5728b315 Merge "audio: Fix state machine initial and final state symbols" into main am: 1829d2133f am: ee3ebccd56
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2663915

Change-Id: I48c4fb28c3426a8f6cafa81aef4e4295198082a5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-18 23:46:37 +00:00
Shunkai Yao
ce48efbd11 Update effect AIDL state machine graph am: a8c5e014db am: bcd00246c8
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2663775

Change-Id: I40826c93b09817357e5bf39ae0b7f8114a28538a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-18 23:44:32 +00:00
Treehugger Robot
1829d2133f Merge "audio: Fix state machine initial and final state symbols" into main 2023-07-18 22:59:06 +00:00
Mikhail Naganov
f082902b41 audio: Fix state machine initial and final state symbols
In UML, the initial state is a solid circle, the final
state is a double circle. In the Core HAL diagrams it
was the opposite.

Test: dot -Tpng stream-{in|out}-[async-]sm.gv -o ...
Change-Id: Id69f17d0a47227e744eb6dadcb5fee08c07bb0bd
2023-07-18 14:46:18 -07:00
Shunkai Yao
a8c5e014db Update effect AIDL state machine graph
Bug: 271500140
Test: dot -Tpng state.gv -o state.png
Change-Id: Icbabe75e24497594f8bc62985553c1c13d268dae
2023-07-18 21:22:15 +00:00
Treehugger Robot
0a48f7635c Merge "Make EffectFactory implementation thread-safe" into main am: cdac9b5064 am: bee170ab74
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2657140

Change-Id: I26b198e6cb5c9defee13b4580e5891f1a50d30c5
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-17 23:59:38 +00:00
Treehugger Robot
cdac9b5064 Merge "Make EffectFactory implementation thread-safe" into main 2023-07-17 22:43:24 +00:00
Treehugger Robot
1087c40f5d Merge "Support custom effect type UUID in audio effect AIDL example service" into main am: 03a07174dd am: 24bfa18a1a
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2657141

Change-Id: Ia27872ab1b98b86d3a9918005ca89a7056a15c8e
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-15 02:54:02 +00:00
Mikhail Naganov
4125bf3bcf Merge "audio: Allow Module subclasses to customize Configuration" into main am: 00a7a24e0a am: 9767286509
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2656082

Change-Id: I747ab85d71680548f64d241a10186c98f7de277a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-15 01:20:16 +00:00
Treehugger Robot
03a07174dd Merge "Support custom effect type UUID in audio effect AIDL example service" into main 2023-07-15 00:56:10 +00:00
Shunkai Yao
074cf23ff6 Make EffectFactory implementation thread-safe
Also adjust some log level as verbos

Bug: 271500140
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: I04560c62bdbcfb85dbe223bec0149b112205a323
2023-07-14 23:57:32 +00:00
Shunkai Yao
80e5850d82 Support custom effect type UUID in audio effect AIDL example service
Parse custom effect type uuid in audio_effects_config.xml, so OEM can
add effect types without changing code

Bug: 271500140
Test: atest --test-mapping hardware/interfaces/audio/aidl/vts:presubmit
Change-Id: I558958cc42c6c4a304e0ab1239ddefec9575a5af
2023-07-14 23:57:21 +00:00
Peter Yoon
918a6a5ce9 audio: Allow Module subclasses to customize Configuration
When a vendor HAL reuses libaudioserviceexampleimpl,
a subclass of Module cannot change Configuration.

This change adds virtual method Module::initializeConfig(),
then a vendor HAL can override it to load custom Configuration.

Test: atest VtsHalAudioCoreTargetTest
Change-Id: I63fa8d70f3c4e13c8938070ee5431ebefd36bb58
2023-07-15 05:50:27 +09:00
Mikhail Naganov
11ce659cea Merge changes I392933f8,I5e4da0c3,I2134b15e into main am: f0ad731bb9 am: dc432d502c am: 7eedbb1e9e
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/2657259

Change-Id: Ic99961ff8d63b04187b7f44bea7755cf5f76c9bd
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
2023-07-13 22:00:31 +00:00
Mikhail Naganov
f0ad731bb9 Merge changes I392933f8,I5e4da0c3,I2134b15e into main
* changes:
  audio: Add optional 'DriverInterface::getPosition' method.
  audio: Create ModulePrimary and ModuleStub
  audio: Move tinyALSA-specific code to Module/StreamAlsa
2023-07-13 20:10:10 +00:00
Mikhail Naganov
704aec434e audio: Add optional 'DriverInterface::getPosition' method.
This is a method which can be optionally implemented
by a stream in case it can provide more exact position,
for example by taking into account data in intermediate
buffers.

Implemented this method for StreamAlsa and StreamRemoteSubmix.

Bug: 264712385
Test: atest VtsHalAudioCoreTargetTest
Change-Id: I392933f8f6b22d784726925199db00dcb0313648
2023-07-13 11:25:47 -07:00