Commit graph

9 commits

Author SHA1 Message Date
Mikhail Naganov
a5c0437327 audio: Add retries for BT proxy port registration
When ModuleBluetooth::createProxy is invoked on BT device
connection, the BT stack may not be fully ready yet,
and port registration can fail. This is an intermittent
state and registration should succeed after retrying.

Bug: 320838889
Test: atest pts-bot:A2DP/SRC/REL/BV-02-I
Change-Id: I0c7cf7c1c6a8ee03ef55b004f89139e3b56ee9cd
2024-01-26 16:19:45 -08: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
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
Devin Moore
0b2b93dccd Register bluetooth.audio in the audioservice AIDL example
android.hardware.bluetooth.audio should really be registered in its own
process, but this is a temporariy solution that is similar to the
old HIDL example.

Test: launch_cvd
Bug: 312265159
Change-Id: Ib60e2654d3b751bedf256d90de72921210174fe4
2023-11-29 00:13:18 +00: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
84bcc049e6 audio: Allow "dynamic" profiles for device ports
Some device ports are connected via ADSP which takes care
of the actual audio configuration (format, channels, SR),
for example the built-in speaker and mic ports, as well
as some external devices like analog headsets.

In the legacy implementation, such device ports did not have
any profiles specified. Allow the same behavior in the AIDL
implementation. To ensure correctness, device ports with no
profiles must be routable to mix ports that have profiles
specified. This requirement is fulfilled in legacy configs.

Bug: 266124463
Test: atest VtsHalAudioCoreTargetTest
Test: atest audiosystem_tests audiorouting_tests
Test: atest CtsMediaAudioTestCases
Change-Id: Iaccd1e8ef2a5af9a5f8bae453905d01c6b7fdc28
2023-10-10 15:15:50 -07: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
Ram Mohan
18f0d5121a aosp aidl bluetooth parameter support
Bug: 228804498
Test: atest VtsHalAudioCoreTargetTest
Change-Id: If1820018d5a6750eed0d0b486e15fc7c717aa11c
2023-08-02 21:42:01 +05:30
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